github autodiff/autodiff v0.5.1
Bug fix - aliasing errors

latest releases: v1.1.2, v1.1.1, v1.1.0...
4 years ago

This is an important bug fix that corrects aliasing. As reported in #32 , operations such as:

dual a = 1;
a = a - 2*a;

did not work as expected, because a is used on the right-hand side expression. As this expression is evaluated, a changes and so does the other occurrences of a in the expression.

To prevent this, the default behavior needs to be such that the result of the expression is stored in a temporary, and then the self dual object is assigned to this temporary.

In a future release, something similar to Eigen .noalias() method could be envisioned if the user is sure there is no alias on the right-hand side expression.

Don't miss a new autodiff release

NewReleases is sending notifications on new releases.