/** * {@inheritDoc} */ @Override protected double doSolve() throws TooManyEvaluationsException { final double startValue = getStartValue(); final double absoluteAccuracy = getAbsoluteAccuracy(); double x0 = startValue; double x1; while (true) { final DerivativeStructure y0 = computeObjectiveValueAndDerivative(x0); x1 = x0 - (y0.getValue() / y0.getPartialDerivative(1)); if (FastMath.abs(x1 - x0) <= absoluteAccuracy) { return x1; } x0 = x1; } } }
/** * {@inheritDoc} */ @Override protected double doSolve() throws TooManyEvaluationsException { final double startValue = getStartValue(); final double absoluteAccuracy = getAbsoluteAccuracy(); double x0 = startValue; double x1; while (true) { final DerivativeStructure y0 = computeObjectiveValueAndDerivative(x0); x1 = x0 - (y0.getValue() / y0.getPartialDerivative(1)); if (Math.abs(x1 - x0) <= absoluteAccuracy) { return x1; } x0 = x1; } } }
/** * {@inheritDoc} */ @Override protected double doSolve() throws TooManyEvaluationsException { final double startValue = getStartValue(); final double absoluteAccuracy = getAbsoluteAccuracy(); double x0 = startValue; double x1; while (true) { final DerivativeStructure y0 = computeObjectiveValueAndDerivative(x0); x1 = x0 - (y0.getValue() / y0.getPartialDerivative(1)); if (FastMath.abs(x1 - x0) <= absoluteAccuracy) { return x1; } x0 = x1; } } }