Code style.

This commit is contained in:
Gilles 2018-05-08 15:54:09 +02:00
parent a38ef0eaf3
commit f813385c7e
1 changed files with 2 additions and 4 deletions

View File

@ -107,15 +107,13 @@ public class SimpsonIntegrator extends BaseAbstractUnivariateIntegrator {
final double s0 = qtrap.stage(this, 0); final double s0 = qtrap.stage(this, 0);
double oldt = qtrap.stage(this, 1); double oldt = qtrap.stage(this, 1);
double olds = (4 * oldt - s0) / 3.0; double olds = (4 * oldt - s0) / 3.0;
while (true) while (true) {
{
// The first iteration is the first refinement of the sum. // The first iteration is the first refinement of the sum.
iterations.incrementCount(); iterations.incrementCount();
final int i = getIterations(); final int i = getIterations();
final double t = qtrap.stage(this, i + 1); // 1-stage ahead of the iteration final double t = qtrap.stage(this, i + 1); // 1-stage ahead of the iteration
final double s = (4 * t - oldt) / 3.0; final double s = (4 * t - oldt) / 3.0;
if (i >= getMinimalIterationCount()) if (i >= getMinimalIterationCount()) {
{
final double delta = FastMath.abs(s - olds); final double delta = FastMath.abs(s - olds);
final double rLimit = getRelativeAccuracy() * (FastMath.abs(olds) + FastMath.abs(s)) * 0.5; final double rLimit = getRelativeAccuracy() * (FastMath.abs(olds) + FastMath.abs(s)) * 0.5;
if ((delta <= rLimit) || (delta <= getAbsoluteAccuracy())) if ((delta <= rLimit) || (delta <= getAbsoluteAccuracy()))