|
SSJ V. 1.1.9. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectumontreal.iro.lecuyer.util.Num
public class Num
This class provides a few constants and some methods to compute numerical quantities such as factorials, combinations, gamma functions, and so on.
| Field Summary | |
|---|---|
static int |
DBL_DIG
Number of decimal digits of precision in a double. |
static double |
DBL_EPSILON
Difference between 1.0 and the smallest double greater than 1.0. |
static int |
DBL_MAX_10_EXP
Largest int x such that 10x is representable (approximately) as a double. |
static int |
DBL_MAX_EXP
Largest int x such that 2x-1 is representable (approximately) as a double. |
static double |
DBL_MIN
Smallest normalized positive floating-point double. |
static int |
DBL_MIN_EXP
Smallest int x such that 2x-1 is representable (approximately) as a normalised double. |
static double |
EBASE
The constant e. |
static double |
ILN2
The values of 1/ln 2. |
static double |
IRAC2
The value of 1/(2)1/2. |
static double |
LN2
The values of ln 2. |
static double |
MAXINTDOUBLE
Largest integer n0 = 253 such that any integer n <= n0 is represented exactly as a double. |
static double |
MAXTWOEXP
Powers of 2 up to MAXTWOEXP are stored exactly in the array TWOEXP. |
static double |
RAC2
The value of (2)1/2. |
static double[] |
TWOEXP
This table contains the powers of two, precomputed. |
| Method Summary | |
|---|---|
static double |
besselK025(double x)
Returns the value of K1/4(x), where Ka is the modified Bessel's function of the second kind. |
static double[][] |
calcMatStirling(int m,
int n)
Computes and returns the Stirling numbers of the second kind |
static double |
combination(int n,
int s)
Returns the number of different combinations of s objects amongst n. |
static double |
evalCheby(double[] S,
int N,
double x)
Evaluates a series of Chebyshev polynomials Tj, at point x∈[- 1, 1]. |
static double |
factorial(int n)
Returns the value of n factorial. |
static double |
lnFactorial(int n)
Returns the value of the natural logarithm of n factorial. |
static double |
lnGamma(double x)
Returns the natural logarithm of the gamma function evaluated at x. |
static double |
log1p(double x)
Returns a value equivalent to log(1 + x) accurate also for small x. |
static double |
log2(double x)
Returns log2(x). |
static double |
multMod(double a,
double s,
double c,
double m)
Returns (as + c)mod m. |
static int |
multMod(int a,
int s,
int c,
int m)
Returns (as + c)mod m. |
static long |
multMod(long a,
long s,
long c,
long m)
Returns (as + c)mod m. |
static double |
volumeSphere(double p,
int t)
Returns the volume V of a sphere of radius 1 in t dimensions using the norm Lp. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final double DBL_EPSILON
public static final int DBL_MAX_EXP
public static final int DBL_MIN_EXP
public static final int DBL_MAX_10_EXP
public static final double DBL_MIN
public static final int DBL_DIG
public static final double EBASE
public static final double RAC2
public static final double IRAC2
public static final double LN2
public static final double ILN2
public static final double MAXINTDOUBLE
public static final double MAXTWOEXP
public static final double[] TWOEXP
| Method Detail |
|---|
public static double log2(double x)
x - the value for which the logarithm must be computed
public static double log1p(double x)
x - the argument of the function
public static double factorial(int n)
n - the integer for which the factorial must be computed
public static double lnFactorial(int n)
n - the integer for which the log-factorial has to be computed
public static double lnGamma(double x)
x - the value for which the lnGamma function must be computed
public static double combination(int n,
int s)
n - total number of objectss - number of chosen objects on a combination
public static double[][] calcMatStirling(int m,
int n)
m - number of rows of the allocated matrixn - number of columns of the allocated matrix
public static double volumeSphere(double p,
int t)
p - index of the used normt - number of dimensions
public static double evalCheby(double[] S,
int N,
double x)
S - coefficients of the polynomialsN - largest degree of polynomialsx - the parameter of the Tj functions
public static double besselK025(double x)
x - value at which the function is calculated
public static int multMod(int a,
int s,
int c,
int m)
a - first term of the products - second term of the productc - shift factorm - the used modulo
public static long multMod(long a,
long s,
long c,
long m)
a - first term of the products - second term of the productc - shift factorm - the used modulo
public static double multMod(double a,
double s,
double c,
double m)
a - first term of the products - second term of the productc - shift factorm - the used modulo
|
SSJ V. 1.1.9. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||