1 #ifndef STAN_MATH_PRIM_MAT_PROB_INV_WISHART_RNG_HPP
2 #define STAN_MATH_PRIM_MAT_PROB_INV_WISHART_RNG_HPP
20 inline Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic>
23 <
double, Eigen::Dynamic, Eigen::Dynamic>& S,
25 static const char*
function(
"stan::math::inv_wishart_rng");
29 using Eigen::MatrixXd;
34 check_greater(
function,
"Degrees of freedom parameter", nu, k-1);
37 MatrixXd S_inv = MatrixXd::Identity(k, k);
38 S_inv = S.ldlt().solve(S_inv);
Primary template class for the metaprogram to compute the index type of a container.
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > wishart_rng(const double nu, const Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > &S, RNG &rng)
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > inv_wishart_rng(const double nu, const Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > &S, RNG &rng)
bool check_square(const char *function, const char *name, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y)
Return true if the specified matrix is square.
bool check_greater(const char *function, const char *name, const T_y &y, const T_low &low)
Return true if y is strictly greater than low.