/** {@inheritDoc} */ @Override protected double doIntegrate() throws MathIllegalArgumentException, TooManyEvaluationsException, MaxCountExceededException { final double min = getMin(); final double diff = getMax() - min; final double midPoint = min + 0.5 * diff; double oldt = diff * computeObjectiveValue(midPoint); while (true) { incrementCount(); final int i = getIterations(); final double t = stage(i, oldt, min, diff); if (i >= getMinimalIterationCount()) { final double delta = FastMath.abs(t - oldt); final double rLimit = getRelativeAccuracy() * (FastMath.abs(oldt) + FastMath.abs(t)) * 0.5; if ((delta <= rLimit) || (delta <= getAbsoluteAccuracy())) { return t; } } oldt = t; } }
sum += computeObjectiveValue(x); x += spacing;
sum += computeObjectiveValue(x); x += spacing;
/** {@inheritDoc} */ @Override protected double doIntegrate() throws MathIllegalArgumentException, TooManyEvaluationsException, MaxCountExceededException { final double min = getMin(); final double diff = getMax() - min; final double midPoint = min + 0.5 * diff; double oldt = diff * computeObjectiveValue(midPoint); while (true) { incrementCount(); final int i = getIterations(); final double t = stage(i, oldt, min, diff); if (i >= getMinimalIterationCount()) { final double delta = Math.abs(t - oldt); final double rLimit = getRelativeAccuracy() * (Math.abs(oldt) + Math.abs(t)) * 0.5; if ((delta <= rLimit) || (delta <= getAbsoluteAccuracy())) { return t; } } oldt = t; } }
sum += computeObjectiveValue(x); x += spacing;
/** {@inheritDoc} */ @Override protected double doIntegrate() throws MathIllegalArgumentException, TooManyEvaluationsException, MaxCountExceededException { final double min = getMin(); final double diff = getMax() - min; final double midPoint = min + 0.5 * diff; double oldt = diff * computeObjectiveValue(midPoint); while (true) { incrementCount(); final int i = getIterations(); final double t = stage(i, oldt, min, diff); if (i >= getMinimalIterationCount()) { final double delta = FastMath.abs(t - oldt); final double rLimit = getRelativeAccuracy() * (FastMath.abs(oldt) + FastMath.abs(t)) * 0.5; if ((delta <= rLimit) || (delta <= getAbsoluteAccuracy())) { return t; } } oldt = t; } }