|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.numericalmethod.suanshu.analysis.integration.univariate.riemann.Romberg
public class Romberg
Romberg's method computes an integral by generating a sequence of estimations of the integral values and then extrapolation. The estimations are extrapolated to where the discretization is 0.
For example, Simpson's rule is a special case of Romberg's method, with the number of points for extrapolation is equal to 2.
This implementation does not assume any particular integrator,
other than that the integrator is an IterativeIntegrator.
The user may combine Romberg's method with his favorite iterative integrator.
| Constructor Summary | |
|---|---|
Romberg(IterativeIntegrator integrator)
Construct an integrator by extending an IterativeIntegrator using Romberg's method. |
|
| Method Summary | |
|---|---|
double |
integrate(UnivariateRealFunction f,
double a,
double b)
Integrate function f from a to b. |
double |
precision()
Get the convergence threshold. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Romberg(IterativeIntegrator integrator)
IterativeIntegrator using Romberg's method.
Note that the iterative integrator must do at least 2 steps in order to carry out any extrapolation.
integrator - an iterative integrator| Method Detail |
|---|
public double integrate(UnivariateRealFunction f,
double a,
double b)
Integratorf from a to b.
/ b
| f(x) dx
/ a
integrate in interface Integratorf - a univariate functiona - lower limitb - upper limit
public double precision()
Integrator
For example, for an IterativeIntegrator,
the integral is considered converged
if the relative error of two successive sums is less than the threshold.
precision in interface Integrator
|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||