Re: [eigen] problem with selfadjointView

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




2010/8/22 Ben Goodrich <bgokgm@xxxxxxxxxxxxxx>
On Sun, Aug 22, 2010 at 7:39 AM, Jitse Niesen <jitse@xxxxxxxxxxxxxxxxx> wrote:
> On Sat, 21 Aug 2010, Ben Goodrich wrote:
>
>> Thanks for implementing that. Is there something special needed to
>> make it work with templates? I would have expected
>>
>> template <typename Derived>
>> void bar(const MatrixBase<Derived> &x, const MatrixBase<Derived> &A,
>> MatrixBase<Derived> &z) {
>> z = x.transpose() * A.selfadjointView<Lower>() * x;
>> }
>>
>> to work now, but the compiler throws an expected primary-_expression_ error.
>
> Perhaps you need to add the 'template' keyword, as in:
>
>   z = x.transpose() * A.template selfadjointView<Lower>() * x;
>
> Warning: I did not try it out.
>
>
> Jitse

I had tried that yesterday but forgot to mention it. It doesn't work
for me, but maybe the .template() trick should be mentioned somewhere
in the documentation?

I confirm what Jitse says, but since it's a general C++ syntax quirk, it's hard for us to document it everywhere where needed.

Can you paste the whole compiler error that you're getting?

Benoit


 

Ben





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