Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ check_cholesky_factor_corr() [2/2]

template<typename StdVec , require_std_vector_t< StdVec > * = nullptr>
void stan::math::check_cholesky_factor_corr ( const char *  function,
const char *  name,
const StdVec &  y 
)

Throw an exception if the specified matrix is not a valid Cholesky factor of a correlation matrix.

A Cholesky factor is a lower triangular matrix whose diagonal elements are all positive and each row has unit Euclidean length. Note that Cholesky factors need not be square, but require at least as many rows M as columns N (i.e., M >= N). Tolerance is specified by math::CONSTRAINT_TOLERANCE. Tolerance is specified by math::CONSTRAINT_TOLERANCE.

Template Parameters
StdVecA standard vector with inner type either inheriting from MatrixBase with neither rows or columns defined at compile time to be equal to 1 or a var_value with the var's inner type inheriting from Eigen::MatrixBase with neither rows or columns defined at compile time to be equal to 1
Parameters
functionFunction name (for error messages)
nameVariable name (for error messages)
yStandard vector of matrics to test
Exceptions
`std::domain_error`if y[i] is not a valid Cholesky factor, if number of rows is less than the number of columns, if there are 0 columns, or if any element in matrix is NaN

Definition at line 69 of file check_cholesky_factor_corr.hpp.