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

Matrix conversion for structured matrices without a zero #1159

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jishnub
Copy link
Collaborator

@jishnub jishnub commented Dec 25, 2024

This adds a fallback branch in case the eltype doesn't have a unique zero, so that the following works after this PR:

julia> D = Diagonal(fill(ones(2,2), 2, 2))
2×2 Diagonal{Matrix{Float64}, Vector{Matrix{Float64}}}:
 [1.0 1.0; 1.0 1.0]                   
                    [1.0 1.0; 1.0 1.0]

julia> Matrix(D)
2×2 Matrix{Matrix{Float64}}:
 [1.0 1.0; 1.0 1.0]  [0.0 0.0; 0.0 0.0]
 [0.0 0.0; 0.0 0.0]  [1.0 1.0; 1.0 1.0]

Similarly, for Bidiagonal and Tridiagonal/SymTridiagonal.

@jishnub jishnub added the arrays [a, r, r, a, y, s] label Dec 25, 2024
@jishnub jishnub marked this pull request as draft December 25, 2024 10:36
Copy link

codecov bot commented Dec 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.84%. Comparing base (6e5ea12) to head (d05a39b).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1159      +/-   ##
==========================================
+ Coverage   91.83%   91.84%   +0.01%     
==========================================
  Files          34       34              
  Lines       15363    15375      +12     
==========================================
+ Hits        14108    14121      +13     
+ Misses       1255     1254       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrays [a, r, r, a, y, s]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant