1#ifndef STAN_MATH_PRIM_FUN_MULTIPLY_LOWER_TRI_SELF_TRANSPOSE_HPP
2#define STAN_MATH_PRIM_FUN_MULTIPLY_LOWER_TRI_SELF_TRANSPOSE_HPP
18template <
typename EigMat, require_eigen_matrix_dynamic_t<EigMat>* =
nullptr,
19 require_not_st_autodiff<EigMat>* =
nullptr>
27 result.coeffRef(0) =
square(L.coeff(0, 0));
33 for (
int m = 0; m < K; ++m) {
34 int k = (J < m + 1) ? J : m + 1;
35 LLt(m, m) = Lt.col(m).head(k).squaredNorm();
36 for (
int n = (m + 1); n < K; ++n) {
37 LLt(n, m) = LLt(m, n) = Lt.col(m).head(k).dot(Lt.col(n).head(k));
Eigen::Matrix< value_type_t< EigMat >, EigMat::RowsAtCompileTime, EigMat::RowsAtCompileTime > multiply_lower_tri_self_transpose(const EigMat &m)
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > matrix_d
Type for matrix of double values.
fvar< T > square(const fvar< T > &x)
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...