|Re: [eigen] Aliasing bug with Transpose, possibly a ReturnByValue problem|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen <eigen@xxxxxxxxxxxxxxxxxxx>
- Subject: Re: [eigen] Aliasing bug with Transpose, possibly a ReturnByValue problem
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Mon, 16 Feb 2015 16:17:29 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=WQQd8rer/5b/+kOacw0crArvTO+qf/lshAopjGtXRn8=; b=0NOMWe3YGVO+8K74+tkjVP9WTesM+WZfVvPdHWW/22M/Z6nPmEdyt27gcCxKRre1Wf 6ue3emz6ioasdc9ZMOG4Csl0nYkEoUIgDs0oEj3EuuMdBZRi2DmpanyKFrYY3SeJd3aY LlAPlcDY5idNWaQInu0jvXGSkTlnYKICg9NmLnHTBwtgDKbUDDLzW3aKJnYXyFz43rJh VwfSm5cT23E67NBsFanqJ5jC1e3R37tKbv6mrjj80QbeiP1/rgBVrpplABo+Yb1Sajwe 0xvXh95uslSrGxnG3h0NpyUwVS3SuYBkSH7S7oSnvmVtLZWzn/VP/nNZYHBTDNr+Gkd8 dUbg==
sorry for the very late reply. Basically, dealing with aliasing issue is the responsibility of the user. There only a very few cases where Eigen explicitly consider aliasing:
- plain matrix-matrix products, which assumes aliasing by default (in my opinion this should be changed to noaliasing by default, but that's not the point here)
- A = A.transpose() (and some variants, which trigger a runtime assertion in debug mode
- A = A * permutation, which automatically fallbacks to an inplace implementation. Only works if the types of both 'A' are the same.
All other cases will silently fail. It would ben ice to implement a mechanism to automatically detect all possible cases of aliasing, but I don't see any lightweight solution for that.