Re: [eigen] Re: recent improvements in the products

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


On Thu, Jul 30, 2009 at 4:43 PM, Jitse Niesen<jitse@xxxxxxxxxxxxxxxxx> wrote:
> On Thu, 30 Jul 2009, Gael Guennebaud wrote:
>
>>   A00.template triangularView<LowerTriangular>().template
>> solveInPlace<OnTheRight>(A10); // bottleneck
>
> I think that the need for the template keyword is an argument not to use
> templates here. It's simpler if you could write
>
>     A00.lowerTriangularView().solveOnRightInPlace(A10);

indeed the current API is pretty verbose. Actually I'd be in favor of
removing the "Triangular" suffix of the LowerTriangular,
UnitLowerTriangular and similar constants because they will always be
used next to a triangularView or selfadjointView functions. So no
confusion is possible.

Now about template functions versus multiple functions, well there are
pro and cons on both sides. The unique drawback of template member
functions is that you have to put the template keywords in templated
code, and this is something that a lot of people don't know. On the
other hand that simplifies the API: you have a single function for a
given feature, so only one entry point to document, etc.. Another
major advantage is that you can template a function to work on a Lower
or Upper function, and do calls like:

m1.triangularView<UpLo>() * m2;

where you don't know what is UpLo. So at least you need the template versions.

Cheers,
Gael.


> It looks impressive what you've done (there's no shame in following Goto &
> Van de Geijn). I hope to find some time soon to play with it.
>
> Cheers,
> Jitse
>
>
>



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