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

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




On Tue, Oct 2, 2018 at 4:24 PM Brook Milligan <brook@xxxxxxxx> wrote:

Have you considered a solution such as used by Boost GIL (Generic Image Library)?  That has the concept of "pixel locators" which allow both 1-D and 2-D (i.e., up/down, right/left) movement through the pixels of an image.
In fact, I would be surprised if you cannot adapt a matrix to the GIL "image" concept and get a whole lot for free.
In any case, I think it would be worth investigating before you settle on the arbitrary restriction of a 1-D-only API.

The main goal here was to provide iterators for compatibility with STL algorithm, those are purely 1D iterators.

I'm not sure that hybrid 1D/2D iterators are that useful with Eigen because Eigen is designed so that you don't have to write loops over the elements.. But if there are good use cases, we can still extend the API later on to support hybrid 1D/2D iterators. 

gael


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