1#ifndef STAN_MATH_PRIM_FUN_CHOL2INV_HPP
2#define STAN_MATH_PRIM_FUN_CHOL2INV_HPP
23template <
typename T, require_eigen_t<T>* =
nullptr>
25 decltype(
auto) L_ref =
to_ref(std::forward<T>(L));
31 return std::forward<decltype(L_ref)>(L_ref);
39 mdivide_left_tri<Eigen::Lower>(std::forward<
decltype(L_ref)>(L_ref)));
void check_square(const char *function, const char *name, const T_y &y)
Check if the specified matrix is square.
fvar< T > inv_square(const fvar< T > &x)
plain_type_t< T > chol2inv(T &&L)
Returns the inverse of the matrix whose Cholesky factor is L.
matrix_cl< typename std::decay_t< T_A >::Scalar > crossprod(T_A &&A)
Returns the result of pre-multiplying a matrix by its own transpose.
ref_type_t< T && > to_ref(T &&a)
This evaluates expensive Eigen expressions.
void check_lower_triangular(const char *function, const char *name, const T_y &y)
Check if the specified matrix is lower triangular.
typename plain_type< std::decay_t< T > >::type plain_type_t
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...