Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SymTridiagonal{<:Matrix} should transpose for sub-diagonal and make diagonal symmetric #613

Closed
dlfivefifty opened this issue Feb 23, 2019 · 3 comments · Fixed by JuliaLang/julia#31327
Assignees

Comments

@dlfivefifty
Copy link
Contributor

Symmetric with a Matrix{<:Matrix} transposes the argument:

julia> A = Symmetric(fill([1 2; 3 4],3,3));

julia> A[1,1]
2×2 Symmetric{Int64,Array{Int64,2}}:
 1  2
 2  4

julia> A[1,2]
2×2 Array{Int64,2}:
 1  2
 3  4

julia> A[2,1]
2×2 Transpose{Int64,Array{Int64,2}}:
 1  3
 2  4

For consistency, SymTridiagonal should have similar behaviour, but it doesn't:

julia> A = SymTridiagonal(fill([1 2; 3 4],3), fill([1 2; 3 4],2));

julia> A[1,1]
2×2 Array{Int64,2}:
 1  2
 3  4

julia> A[1,2]
2×2 Array{Int64,2}:
 1  2
 3  4

julia> A[2,1]
2×2 Array{Int64,2}:
 1  2
 3  4
@namanbiyani
Copy link

Hi, I was planning to contribute towards GSoC 2019. I want to contribute to this issue. Please give some guidelines .

@dlfivefifty
Copy link
Contributor Author

Probably we want the following behaviour:

julia> A = SymTridiagonal(fill([1 2; 3 4],3), fill([1 2; 3 4],2));

julia> A[1,1]
2×2 Symmetric{Int64,Array{Int64,2}}:
 1  2
 2  4

julia> A[1,2]
2×2 Array{Int64,2}:
 1  2
 3  4

julia> A[2,1]
2×2 Transpose{Int64,Array{Int64,2}}:
 1  3
 2  4

@dkarrasch
Copy link
Member

I started being very skeptical about interpreting special matrix structure elementwise, see #610.

@KristofferC KristofferC transferred this issue from JuliaLang/julia Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants