From ab88ba6f7fadcbf4fe24a8359bcb6a7204b25b99 Mon Sep 17 00:00:00 2001 From: Thomas Capricelli Date: Sun, 13 Sep 2009 23:55:08 +0200 Subject: [PATCH] provide some default values for important results. So that we can read them even before *Init() and do no get random values. --- unsupported/Eigen/src/NonLinear/HybridNonLinearSolver.h | 4 ++-- unsupported/Eigen/src/NonLinear/LevenbergMarquardt.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/unsupported/Eigen/src/NonLinear/HybridNonLinearSolver.h b/unsupported/Eigen/src/NonLinear/HybridNonLinearSolver.h index ed0eeb5d2..ee98300ab 100644 --- a/unsupported/Eigen/src/NonLinear/HybridNonLinearSolver.h +++ b/unsupported/Eigen/src/NonLinear/HybridNonLinearSolver.h @@ -4,7 +4,7 @@ class HybridNonLinearSolver { public: HybridNonLinearSolver(FunctorType &_functor) - : functor(_functor) {} + : functor(_functor) { nfev=njev=iter = 0; fnorm= 0.; } enum Status { Running = -1, @@ -79,6 +79,7 @@ public: int nfev; int njev; int iter; + Scalar fnorm; private: FunctorType &functor; int n; @@ -89,7 +90,6 @@ private: bool jeval; int ncsuc; Scalar ratio; - Scalar fnorm; Scalar pnorm, xnorm, fnorm1; int nslow1, nslow2; int ncfail; diff --git a/unsupported/Eigen/src/NonLinear/LevenbergMarquardt.h b/unsupported/Eigen/src/NonLinear/LevenbergMarquardt.h index 27768a160..47576e733 100644 --- a/unsupported/Eigen/src/NonLinear/LevenbergMarquardt.h +++ b/unsupported/Eigen/src/NonLinear/LevenbergMarquardt.h @@ -4,7 +4,7 @@ class LevenbergMarquardt { public: LevenbergMarquardt(FunctorType &_functor) - : functor(_functor) {} + : functor(_functor) { nfev = njev = iter = 0; fnorm=gnorm = 0.; } enum Status { Running = -1, @@ -100,6 +100,7 @@ public: int nfev; int njev; int iter; + Scalar fnorm, gnorm; private: FunctorType &functor; int n; @@ -110,7 +111,6 @@ private: Scalar temp, temp1, temp2; Scalar delta; Scalar ratio; - Scalar fnorm, gnorm; Scalar pnorm, xnorm, fnorm1, actred, dirder, prered; };