-
-
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
problem of conversion from sparse matrix slice to sparse vector #14013
Comments
cc: @mbauman @mingsystemx Regarding your last point, then notice that you can easily get what you want with e.g. |
hello, |
@mingsystemx |
This is a much discussed point, and the behaviour for sparse is now consistent with the dense behaviour. |
ok, this is the following rule : Trailing dimensions indexed with scalars are dropped |
In 0.5, this rule changes: now all dimensions indexed with a scalar are dropped. |
hello,
the conversion between sparse matrix line and sparse vecteor is not correct
julia> aa = sparse([10. 0 30.])
1x3 sparse matrix with 2 Float64 entries:
[1, 1] = 10.0
[1, 3] = 30.0
julia> full(aa[1,:])
3-element Array{Float64,1}:
10.0
30.0
0.0
the zeros coefficient has been misplaced in the sparse vector.
this happens in the development branch
Version 0.5.0-dev+1265 (2015-11-13 08:40 UTC)
Commit f045831 (0 days old master)
x86_64-linux-gnu
...and just a comment about
#13440
the direction taken by sparse arrays (matrix or vector) library is questionable in my opinion. if a line or column slice of a sparse matrix is transformed into a sparse vector, with a different internal implementation, then you will prevent people from passing slices like a[k,:] to libraries. in my opinion, more generally, the implicit conversion of matrix slices like a[k,:] or a[:,k] into vectors will reduce drastically the main quality of Julia : "it's very easy to plug algorithms between them". we will have to write special case for slices every time.
bests,
M.
The text was updated successfully, but these errors were encountered: