It looks like no one has written the required methods yet. A really efficient
method that exploits the sparseness of b would require some custom code. But I
am surprised that there isn't a generic AbstractArray fallback that works.
That fallback would be much more efficient in 0.4 than 0.3 (in 0.3 that
fallback
would go through linear indexing, which is slow for a sparse matrix). But both
would pale by comparison to an algorithm specifically tuned to exploit
sparseness.
--Tim
On Saturday, December 20, 2014 08:25:24 PM Robert Gates wrote:
> Hi Julians,
>
> When trying this, I get (Julia 0.3.3):
>
> *julia> **b = sub(a,1:2,1:2)*
>
> *2x2
> SubArray{Float64,2,SparseMatrixCSC{Float64,Int64},(UnitRange{Int64},UnitRang
> e{Int64})}:*
>
> * 1.0 0.0*
>
> * 0.0 1.0*
>
>
> *julia> **b*ones(2)*
>
> *ERROR: `A_mul_B!` has no method matching A_mul_B!(::Array{Float64,1},
>
> ::SubArray{Float64,2,SparseMatrixCSC{Float64,Int64},(UnitRange{Int64},UnitRa
> ::nge{Int64})}, Array{Float64,1})*
>
> * in * at linalg/matmul.jl:72*
>
> Am I doing something wrong? If it's unsupported, does multiplication of
> sparse subarrays work in 0.4?
>
> Best regards,
>
> Robert