HE_Mesh  5.0.0
wblut.math.WB_Binomial Class Reference

Public Member Functions

 WB_Binomial (final int N, final int K)
 
long binPrecalc (final int n, final int k)
 

Static Public Member Functions

static long bin (final int N, final int K)
 

Private Attributes

final long[][] binomial
 

Detailed Description

WB_Binomial.

Author
Frederik Vanhoutte, W:Blut
    Calculates binomial coefficients.

Constructor & Destructor Documentation

wblut.math.WB_Binomial.WB_Binomial ( final int  N,
final int  K 
)

An instance of WB_Binomial stores a N by K matrix of binomial coefficients.

n! / (n-k)! k!

This is efficient if the same coefficients are need over and over. The precalculated coefficient are retrieved with binPreCalc(). If only a few coefficients are needed, the static function bin() can be more efficient. It can be directly called as WB_Binomial.bin(n,k)

Parameters
Nn-value
Kk-value

Member Function Documentation

static long wblut.math.WB_Binomial.bin ( final int  N,
final int  K 
)
static

Retrieve arbitrary binomial coefficient.

Parameters
Nn-value
Kk-value
Returns
binomial coefficient as long
long wblut.math.WB_Binomial.binPrecalc ( final int  n,
final int  k 
)

Retrieve the precalculated binomial coefficient from an instance of WB_Binomial.

Parameters
nn-value, <=N of WB_Binomial instance
kk-value, <=K of WB_Binomial instance
Returns
binomial coefficient as long

Member Data Documentation

final long [][] wblut.math.WB_Binomial.binomial
private

The binomial.


The documentation for this class was generated from the following file: