Skip to content
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

Inconsistent addition between sparse and dense #516

Open
matbesancon opened this issue Feb 21, 2024 · 1 comment
Open

Inconsistent addition between sparse and dense #516

matbesancon opened this issue Feb 21, 2024 · 1 comment

Comments

@matbesancon
Copy link
Contributor

julia>  spzeros(2) + [1.4, 3]
2-element SparseVector{Float64, Int64} with 2 stored entries:
       
  [2]  =  3.0

julia>  spzeros(2,2) +
        [1.4 3
        0 2]
2×2 Matrix{Float64}:
 1.4  3.0
 0.0  2.0

The matrix behavior seems to be the most sensible, assuming that adding a dense and a sparse will yield something sparse seems very risky

@ViralBShah
Copy link
Member

Agree. Having a dense result is the sensible- since one of the inputs was already dense.

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

No branches or pull requests

2 participants