Automatic Differentiation
 
Loading...
Searching...
No Matches
uniform_simplex.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_FUN_UNIFORM_SIMPLEX_HPP
2#define STAN_MATH_PRIM_FUN_UNIFORM_SIMPLEX_HPP
3
6
7namespace stan {
8namespace math {
9
18inline auto uniform_simplex(int K) {
19 check_positive("uniform_simplex", "size", K);
20 return Eigen::VectorXd::Constant(K, 1.0 / K);
21}
22
23} // namespace math
24} // namespace stan
25
26#endif
auto uniform_simplex(int K)
Return a uniform simplex of size K.
void check_positive(const char *function, const char *name, const T_y &y)
Check if y is positive.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...