-
Notifications
You must be signed in to change notification settings - Fork 49
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
An alternative amalgamate strategy #216
Conversation
Codecov Report
@@ Coverage Diff @@
## master #216 +/- ##
==========================================
- Coverage 93.25% 93.09% -0.17%
==========================================
Files 18 18
Lines 1290 1288 -2
==========================================
- Hits 1203 1199 -4
- Misses 87 89 +2
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, only a minor style suggestion.
How much work will it take to actually remove / write internal replacements for |
There aren't that many people familiar with BlockArrays. @dlfivefifty would be the person best positioned to answer whether heterogenous types of blocks could be supported or how to best have an internal workaround (e.g., other than just copying BlockArrays 0.7 as internal module...). The incompatibility is currently affecting a few packages such as Pumas/Bioequivalence which are meant to be working together, but currently can't coexist in the same environment due to the issue. |
I'm guessing no because some of them are sparse and some of them are not, and the sparse ones may have different substructures of sparsity. |
Would it be feasible to have a copy of BlockArrays 0.7 version code bundled as an internal module in case there isn't a good solution in the meantime? |
I haven't looked at how the indexing is actually done in the linear algebra, but assuming that the blocks are used and everything else is ignored (as zeroing out), it might be possible to replace BlockArrays with a dictionary indexed by Block / ordered pair. You lose the ability to index between blocks (at least without adding a wrapper around that / using an indexer that returns a default zero value there) and the sense of overall indexing, but otherwise that should really easy to implement. |
I couldn't find it, but some package had a simple wrapper view for extending indexing to block-like matrices (a non BlockArrays). At this point I think a temporary solution even if not ideal should be the priority. |
I don't really understand the issue, there shouldn't be any reason to stay on BlockArrays v0.7, and I don't see why BlockDiagonals.jl and BlockArrays.jl should be incompatible. |
The current implementation used BlockArrays where some blocks are sparse and others dense. Is this supported (or could be) in current versions of BlockArrays? |
Yes: julia> B = Matrix{AbstractMatrix{Float64}}(undef,2,1)
julia> B[1,1] = fill(1.0,2,2)
julia> B[2,1] = sparse(I,2,2)
julia> A = mortar(B)
2×1-blocked 4×2 BlockArray{Float64,2,Array{AbstractArray{Float64,2},2},BlockArrays.BlockSizes{2,Tuple{Array{Int64,1},Array{Int64,1}}}}:
1.0 1.0
1.0 1.0
────────
1.0 0.0
0.0 1.0
julia> A[Block(1,1)]
2×2 Array{Float64,2}:
1.0 1.0
1.0 1.0
julia> A[Block(2,1)]
2×2 SparseMatrixCSC{Float64,Int64} with 2 stored entries:
[1, 1] = 1.0
[2, 2] = 1.0 |
I think the "incompatibility" @dmbates was referring to was the collision in imported method names and thus the necessity of using fully qualified names for |
The "right" way to resolve this is to move out the core features ( |
I was mistaken about the need to freeze the version of The reason I said that the dependence on |
I do think, as @palday mentioned, that using |
I think it’s a better use of time, and more “community oriented” take make the two packages work well together. Others will run into this problem and so it would be good to solve it properly... |
Hi there, I came across this issue by pure chance, from |
Thank you for pointing this out. The use case here is a blocked Cholesky factorization, which may or may not be a good fit for |
As both @dlfivefifty and @nickrobinson251 have made contributions to https://github.com/JuliaArrays/BlockArrays.jl, perhaps one of them could create a |
indmat
extractor forReMat
returns aBool
indicator matrix of potential nonzeros in lambdaBlockDiagonals
package to create indmat of amalgamatedReMat
s from originalindmat
BlockDiagonals
creates some conflict withBlockArrays
butBlockArrays
should be removed anywaygithub.aaakk.us.kg/invenia/BlueStyle
guideDataFramesMeta
as a test dependency