Re: [eigen] On the implementation of STL iterator for Eigen::Matrix

[ Thread Index | Date Index | More Archives ]

Dear Gael,

Thank you for your great job.

Hopefully, I will not add more doubts with my suggestions.

for(auto x : A.irows()) { ... }
for(auto x : A.icols()) { ... }
for(auto x : A.icoeffs()) { ... }
(or iRows, to make sure the eyes do not remove the 'i')

the prefix i being for iterator. Users need to understand that iterator
methods are prefixed with i. Once, this is known, I think there is no
hard time remembering names for the one who writes the code. And I do
not see ambiguities for the one who reads it.

There are also longer options or the use of an intermediate class, like:
for(auto x : A.iterator().rows()) { ... }

> for(auto x : A.rowwise()) { ... }
I agree it is ambiguous. I would need to check the doc.

> for(auto x : A.allRows()) { ... }
> for(auto x : A.rowSet()) { ... }
Both are clear to me.

Best regards,

Mail converted by MHonArc 2.6.19+