Package org.sunflow.math
Class QMC
- java.lang.Object
-
- org.sunflow.math.QMC
-
public final class QMC extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private static int[]
FIBONACCI
private static double[]
FIBONACCI_INV
private static double[]
KOROBOV
static int
MAX_SIGMA_ORDER
private static int
NUM
private static int[]
PRIMES
private static int[][]
SIGMA
-
Constructor Summary
Constructors Modifier Constructor Description private
QMC()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
fibonacci(int k)
static double
fibonacciLattice(int k, int i, int d)
static int
getFibonacciRank(int n)
static double
halton(int d, int i)
static double
korobovLattice(int m, int i, int d)
static double
mod1(double x)
Compute mod(x,1), assuming that x is positive or 0.private static int
nextPrime(int p)
static double
reducedCPRotation(int k, int d, double x0, double x1)
static double
riLP(int i, int r)
static double
riS(int i, int r)
static double
riVDC(int bits, int r)
static int
sigma(int i, int order)
Compute sigma function used to seed QMC sequence trees.
-
-
-
Field Detail
-
MAX_SIGMA_ORDER
public static final int MAX_SIGMA_ORDER
- See Also:
- Constant Field Values
-
NUM
private static final int NUM
- See Also:
- Constant Field Values
-
SIGMA
private static final int[][] SIGMA
-
PRIMES
private static final int[] PRIMES
-
FIBONACCI
private static final int[] FIBONACCI
-
FIBONACCI_INV
private static final double[] FIBONACCI_INV
-
KOROBOV
private static final double[] KOROBOV
-
-
Method Detail
-
nextPrime
private static final int nextPrime(int p)
-
riVDC
public static double riVDC(int bits, int r)
-
riS
public static double riS(int i, int r)
-
riLP
public static double riLP(int i, int r)
-
halton
public static final double halton(int d, int i)
-
mod1
public static final double mod1(double x)
Compute mod(x,1), assuming that x is positive or 0.- Parameters:
x
- any number >= 0- Returns:
- mod(x,1)
-
sigma
public static final int sigma(int i, int order)
Compute sigma function used to seed QMC sequence trees. The sigma table is exactly 2^order elements long, and therefore i should be in the: [0, 2^order) interval. This function is equal to 2^order*halton(0,i)- Parameters:
i
- indexorder
-- Returns:
- sigma function
-
getFibonacciRank
public static final int getFibonacciRank(int n)
-
fibonacci
public static final int fibonacci(int k)
-
fibonacciLattice
public static final double fibonacciLattice(int k, int i, int d)
-
reducedCPRotation
public static final double reducedCPRotation(int k, int d, double x0, double x1)
-
korobovLattice
public static final double korobovLattice(int m, int i, int d)
-
-