Thanks for the suggestions. Right now I am using a three-dimensional array
for the nonzeros because there are times when I want to operate on nonzeros
as an p by q*nz matrix. I'll see how far I can get with this.
On Sunday, August 16, 2015 at 10:06:25 PM UTC-5, Tim Holy wrote:
>
> Note:
>
> julia>
> sparse([1,2,3],[1,2,3],Matrix{Float64}[ones(2,2),zeros(2,2),eye(2,2)])
> 3x3 sparse matrix with 3 Array{Float64,2} entries:
> [1, 1] = 2x2 Array{Float64,2}:
> 1.0 1.0
> 1.0 1.0
> [2, 2] = 2x2 Array{Float64,2}:
> 0.0 0.0
> 0.0 0.0
> [3, 3] = 2x2 Array{Float64,2}:
> 1.0 0.0
> 0.0 1.0
>
> julia> v = Vector{Float64}[rand(2),rand(2),rand(2)]
> 3-element Array{Array{Float64,1},1}:
> [0.8419746064422413,0.07808744490321806]
> [0.5358955649876855,0.06596091273868865]
> [0.3325842069442646,0.5785178563938704]
>
> julia> A*v
> ERROR: MethodError: `one` has no method matching
> one(::Type{Array{Float64,N}})
> in * at sparse/linalg.jl:59
>
> You could replace that `zero(T)` on that line with `zero(x[1])`, after
> suitable checks for empty matrices and the like. Commutivity is another
> thing
> that has probably been assumed, and would need to be fixed. Someone (Doug?
> Christoph?) just needs to chase down all such errors, and you'd be good to
> go
> (by, say, tomorrow :-) ).
>
> --Tim
>
> On Sunday, August 16, 2015 04:55:51 PM Christoph Ortner wrote:
> > data structures like that would be very natural, e.g., in FE codes and
> > similar applications. But I would argue unless there are good solvers
> that
> > exploits this structure, they are essentially useless. Do such solvers
> > exist? (The only case I know of, off the top of my head, is the trivial
> > case of a higher-order DGFE mass matrix.)
> >
> > Personally, I would also be quite interested in such data structures and
> > associated sparse solvers.
> >
> > Christoph
>
>