Skip to content

Commit fe5dc6d

Browse files
committed
Update chol2inv.hpp
1 parent 754e94e commit fe5dc6d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stan/math/prim/fun/chol2inv.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <stan/math/prim/fun/Eigen.hpp>
66
#include <stan/math/prim/fun/dot_self.hpp>
77
#include <stan/math/prim/fun/dot_product.hpp>
8-
#include <stan/math/prim/fun/mdivide_left_tri_low.hpp>
8+
#include <stan/math/prim/fun/mdivide_left_tri.hpp>
99
#include <stan/math/prim/fun/inv_square.hpp>
1010

1111
namespace stan {
@@ -35,7 +35,7 @@ plain_type_t<T> chol2inv(const T& L) {
3535
X.coeffRef(0) = inv_square(L_ref.coeff(0, 0));
3636
return X;
3737
}
38-
T_result L_inv = mdivide_left_tri_low(L_ref, T_result::Identity(K, K));
38+
T_result L_inv = mdivide_left_tri<Eigen::Lower>(L_ref);
3939
T_result X(K, K);
4040
for (int k = 0; k < K; ++k) {
4141
X.coeffRef(k, k) = dot_self(L_inv.col(k).tail(K - k).eval());

0 commit comments

Comments
 (0)