1#ifndef STAN_MATH_PRIM_FUN_REP_ARRAY_HPP
2#define STAN_MATH_PRIM_FUN_REP_ARRAY_HPP
11template <
typename T_ret,
typename In, require_std_vector_t<T_ret>* =
nullptr>
12inline std::vector<plain_type_t<In>>
rep_array(
const In& x,
int n) {
15 return std::vector<T>(n, x);
18inline std::vector<plain_type_t<In>>
rep_array(
const In& x,
int n) {
19 return rep_array<std::vector<plain_type_t<In>>>(x, n);
23inline std::vector<std::vector<plain_type_t<In>>>
rep_array(
const In& x,
int m,
29 return vector<vector<T>>(m, vector<T>(n, x));
33inline std::vector<std::vector<std::vector<plain_type_t<In>>>>
rep_array(
34 const In& x,
int k,
int m,
int n) {
40 return vector<vector<vector<T>>>(k, vector<vector<T>>(m, vector<T>(n, x)));
auto rep_array(const scalar_type_t< T > &x, int n)
Creates a matrix_cl representing an array by replicating the input value.
void check_nonnegative(const char *function, const char *name, const T_y &y)
Check if y is non-negative.
typename plain_type< T >::type plain_type_t
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...