1#ifndef STAN_MATH_PRIM_CONSTRAINT_CORR_MATRIX_CONSTRAIN_HPP
2#define STAN_MATH_PRIM_CONSTRAINT_CORR_MATRIX_CONSTRAIN_HPP
39template <
typename T, require_eigen_col_vector_t<T>* =
nullptr>
40inline Eigen::Matrix<value_type_t<T>, Eigen::Dynamic, Eigen::Dynamic>
42 Eigen::Index k_choose_2 = (k * (k - 1)) / 2;
68template <
typename T, require_eigen_col_vector_t<T>* =
nullptr>
69inline Eigen::Matrix<value_type_t<T>, Eigen::Dynamic, Eigen::Dynamic>
71 Eigen::Index k_choose_2 = (k * (k - 1)) / 2;
96template <
bool Jacobian,
typename T, require_not_std_vector_t<T>* =
nullptr>
125template <
bool Jacobian,
typename T, require_std_vector_t<T>* =
nullptr>
128 return corr_matrix_constrain<Jacobian>(v, K, lp);
typename return_type< Ts... >::type return_type_t
Convenience type for the return type of the specified template parameters.
Eigen::Matrix< value_type_t< T >, Eigen::Dynamic, Eigen::Dynamic > corr_matrix_constrain(const T &x, Eigen::Index k)
Return the correlation matrix of the specified dimensionality derived from the specified vector of un...
Eigen::Matrix< value_type_t< T_CPCs >, Eigen::Dynamic, Eigen::Dynamic > read_corr_matrix(const T_CPCs &CPCs, size_t K)
Return the correlation matrix of the specified dimensionality corresponding to the specified canonica...
plain_type_t< T > corr_constrain(const T &x)
Return the result of transforming the specified scalar or container of values to have a valid correla...
void check_size_match(const char *function, const char *name_i, T_size1 i, const char *name_j, T_size2 j)
Check if the provided sizes match.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...