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

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


My vote:

i prefer 3) because increasing by +5 the number of methods in
MatrixBase is not a huge disadvantage, this is an essential feature,
this gives the cutest syntax (there is no use anyway for determining
the triangular view type as a parameter) and the difference is even
bigger in cases where the other solutions require a ".template"
keyword.

Benoit

2009/11/20 Benoit Jacob <jacob.benoit.1@xxxxxxxxx>:
> Hi,
>
> currently, our API is:
>  matrix.triangularView<UpperTriangular>()
> with other constants like StrictlyLowerTriangular, UnitUpperTriangular, etc.
>
> Main problem to discuss: "triangle" is repeated.
>
> Solutions include:
>
> 1) (Gael's old proposal) rename UpperTriangle ---> Upper, so we do:
>  matrix.triangularView<Upper>()
>  pro: still only 1 method triangle() in MatrixBase
>  con: Upper is not explicit enough
>
> 2) rename the triangularView<>() method to something short and generic
> like "view", so we do:
>  matrix.view<UpperTriangular>()
>  pro: no polluting constant Upper
>  con: introduce big all-purpose method 'view' which you might or might not like
>
> 3) replace triangularView() by 6 methods in MatrixBase:
>  matrix.upperTriangle() // or upperTriangularView if you prefer
>  matrix.strictLowerTriangle()
>  In this solution it's rather important to abbreviate triangularview
> ---> triangle, i think.
>  pro: no polluting constant, no all-purpose method if you don't like that
>  con: replace that 1 method by 6 methods in MatrixBase, which you
> might not like
>
> Opinions?
>
> Benoit
>



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