Re: [eigen] better name for triangularView<UpperTriangular>() ?

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



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







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