KrisLibrary  1.0.0
Namespaces | Functions
misc.h File Reference

Miscellaneous math functions. More...

#include "math.h"

Go to the source code of this file.

Namespaces

 Math
 Contains all definitions in the Math package.
 

Functions

int Math::quadratic (double a, double b, double c, double &x1, double &x2)
 
int Math::cubic (double a, double b, double c, double d, double x[3])
 
double Math::pythag (double a, double b)
 Returns c where a^2+b^2=c^2.
 
double Math::pythag_leg (double a, double c)
 Returns b where a^2+b^2=c^2.
 
double Math::Sinc (double x)
 Computes the sinc function sin(x)/x (stable for small x)
 
double Math::Sinc_Dx (double x)
 Computes the derivative of the sinc function.
 
double Math::dFactorial (unsigned int n)
 Computes the factorial of n, with double precision.
 
double Math::dLogFactorial (unsigned int n)
 Computes the log of the factorial of n.
 
double Math::dChoose (unsigned int n, unsigned int k)
 Computes n choose k in double precision.
 
double Math::dLogChoose (unsigned int n, unsigned int k)
 Computes the log of n choose k.
 
double Math::TaylorCoeff (double x, unsigned int n)
 Computes the taylor series coefficient x^n/n!
 
double Math::Gamma (double x)
 Computes the gamma function.
 
double Math::LogGamma (double x)
 Computes log gamma(x)
 
double Math::GammaInv (double x)
 Computes 1 / gamma(x)
 
double Math::Beta (double a, double b)
 Computes the beta function B(a,b)
 
double Math::LogBeta (double a, double b)
 Computes log B(a,b)
 
double Math::NormalizedIncompleteBeta (double a, double b, double x)
 Computes the normalized incomplete beta function B(a,b,x)
 
double Math::Erf (double x)
 Computes the error function.
 
double Math::ErfComplimentary (double x)
 Computes the complimentary error function?
 
int Math::FuzzySign (double x, double eps=dEpsilon)
 Returns -1 if x<eps, 0 if |x|<=eps, 1 if x>eps.
 
bool Math::OpposingSigns_pos (double a, double b)
 
bool Math::OpposingSigns_neg (double a, double b)
 Same as above, but treats 0 as a negative number.
 
int Math::quadratic (float a, float b, float c, float &x1, float &x2)
 
int Math::cubic (float a, float b, float c, float d, float x[3])
 
float Math::pythag (float a, float b)
 
float Math::pythag_leg (float a, float c)
 
float Math::Sinc (float x)
 
float Math::Sinc_Dx (float x)
 
float Math::fFactorial (unsigned int n)
 
float Math::fLogFactorial (unsigned int n)
 
float Math::fChoose (unsigned int n, unsigned int k)
 
float Math::fLogChoose (unsigned int n, unsigned int k)
 
float Math::TaylorCoeff (float x, unsigned int n)
 
float Math::Gamma (float x)
 
float Math::LogGamma (float x)
 
float Math::GammaInv (float x)
 
float Math::Beta (float a, float b)
 
float Math::LogBeta (float a, float b)
 
float Math::NormalizedIncompleteBeta (float a, float b, float x)
 
float Math::Erf (float x)
 
float Math::ErfComplimentary (float x)
 
int Math::FuzzySign (float x, float eps=fEpsilon)
 
bool Math::OpposingSigns_pos (float a, float b)
 
bool Math::OpposingSigns_neg (float a, float b)
 
template<class T >
Math::IntegerPower (const T x, int i)
 Calculates x^i where i is an integer (in O(log i) time)
 
unsigned int Math::Factorial (unsigned int n)
 Returns n! in O(n) time.
 
unsigned int Math::FactorialTruncated (unsigned int n, unsigned int k)
 Returns n!/(n-k)! in O(k) time.
 
unsigned int Math::Choose (unsigned int n, unsigned int k)
 Returns `n choose k' = n!/k!(n-k)! in O(k) time.
 
Real Math::rFactorial (unsigned int n)
 
Real Math::LogFactorial (unsigned int n)
 
Real Math::rChoose (unsigned int n, unsigned int k)
 
Real Math::LogChoose (unsigned int n, unsigned int k)
 

Detailed Description

Miscellaneous math functions.