138139140141142143144145146
state.iterate(); } while (state.getIterations() < getMaximumIterations() && Math.abs(state.getRelativeError()) > getMaximumRelativeError()); if (state.getIterations() >= getMaximumIterations()) { throw new ConvergenceException( "Iterative method failed to converge."); } }
141142143144145146147148149150
s = sn; } while (n < getMaximumIterations() && Math.abs(error) > getMaximumRelativeError()); if (n >= getMaximumIterations()) { throw new ConvergenceException("Power series failed to converge."); } return s; }
127128129130131132133134135136137
fa = getFunction().evaluate(a); fb = getFunction().evaluate(b); } while ((fa * fb > 0.0) && (n < getMaximumIterations())); if (n >= getMaximumIterations()) { throw new ConvergenceException( "the initial bounds do not bracket a root."); } ret = new double[] { a, b }; }
150151152153154155156157158159
f1 = f; } while (n < getMaximumIterations() && error > getMaximumRelativeError()); if (n >= getMaximumIterations()) { throw new ConvergenceException("Secant method failed to converge."); } return x1; }
161162163164165166167168169170171
++n; } while (n < getMaximumIterations() && error > getMaximumRelativeError()); if (n >= getMaximumIterations()) { throw new ConvergenceException( "False position method failed to converge."); } return x; }
155156157158159160161162163164165
sumSimpons = sumSimponsNext; } while (state.getIterations() < getMaximumIterations() && error > getMaximumRelativeError()); if (state.getIterations() >= getMaximumIterations()) { throw new ConvergenceException( "Simpson's integration failed to converge."); } return sumSimpons; }
236237238239240241242243244245246
s = sn; } while (state.getIterations() < getMaximumIterations() && error > getMaximumRelativeError()); if (state.getIterations() >= getMaximumIterations()) { throw new ConvergenceException( "Trapezoidal integration failed to converge."); } return s; }
195196197198199200201202203204205
error = Math.max(Math.abs(fb), Math.abs(b / c - 1.0)); } while (n < getMaximumIterations() && error > getMaximumRelativeError()); if (n >= getMaximumIterations()) { throw new ConvergenceException( "Brent's method failed to converge."); } ret = b; }
163164165166167168169170171172173
int n = level + 1; ret = integrate(a, pivot, fa, fc, fd, hn, e, s1, n) + integrate(pivot, b, fc, fb, fe, hn, e, s2, n); } } else { throw new ConvergenceException( "Adaptive quadrature failed to converge."); } return ret; }
160161162163164165166167168169170
r1 = new DoubleArray(); } while (n < getMaximumIterations() && error > getMaximumRelativeError()); if (n >= getMaximumIterations()) { throw new ConvergenceException( "Romberg integration failed to converge."); } return r0.get(r0.getSize() - 1); }