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 ]


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
>



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