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.

Functions

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


Function Documentation

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< Dim, P >::divideByFactorial(), IndexedMoments< Dim, P >::multiplyByFactorial(), nCk(), and pfactorial().

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

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

Calculates the binomial coefficient, "n choose k".

References CH_assert, and factorial().

Referenced by pCk().

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

Calculates factorials for a multinomial.

References CH_assert, and factorial().

Referenced by IndexedMoments< Dim, P >::divideByFactorial(), and IndexedMoments< Dim, P >::multiplyByFactorial().

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().

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

calculate x^p

References ipow().


Generated on Fri Apr 5 04:21:27 2019 for Chombo + EB by  doxygen 1.5.5