ExtendedMath.h File Reference
#include <iostream>
#include <fstream>
#include <cmath>
#include <complex>
#include <limits>
#include "NumericalVector.h"
#include "Vector.h"
#include "Quaternion.h"

Go to the source code of this file.


 Namespace for some extra maths function that are often needed



Mdouble mathsFunc::gamma (Mdouble gamma_in)
 This is the gamma function returns the true value for the half integer value. More...
Mdouble mathsFunc::beta (Mdouble z, Mdouble w)
 This is the beta function, returns the approximation based on cmath's implementation of ln(gamma) More...
Mdouble mathsFunc::chi_squared (Mdouble x, unsigned int k)
 This is a chi_squared function return the value x and degrees of freedom k. More...
Mdouble mathsFunc::chi_squared_prob (Mdouble x, unsigned int k)
 This is the function which actually gives the probability back using a chi squared test. More...
Mdouble mathsFunc::goldenSectionSearch (Mdouble(*function)(const Mdouble), Mdouble min, Mdouble cur, Mdouble max, Mdouble endCondition, Mdouble curVal=std::numeric_limits< Mdouble >::quiet_NaN())
 This function performs a golden section search to find the location of the minimum of a function. More...
template<typename T >
int mathsFunc::sign (T val)
 This is a sign function, it returns -1 for negative numbers, 1 for positive numbers and 0 for 0. More...
template<typename T >
mathsFunc::square (const T val)
 squares a number More...
template<typename T >
mathsFunc::cubic (const T val)
 calculates the cube of a number More...
bool mathsFunc::isEqual (Mdouble v1, Mdouble v2, Mdouble absError)
 Compares the difference of two Mdouble with an absolute error, useful in UnitTests. More...
bool mathsFunc::isEqual (Vec3D v1, Vec3D v2, Mdouble absError)
 Compares the difference of two Vec3D with an absolute error, useful in UnitTests. More...
bool mathsFunc::isEqual (Matrix3D m1, Matrix3D m2, Mdouble absError)
 Compares the difference of two Vec3D with an absolute error, useful in UnitTests. More...
bool mathsFunc::isEqual (MatrixSymmetric3D m1, MatrixSymmetric3D m2, Mdouble absError)
bool mathsFunc::isEqual (Quaternion v1, Quaternion v2, double absError)
template<typename T >
constexpr T mathsFunc::factorial (const T t)
 factorial function More...
Mdouble mathsFunc::sin (Mdouble x)
Mdouble mathsFunc::cos (Mdouble x)
Mdouble mathsFunc::exp (Mdouble Exponent)
Mdouble mathsFunc::log (Mdouble Power)
template<typename T >
mathsFunc::tan (T x)
Mdouble mathsFunc::chebyshev (Mdouble x, const Mdouble coef[], int N)
 Namespace for evaluating the zeroth modified Bessel function of the first kind, I0(x), required in StatisticsPoint.hcc. More...
Mdouble mathsFunc::I0_exp (Mdouble x)
Mdouble mathsFunc::I0 (Mdouble x)
NumericalVector sphericalHarmonics::associatedLegendrePolynomials (int n, Mdouble x)
NumericalVector< std::complex< Mdouble > > sphericalHarmonics::sphericalHarmonics (int p, Mdouble theta, Mdouble phi)
NumericalVector sphericalHarmonics::computeSquaredFactorialValues (int p)


const Mdouble constants::pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117068
const Mdouble constants::sqrt_pi = 1.772453850905516027298167483341145182797549456122387128213807789852911284591032181374950656738544665
const Mdouble constants::sqr_pi = 9.869604401089358618834490999876151135313699407240790626413349376220044822419205243001773403718552232
const Mdouble constants::sqrt_2 = 1.414213562373095048801688724209698078569671875376948073176679737990732478462107038850387534327641573
const Mdouble constants::sqrt_3 = 1.732050807568877293527446341505872366942805253810380628055806979451933016908800037081146186757248576
const Mdouble constants::R = 8.31446261815324
const std::complex< Mdoubleconstants::i = {0.0, 1.0}
const Mdouble constants::degree = pi / 180.