Skip to content

Commit a6d08f4

Browse files
committed
Add cholesky_{upper,lower} methods
1 parent 9738946 commit a6d08f4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/utils.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ rather than `LowerTriangular`.
3131
that returns a `Matrix` rather than `LowerTriangular`.
3232
"""
3333
cholesky_lower(X::AbstractMatrix) = lower_triangular(parent(cholesky(Hermitian(X, :L)).L))
34+
cholesky_lower(X::PDMat) = X.chol.L
3435
cholesky_lower(X::Cholesky) = X.L
3536

3637
"""
@@ -44,6 +45,7 @@ rather than `UpperTriangular`.
4445
that returns a `Matrix` rather than `UpperTriangular`.
4546
"""
4647
cholesky_upper(X::AbstractMatrix) = upper_triangular(parent(cholesky(Hermitian(X)).U))
48+
cholesky_upper(X::PDMat) = X.chol.U
4749
cholesky_upper(X::Cholesky) = X.U
4850

4951
"""

0 commit comments

Comments
 (0)