diff options
author | Gael Guennebaud <g.gael@free.fr> | 2011-09-22 17:34:25 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2011-09-22 17:34:25 +0200 |
commit | 823b2105b660ad9953036eea00da61bd2822d7e0 (patch) | |
tree | e2c081a4893fd774c8376f40e94d1d146846256c /unsupported/Eigen/src/AutoDiff | |
parent | b0adbfbae716bbeac362aae1d931de24b8bb83f5 (diff) |
fix atan2 when tmp4==0
Diffstat (limited to 'unsupported/Eigen/src/AutoDiff')
-rw-r--r-- | unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h b/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h index 3510fba77..0afea3b7d 100644 --- a/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h +++ b/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h @@ -569,6 +569,7 @@ inline const AutoDiffScalar<Matrix<typename internal::traits<DerTypeA>::Scalar,D atan2(const AutoDiffScalar<DerTypeA>& a, const AutoDiffScalar<DerTypeB>& b) { using std::atan2; + using std::max; typedef typename internal::traits<DerTypeA>::Scalar Scalar; typedef AutoDiffScalar<Matrix<Scalar,Dynamic,1> > PlainADS; PlainADS ret; @@ -580,8 +581,6 @@ atan2(const AutoDiffScalar<DerTypeA>& a, const AutoDiffScalar<DerTypeB>& b) if (tmp4!=0) ret.derivatives() = (a.derivatives() * b.value() - a.value() * b.derivatives()) * (tmp2+tmp3); - else - ret.derivatives().setZero(); return ret; } |