-
-
Notifications
You must be signed in to change notification settings - Fork 36
convert to banded matrix types from AbstractMatrixes
#1212
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
Conversation
|
Does this work (in all cases) when the converted-to type has a different eltype? Like implicit eltype promotion? |
|
Should work now after generalizing the constructor. julia> M = diagm(0=>fill(3,4), 1=>fill(3,3))
4×4 Matrix{Int64}:
3 3 0 0
0 3 3 0
0 0 3 3
0 0 0 3
julia> using FillArrays
julia> f = Fill(Int8(4), 3);
julia> convert(Bidiagonal{eltype(f)}, M)
4×4 Bidiagonal{Int8, Vector{Int8}}:
3 3 ⋅ ⋅
⋅ 3 3 ⋅
⋅ ⋅ 3 3
⋅ ⋅ ⋅ 3
julia> convert(Bidiagonal{eltype(f), typeof(f)}, M)
4×4 Bidiagonal{Int8, Fill{Int8, 1, Tuple{Base.OneTo{Int64}}}}:
3 3 ⋅ ⋅
⋅ 3 3 ⋅
⋅ ⋅ 3 3
⋅ ⋅ ⋅ 3 |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1212 +/- ##
==========================================
+ Coverage 91.88% 91.90% +0.01%
==========================================
Files 34 34
Lines 15374 15386 +12
==========================================
+ Hits 14127 14141 +14
+ Misses 1247 1245 -2 ☔ View full report in Codecov by Sentry. |
|
Gentle bump |
After this, the following work:
These parallel the analogous
convertmethod forDiagonalthat already exists. The method forBidiagonaldetects the zero band and automatically chooses theuploaccordingly. This fixes the currently broken behavior, where theuplowas not provided to the constructor: