From fe5dc6dcb42133acf73ca17c1bd871dc34956163 Mon Sep 17 00:00:00 2001 From: Sean Pinkney Date: Wed, 6 Dec 2023 06:57:58 -0500 Subject: [PATCH] Update chol2inv.hpp --- stan/math/prim/fun/chol2inv.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stan/math/prim/fun/chol2inv.hpp b/stan/math/prim/fun/chol2inv.hpp index 7f7ec19ca8d..2c46de28dd8 100644 --- a/stan/math/prim/fun/chol2inv.hpp +++ b/stan/math/prim/fun/chol2inv.hpp @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include namespace stan { @@ -35,7 +35,7 @@ plain_type_t chol2inv(const T& L) { X.coeffRef(0) = inv_square(L_ref.coeff(0, 0)); return X; } - T_result L_inv = mdivide_left_tri_low(L_ref, T_result::Identity(K, K)); + T_result L_inv = mdivide_left_tri(L_ref); T_result X(K, K); for (int k = 0; k < K; ++k) { X.coeffRef(k, k) = dot_self(L_inv.col(k).tail(K - k).eval());