Hello,
        I was trying to create a spare matrix 
<http://julia-demo.readthedocs.org/en/latest/stdlib/sparse.html#Base.spdiagm> 
with 
diagonal indexing. I have done the following :
x = [3:-1:3]

When I give in 

julia> spdiagm(x, 0, length(x), length(x))
7x7 sparse matrix with 6 Int64 entries:
[1, 1]  =  3
[2, 2]  =  2
[3, 3]  =  1
[5, 5]  =  -1
[6, 6]  =  -2
[7, 7]  =  -3

it works.

But when I give in 
julia> spdiagm(x, 1, length(x), length(x))
ERROR: BoundsError
 in sparse at sparse/csparse.jl:50
 in spdiagm at sparse/sparsematrix.jl:2133
 in spdiagm at sparse/sparsematrix.jl:2141

I get the above error. Any leads on this would be great. Thanks.

Reply via email to