Automatic Differentiation
 
Loading...
Searching...
No Matches
linspaced_row_vector.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_FUN_LINSPACED_ROW_VECTOR_HPP
2#define STAN_MATH_PRIM_FUN_LINSPACED_ROW_VECTOR_HPP
3
6
7namespace stan {
8namespace math {
9
25inline auto linspaced_row_vector(int K, double low, double high) {
26 static constexpr const char* function = "linspaced_row_vector";
27 check_nonnegative(function, "size", K);
28 check_finite(function, "low", low);
29 check_finite(function, "high", high);
30 check_greater_or_equal(function, "high", high, low);
31
32 return Eigen::RowVectorXd::LinSpaced(K, low, high);
33}
34
35} // namespace math
36} // namespace stan
37
38#endif
void check_nonnegative(const char *function, const char *name, const T_y &y)
Check if y is non-negative.
void check_greater_or_equal(const char *function, const char *name, const T_y &y, const T_low &low, Idxs... idxs)
Throw an exception if y is not greater or equal than low.
void check_finite(const char *function, const char *name, const T_y &y)
Return true if all values in y are finite.
auto linspaced_row_vector(int K, double low, double high)
Return a row vector of linearly spaced elements.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...