Open dmbates opened 5 years ago
Seems legit to me
Thanks think we decided to have this package not use the BlockArrays.jl machinery (though Blockarrays could have a Diagonal type https://github.com/JuliaArrays/BlockArrays.jl/issues/89)
So it depends on the details
Certainly open to the Idea
I think this could make sense, since there are packages using BlockDiagonals.jl and BlockArrays.jl
I had envisioned this package as being for the case where you only want block-diagonal matrices and do not want to depend on BlockArrays.jl. My thought was "if you were depending on BlockArrays.jl anyway, then why not use the "Diagonal BlockArray" type provided there?", but evidently there's some reason to use both packages 😄 And anyway a standard interface to enable switching between "block array" packages would be nice.
What does @dlfivefifty think of putting generic core API of BlockArrays.jl into a "BlockArraysBase.jl" package?
I guess this would include blocksize
, blocksizes
, nblocks
, and AbstractBlockArray
, possibly also setblock!
, getblock
and maybe AbstractBlockSizes
and Block
?
As it happens I'm completely redesigning BlockArrays.jl:
https://github.com/JuliaArrays/BlockArrays.jl/pull/95
The idea is to include all block information in the axes, so BlockSizes
is completely gone. I also renamed the functionality (with some incompatibility with previous termonlogy).
This makes a BlockArraysBase.jl package a bit simpler. It would contain:
Block
, BlockIndex
, BlockIndexRange
, and BlockRange
blockaxes
, blocksize
, findblock
, and findblockindex
AbstractBlockArray
. This is actually optional as there is now a better defined "block interface".BlockedUnitRange
for the implementation of a blocked axesI'm not sure about setblock!
and getblock
: I want to eventually remove them completely in favour of A[Block(5)]
and A[Block(3)] .= ....
.
Great timinng! Let's come back to this once that PR is in?
It would be fantastic if you have time to do a code review of that PR. The tests pass already, I'm just getting the doc tests to pass and in theory it would be ready to merge.
Sorry for my ignorance, but what exactly is the difference between the "DiagonalBlockArray" and BlockDiagonal
? I thought that the initial stimulus for this package was that BlockArrays.jl had some "undesirable" overhead in the structured/sparse block case?
EDIT: I must have missed that there are currently no linalg-methods in BlockArrays.jl
, so the difference is that this package here provides multiplication methods for BlockMatrices.
See the discussion in https://github.com/dmbates/MixedModels.jl/pull/216
Would you be open to having
BlockDiagonals.jl
depend on aBlockArraysBase.jl
package in which the conflicting generics likenblocks
were defined?