Class HaltonSequence

    • Constructor Detail

      • HaltonSequence

        public HaltonSequence​(int[] base)
        Constructs a Halton sequence with the given bases. The bases should be integers without common divisor greater than 1, for example, prime numbers.
        Parameters:
        base - The array of base integers. The length of the array defines the dimension of the sequence.
    • Method Detail

      • getNext

        public double[] getNext()
        Description copied from interface: RandomNumberGenerator
        Get the next sample vector of dimension n, where n is getDimension. An implementation has to be thread safe.
        Specified by:
        getNext in interface RandomNumberGenerator
        Returns:
        The next sample vector of dimension n, where n is getDimension.
      • getHaltonNumber

        public double[] getHaltonNumber​(long index)
      • getHaltonNumber

        public double getHaltonNumber​(long index,
                                      int dimension)
      • getHaltonNumberForGivenBase

        public static double getHaltonNumberForGivenBase​(long index,
                                                         int base)
        Return a Halton number, sequence starting at index = 0, base > 1.
        Parameters:
        index - The index of the sequence.
        base - The base of the sequence. Has to be greater than one (this is not checked).
        Returns:
        The Halton number.