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());