Automatic Differentiation
 
Loading...
Searching...
No Matches
rep_vector.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_FUN_REP_VECTOR_HPP
2#define STAN_MATH_PRIM_FUN_REP_VECTOR_HPP
3
6
7namespace stan {
8namespace math {
9
10template <typename T_ret, typename T,
11 require_eigen_col_vector_t<T_ret>* = nullptr,
12 require_stan_scalar_t<T>* = nullptr>
13inline auto rep_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_vector(const T& x, int n) {
19 return rep_vector<Eigen::Matrix<return_type_t<T>, Eigen::Dynamic, 1>>(x, n);
20}
21
22} // namespace math
23} // namespace stan
24
25#endif
auto rep_vector(const scalar_type_t< T > &x, int n)
Creates a matrix_cl representing a 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 ...