1#ifndef STAN_MATH_PRIM_FUN_ONE_HOT_ARRAY_HPP
2#define STAN_MATH_PRIM_FUN_ONE_HOT_ARRAY_HPP
21 static constexpr const char* function =
"one_hot_array";
25 std::vector<double> v(K, 0);
void check_bounded(const char *function, const char *name, const T_y &y, const T_low &low, const T_high &high)
Check if the value is between the low and high values, inclusively.
void check_positive(const char *function, const char *name, const T_y &y)
Check if y is positive.
std::vector< double > one_hot_array(int K, int k)
Return an array with 1 in the k-th position and zero elsewhere.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...