Skip to content

Commit

Permalink
Make conversion of Diagonal matrices to Unit(Upper|Lower)Triangular p…
Browse files Browse the repository at this point in the history
…reserve the Diagonal storage structure, consistent with conversion to (Upper|Lower)Triangular.
  • Loading branch information
Sacha0 committed Jul 27, 2016
1 parent d0a378d commit 87272d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions base/linalg/special.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ function convert(::Type{UnitUpperTriangular}, A::Diagonal)
if !all(A.diag .== one(eltype(A)))
throw(ArgumentError("matrix cannot be represented as UnitUpperTriangular"))
end
UnitUpperTriangular(full(A))
UnitUpperTriangular(A)
end

function convert(::Type{UnitLowerTriangular}, A::Diagonal)
if !all(A.diag .== one(eltype(A)))
throw(ArgumentError("matrix cannot be represented as UnitLowerTriangular"))
end
UnitLowerTriangular(full(A))
UnitLowerTriangular(A)
end

function convert(::Type{Diagonal}, A::Union{Bidiagonal, SymTridiagonal})
Expand Down

0 comments on commit 87272d3

Please sign in to comment.