From 6a8b52b3aafdbabf515f743fa05c8e293545bf65 Mon Sep 17 00:00:00 2001 From: Thomas Capricelli Date: Fri, 21 Aug 2009 01:24:04 +0200 Subject: [PATCH] simplifying --- unsupported/Eigen/src/NonLinear/lmder.h | 8 ++++---- unsupported/Eigen/src/NonLinear/lmdif.h | 8 ++++---- unsupported/Eigen/src/NonLinear/lmstr.h | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/unsupported/Eigen/src/NonLinear/lmder.h b/unsupported/Eigen/src/NonLinear/lmder.h index f134927b1..1b8fd9adf 100644 --- a/unsupported/Eigen/src/NonLinear/lmder.h +++ b/unsupported/Eigen/src/NonLinear/lmder.h @@ -260,11 +260,11 @@ L200: } /* L230: */ } - temp1 = ei_enorm(n, &wa3[1]) / fnorm; - temp2 = ei_sqrt(par) * pnorm / fnorm; + temp1 = ei_abs2(ei_enorm(n, &wa3[1]) / fnorm); + temp2 = ei_abs2( ei_sqrt(par) * pnorm / fnorm); /* Computing 2nd power */ - prered = temp1 * temp1 + temp2 * temp2 / p5; - dirder = -(temp1 * temp1 + temp2 * temp2); + prered = temp1 + temp2 / p5; + dirder = -(temp1 + temp2); /* compute the ratio of the actual to the predicted */ /* reduction. */ diff --git a/unsupported/Eigen/src/NonLinear/lmdif.h b/unsupported/Eigen/src/NonLinear/lmdif.h index 3db36fcbf..5f06a9b82 100644 --- a/unsupported/Eigen/src/NonLinear/lmdif.h +++ b/unsupported/Eigen/src/NonLinear/lmdif.h @@ -262,11 +262,11 @@ L200: } /* L230: */ } - temp1 = ei_enorm(n, &wa3[1]) / fnorm; - temp2 = ei_sqrt(par) * pnorm / fnorm; + temp1 = ei_abs2(ei_enorm(n, &wa3[1]) / fnorm); + temp2 = ei_abs2( ei_sqrt(par) * pnorm / fnorm); /* Computing 2nd power */ - prered = temp1 * temp1 + temp2 * temp2 / p5; - dirder = -(temp1 * temp1 + temp2 * temp2); + prered = temp1 + temp2 / p5; + dirder = -(temp1 + temp2); /* compute the ratio of the actual to the predicted */ /* reduction. */ diff --git a/unsupported/Eigen/src/NonLinear/lmstr.h b/unsupported/Eigen/src/NonLinear/lmstr.h index e18ee4cb0..e2dbc870f 100644 --- a/unsupported/Eigen/src/NonLinear/lmstr.h +++ b/unsupported/Eigen/src/NonLinear/lmstr.h @@ -284,11 +284,11 @@ L240: } /* L270: */ } - temp1 = ei_enorm(n, &wa3[1]) / fnorm; - temp2 = ei_sqrt(par) * pnorm / fnorm; + temp1 = ei_abs2(ei_enorm(n, &wa3[1]) / fnorm); + temp2 = ei_abs2( ei_sqrt(par) * pnorm / fnorm); /* Computing 2nd power */ - prered = temp1 * temp1 + temp2 * temp2 / p5; - dirder = -(temp1 * temp1 + temp2 * temp2); + prered = temp1 + temp2 / p5; + dirder = -(temp1 + temp2); /* compute the ratio of the actual to the predicted */ /* reduction. */