| NiederreiterQuasiRandomGenerator(Int32, BitArray, Int32) Constructor |
Constructs a NiederreiterQuasiRandomGenerator for generating quasi-random points
in n-dimensioal space. Uses the given set of irreducible polynomials and directionto initialize
numbers to initialize the generator.
Namespace: CenterSpace.NMath.CoreAssembly: NMath (in NMath.dll) Version: 7.4
Syntax public NiederreiterQuasiRandomGenerator(
int numDimensions,
BitArray[] irreduciblePolynomials,
int[,] initialDirectionNumbers
)
Public Sub New (
numDimensions As Integer,
irreduciblePolynomials As BitArray(),
initialDirectionNumbers As Integer(,)
)
public:
NiederreiterQuasiRandomGenerator(
int numDimensions,
array<BitArray^>^ irreduciblePolynomials,
array<int,2>^ initialDirectionNumbers
)
new :
numDimensions : int *
irreduciblePolynomials : BitArray[] *
initialDirectionNumbers : int[,] -> NiederreiterQuasiRandomGenerator
Parameters
- numDimensions Int32
- The number of dimensions.
- irreduciblePolynomials BitArray
- Array of irreducible polynomial coefficients. The
number of irreducible 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 irreducible polynomial for the first dimension will
be initialized with a default value.
Since a irreducible 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 irreducible 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
- numDimension x 32Array 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. The number of columns in the initialDirectionNumbers
array must be equal to 32.
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 irreducible polynomials and the number of initial direction numbers is not equal. |
See Also