Comments (7)
sparse(::BlockArray)
is just calling the default, which spends a lot of time in findall(x -> x != 0, M)
. It's possible a faster findall
would accomplish the same feat, otherwise, can you file a PR with your createSP
implemented via overloading SparseMatrixCSC{Tv,Ti}(M::AbstractBlockArray) where {Tv,Ti}
which sparse
eventually calls?
There's a question whether sparse(::AbstractBlockArray)
should return a block array itself with sparse storage, so as to not lose the block information?
from blockarrays.jl.
We should limit the type to BlockArray{Tv,2,SparseMatrixCSC{Tv,Ti}}
, don't you agree?
I am not sure I am so skilled as to do a pull request ;)
I wanted to check if I missed a point. Also, my function is geared toward blocks with same size.
from blockarrays.jl.
We should limit the type to BlockArray{Tv,2,SparseMatrixCSC{Tv,Ti}}, don't you agree?
No, as other types have nice sparse representations. Calling sparse(J[Block(i,j)])
should tackle the general case.
But it may be better to create the i
, j
, z
directly, say by modifying sparse(::BandedBlockBandedMatrix)
: https://github.com/JuliaMatrices/BlockBandedMatrices.jl/blob/e19c22fc9c9e5399976c24aa06a6871bf0133841/src/BandedBlockBandedMatrix.jl#L254
I am not sure I am so skilled as to do a pull request ;)
In open-source software, people maintaining packages have limited time and so are unlikely to add new features that they don't directly benefit from. So if you really want this you'll probably have to do the PR yourself. Given the current state of Julia packages I'd consider being able to make a PR an essential skill to have.
from blockarrays.jl.
Which file should I put the function in?
from blockarrays.jl.
If it only works with BlockArray
, then probably src/blockarray.jl, otherwise src.abstractblockarray.jl
from blockarrays.jl.
Did a PR eventually come out of this?
from blockarrays.jl.
I don't believe so, if you are keen to do one I'm sure it will be appreciated.
from blockarrays.jl.
Related Issues (20)
- Functionality for slicing with unit ranges that preserves block information HOT 8
- Slicing a `BlockIndexRange` with unit ranges doesn't return a `BlockedIndexRange`
- Indexing with `Vector{<:BlockIndexRange{1}}` HOT 2
- More convenient syntax for merging blocks
- Generic interface for constructing `AbstractBlockArray`s: `blocked(a::AbstractArray, blocklengths...)`
- `getindex(::UnitRange, ::BlockedUnitRange)` isn't blocked HOT 1
- More convenient syntax for getting the size of a block HOT 5
- Definition of BlockUnitRange HOT 3
- Overload dot HOT 3
- Bug: Block indexing changed between 0.16.40 and 0.16.43 HOT 1
- Failing to compile on 1.12 nightly HOT 7
- Rename PseudoBlockArray to BlockedArray (v1.0) HOT 1
- Make `blocks(randn(2, 2))[1, 1]` return the original array
- `mortar([Block(1)[1:2], Block(2)[1:2]])[Block(1)]` has type `Vector{BlockIndex{1}}` instead of `BlockIndexRange{1}`
- `+(::BlockVector, ::Vector)` promotes axis from `BlockedOneTo` to `BlockedUnitRange`
- zero dimensional BlockArray and BlockedArray are broken HOT 5
- Stackoverflow with broadcast += between Vector and scalar*BlockedVector
- Overlapping blocks: here or a new package? HOT 7
- Examples of mortar() for nd arrays? HOT 2
- Array conversion breaks image outputs? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blockarrays.jl.