Loading...
Searching...
No Matches
casacore::Combinatorics Class Reference
scimath package (libcasa_scimath) » Mathematics_module

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!

## Static Private Member Functions

static void | fillCache (const uInt n)

## Static Private Attributes

static Vector< uInt > | _factorialCache
static volatile uInt | _factorialCacheSize
static std::mutex | theirMutex

## Detailed Description

Combinatorics related functions.

### Intended use:

Public interface

### Review Status

Date Reviewed:
  yyyy/mm/dd

### Prerequisite

- Vector
- Array

### Etymology

self-explanatory

### Synopsis

Various factorial and combinatorical functions.

### Motivation

Binomial coefficients needed for Images/ImageProfileFitter

Definition at line 66 of file Combinatorics.h.

## Member Function Documentation

## choose()

uInt casacore::Combinatorics::choose | ( | const uInt | n,
|  | const uInt | k )

static

"n choose k" = n!

/(k!(n-k)!) Exception is thrown if k > n.

## factorial()

uInt casacore::Combinatorics::factorial | ( | const uInt | n | ) |

inline static

Get n!

Definition at line 71 of file Combinatorics.h.

References _factorialCache, and fillCache().

## fillCache()

void casacore::Combinatorics::fillCache | ( | const uInt | n | ) |

static private

Referenced by factorial().

## Member Data Documentation

## _factorialCache

Vector<uInt> casacore::Combinatorics::_factorialCache

static private

Definition at line 84 of file Combinatorics.h.

Referenced by factorial().

## _factorialCacheSize

volatile uInt casacore::Combinatorics::_factorialCacheSize

static private

Definition at line 85 of file Combinatorics.h.

## theirMutex

std::mutex casacore::Combinatorics::theirMutex

static private

Definition at line 86 of file Combinatorics.h.

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

- scimath/Mathematics/Combinatorics.h