mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-12 03:39:01 +08:00
fix atan2 when tmp4==0
This commit is contained in:
parent
b0adbfbae7
commit
823b2105b6
@ -569,6 +569,7 @@ inline const AutoDiffScalar<Matrix<typename internal::traits<DerTypeA>::Scalar,D
|
|||||||
atan2(const AutoDiffScalar<DerTypeA>& a, const AutoDiffScalar<DerTypeB>& b)
|
atan2(const AutoDiffScalar<DerTypeA>& a, const AutoDiffScalar<DerTypeB>& b)
|
||||||
{
|
{
|
||||||
using std::atan2;
|
using std::atan2;
|
||||||
|
using std::max;
|
||||||
typedef typename internal::traits<DerTypeA>::Scalar Scalar;
|
typedef typename internal::traits<DerTypeA>::Scalar Scalar;
|
||||||
typedef AutoDiffScalar<Matrix<Scalar,Dynamic,1> > PlainADS;
|
typedef AutoDiffScalar<Matrix<Scalar,Dynamic,1> > PlainADS;
|
||||||
PlainADS ret;
|
PlainADS ret;
|
||||||
@ -580,8 +581,6 @@ atan2(const AutoDiffScalar<DerTypeA>& a, const AutoDiffScalar<DerTypeB>& b)
|
|||||||
|
|
||||||
if (tmp4!=0)
|
if (tmp4!=0)
|
||||||
ret.derivatives() = (a.derivatives() * b.value() - a.value() * b.derivatives()) * (tmp2+tmp3);
|
ret.derivatives() = (a.derivatives() * b.value() - a.value() * b.derivatives()) * (tmp2+tmp3);
|
||||||
else
|
|
||||||
ret.derivatives().setZero();
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user