Automatic Differentiation
 
Loading...
Searching...
No Matches
rep_row_vector.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_FUN_REP_ROW_VECTOR_HPP
2#define STAN_MATH_PRIM_FUN_REP_ROW_VECTOR_HPP
3
6
7namespace stan {
8namespace math {
9
10template <typename T_ret, typename T,
11 require_eigen_row_vector_t<T_ret>* = nullptr,
12 require_stan_scalar_t<T>* = nullptr>
13inline auto rep_row_vector(const T& x, int n) {
14 check_nonnegative("rep_vector", "n", n);
15 return T_ret::Constant(n, x);
16}
17template <typename T, require_stan_scalar_t<T>* = nullptr>
18inline auto rep_row_vector(const T& x, int n) {
19 return rep_row_vector<Eigen::Matrix<return_type_t<T>, 1, Eigen::Dynamic>>(x,
20 n);
21}
22
23} // namespace math
24} // namespace stan
25
26#endif
auto rep_row_vector(const scalar_type_t< T > &x, int n)
Creates a matrix_cl representing a row vector by replicating the input value.
void check_nonnegative(const char *function, const char *name, const T_y &y)
Check if y is non-negative.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Definition fvar.hpp:9