casa
$Rev:20696$
|
Combinatorics related functions. More...
#include <Combinatorics.h>
Static Public Member Functions | |
static uInt | factorial (const uInt n) |
Get n! | |
static uInt | choose (const uInt n, const uInt k) |
"n choose k" = n!/(k!(n-k)!) Exception is thrown if k > n. | |
Static Private Member Functions | |
static void | fillCache (const uInt n) |
Static Private Attributes | |
static Vector< uInt > | _factorialCache |
static volatile uInt | _factorialCacheSize |
static Mutex | theirMutex |
Combinatorics related functions.
Public interface
self-explanatory
Various factorial and combinatorical functions.
Binomial coefficients needed for Images/ImageProfileFitter
Definition at line 68 of file Combinatorics.h.
static uInt casa::Combinatorics::choose | ( | const uInt | n, |
const uInt | k | ||
) | [static] |
"n choose k" = n!/(k!(n-k)!) Exception is thrown if k > n.
static uInt casa::Combinatorics::factorial | ( | const uInt | n | ) | [inline, static] |
Get n!
Definition at line 73 of file Combinatorics.h.
References _factorialCache, _factorialCacheSize, and fillCache().
static void casa::Combinatorics::fillCache | ( | const uInt | n | ) | [static, private] |
Referenced by factorial().
Vector<uInt> casa::Combinatorics::_factorialCache [static, private] |
Definition at line 87 of file Combinatorics.h.
Referenced by factorial().
volatile uInt casa::Combinatorics::_factorialCacheSize [static, private] |
Definition at line 88 of file Combinatorics.h.
Referenced by factorial().
Mutex casa::Combinatorics::theirMutex [static, private] |
Definition at line 89 of file Combinatorics.h.