public final int apply(int a) { return (int) Arithmetic.factorial(a); } };
/** * Returns the exponentially scaled modified Bessel function * of order 0 of the argument. * <p> * The function is defined as <tt>i0e(x) = exp(-|x|) j0( ix )</tt>. * * * @param x the value to compute the bessel function of. */ static public double i0e(double x) throws ArithmeticException { double y; if( x < 0 ) x = -x; if( x <= 8.0 ) { y = (x/2.0) - 2.0; return( Arithmetic.chbevl( y, A_i0, 30 ) ); } return( Arithmetic.chbevl( 32.0/x - 2.0, B_i0, 25 ) / Math.sqrt(x) ); } /**
if ( (N+M)*cern.jet.math.Arithmetic.log2(N) < M*N ) {
private static double fc_lnpk(int k, int N_Mn, int M, int n) { return(Arithmetic.logFactorial(k) + Arithmetic.logFactorial(M - k) + Arithmetic.logFactorial(n - k) + Arithmetic.logFactorial(N_Mn + k)); } /**
/** * Returns <tt>n!</tt>. */ public static long factorial(int n) { return cern.jet.math.Arithmetic.longFactorial(n); /* long i,prod; prod = 1; if (n != 0) { for (i = 2; i <= n; i++) prod *= i; } return prod; */ } private static double fkt2_value(double lambda, double beta, double x_value) {
/** * Removes all elements from the receiver. The receiver will * be empty after this call returns, and its memory requirements will be close to zero. */ public void clear() { super.clear(); this.beta=1.0; this.weHadMoreThanOneEmptyBuffer = false; //this.setSamplingRate(samplingRate,N); RandomSamplingAssistant assist = this.samplingAssistant; if (assist != null) { this.samplingAssistant = new RandomSamplingAssistant(Arithmetic.floor(N/samplingRate), N, assist.getRandomGenerator()); } } /**
/** * Returns the number of bits necessary to store values in the range <tt>[minimum,maximum]</tt>. */ public static int bitsPerElement(long minimum, long maximum) { int bits; if (1+maximum-minimum > 0) { bits=(int) Math.round(Math.ceil(cern.jet.math.Arithmetic.log(2,1+maximum-minimum))); } else { // overflow or underflow in calculating "1+maximum-minimum" // happens if signed long representation is too short for doing unsigned calculations // e.g. if minimum==LONG.MIN_VALUE, maximum==LONG.MAX_VALUE // --> in such cases store all bits of values without any compression. bits=64; } return bits; } /**
Arithmetic.stirlingCorrection(m + 1) + Arithmetic.stirlingCorrection(nm); Arithmetic.stirlingCorrection(K + 1) - Arithmetic.stirlingCorrection(nK)) break;
if ( (N+M)*cern.jet.math.Arithmetic.log2(N) < M*N ) {
private static double fc_lnpk(int k, int N_Mn, int M, int n) { return(Arithmetic.logFactorial(k) + Arithmetic.logFactorial(M - k) + Arithmetic.logFactorial(n - k) + Arithmetic.logFactorial(N_Mn + k)); } /**
/** * Returns <tt>n!</tt>. */ public static long factorial(int n) { return cern.jet.math.Arithmetic.longFactorial(n); /* long i,prod; prod = 1; if (n != 0) { for (i = 2; i <= n; i++) prod *= i; } return prod; */ } private static double fkt2_value(double lambda, double beta, double x_value) {
/** * Removes all elements from the receiver. The receiver will * be empty after this call returns, and its memory requirements will be close to zero. */ public void clear() { super.clear(); this.beta=1.0; this.weHadMoreThanOneEmptyBuffer = false; //this.setSamplingRate(samplingRate,N); RandomSamplingAssistant assist = this.samplingAssistant; if (assist != null) { this.samplingAssistant = new RandomSamplingAssistant(Arithmetic.floor(N/samplingRate), N, assist.getRandomGenerator()); } } /**
/** * Returns the number of bits necessary to store values in the range <tt>[minimum,maximum]</tt>. */ public static int bitsPerElement(long minimum, long maximum) { int bits; if (1+maximum-minimum > 0) { bits=(int) Math.round(Math.ceil(cern.jet.math.Arithmetic.log(2,1+maximum-minimum))); } else { // overflow or underflow in calculating "1+maximum-minimum" // happens if signed long representation is too short for doing unsigned calculations // e.g. if minimum==LONG.MIN_VALUE, maximum==LONG.MAX_VALUE // --> in such cases store all bits of values without any compression. bits=64; } return bits; } /**
Arithmetic.stirlingCorrection(m + 1) + Arithmetic.stirlingCorrection(nm); Arithmetic.stirlingCorrection(K + 1) - Arithmetic.stirlingCorrection(nK)) break;
public static double binomial(double n, long k) { double result = 0; result = cern.jet.math.Arithmetic.binomial(n, k); return result; }
if ( (N+M)*cern.jet.math.Arithmetic.log2(N) < M*N ) {
public final int apply(int a) { return (int) Arithmetic.factorial(a); } };
/** * Returns the exponentially scaled modified Bessel function * of order 0 of the argument. * <p> * The function is defined as <tt>i0e(x) = exp(-|x|) j0( ix )</tt>. * * * @param x the value to compute the bessel function of. */ static public double i0e(double x) throws ArithmeticException { double y; if( x < 0 ) x = -x; if( x <= 8.0 ) { y = (x/2.0) - 2.0; return( Arithmetic.chbevl( y, A_i0, 30 ) ); } return( Arithmetic.chbevl( 32.0/x - 2.0, B_i0, 25 ) / Math.sqrt(x) ); } /**
/** * Returns the probability distribution function. */ public double pdf(int k) { if (k < 0) throw new IllegalArgumentException(); int r = this.n - k; return Math.exp(this.log_n - Arithmetic.logFactorial(k) - Arithmetic.logFactorial(r) + this.log_p * k + this.log_q * r); } /**