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:
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;

View File

@ -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;
};