finMath lib documentation
net.finmath.integration

## Class MonteCarloIntegrator

• All Implemented Interfaces:
RealIntegral

public class MonteCarloIntegrator
extends AbstractRealIntegral
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

Constructors
Constructor and Description
MonteCarloIntegrator(double lowerBound, double upperBound, int numberOfEvaluationPoints)
Create an integrator using Simpson's rule.
MonteCarloIntegrator(double lowerBound, double upperBound, int numberOfEvaluationPoints, boolean useParallelEvaluation)
Create an integrator using Simpson's rule.
• ### Method Summary

All Methods
Modifier and Type Method and Description
double integrate(DoubleUnaryOperator integrand)
• ### Methods inherited from class net.finmath.integration.AbstractRealIntegral

getLowerBound, getUpperBound
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### Constructor Detail

• #### MonteCarloIntegrator

public MonteCarloIntegrator(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.
• #### MonteCarloIntegrator

public MonteCarloIntegrator(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(DoubleUnaryOperator integrand)
Specified by:
integrate in interface RealIntegral
Specified by:
integrate in class AbstractRealIntegral