1 #ifndef STAN_MATH_PRIM_MAT_FUN_ORDERED_FREE_HPP 2 #define STAN_MATH_PRIM_MAT_FUN_ORDERED_FREE_HPP 26 const Eigen::Matrix<T, Eigen::Dynamic, 1>& y) {
27 check_ordered(
"stan::math::ordered_free",
"Ordered variable", y);
33 size_type k = y.size();
34 Matrix<T, Dynamic, 1> x(k);
38 for (size_type i = 1; i < k; ++i)
39 x[i] =
log(y[i] - y[i - 1]);
Eigen::Matrix< T, Eigen::Dynamic, 1 > ordered_free(const Eigen::Matrix< T, Eigen::Dynamic, 1 > &y)
Return the vector of unconstrained scalars that transform to the specified positive ordered vector...
void check_ordered(const char *function, const char *name, const std::vector< T_y > &y)
Check if the specified vector is sorted into strictly increasing order.
fvar< T > log(const fvar< T > &x)
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic >::Index size_type
Type for sizes and indexes in an Eigen matrix with double e.
Primary template class for the metaprogram to compute the index type of a container.