|Re: [eigen] On the implementation of STL iterator for Eigen::Matrix|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen <eigen@xxxxxxxxxxxxxxxxxxx>
- Subject: Re: [eigen] On the implementation of STL iterator for Eigen::Matrix
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Tue, 2 Oct 2018 17:00:37 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=9HK2iJvCogNnWxNE45I8gKGZjq5FzbeZ8Ez6FrtayRM=; b=HlEwpzsAgepF+FyvzrNNnO+lUBe7Fy8vkEO8LLc+A2YYzeeAHO378MEzqLRry5nr5t HtqDxQG6Z0I+sKYvJB+qRyS5mRJDR9k8vBNGkQbt0zHGDQJCsm17OxxT3KrMQkuHnql3 A06XTJKyQ+CGK08Eg+fN4bcnz8c5/6fNW84W4z+GoVwo4UwM+r30SLNvy9nezv9AsqmI DnAQNDGnIk3xf5LQxzslgtbKNicntpAAmc9V+c7oNf8F4ud9g2BwY3m2DmSpM0c9qF8+ rfGjq4R9eqMZqeT0xEyeA6fXaM2sBmrbwx+TOatndl+BwxPpSyLiEhOL+PU+8Y3h0QyG 0mvQ==
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.