41 #include "../NumTools.h"
42 #include "../../Text/TextTools.h"
63 if (params.size() != 1)
64 throw Exception(
"NewtonOneDimension::init(). This optimizer only deals with one parameter.");
65 _param = params[0].getName();
66 currentValue_ = getFunction()->f(getParameters());
67 getStopCondition()->init();
80 if (secondOrderDerivative <= 0)
85 movement = -firstOrderDerivative / secondOrderDerivative;
87 else movement = firstOrderDerivative / secondOrderDerivative;
88 if (std::isnan(movement))
93 newPoint[0].setValue(
getParameters()[0].getValue() - movement);
97 unsigned int count = 0;
106 printMessage(
"!!! Felsenstein-Churchill correction applied too much time. Stopping here. Convergence probably not reached.");
112 movement = movement / 2;
113 newPoint[0].setValue(
getParameters()[0].getValue() - movement);