Skip to content

Commit ffeedb5

Browse files
authored
Merge pull request #2981 from stan-dev/optimization-chol2inv
Optimization for chol2inv
2 parents 754e94e + fe5dc6d commit ffeedb5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stan/math/prim/fun/chol2inv.hpp

+2-2
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)