Re: [eigen] ei_redux_impl & ei_alignmentOffset

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


(follow-up from IRC)
This xpr here does not have DirectAccessBit, so its coeff method has
got to return by value, so the bug is different, this path should not
be used in the first place.
Benoit

2009/12/16 Benoit Jacob <jacob.benoit.1@xxxxxxxxx>:
> 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/