Re: [eigen] better name for triangularView<UpperTriangular>() ? |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] better name for triangularView<UpperTriangular>() ?
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Fri, 20 Nov 2009 11:56:12 -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 :content-transfer-encoding; bh=wZdikM70n6DLg1DzMAVr5RsC6+7L81/euBGrhKWFiXw=; b=tlynyMmqH8B4ZD18wGnPhn8xj7le+buyeHBL/OyrSlt9VycpZEw6aTczjfVbMMk2ka CMZfU9Vq45djoffn/p5Ibx45Sv5/3B2BbDkYr/pAEEy+YIJW76d7rbnzstV3KES2c1Kt sTkjAf27nWOdbtlDLE6nz9BsVmbLs0V8pQdu0=
- 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:content-transfer-encoding; b=cw/FJ3Np+rglFZL6S3vOe95+ER4sXjUn5RL3/bwPVosGDw3S7sDRpiQc4tRLX+cFQz 14EyYOUvxW9CC9bMo/UHTPk3RqVwhrwYs8Gma9W9WBTMO0QS32hs3f+eQe5/1R8AUIYJ YdIDopf8QtlZSIR5xuXfYx45XJS3U0aIuGVyk=
ok: if we agree once and for all that we reserve forever the name
"Upper" to mean "upper triangular" everywhere, then your proposal
makes sense. I was a bit afraid of making that decision but indeed the
argument that LAPACK does that already for 'U' is not bad.
also i was forgetting about cases where the genericity is wanted.
well, your arguments make sense, let's go for 1).
Benoit
2009/11/20 Gael Guennebaud <gael.guennebaud@xxxxxxxxx>:
>
> At a first glance I'd be tempted by solution 3 mainly because it avoids the
> need for .template, but I have a couple of concerns:
>
> a) The triangular part you want to refer is not always known at "writing
> time". I mean, e.g., when you write a generic algorithm dealing with
> selfadjoint matrices stored either in the lower of upper part, the current
> template triangularView function is very convenient. Said that, I have to
> acknowledge that currently the best example for that feature, LLT, does not
> exploit it... Anyway, I still think that's an important feature.
>
> b) I think the names upperTriangle(), strictUpperTriangle(), and
> unitUpperTriangle() miss the notion of "view" which more explicitely tell
> you what is going on.
>
> Another advantage for solution 1) is that it remains coherent with the name
> of the underlying class: TriangularView<>.
>
> It is also important to include in this discussion the others
> methods/classes which uses these constants, which with solution 1) are:
>
> class TriangularView<MatrixType, {,Strict,Unit}{Upper,Lower}>
> MatrixBase::selfadjointView<{Upper,Lower}>
> class SelfAdjointView<MatrixType,{Upper,Lower}>
> class LLT<MatrixType,{Upper,Lower}>
>
> If we go for solution 3, for consistency reason it would make sense to also
> rename the selfadjointView method: upperSelfadjoint() ?? hm does not make
> much sense.
>
>
> So finally, I would still go for solution 1. About your concern "Upper is
> not explicit enough", I'd like to see an example where a confusion is
> possible.
>
> Oh, and one last not serious argument: some very very fameous libraries
> (more famous than Eigen) simply use 'U' to say, "please consider the upper
> triangular part of the matrix".
>
> gael.
>
>
> On Fri, Nov 20, 2009 at 5:05 PM, Thomas Capricelli <orzel@xxxxxxxxxxxxxxx>
> wrote:
>>
>> In data venerdì 20 novembre 2009 16:38:20, Benoit Jacob ha scritto:
>> > currently, our API is:
>> > matrix.triangularView<UpperTriangular>()
>> > with other constants like StrictlyLowerTriangular, UnitUpperTriangular,
>> > etc.
>> >
>> > Main problem to discuss: "triangle" is repeated.
>>
>> ...
>>
>> >
>> > Opinions?
>>
>> Well, not really, i'm fine with all proposals. They are unambiguous enough
>> for
>> me.
>>
>> Thomas
>> --
>> Thomas Capricelli <orzel@xxxxxxxxxxxxxxx>
>> http://www.freehackers.org/thomas
>>
>>
>
>
>
>