Chombo + EB  3.2
Macros | Functions
Factorial.H File Reference
#include "MayDay.H"
#include "RealVect.H"
#include "IndexTM.H"
#include "NamespaceHeader.H"
#include "NamespaceFooter.H"
Include dependency graph for Factorial.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define _FACTORIAL_H_
 

Functions

Real factorial (const int n)
 Calculates factorial for an integer. More...
 
Real POW (const Real &a_x, const int &a_p)
 computes x^p More...
 
Real nCk (const int n, const int k)
 Calculates the binomial coefficient, "n choose k". More...
 
template<int Dim>
Real pfactorial (const IndexTM< int, Dim > p)
 Calculates factorials for a multinomial. More...
 
template<int Dim>
Real pCk (const IndexTM< int, Dim > &p, const IndexTM< int, Dim > &k)
 Calculates the multinomial coefficient, "p choose k". More...
 
template<int Dim>
Real power (const IndexTM< Real, Dim > &a_x, const IndexTM< int, Dim > &a_p)
 calculate x^p More...
 

Macro Definition Documentation

◆ _FACTORIAL_H_

#define _FACTORIAL_H_

Function Documentation

◆ factorial()

Real factorial ( const int  n)
inline

Calculates factorial for an integer.

These helper functions calculate factorials, binomial coeff, etc. for multinomials.

References CH_assert.

Referenced by CutCellMoments< dim >::changeMomentCoordinates(), IndexedMoments< SpaceDim, CH_EBIS_ORDER >::divideByFactorial(), IndexedMoments< SpaceDim, CH_EBIS_ORDER >::multiplyByFactorial(), nCk(), and pfactorial().

◆ POW()

Real POW ( const Real a_x,
const int &  a_p 
)
inline

◆ nCk()

Real nCk ( const int  n,
const int  k 
)
inline

Calculates the binomial coefficient, "n choose k".

References CH_assert, and factorial().

Referenced by pCk().

◆ pfactorial()

template<int Dim>
Real pfactorial ( const IndexTM< int, Dim >  p)
inline

◆ pCk()

template<int Dim>
Real pCk ( const IndexTM< int, Dim > &  p,
const IndexTM< int, Dim > &  k 
)
inline

Calculates the multinomial coefficient, "p choose k".

References nCk().

◆ power()

template<int Dim>
Real power ( const IndexTM< Real, Dim > &  a_x,
const IndexTM< int, Dim > &  a_p 
)
inline

calculate x^p

References ipow().