Skip to content

Conversation

@jishnub
Copy link
Member

@jishnub jishnub commented Oct 6, 2024

After this,

julia> A = rand(2,2);

julia> H = Hermitian(A)
2×2 Hermitian{Float64, Matrix{Float64}}:
 0.889108  0.264298
 0.264298  0.234985

julia> println(H)
Hermitian([0.8891078167175059 0.26429820656950753; 0.26429820656950753 0.23498548977257172])

julia> S = Symmetric(A)
2×2 Symmetric{Float64, Matrix{Float64}}:
 0.889108  0.264298
 0.264298  0.234985

julia> println(S)
Symmetric([0.8891078167175059 0.26429820656950753; 0.26429820656950753 0.23498548977257172])

julia> U = UpperTriangular(A)
2×2 UpperTriangular{Float64, Matrix{Float64}}:
 0.889108  0.264298
          0.234985

julia> println(U)
UpperTriangular([0.8891078167175059 0.26429820656950753; 0.0 0.23498548977257172])

julia> U = UnitUpperTriangular(A)
2×2 UnitUpperTriangular{Float64, Matrix{Float64}}:
 1.0  0.264298
     1.0

julia> println(U)
UnitUpperTriangular([1.0 0.26429820656950753; 0.0 1.0])

julia> L = LowerTriangular(A)
2×2 LowerTriangular{Float64, Matrix{Float64}}:
 0.889108    
 0.2504    0.234985

julia> println(L)
LowerTriangular([0.8891078167175059 0.0; 0.2503997651590879 0.23498548977257172])

julia> L = UnitLowerTriangular(A)
2×2 UnitLowerTriangular{Float64, Matrix{Float64}}:
 1.0       
 0.2504  1.0

julia> println(L)
UnitLowerTriangular([1.0 0.0; 0.2503997651590879 1.0])

The displayed form is now a valid constructor, and may be copy-pasted to reconstruct the object.

@jishnub jishnub added the linear algebra Linear algebra label Oct 6, 2024
@nsajko nsajko added the display and printing Aesthetics and correctness of printed representations of objects. label Oct 6, 2024
@jishnub jishnub marked this pull request as draft October 7, 2024 16:31
@ViralBShah
Copy link
Member

Worth getting this in? I assume it is marked Draft because it has more work to be done.

@jishnub
Copy link
Member Author

jishnub commented Nov 8, 2024

There were some test failures because of how arrays of arrays would now be printed. I haven't really thought about this since.

@DilumAluthge
Copy link
Member

We have moved the LinearAlgebra stdlib to an external repo: https://github.com/JuliaLang/LinearAlgebra.jl

@jishnub If you think that this PR is still relevant, please open a new PR on the LinearAlgebra.jl repo.

@DilumAluthge DilumAluthge deleted the jishnub/symhermshow branch January 12, 2025 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

display and printing Aesthetics and correctness of printed representations of objects. linear algebra Linear algebra

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants