From 6719e56b5bfe9ae4badc9a6e894c5824f663d62e Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Sun, 11 Aug 2013 17:52:43 +0200 Subject: Ref<> objects must be nested by reference because they potentially store a temporary object --- unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h | 2 +- unsupported/Eigen/src/MatrixFunctions/MatrixPower.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'unsupported') diff --git a/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h b/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h index 8d42e69b9..763ed414a 100644 --- a/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h +++ b/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h @@ -604,7 +604,7 @@ atan2(const AutoDiffScalar& a, const AutoDiffScalar& b) Scalar tmp4 = tmp3/(tmp2+tmp3); if (tmp4!=0) - ret.derivatives() = (a.derivatives() * b.value() - a.value() * b.derivatives()) * (tmp2+tmp3); + ret.derivatives() = (a.value() * b.derivatives() - a.derivatives() * b.value()) * (tmp2+tmp3); return ret; } diff --git a/unsupported/Eigen/src/MatrixFunctions/MatrixPower.h b/unsupported/Eigen/src/MatrixFunctions/MatrixPower.h index ee665c18e..b91d8632a 100644 --- a/unsupported/Eigen/src/MatrixFunctions/MatrixPower.h +++ b/unsupported/Eigen/src/MatrixFunctions/MatrixPower.h @@ -299,7 +299,7 @@ MatrixPowerAtomic::computeSuperDiag(const ComplexScalar& curr, const ComplexScalar logCurr = log(curr); ComplexScalar logPrev = log(prev); int unwindingNumber = ceil((numext::imag(logCurr - logPrev) - M_PI) / (2*M_PI)); - ComplexScalar w = numext::atanh2(curr - prev, curr + prev) + ComplexScalar(0, M_PI*unwindingNumber); + ComplexScalar w = numext::atanh2(curr - prev, curr + prev) + ComplexScalar(RealScalar(0), RealScalar(M_PI*unwindingNumber)); return RealScalar(2) * exp(RealScalar(0.5) * p * (logCurr + logPrev)) * sinh(p * w) / (curr - prev); } -- cgit v1.2.3