1 |
< |
#include "minimizers/OOPSEMinimizer.hpp" |
1 |
> |
#include "minimizers/SDMinimizer.hpp" |
2 |
|
#include "utils/Utility.hpp" |
3 |
|
|
4 |
< |
SDMinimizer::SDMinimizer(SimInfo *theInfo, MinimizerParameterSet *param) : |
5 |
< |
OOPSEMinimizer(theInfo, the_ff, param) { |
4 |
> |
namespace oopse { |
5 |
> |
SDMinimizer::SDMinimizer(SimInfo* info) : OOPSEMinimizer(info) { |
6 |
|
direction.resize(ndim); |
7 |
|
stepSize = paramSet->getStepSize(); |
8 |
|
} |
50 |
|
|
51 |
|
if (fabs(deltaF) <= relativeFTol) { |
52 |
|
if (bVerbose) { |
53 |
< |
cout << "function value tolerance test passed" << std::endl; |
54 |
< |
cout << "ftol = " << fTol << "\tdeltaf = " << deltaF << std::endl; |
53 |
> |
std::cout << "function value tolerance test passed" << std::endl; |
54 |
> |
std::cout << "ftol = " << fTol << "\tdeltaf = " << deltaF << std::endl; |
55 |
|
} |
56 |
|
|
57 |
|
return CONVG_FTOL; |
77 |
|
#endif |
78 |
|
|
79 |
|
if (gnorm <= relativeGTol) { |
80 |
< |
cout << "gradient tolerance test" << std::endl; |
81 |
< |
cout << "gnorm = " << gnorm << "\trelativeGTol = " << relativeGTol |
80 |
> |
std::cout << "gradient tolerance test" << std::endl; |
81 |
> |
std::cout << "gnorm = " << gnorm << "\trelativeGTol = " << relativeGTol |
82 |
|
<< std::endl; |
83 |
|
return CONVG_GTOL; |
84 |
|
} |
86 |
|
//absolute gradient tolerance test |
87 |
|
|
88 |
|
if (gnorm <= gTol) { |
89 |
< |
cout << "absolute gradient tolerance test" << std::endl; |
90 |
< |
cout << "gnorm = " << gnorm << "\tgTol = " << gTol << std::endl; |
89 |
> |
std::cout << "absolute gradient tolerance test" << std::endl; |
90 |
> |
std::cout << "gnorm = " << gnorm << "\tgTol = " << gTol << std::endl; |
91 |
|
return CONVG_ABSGTOL; |
92 |
|
} |
93 |
|
|
94 |
|
return CONVG_UNCONVG; |
95 |
|
} |
96 |
+ |
|
97 |
+ |
} |