Re: [eigen] , basic usageSparse vectors

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


well, if you just want to store/read sparse data in a random order,
then std::map (or Google's dense_hash_map) are better suited.

More specifically, SparseArray is an internal class used for the
storage of SpasreVector and SparseMatrix. SpasreVector (and
SparseArray) are not designed for random read/write accesses.
Moreover, SparseVector is not designed for dynamic resize, it really
aims to represent a math vector. Eventually, if in your case you fill
the vector once, and then loop over the elements in a sequential order
(using SparseVector::Iterator), then SparseVector is just perfect !

Cheers,
Gael.

On Wed, Jan 14, 2009 at 11:27 PM, Jose Alcalá Correa <gskbyte@xxxxxxxxx> wrote:
> Hi!
>
> I'm using Eigen 2 for a little project at the University. I need to use
> dynamic sparse vectors, but I won't do matrix operations over it, just basic
> element readings and accessings. Which is the most appropiate class for
> that, SparseArray or SparseVector?
>
> Thank you very much, especially for your great work!
>
> --
>  Jose Alcalá Correa
>  Correo: gskbyte@xxxxxxxxx
>  Mésenller: gskbyte@xxxxxxxxxxx
>  http://www.gskbyte.net/
>


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/