Re: [eigen] ei_redux_impl & ei_alignmentOffset |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] ei_redux_impl & ei_alignmentOffset
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Wed, 16 Dec 2009 08:12:57 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=Pp8IYOdrEvg90PFCrxtsMteq1wcqZwqpmd1lZx8YI3g=; b=RNXAcA57THcKNvhe8q81Z7KlYATccd1aKWqSBYYdeqcDWJUAGz4ZgHeMDgiUKbCqbd vyaKiHWAQaw4KJciyJqQNTR551cTPIDbWXjXu4T/b9HuZ0SewxN1LpjZ99sAXrD51qrg aL1eNy5XMnYMI6ZDOIZxPBnrwauD4ESwLRqw4=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=jOJ+AyDF2ZwoUevOmIFm2cONgRX9xug+iIB28DTxCMUsqPjYEIHoW0vInhHTzYXgsf ytq7u+8B1jI8xNLCQmWKtz0FpvcVs1x+u1qOvgKJ+/fPXJUNSTo+uZ4+NOYaf8+GNFEd z1sM0BtzCbwBkBMD+Ibh+nE2QnH/3cf0qbyi4=
(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
>