Skip to content

Commit

Permalink
Compare Symbols and Chars more efficiently in Cholesky (JuliaLang#28873)
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasnoack authored and KristofferC committed Aug 26, 2018
1 parent 7314249 commit a2a1506
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 a2a1506

Please sign in to comment.