-
Notifications
You must be signed in to change notification settings - Fork 31
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
support general backends for BlockArray #76
Conversation
Codecov Report
@@ Coverage Diff @@
## master #76 +/- ##
==========================================
- Coverage 80.1% 76.02% -4.09%
==========================================
Files 12 12
Lines 578 588 +10
==========================================
- Hits 463 447 -16
- Misses 115 141 +26
Continue to review full report at Codecov.
|
Could this functionality be included in some other type under the |
This is to support special blocksizes with extra structure (for example, constant block sizes #26). I don't see how else to do it apart from adding another templated variable. Type-aliases can give the current behaviour if needed: const DefaultBlockSizes{N} = BlockSizes{N,Vector{Int}}
const DefaultBlockArray{T, N, R} = BlockArray{T,N,R,DefaultBlockSizes{N}} |
I think that |
It's a modifier type, that takes in something else and reinterprets it. It's more like |
A slight variant to the type-alias approach would be to define (Side notes: I had a similar pull request for I guess another approach would be to define getter/setter for |
Sure that's fine. How about |
I just don't understand the need to push every usecase into the same struct, this makes things unnecessary complicated IMO. Most users will never use this and would be better off with just (e.g. even removing the
Why can't this functionality just be included in a
? |
Because the current |
And the exact same logic applies to |
I think you may also need |
|
Isn't this handled by the |
No |
@dlfivefifty I see. Another argument against this is that Actually, I think this PR as-is without re-naming using |
Why couldn't it be used for a new struct like |
You would need an extra abstract type to be able to reuse code. Which makes the code more complex than just doing a typealias as the implementation is identical. I really don’t see the argument against a typealias as for users of |
What I like about |
I agree that simplicity is appealing. But I think it would be confusing to have both |
It looks like only two packages (other than mine) depend on BlockArrays.jl: Stheno.jl, which won't need any changes, and MixedModels.jl, which will need to be updated if we change the templates for @willtebbutt @dmbates do you have any strong feelings about the proposed change to allow general |
I am in favour of this change. Being able to use a |
Note it also supports https://github.com/JuliaMatrices/BlockBandedMatrices.jl/pull/24/files (I could move these changes to support |
I think the best solution is to simplify the default output to hind the implementation details from the user: julia> A = BlockArray{Float64}(undef, 1:3)
3-blocked 6-element BlockArray{Float64,1}:
2.2619260434e-314
─────────────────
2.3300040286e-314
2.29625195e-314
─────────────────
2.330002479e-314
2.330002479e-314
2.330002479e-314 This avoids unnecessary extra type names. |
This allows general backends for BlockArray. For example: