66 |
|
RealType gTol; |
67 |
|
RealType relativeGTol; |
68 |
|
RealType gnorm; |
69 |
– |
|
69 |
|
|
70 |
|
// test function tolerance test |
71 |
|
fTol =paramSet->getFTol(); |
72 |
< |
relativeFTol = fTol * std::max(1.0,fabs(curF)); // relative tolerance |
72 |
> |
|
73 |
> |
relativeFTol = fTol * std::max(RealType(1.0), fabs(curF)); // relative tolerance |
74 |
> |
|
75 |
|
deltaF = prevF - curF; |
76 |
|
|
77 |
|
if (fabs(deltaF) <= relativeFTol) { |
86 |
|
|
87 |
|
//gradient tolerance test |
88 |
|
gTol = paramSet->getGTol(); |
89 |
< |
relativeGTol = gTol * std::max(1.0,fabs(curF)); |
89 |
> |
relativeGTol = gTol * std::max(RealType(1.0), fabs(curF)); |
90 |
|
|
91 |
|
#ifndef IS_MPI |
92 |
|
gnorm = sqrt(dotProduct(curG, curG)); |