public class MonteCarloIntegrator
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
MonteCarloIntegrator.FunctionNdSampler
Samples a function, producing the value and probability (or 'importance')
of selecting the sampled point
|
static interface |
MonteCarloIntegrator.FunctionSampler
Samples a function, producing the value and probability (or 'importance')
of selecting the sampled point
|
Constructor and Description |
---|
MonteCarloIntegrator() |
Modifier and Type | Method and Description |
---|---|
void |
integrate(MonteCarloIntegrator.FunctionNdSampler func,
double volume,
VectorNd out)
Integrates the supplied random sampler function, normalizing the error
estimate threshold by the provided volume
|
static void |
integrate(MonteCarloIntegrator.FunctionNdSampler func,
int minSamples,
int maxSamples,
double maxVariance,
VectorNd out)
Integrates the provided N-dimensional function using importance-sampling
|
void |
integrate(MonteCarloIntegrator.FunctionNdSampler func,
VectorNd out)
Integrates the supplied random sampler function
|
double |
integrate(MonteCarloIntegrator.FunctionSampler func)
Integrates the supplied random sampler function
|
double |
integrate(MonteCarloIntegrator.FunctionSampler func,
double volume)
Integrates the supplied random sampler function, normalizing the error
estimate threshold by the provided volume
|
static double |
integrate(MonteCarloIntegrator.FunctionSampler func,
int minSamples,
int maxSamples,
double maxVariance)
Integrates the provided function using importance-sampling
|
void |
setLimits(int minSamples,
int maxSamples,
double maxVariance)
Integrator will continue integrating until either the variance estimate
falls below maxVariance, or maxIterations is reached
|
void |
setMaxSamples(int max) |
void |
setMaxVariance(int max) |
void |
setMinSamples(int min) |
public void setLimits(int minSamples, int maxSamples, double maxVariance)
minSamples
- minimum number of samplesmaxSamples
- maximum number of samplesmaxVariance
- variance thresholdpublic void setMaxSamples(int max)
public void setMinSamples(int min)
public void setMaxVariance(int max)
public static double integrate(MonteCarloIntegrator.FunctionSampler func, int minSamples, int maxSamples, double maxVariance)
func
- function to integrateminSamples
- minimum number of samplesmaxSamples
- maximum number of samplesmaxVariance
- variance threshold to stop integrationpublic static void integrate(MonteCarloIntegrator.FunctionNdSampler func, int minSamples, int maxSamples, double maxVariance, VectorNd out)
func
- function to integrateminSamples
- minimum number of samplesmaxSamples
- maximum number of samplesmaxVariance
- variance threshold for integrationout
- output of integrationpublic double integrate(MonteCarloIntegrator.FunctionSampler func)
func
- function to integratepublic double integrate(MonteCarloIntegrator.FunctionSampler func, double volume)
func
- function to integratevolume
- volume of integration regionpublic void integrate(MonteCarloIntegrator.FunctionNdSampler func, VectorNd out)
func
- function to integrateout
- estimated integralpublic void integrate(MonteCarloIntegrator.FunctionNdSampler func, double volume, VectorNd out)
func
- function to integratevolume
- volume of integration regionout
- estimated integral