Skip to content

Conversation

@matbesancon
Copy link
Contributor

This is useful to have a unified way to create sparse and dense vectors.

Will add tests if the feature is considered useful / needed

@codecov-commenter
Copy link

codecov-commenter commented Sep 19, 2022

Codecov Report

Merging #263 (bb83120) into main (0d63db0) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #263   +/-   ##
=======================================
  Coverage   92.01%   92.02%           
=======================================
  Files          12       12           
  Lines        7317     7319    +2     
=======================================
+ Hits         6733     6735    +2     
  Misses        584      584           
Impacted Files Coverage Δ
src/sparsematrix.jl 95.37% <100.00%> (+<0.01%) ⬆️
src/sparsevector.jl 95.16% <100.00%> (+<0.01%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@rayegun
Copy link
Member

rayegun commented Sep 19, 2022

Is this semantically correct compared to other undef initializers? If so this seems like a fine addition.

@matbesancon
Copy link
Contributor Author

Is this semantically correct compared to other undef initializers

it seems so, the type has to be given as type parameter, it creates a new object of the same type

@rayegun
Copy link
Member

rayegun commented Sep 19, 2022

I'll approve with a few tests and maybe a short docstring to clarify that this is an empty spmatrix.

@matbesancon
Copy link
Contributor Author

done

@rayegun rayegun merged commit fe42f2c into JuliaSparse:main Sep 19, 2022
@matbesancon matbesancon deleted the undef-init branch September 19, 2022 12:09
fredrikekre added a commit to JuliaLang/julia that referenced this pull request Sep 22, 2022
This patch updates SparseArrays. In particular it contains
JuliaSparse/SparseArrays.jl#260 which is
necessary to make progress in #46759.

All changes:
 - Fix ambiguities with Base. (JuliaSparse/SparseArrays.jl#268)
 - add == for vectors (JuliaSparse/SparseArrays.jl#248)
 - add undef initializers (JuliaSparse/SparseArrays.jl#263)
 - Make sure reductions benefit from sparsity (JuliaSparse/SparseArrays.jl#244)
 - Remove fkeep! from the documentation (JuliaSparse/SparseArrays.jl#261)
 - Fix direction of circshift (JuliaSparse/SparseArrays.jl#260)
 - Fix `vcat` of sparse vectors with numbers (JuliaSparse/SparseArrays.jl#253)
 - decrement should always return a vector (JuliaSparse/SparseArrays.jl#241)
 - change order of arguments in fkeep, fix bug with fixed elements (JuliaSparse/SparseArrays.jl#240)
 - Sparse matrix/vectors with fixed sparsity pattern. (JuliaSparse/SparseArrays.jl#201)
fredrikekre added a commit to JuliaLang/julia that referenced this pull request Sep 27, 2022
This patch updates SparseArrays. In particular it contains
JuliaSparse/SparseArrays.jl#260 which is
necessary to make progress in #46759.

All changes:
 - Fix ambiguities with Base. (JuliaSparse/SparseArrays.jl#268)
 - add == for vectors (JuliaSparse/SparseArrays.jl#248)
 - add undef initializers (JuliaSparse/SparseArrays.jl#263)
 - Make sure reductions benefit from sparsity (JuliaSparse/SparseArrays.jl#244)
 - Remove fkeep! from the documentation (JuliaSparse/SparseArrays.jl#261)
 - Fix direction of circshift (JuliaSparse/SparseArrays.jl#260)
 - Fix `vcat` of sparse vectors with numbers (JuliaSparse/SparseArrays.jl#253)
 - decrement should always return a vector (JuliaSparse/SparseArrays.jl#241)
 - change order of arguments in fkeep, fix bug with fixed elements (JuliaSparse/SparseArrays.jl#240)
 - Sparse matrix/vectors with fixed sparsity pattern. (JuliaSparse/SparseArrays.jl#201)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants