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
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Iterators with dense matrices: (was: Areas of eigen3 variation and using eigen2/3 in generic code)
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Mon, 4 Jan 2010 08:59:19 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=y65QBgWjeOBH8IeMMBX7CTldbIGMWQbXcRN5MiNNNqA=; b=XUDD0yOwh1PQiRbZ2+tdnnlCxlAa3HmhgTy2/4C9pp+a9FXl62gBqTs7HXGiu8LxTm MQnNh85cBOwIYYxu4rVRatl9trJz6UXLfZNsvklHV/DwO35xooK0wWVo0wVdQNX9wg2E 0qhLPjP8rRmVCezydCL4DPm0SlMBFM3gvbTbA=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=QxgP4+AaVJGtckmrnIkE2OwtKdLJXSnNsJX2Z8VQCBbKGon+YisRIjiH7sWcEcXWh+ hJwdS9f39Z0KPGkkqynOIwanfaFQKqr16TeCUKf5OTQpCN93zARkpvojAMK9i3nPFLkE Fvq/fV4YtAyDYXihzJ7DL/p28gUPorg3KRFWI=
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.
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
I just can't really prioritize iterators now, otherwise i'll never
find the time to do the SVD... ;)
Benoit
2010/1/4 Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>:
> 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
>