net.finmath.integration
Class SimpsonRealIntegrator
- java.lang.Object
-
- net.finmath.integration.AbstractRealIntegral
-
- net.finmath.integration.SimpsonRealIntegrator
-
- All Implemented Interfaces:
- RealIntegralInterface
public class SimpsonRealIntegrator extends AbstractRealIntegral
A simple integrator using Simpson's rule. The constructor has an optional argument to allow parallel function evaluation. In that case, the integration rule uses Java 8 parallel streams to evaluate.
-
-
Constructor Summary
Constructors Constructor and Description SimpsonRealIntegrator(double lowerBound, double upperBound, int numberOfEvaluationPoints)Create an integrator using Simpson's rule.SimpsonRealIntegrator(double lowerBound, double upperBound, int numberOfEvaluationPoints, boolean useParallelEvaluation)Create an integrator using Simpson's rule.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doubleintegrate(java.util.function.DoubleUnaryOperator integrand)-
Methods inherited from class net.finmath.integration.AbstractRealIntegral
getLowerBound, getUpperBound
-
-
-
-
Constructor Detail
-
SimpsonRealIntegrator
public SimpsonRealIntegrator(double lowerBound, double upperBound, int numberOfEvaluationPoints, boolean useParallelEvaluation)Create an integrator using Simpson's rule.- Parameters:
lowerBound- Lower bound of the integral.upperBound- Upper bound of the integral.numberOfEvaluationPoints- Maximum number of evaluation points to be used, must be greater or equal to 3.useParallelEvaluation- If true, the integration rule will perform parallel evaluation of the integrand.
-
SimpsonRealIntegrator
public SimpsonRealIntegrator(double lowerBound, double upperBound, int numberOfEvaluationPoints)Create an integrator using Simpson's rule.- Parameters:
lowerBound- Lower bound of the integral.upperBound- Upper bound of the integral.numberOfEvaluationPoints- Maximum number of evaluation points to be used.
-
-
Method Detail
-
integrate
public double integrate(java.util.function.DoubleUnaryOperator integrand)
- Specified by:
integratein interfaceRealIntegralInterface- Specified by:
integratein classAbstractRealIntegral
-
-
DataMelt 3.0 © DataMelt by jWork.ORG