ComputePi
public abstract class MonteCarloIntegration
extends java.lang.Object
Constructor | Description |
---|---|
MonteCarloIntegration(org.apache.commons.rng.simple.RandomSource source,
int dimension) |
Simulation constructor.
|
Modifier and Type | Method | Description |
---|---|---|
double |
integrate(long n) |
Run the Monte-Carlo integration.
|
protected abstract boolean |
isInside(double... point) |
Indicates whether the given points is inside the region whose
integral is computed.
|
public MonteCarloIntegration(org.apache.commons.rng.simple.RandomSource source, int dimension)
source
- RNG algorithm.dimension
- Integration domain dimension.public double integrate(long n)
n
- Number of random points to generate.protected abstract boolean isInside(double... point)
point
- Point whose coordinates are random numbers uniformly
distributed in the unit interval.true
if the point
is inside.Copyright © 2016–2018 The Apache Software Foundation. All rights reserved.