Re: [eigen] ei_redux_impl & ei_alignmentOffset

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


2009/12/16 Benoit Jacob <jacob.benoit.1@xxxxxxxxx>:
> *oh*
>
> I know where you can very plausibly get an infinite recursion. It is
> in the call to coeffRef() itself!!!
>
> Indeed we define it only for lvalue expressions!
>
> Here your cwise().abs2() produces a rvalue expression, hence it
> doesn't have coeffRef() defined, hence matrixBase::coeffRef() calls
> derived().coeffRef() which is itself!
>
> Solution: in the line,
>
>  &mat.const_cast_derived().coeffRef(0)
>
> replace coeffRef by coeff.

.... and thus, you can drop the const_cast.

Benoit



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