From f6c18413168c01fca08ae9e0cfeb650b705858f6 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Wed, 12 Jun 2013 12:52:41 +0200 Subject: [PATCH] compilation fixes in unsupported --- unsupported/Eigen/src/MatrixFunctions/MatrixLogarithm.h | 2 +- unsupported/Eigen/src/MatrixFunctions/MatrixPowerBase.h | 4 ++-- unsupported/Eigen/src/NonLinearOptimization/dogleg.h | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/unsupported/Eigen/src/MatrixFunctions/MatrixLogarithm.h b/unsupported/Eigen/src/MatrixFunctions/MatrixLogarithm.h index b00e5e921..c744fc05f 100644 --- a/unsupported/Eigen/src/MatrixFunctions/MatrixLogarithm.h +++ b/unsupported/Eigen/src/MatrixFunctions/MatrixLogarithm.h @@ -116,7 +116,7 @@ void MatrixLogarithmAtomic::compute2x2(const MatrixType& A, MatrixTy // computation in previous branch is inaccurate if A(1,1) \approx A(0,0) int unwindingNumber = static_cast(ceil((imag(logA11 - logA00) - M_PI) / (2*M_PI))); Scalar y = A(1,1) - A(0,0), x = A(1,1) + A(0,0); - result(0,1) = A(0,1) * (Scalar(2) * internal::atanh2(y,x) + Scalar(0,2*M_PI*unwindingNumber)) / y; + result(0,1) = A(0,1) * (Scalar(2) * numext::atanh2(y,x) + Scalar(0,2*M_PI*unwindingNumber)) / y; } } diff --git a/unsupported/Eigen/src/MatrixFunctions/MatrixPowerBase.h b/unsupported/Eigen/src/MatrixFunctions/MatrixPowerBase.h index 636df5363..5e43b285b 100644 --- a/unsupported/Eigen/src/MatrixFunctions/MatrixPowerBase.h +++ b/unsupported/Eigen/src/MatrixFunctions/MatrixPowerBase.h @@ -183,14 +183,14 @@ template::IsComplex> struct matrix_power_unwinder { static inline Scalar run(const Scalar& eival, const Scalar& eival0, int unwindingNumber) - { return internal::atanh2(eival-eival0, eival+eival0) + Scalar(0, M_PI*unwindingNumber); } + { return numext::atanh2(eival-eival0, eival+eival0) + Scalar(0, M_PI*unwindingNumber); } }; template struct matrix_power_unwinder { static inline Scalar run(Scalar eival, Scalar eival0, int) - { return internal::atanh2(eival-eival0, eival+eival0); } + { return numext::atanh2(eival-eival0, eival+eival0); } }; template diff --git a/unsupported/Eigen/src/NonLinearOptimization/dogleg.h b/unsupported/Eigen/src/NonLinearOptimization/dogleg.h index 4210958e7..80c5d277b 100644 --- a/unsupported/Eigen/src/NonLinearOptimization/dogleg.h +++ b/unsupported/Eigen/src/NonLinearOptimization/dogleg.h @@ -92,8 +92,8 @@ void dogleg( /* at which the quadratic is minimized. */ bnorm = qtb.stableNorm(); temp = bnorm / gnorm * (bnorm / qnorm) * (sgnorm / delta); - temp = temp - delta / qnorm * abs2(sgnorm / delta) + sqrt(abs2(temp - delta / qnorm) + (1.-abs2(delta / qnorm)) * (1.-abs2(sgnorm / delta))); - alpha = delta / qnorm * (1. - abs2(sgnorm / delta)) / temp; + temp = temp - delta / qnorm * numext::abs2(sgnorm / delta) + sqrt(numext::abs2(temp - delta / qnorm) + (1.-numext::abs2(delta / qnorm)) * (1.-numext::abs2(sgnorm / delta))); + alpha = delta / qnorm * (1. - numext::abs2(sgnorm / delta)) / temp; algo_end: /* form appropriate convex combination of the gauss-newton */