1#ifndef STAN_MATH_PRIM_CONSTRAINT_POSITIVE_ORDERED_FREE_HPP
2#define STAN_MATH_PRIM_CONSTRAINT_POSITIVE_ORDERED_FREE_HPP
27template <
typename EigVec, require_eigen_col_vector_t<EigVec>* =
nullptr>
30 const auto& y_ref =
to_ref(y);
32 "Positive ordered variable", y_ref);
33 Eigen::Index k = y_ref.size();
38 x.coeffRef(0) =
log(y_ref.coeff(0));
40 = (y_ref.tail(k - 1) - y_ref.head(k - 1)).array().log().matrix();
51template <
typename T, require_std_vector_t<T>* =
nullptr>
void check_positive_ordered(const char *function, const char *name, const Vec &y)
Throw an exception if the specified the vector contains negative values or is not sorted into strictl...
fvar< T > log(const fvar< T > &x)
auto positive_ordered_free(const EigVec &y)
Return the vector of unconstrained scalars that transform to the specified positive ordered vector.
ref_type_t< T && > to_ref(T &&a)
This evaluates expensive Eigen expressions.
typename plain_type< T >::type plain_type_t
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...