Re: [eigen] sdgfdf

[ Thread Index | Date Index | More Archives ]


yes this is something I've thought about, there is no difficulty.
Actually my initial concern was rather about "int" which could be too
small if n > 2^32, so I'll make the types of both "index pointers" and
"coordinate" template parameters. Note that with "unsigned short" for
the coordinate type, you are limited to 65k x 65k matrices, that is
not very large.


On Mon, Feb 2, 2009 at 10:50 AM, Jens Mueller <jens.k.mueller@xxxxxx> wrote:
> Hi,
> storing sparse matrices efficiently is important. Eigen2 supports the
> often used compressed sparse row/column format. What I find annoying is
> that the type of the indices can't be specified. For dense matrices this
> is perfectly valid. But let's say I have a sparse matrix with n
> coefficients. With Eigen it boils down to having a value array of size n
> with Scalar type and an int array of size n. Let's assume my index
> would fit in a short that consumes 2 bytes compared to an 4 byte int.
> Then this wastes 2n bytes. I'm working with large sparse matrices. From
> my perspective I need to be very carefully using main memory. Further
> storing the indices more compact should result in better cache
> behaviour. Since I can fit more into the cache, i.e. reducing cache
> misses. But I'm not very sure about this, since aligned memory is also
> an issue.
> The most obvious solution is to introduce template arguments to set the
> types of the indices.
> But I'm very unsure whether this is worse the trouble. Have you thought
> about this issue yet? Any ideas? Or no problem at all?
> Regards,
> Jens
> PS:
> Thanks, Gael. I have seen the MappedSparseMatrix. I will try this out in
> the near future.

Mail converted by MHonArc 2.6.19+