1 |
< |
#include <math.h> |
1 |
> |
#include <cmath> |
2 |
|
|
3 |
|
#include "minimizers/OOPSEMinimizer.hpp" |
4 |
|
#include "utils/Utility.hpp" |
5 |
|
|
6 |
< |
CGFamilyMinmizer::CGFamilyMinmizer(SimInfo *theInfo, ForceFields* the_ff , |
6 |
> |
CGFamilyMinmizer::CGFamilyMinmizer(SimInfo *theInfo |
7 |
|
MinimizerParameterSet * param) |
8 |
< |
:OOPSEMinimizer(theInfo, the_ff, param){ |
8 |
> |
:OOPSEMinimizer(theInfo, param){ |
9 |
|
prevG.resize(ndim); |
10 |
|
prevX.resize(ndim); |
11 |
|
direction.resize(ndim); |
68 |
|
return CONVG_ABSGTOL; |
69 |
|
} |
70 |
|
|
71 |
– |
/* |
72 |
– |
//test step tolerance test |
73 |
– |
|
74 |
– |
double stepTol = paramSet->getStepTol(); |
75 |
– |
double snorm = stepTolNorm(); |
76 |
– |
double xnorm = Norm2(curX); |
77 |
– |
double sTol = stepTol*max(1.0, xnorm); |
78 |
– |
if (snorm <= sTol) { |
79 |
– |
cout << "step tolerance test passed" << std::endl; |
80 |
– |
cout << "stol = " << sTol |
81 |
– |
<< "\tsnorm = " << snorm<< std::endl; |
82 |
– |
return CONVG_STEPTOL; |
83 |
– |
} |
84 |
– |
*/ |
71 |
|
// did not converge yet |
72 |
|
return CONVG_UNCONVG; |
73 |
|
} |