Re: [eigen] Iterators with dense matrices: (was: Areas of eigen3 variation and using eigen2/3 in generic code) |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Iterators with dense matrices: (was: Areas of eigen3 variation and using eigen2/3 in generic code)
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Mon, 4 Jan 2010 16:22:30 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=zlsfPjrZmV2AQ3wAyQfx7GMKLo5maYUvJmflcp7kKnM=; b=uQuGSxltPeue+JaUUJp93upIhBpmFsYtnTyUTMHICk3Xqa4NCVDCk4OBDvV55cjzd9 Ig2Fr1kSsZXM7HG5Yhyq3d2CN1IfDInEn2KX8SSMEyGO6rq/wqGsdyTmyyZoeua5GLVv pHlkeyuXRi47KyESxfw+QRwobpeyd5LhnpAvA=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=mBQLCVtF64JkU9WUGNkmjDIqraiQZD8CY+XCPhjwTWd+HepQc2ZwAIkyXV4dyqAEDe whWdl+ao4+sxQ073URrimSJGTX7dXPrlGUDpeX6wtJQjmRmSFUiX3jih43iCRGAU8W57 o1jZiQtHhRkPYouo5oXkgHSqZEL53N/44liKY=
Hi,
a few quick comments:
- I'm ok with the renaming of start/end to head/tail
- adding STL iterators is not a priority for me too...
- I don't see any point in being ublas compatible
- note that Sparse iterators are not STL compatible, they are designed
to be simple and fast, that is something I did not manage to get using
the STL API. Of course it is still possible to implement STL
compatible iterators on top of the sparse ones
- I think that sparse iterator works for dense expressions as well, so
you can already write your own generic loops for dense/sparse objects,
for the record:
for(int outer=0;outer<m.outerSize(); ++outer)
for(MatrixType::InnerIterator it(m, outer); it; ++it)
{
// here you can use:
it.value();
it.index();
it.col();
it.row();
}
cheers,
gael
On Mon, Jan 4, 2010 at 3:23 PM, Hauke Heibel
<hauke.heibel@xxxxxxxxxxxxxx> wrote:
> On Mon, Jan 4, 2010 at 2:59 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
> wrote:
>>
>> Thanks a lot for the explanation.
>>
>> Is this completely specific to uBlas or are there other Boost
>> libraries standardizing on the same interface? uBlas alone is not
>> enough to be worth standardizing on, is it? I ask because I don't
>> really like the "1" and "2" suffixes, I would rather use explicit
>> "inner" and "outer" names. I guess uBlas did that as they want to
>> support 3D matrices and up. If it matters, we can always provide
>> synonyms.
>
> As far as I know, its uBlas specific. They aimed at offering the complete
> STL iterator interface (bidirectional iterators, random access iterators,
> reverse iterators, etc.) and I am quite sure that 3D matrices are not
> supported by uBlas.
> I would also prefer changing the suffixes and since they are particularly
> matrix related I assume it is unlikely that there exists a global standard.
> In the STL all containers are one-dimensional and thus there is no
> requirement for multi-dimensional iterators and consequently not yet a
> standard.
>
>>
>> How about this:
>> - we do the start()/end() renaming right now
>> - so anybody with motivation can add iterators, even why not as a
>> EIGEN_MATRIXBASE_PLUGIN
>
> Both proposals sound good ...
>
>>
>> I just can't really prioritize iterators now, otherwise i'll never
>> find the time to do the SVD... ;)
>
> ... since 3.0 has priority :)
>
> In particular the renaming removes tha name clash with the STL and offers
> users the possibility to use the plugin mechanism.
>
> Regards,
> Hauke
>