org.apache.commons.math.analysis.integration
Class RombergIntegrator

java.lang.Object
  extended by org.apache.commons.math.ConvergingAlgorithmImpl
      extended by org.apache.commons.math.analysis.integration.UnivariateRealIntegratorImpl
          extended by org.apache.commons.math.analysis.integration.RombergIntegrator
All Implemented Interfaces:
UnivariateRealIntegrator, ConvergingAlgorithm

public class RombergIntegrator
extends UnivariateRealIntegratorImpl

Implements the Romberg Algorithm for integration of real univariate functions. For reference, see Introduction to Numerical Analysis, ISBN 038795452X, chapter 3.

Romberg integration employs k successive refinements of the trapezoid rule to remove error terms less than order O(N^(-2k)). Simpson's rule is a special case of k = 2.

Since:
1.2

Constructor Summary
RombergIntegrator()
          Construct an integrator.
RombergIntegrator(UnivariateRealFunction f)
          Deprecated. as of 2.0 the integrand function is passed as an argument to the integrate(UnivariateRealFunction, double, double)method.
 
Method Summary
 double integrate(double min, double max)
          Deprecated. 
 double integrate(UnivariateRealFunction f, double min, double max)
          Integrate the function in the given interval.
 
Methods inherited from class org.apache.commons.math.analysis.integration.UnivariateRealIntegratorImpl
getMinimalIterationCount, getResult, resetMinimalIterationCount, setMinimalIterationCount
 
Methods inherited from class org.apache.commons.math.ConvergingAlgorithmImpl
getAbsoluteAccuracy, getIterationCount, getMaximalIterationCount, getRelativeAccuracy, resetAbsoluteAccuracy, resetMaximalIterationCount, resetRelativeAccuracy, setAbsoluteAccuracy, setMaximalIterationCount, setRelativeAccuracy
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.commons.math.ConvergingAlgorithm
getAbsoluteAccuracy, getIterationCount, getMaximalIterationCount, getRelativeAccuracy, resetAbsoluteAccuracy, resetMaximalIterationCount, resetRelativeAccuracy, setAbsoluteAccuracy, setMaximalIterationCount, setRelativeAccuracy
 

Constructor Detail

RombergIntegrator

@Deprecated
public RombergIntegrator(UnivariateRealFunction f)
Deprecated. as of 2.0 the integrand function is passed as an argument to the integrate(UnivariateRealFunction, double, double)method.

Construct an integrator for the given function.

Parameters:
f - function to integrate

RombergIntegrator

public RombergIntegrator()
Construct an integrator.

Method Detail

integrate

@Deprecated
public double integrate(double min,
                                   double max)
                 throws MaxIterationsExceededException,
                        FunctionEvaluationException,
                        IllegalArgumentException
Deprecated. 

Integrate the function in the given interval.

Parameters:
min - the lower bound for the interval
max - the upper bound for the interval
Returns:
the value of integral
Throws:
FunctionEvaluationException - if an error occurs evaluating the function
IllegalArgumentException - if min > max or the endpoints do not satisfy the requirements specified by the integrator
MaxIterationsExceededException

integrate

public double integrate(UnivariateRealFunction f,
                        double min,
                        double max)
                 throws MaxIterationsExceededException,
                        FunctionEvaluationException,
                        IllegalArgumentException
Integrate the function in the given interval.

Parameters:
f - the integrand function
min - the lower bound for the interval
max - the upper bound for the interval
Returns:
the value of integral
Throws:
FunctionEvaluationException - if an error occurs evaluating the function
IllegalArgumentException - if min > max or the endpoints do not satisfy the requirements specified by the integrator
MaxIterationsExceededException


jHepWork 3.1 ©