A monte carlo pin cell spectral code for nuclear engineering applications.
|
Utility functions for numerical integration of 1D functions. More...
Go to the source code of this file.
Typedefs | |
typedef enum integrationSchemes | integrationScheme |
Numerical integration methods. | |
Enumerations | |
enum | integrationSchemes { RIEMANN_LEFT, RIEMANN_RIGHT, RIEMANN_CENTER, TRAPEZOIDAL, SIMPSONS, SIMPSONS38, BOOLES } |
Numerical integration methods. More... | |
Functions | |
template<typename T , typename U > | |
void | cumulativeIntegral (T *x, T *y, U *cdf, int length, integrationScheme scheme) |
Performs a cumulative numerical integral over arrays of x and y values using the specificed integration method. More... | |
template<typename T > | |
double | computeRiemannLeft (T *x, T *y, int length) |
Performs a numerical integral using the left-centered Riemann numerical integration method. More... | |
template<typename T > | |
double | computeRiemannRight (T *x, T *y, int length) |
Performs a numerical integral using the right-centered Riemann numerical integration method. More... | |
template<typename T > | |
double | computeRiemannCenter (T *x, T *y, int length) |
Performs a numerical integral using the midpoint-centered Riemann numerical integration method. More... | |
template<typename T > | |
double | computeTrapezoidal (T *x, T *y, int length) |
Performs a numerical integral using the trapezoidal numerical integration method. More... | |
template<typename T > | |
double | computeSimpsons (T *x, T *y, int length) |
Performs a numerical integral using the Simpson's numerical integration method. More... | |
template<typename T > | |
double | computeSimpsons38 (T *x, T *y, int length) |
Performs a numerical integral using the Simpson's 3/8ths numerical integration method. More... | |
template<typename T > | |
double | computeBooles (T *x, T *y, int length) |
Performs a numerical integral using the Boole's numerical integration method. More... | |
template<typename T > | |
double | integrate (T *x, T *y, int length, integrationScheme scheme) |
Performs a 1D numerical integral over arrays of x and y values using the specified integration scheme. More... | |
Utility functions for numerical integration of 1D functions.
This module provides a set of templated integration methods for both normal numerical integration and cumulative numerical integration. It implements the Riemann integration method with left-aligned, right-aligned and midpoint methods, the trapezoidal integration, and higher-order Simpsons, Simpson's 3/8ths and Boole's methods.
enum integrationSchemes |
Numerical integration methods.
double computeBooles | ( | T * | x, |
T * | y, | ||
int | length | ||
) |
Performs a numerical integral using the Boole's numerical integration method.
x | the the x values |
y | the y values |
length | the length of the x and y arrays |
double computeRiemannCenter | ( | T * | x, |
T * | y, | ||
int | length | ||
) |
Performs a numerical integral using the midpoint-centered Riemann numerical integration method.
x | the the x values |
y | the y values |
length | the length of the x and y arrays |
double computeRiemannLeft | ( | T * | x, |
T * | y, | ||
int | length | ||
) |
Performs a numerical integral using the left-centered Riemann numerical integration method.
x | the the x values |
y | the y values |
length | the length of the x and y arrays |
double computeRiemannRight | ( | T * | x, |
T * | y, | ||
int | length | ||
) |
Performs a numerical integral using the right-centered Riemann numerical integration method.
x | the the x values |
y | the y values |
length | the length of the x and y arrays |
double computeSimpsons | ( | T * | x, |
T * | y, | ||
int | length | ||
) |
Performs a numerical integral using the Simpson's numerical integration method.
x | the the x values |
y | the y values |
length | the length of the x and y arrays |
double computeSimpsons38 | ( | T * | x, |
T * | y, | ||
int | length | ||
) |
Performs a numerical integral using the Simpson's 3/8ths numerical integration method.
x | the the x values |
y | the y values |
length | the length of the x and y arrays |
double computeTrapezoidal | ( | T * | x, |
T * | y, | ||
int | length | ||
) |
Performs a numerical integral using the trapezoidal numerical integration method.
x | the the x values |
y | the y values |
length | the length of the x and y arrays |
void cumulativeIntegral | ( | T * | x, |
T * | y, | ||
U * | cdf, | ||
int | length, | ||
integrationScheme | scheme | ||
) |
Performs a cumulative numerical integral over arrays of x and y values using the specificed integration method.
x | the the x values |
y | the y values |
cdf | the array of cdf values at each value of x and y |
length | the length of the x and y arrays |
scheme | the integration scheme |
double integrate | ( | T * | x, |
T * | y, | ||
int | length, | ||
integrationScheme | scheme | ||
) |
Performs a 1D numerical integral over arrays of x and y values using the specified integration scheme.
x | the the x values |
y | the y values |
length | the length of the x and y arrays |
scheme | integration scheme |