julia
8dc2c30f - Preserve eltype in converting `Symmetric` to `Matrix` (#52738)

Commit
1 year ago
Preserve eltype in converting `Symmetric` to `Matrix` (#52738) This allows cases where the `eltype` differs from that of the parent: ```julia julia> M = [UpperTriangular([1 2; 3 4]) for i in 1:2, j in 1:2] 2×2 Matrix{UpperTriangular{Int64, Matrix{Int64}}}: [1 2; 0 4] [1 2; 0 4] [1 2; 0 4] [1 2; 0 4] julia> H = Hermitian(M) 2×2 Hermitian{AbstractMatrix, Matrix{UpperTriangular{Int64, Matrix{Int64}}}}: [1 2; 2 4] [1 2; 0 4] [1 0; 2 4] [1 2; 2 4] julia> Array(H) 2×2 Matrix{AbstractMatrix}: [1 2; 2 4] [1 2; 0 4] [1 0; 2 4] [1 2; 2 4] ``` This conversion throws an error at present on master.
Author
Parents
Loading