julia> using LinearAlgebra
julia> zero(UnitUpperTriangular(rand(5,5)))
ERROR: ArgumentError: cannot set index (1, 1) on the diagonal of a UnitUpperTriangular matrix to a non-unit value (0.0)
Seems like this should return an UpperTriangular matrix of zeros?
Similarly for UnitLowerTriangular.
Usually, we try to have zero return the same type, but that's not always the case (e.g. zero(1:2) returns a Vector), and here it is impossible. (See also #1050.)
Seems like this should return an
UpperTriangularmatrix of zeros?Similarly for
UnitLowerTriangular.Usually, we try to have
zeroreturn the same type, but that's not always the case (e.g.zero(1:2)returns aVector), and here it is impossible. (See also #1050.)