java.lang.Object
net.finmath.integration.AbstractRealIntegral
net.finmath.integration.MonteCarloIntegrator
- All Implemented Interfaces:
RealIntegral
A simple integrator using Monte-Carlo integration.
The constructor has an optional argument to allow
parallel function evaluation. In that case, the integration rule
uses Java 8 parallel streams to evaluate.
- Version:
- 1.0
- Author:
- Christian Fries
-
Constructor Summary
ConstructorsConstructorDescriptionMonteCarloIntegrator(double lowerBound, double upperBound, int numberOfEvaluationPoints)
Create an integrator using Monte-Carlo.MonteCarloIntegrator(double lowerBound, double upperBound, int numberOfEvaluationPoints, boolean useParallelEvaluation)
Create an integrator using Monte-Carlo.MonteCarloIntegrator(double lowerBound, double upperBound, int numberOfEvaluationPoints, int seed, boolean useParallelEvaluation)
Create an integrator using Monte-Carlo integration. -
Method Summary
Modifier and TypeMethodDescriptionint
int
getSeed()
double
integrate(DoubleUnaryOperator integrand)
Methods inherited from class net.finmath.integration.AbstractRealIntegral
getLowerBound, getUpperBound
-
Constructor Details
-
MonteCarloIntegrator
public MonteCarloIntegrator(double lowerBound, double upperBound, int numberOfEvaluationPoints, int seed, boolean useParallelEvaluation)Create an integrator using Monte-Carlo integration.- 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.seed
- The seed of the random number generator.useParallelEvaluation
- If true, the integration rule will perform parallel evaluation of the integrand.
-
MonteCarloIntegrator
public MonteCarloIntegrator(double lowerBound, double upperBound, int numberOfEvaluationPoints, boolean useParallelEvaluation)Create an integrator using Monte-Carlo.- 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.
-
MonteCarloIntegrator
public MonteCarloIntegrator(double lowerBound, double upperBound, int numberOfEvaluationPoints)Create an integrator using Monte-Carlo.- Parameters:
lowerBound
- Lower bound of the integral.upperBound
- Upper bound of the integral.numberOfEvaluationPoints
- Maximum number of evaluation points to be used.
-
-
Method Details
-
integrate
- Specified by:
integrate
in interfaceRealIntegral
- Specified by:
integrate
in classAbstractRealIntegral
-
getNumberOfEvaluationPoints
public int getNumberOfEvaluationPoints() -
getSeed
public int getSeed()
-