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 ]


On Mon, Jan 4, 2010 at 2:16 PM, Benoit Jacob <jacob.benoit..1@xxxxxxxxx> wrote:
OK, so let's assume that we agree on adding iterators to Eigen dense
types, using begin() and end(). I have questions:

1) are there yet more methods to add, or are begin() and end() the
only methods to add to existing Eigen classes?

Depends on whether we want to support STL like iterators only (i.e. begin() and end() for vectors only) or whether we want to adapt to boost's iterators. Afaik, for boost iterators there is also begin1() and begin2() and end1() and end2() (see below for a complete list).
 
2) Are the member typedefs const_iterator1 and const_iterator2
standard names that we should standardize on? If yes, does "1" mean
outer and "2" inner, or does "1" mean rows and "2" mean columns? It
does matter because Eigen supports both row-major and column-major
matrices.

Here, it's outer and inner. Boost ublas supports col- and row-major matrices in almost the same way as does Eigen and that's propably why they opted for post fixes '1' and '2'.

Ok, let me try to give you a full list of what boost ublas offers:

dense typedefs
matrix::iterator1 (model of 'Indexed Random Access Column/Row Iterator')
matrix::iterator2 (model of 'Indexed Random Access Column/Row Iterator')
vector::iterator (model of 'Indexed Random Access Iterator')

sparse typedefs:
sparse_matrix::iterator1 (model of 'Bidirectional Column/Row Iterator')
sparse_matrix::iterator2 (model of 'Bidirectional Column/Row Iterator')
sparse_vector::iterator (model of 'Indexed Bidirectional Iterator')

Then there exist the corresponding const_ typedefs.

The functions are (for dense and sparse matrices, const and non-const versions)
begin1()
end1()
begin2()
end2()

and (for vectors, also const and non-const)
begin()
end()

For the sake of completeness, they also provide for all iterator types the 'reverse' versions all prefixed with 'r'. As I said, it's a lot.

Here is the reference: http://www.boost.org/doc/libs/1_41_0/libs/numeric/ublas/doc/index.htm

Regards,
Hauke


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