| SobolQuasiRandomGenerator(Int32, BitArray, Int32) Constructor |
Constructs a SobolQuasiRandomGenerator for generating quasi-random points
in n-dimensioal space. Uses the given set of primitive polynomials and directionto initialize
numbers to initialize the generator.
Namespace: CenterSpace.NMath.CoreAssembly: NMath (in NMath.dll) Version: 7.4
Syntax public SobolQuasiRandomGenerator(
int numDimensions,
BitArray[] primitivePolynomials,
int[,] initialDirectionNumbers
)
Public Sub New (
numDimensions As Integer,
primitivePolynomials As BitArray(),
initialDirectionNumbers As Integer(,)
)
public:
SobolQuasiRandomGenerator(
int numDimensions,
array<BitArray^>^ primitivePolynomials,
array<int,2>^ initialDirectionNumbers
)
new :
numDimensions : int *
primitivePolynomials : BitArray[] *
initialDirectionNumbers : int[,] -> SobolQuasiRandomGenerator
Parameters
- numDimensions Int32
- The number of dimensions.
- primitivePolynomials BitArray
- Array of primitive polynomial coefficients. The
number of primitive polynomials, and hence the length of the array
polynomials, must be equal to numDimensions or
numDimensions - 1. If the number of specified polynomials is one less than
the number of dimensions the primitive polynomial for the first dimension will
be initialized with a default value.
Since a primitive polynomial coefficient may only be either 0 or 1, the polynomial
coefficients may be specified as a bit array beginning with the leading coefficient
at index 0.
Example
The primitive polynomial x^3 + x + 1 coefficents are specified as
[1 0 1 1]. The BitArray representing this polynomial may be
constructed as
BitArray p = new BitArray( new bool[] { true, false, true, true } );
- initialDirectionNumbers Int32
- Array of initial direction numbers used to
initialize the generator. In the initial direction numbers array, the ith
row corresponds with the ith dimension. The number of rows in the array
initialDirectionNumbers, must be equal to numDimensions or
numDimensions - 1. If the number of rows is one less than
the number of dimensions the direction numbers for the first dimension will
be initialized with a default values.
Exceptions Exception | Condition |
---|
InvalidArgumentException | Thrown if the number of dimensions is zero
or negative, or if the length of the array initialDirectionNumbers is not
equal to numDimensions or numDimensions - 1, or if
the length of the array polynomials is not
equal to numDimensions or numDimensions - 1. Also thrown if the number
of primitive polynomials and the number of initial direction numbers is not equal. |
See Also