well, nullspace appears to be defined for dense arrays only - and rank is 
defined for abstract arrays but will fail in svdvals!() when passed a 
sparse array (this is arguably a bug).

On Monday, November 16, 2015 at 1:12:04 PM UTC-8, Laurent Bartholdi wrote:
>
> Hello world,
> I'm new at julia, and trying it out as a replacement for matlab and other 
> computer algebra systems. I'm a bit stuck with sparse matrices: I have 
> largeish matrices (10^6 x 10^6) that are very sparse, and
> want to know their rank and nullspace. (the matrices decompose by blocks, 
> so the nullspace should be expressible as a sparse matrix).
>
> I tried with the latest (github) julia 0.5:
>
> julia> nullspace(sparse([1],[1],[1]))
> ERROR: MethodError: `nullspace` has no method matching 
> nullspace(::SparseMatrixCSC{Int64,Int64})
>
> julia> nullspace(full(sparse([1],[1],[1])))
> 1x0 Array{Float64,2} # I'm a bit unhappy here, I was hoping to get a 
> rational answer.
>
> julia> nullspace([1//1])
> 1x0 Array{Float32,2} # yikes! I'm down to 32 bits floats now.
>
> julia> rank(sparse([1],[1],[1.0]))
> ERROR: MethodError: `svdvals!` has no method matching 
> svdvals!(::SparseMatrixCSC{Float64,Int64})
>
> julia> rank([1.0])
> ERROR: MethodError: `rank` has no method matching rank(::Array{Float64,1})
>
> julia> rank([1 0;0 1])
> 2 # finally something that works...
>
> Many thanks in advance! Laurent
>
>

Reply via email to