Hello,
I have a problem with sparse matrix in Julia 0.5. here is the detailed
version number
Version 0.5.0-dev+1265 (2015-11-13 08:40 UTC)
Commit f045831 (0 days old master)
x86_64-linux-gnu
here is the sequence of instructions that highlights the bug ;
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 result should be
[10.0 0.0 30.0]
Other thing : taking a line of a sparse matrix involves an automatic
conversion to sparse vector :
julia> aa[1,:]
Sparse vector of length 3, with 2 Float64 nonzero entries:
[1] = 10.0
[2] = 30.0
by the way all my codes using
line = A[i,:]
a_function_of(line)
where A is a sparse matrix, have to be rewrited. I guess the best option is
to write an overload
function a_function(arg :: sparseVector)
but in my opinion, this conversion is not a good feature, since one-line
matrix are also converted to column vectors.
I was using a 0.4 version (master branch) and moved to 0.5 in order to do
something like that
aa = sprand(...)
ff = qrfact(aa)
ff[:R]
but this feature is still not available (dense matrix only)
bests,
M.