|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.cilib.math.Maths
public final class Maths
This class provides helper functions in addtion to the standard java.lang.Math
class.
These utility functions further are necessary for the various distributions and selections
required within CIlib as a whole.
Field Summary | |
---|---|
static double |
EPSILON
|
Method Summary | |
---|---|
static double |
choose(double n,
double r)
This is a convienience method providing an alias to combination . |
static double |
combination(double n,
double r)
Return the combination of n and r . |
static double |
factorial(double x)
Generate the required factorial of the number x . |
static int |
flip(double probability)
Determine if a "flip" would occur given the provided probability value. |
static double |
log(double base,
double value)
Determine the log of the specified value with the provided base . |
static double |
permutation(double n,
double r)
In combinatorics, a permutation is usually understood to be a sequence containing each element from a finite set once, and only once. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static double EPSILON
Method Detail |
---|
public static double factorial(double x)
x
.
x
- The number to generate the factorial from.
x
.public static double combination(double n, double r)
n
and r
.
n
- The total elements from which the combination is perfromed.r
- The r
-combinations (of size r
) to select.
n
and r
.public static double choose(double n, double r)
combination
.
n
- The number of elements available for selection.r
- The r
-combinations (of size r
) to select.
n
choose x
".public static double permutation(double n, double r)
n
- The number of elements available for selection.r
- The number of elements to be selected (0 <= r <= n)
.
public static int flip(double probability)
probability
- The provided probability value. This value must be in [0,1]
public static double log(double base, double value)
value
with the provided base
.
base
- The base of the log operation.value
- The value to determine the log of.
value
using the base value of base
.Math.log(double).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |