1#ifndef STAN_MATH_PRIM_FUN_ONE_HOT_VECTOR_HPP
2#define STAN_MATH_PRIM_FUN_ONE_HOT_VECTOR_HPP
21 static constexpr const char* function =
"one_hot_vector";
25 Eigen::VectorXd ret = Eigen::VectorXd::Zero(K);
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.
Eigen::VectorXd one_hot_vector(int K, int k)
Return a vector 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 ...