Re: [eigen] , basic usageSparse vectors |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] , basic usageSparse vectors
- From: "Gael Guennebaud" <gael.guennebaud@xxxxxxxxx>
- Date: Wed, 14 Jan 2009 23:50:16 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=XB7fCfudWXEjhDS+5fTBQ4oJm6tK1ySP1FZItXBNf9Y=; b=sMumvOZDJgRxs1yIE/JhKxcSfkNhG2PhQXAIelkKrhvYKW+LTtFZ5VJm6r8Xq81rh/ RH7TnI+Q+LMNFYILMxwRT8ufiZgycenvonLt78N75PlOn4zQ/EHTjWiMHZuZjf9204Iz AFDKJHCpJYnRR0pZ+WGvO1sXYzAvhjUbax/cA=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=pwDCzr+RLIOnT3SybJUV3nZKe64J6vqEoTAt/MhaAJD3Q+bvoSAO9EIni9q5w6uYKY Oh2P+H1S+44lDvy3LBZ8+TTJ56Dn7iZya1O79bSb3lT31RxLm5kAhF9VDpCSFHszSw7L twl1lMaAaCMFp2RKOjZg9nVsXb/oq0ibqu3ho=
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/
>