public class TrapezoidalRealIntegrator extends AbstractRealIntegral
Constructor and Description |
---|
TrapezoidalRealIntegrator(double lowerBound,
double upperBound,
double[] evaluationPoints)
Create an integrator using the trapezoidal rule.
|
TrapezoidalRealIntegrator(double lowerBound,
double upperBound,
int numberOfEvaluationPoints)
Create an integrator using the trapezoidal rule and an equi-distant grid of evaluation points.
|
Modifier and Type | Method and Description |
---|---|
double |
integrate(java.util.function.DoubleUnaryOperator integrand) |
getLowerBound, getUpperBound
public TrapezoidalRealIntegrator(double lowerBound, double upperBound, double[] evaluationPoints)
lowerBound
- Lower bound of the integral.upperBound
- Upper bound of the integral.evaluationPoints
- An ordered array of the inner evaluation points to use.public TrapezoidalRealIntegrator(double lowerBound, double upperBound, int numberOfEvaluationPoints)
numberOfEvaluationPoints
) is 2, since the
trapezoidal rule operates on intervals. That is, lowerBound and upperBound are always evaluated. For
numberOfEvaluationPoints > 2
additional inner points will be evaluated.lowerBound
- Lower bound of the integral.upperBound
- Upper bound of the integral.numberOfEvaluationPoints
- Number of evaluation points (that is calls to the applyAsDouble of integrand). Has to be > 2;public double integrate(java.util.function.DoubleUnaryOperator integrand)
integrate
in interface RealIntegralInterface
integrate
in class AbstractRealIntegral
Copyright © 2016. All rights reserved.