Skip to content

Commit

Permalink
Compare Symbols and Chars more efficiently in Cholesky (#28873)
Browse files Browse the repository at this point in the history
(cherry picked from commit a2a1506)
  • Loading branch information
andreasnoack authored and KristofferC committed Sep 8, 2018
1 parent 30f03c6 commit e76071d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions stdlib/LinearAlgebra/src/cholesky.jl
Original file line number Diff line number Diff line change
Expand Up @@ -340,11 +340,11 @@ function getproperty(C::Cholesky, d::Symbol)
Cuplo = getfield(C, :uplo)
info = getfield(C, :info)
if d == :U
return UpperTriangular(Symbol(Cuplo) == d ? Cfactors : copy(Cfactors'))
return UpperTriangular(Cuplo === char_uplo(d) ? Cfactors : copy(Cfactors'))
elseif d == :L
return LowerTriangular(Symbol(Cuplo) == d ? Cfactors : copy(Cfactors'))
return LowerTriangular(Cuplo === char_uplo(d) ? Cfactors : copy(Cfactors'))
elseif d == :UL
return (Symbol(Cuplo) == :U ? UpperTriangular(Cfactors) : LowerTriangular(Cfactors))
return (Cuplo === 'U' ? UpperTriangular(Cfactors) : LowerTriangular(Cfactors))
else
return getfield(C, d)
end
Expand Down

0 comments on commit e76071d

Please sign in to comment.