public class TrapezoidIntegrator extends UnivariateRealIntegratorImpl
The function should be integrable.
Modifier and Type | Field and Description |
---|---|
private double |
s
Intermediate result.
|
defaultMinimalIterationCount, f, minimalIterationCount, result, resultComputed
absoluteAccuracy, defaultAbsoluteAccuracy, defaultMaximalIterationCount, defaultRelativeAccuracy, iterationCount, maximalIterationCount, relativeAccuracy
Constructor and Description |
---|
TrapezoidIntegrator()
Construct an integrator.
|
TrapezoidIntegrator(UnivariateRealFunction f)
Deprecated.
as of 2.0 the integrand function is passed as an argument
to the
integrate(UnivariateRealFunction, double, double) method. |
Modifier and Type | Method and Description |
---|---|
double |
integrate(double min,
double max)
Deprecated.
|
double |
integrate(UnivariateRealFunction f,
double min,
double max)
Integrate the function in the given interval.
|
(package private) double |
stage(UnivariateRealFunction f,
double min,
double max,
int n)
Compute the n-th stage integral of trapezoid rule.
|
protected void |
verifyIterationCount()
Verifies that the upper and lower limits of iterations are valid.
|
clearResult, getMinimalIterationCount, getResult, resetMinimalIterationCount, setMinimalIterationCount, setResult, verifyInterval
getAbsoluteAccuracy, getIterationCount, getMaximalIterationCount, getRelativeAccuracy, incrementIterationsCounter, resetAbsoluteAccuracy, resetIterationsCounter, resetMaximalIterationCount, resetRelativeAccuracy, setAbsoluteAccuracy, setMaximalIterationCount, setRelativeAccuracy
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAbsoluteAccuracy, getIterationCount, getMaximalIterationCount, getRelativeAccuracy, resetAbsoluteAccuracy, resetMaximalIterationCount, resetRelativeAccuracy, setAbsoluteAccuracy, setMaximalIterationCount, setRelativeAccuracy
@Deprecated public TrapezoidIntegrator(UnivariateRealFunction f)
integrate(UnivariateRealFunction, double, double)
method.f
- function to integratepublic TrapezoidIntegrator()
double stage(UnivariateRealFunction f, double min, double max, int n) throws FunctionEvaluationException
integrate()
in the package.
To save time it does not verify arguments - caller does.
The interval is divided equally into 2^n sections rather than an arbitrary m sections because this configuration can best utilize the alrealy computed values.
f
- the integrand functionmin
- the lower bound for the intervalmax
- the upper bound for the intervaln
- the stage of 1/2 refinement, n = 0 is no refinementFunctionEvaluationException
- if an error occurs evaluating the function@Deprecated public double integrate(double min, double max) throws MaxIterationsExceededException, FunctionEvaluationException, java.lang.IllegalArgumentException
min
- the lower bound for the intervalmax
- the upper bound for the intervalFunctionEvaluationException
- if an error occurs evaluating the
functionjava.lang.IllegalArgumentException
- if min > max or the endpoints do not
satisfy the requirements specified by the integratorMaxIterationsExceededException
public double integrate(UnivariateRealFunction f, double min, double max) throws MaxIterationsExceededException, FunctionEvaluationException, java.lang.IllegalArgumentException
f
- the integrand functionmin
- the lower bound for the intervalmax
- the upper bound for the intervalFunctionEvaluationException
- if an error occurs evaluating the functionjava.lang.IllegalArgumentException
- if min > max or the endpoints do not
satisfy the requirements specified by the integratorMaxIterationsExceededException
protected void verifyIterationCount() throws java.lang.IllegalArgumentException
verifyIterationCount
in class UnivariateRealIntegratorImpl
java.lang.IllegalArgumentException
- if not validCopyright (c) 2003-2014 Apache Software Foundation