provide some default values for important results. So that we can read them

even before *Init() and do no get random values.
This commit is contained in:
Thomas Capricelli 2009-09-13 23:55:08 +02:00
parent 8c3f7d8e94
commit ab88ba6f7f
2 changed files with 4 additions and 4 deletions

View File

@ -4,7 +4,7 @@ class HybridNonLinearSolver
{ {
public: public:
HybridNonLinearSolver(FunctorType &_functor) HybridNonLinearSolver(FunctorType &_functor)
: functor(_functor) {} : functor(_functor) { nfev=njev=iter = 0; fnorm= 0.; }
enum Status { enum Status {
Running = -1, Running = -1,
@ -79,6 +79,7 @@ public:
int nfev; int nfev;
int njev; int njev;
int iter; int iter;
Scalar fnorm;
private: private:
FunctorType &functor; FunctorType &functor;
int n; int n;
@ -89,7 +90,6 @@ private:
bool jeval; bool jeval;
int ncsuc; int ncsuc;
Scalar ratio; Scalar ratio;
Scalar fnorm;
Scalar pnorm, xnorm, fnorm1; Scalar pnorm, xnorm, fnorm1;
int nslow1, nslow2; int nslow1, nslow2;
int ncfail; int ncfail;

View File

@ -4,7 +4,7 @@ class LevenbergMarquardt
{ {
public: public:
LevenbergMarquardt(FunctorType &_functor) LevenbergMarquardt(FunctorType &_functor)
: functor(_functor) {} : functor(_functor) { nfev = njev = iter = 0; fnorm=gnorm = 0.; }
enum Status { enum Status {
Running = -1, Running = -1,
@ -100,6 +100,7 @@ public:
int nfev; int nfev;
int njev; int njev;
int iter; int iter;
Scalar fnorm, gnorm;
private: private:
FunctorType &functor; FunctorType &functor;
int n; int n;
@ -110,7 +111,6 @@ private:
Scalar temp, temp1, temp2; Scalar temp, temp1, temp2;
Scalar delta; Scalar delta;
Scalar ratio; Scalar ratio;
Scalar fnorm, gnorm;
Scalar pnorm, xnorm, fnorm1, actred, dirder, prered; Scalar pnorm, xnorm, fnorm1, actred, dirder, prered;
}; };