-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Let spdiagm preserve sparsity #37254
Conversation
Have you considered using dispatching over _numel(vect::SparseVector) = nnz(vect)
_numel(vect::AbstractArray) = length(vect) instead of p.second isa AbstractSparseVector ? nnz(p.second) : length(p.second) ? Imho, it is more readable and/or extensible. |
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.
AbstractSparseVector
(unlike SparseVector
) should be available since it is defined in abstractsparse.jl
, which is included prior to sparsematrix.jl
in SparseArrays.jl
. I guess your second point is valid. I just think that dispatching is clearer than isa
branching. Perhaps, someone more experienced will join the discussion.
bdfd308
to
024e93e
Compare
Which part of #37174 isn't addressed here? |
The wish for a default |
I included the convenience constructor. Originally, without much thinking, I was under the impression that this might be somewhat controversial, but the analogy to |
Thanks. I missed that part. I guess the only reason not to have it would be to keep the code slightly simpler by only having a single interface for |
Good stuff - Since @andreasnoack has already reviewed, I am happy (without my own review). Off-topic - I wish we could pick better names (and even move sparse matrices out of stdlib sooner than 2.0) |
Although we don't really need a logo here.
`dlopen`ing the release version of the library in the debug build is a **REALLY** bad idea.
Deserializing an array needs to examine the element type (tparam0) layout. Usually we know the layout of a DataType is initialized early (when present). This also ensures that the path to it is initialized (for our case where it may be inline allocated with interior pointers).
#37652) * add in_sysimage to check if a package is in the sysimage * suggestion to empty _sysimage_modules first Co-authored-by: Takafumi Arakaki <takafumi.a@gmail.com> * add tests for in_sysimage * Fix typo in test Co-authored-by: Takafumi Arakaki <takafumi.a@gmail.com>
add an error check that the max size is not exceeded
Something went horribly wrong with rebasing. I'll try again with #37684. |
Closes #37174.
With this PR: