#include <xmath.h>
|
static double | Inv (const double &x) |
|
static double | Sqr (const double &x) |
|
static double | Sqrt (const double &x) |
|
static double | Log (const double &Val) |
|
static double | Log2 (const double &Val) |
|
static double | Round (const double &Val) |
|
static double | Round (const double &Val, int Decs) |
|
static int | Fac (const int &Val) |
|
static int | Choose (const int &N, const int &K) |
|
static uint | Pow2 (const int &pow) |
|
static double | Power (const double &Base, const double &Exponent) |
|
template<typename T > |
static int | Sign (const T &Val) |
|
template<class T > |
static const T & | Mx (const T &LVal, const T &RVal) |
|
template<class T > |
static const T & | Mn (const T &LVal, const T &RVal) |
|
template<class T > |
static const T & | Mx (const T &Val1, const T &Val2, const T &Val3) |
|
template<class T > |
static const T & | Mn (const T &Val1, const T &Val2, const T &Val3) |
|
template<class T > |
static const T & | Median (const T &Val1, const T &Val2, const T &Val3) |
|
template<class T > |
static const T & | InRange (const T &Val, const T &Mn, const T &Mx) |
|
template<class T > |
static bool | IsInRange (const T &Val, const T &Mn, const T &Mx) |
|
template<class T > |
static bool | IsInEps (const T &Val, const T &Eps) |
|
|
static double | E =2.71828182845904523536 |
|
static double | Pi =3.14159265358979323846 |
|
static double | LogOf2 =log(double(2)) |
|
Definition at line 5 of file xmath.h.
static int TMath::Choose |
( |
const int & |
N, |
|
|
const int & |
K |
|
) |
| |
|
inlinestatic |
Definition at line 22 of file xmath.h.
static int Fac(const int &Val)
static int TMath::Fac |
( |
const int & |
Val | ) |
|
|
inlinestatic |
Definition at line 20 of file xmath.h.
21 if (Val<=1){
return 1;}
else {
return Val*
Fac(Val-1);}}
static int Fac(const int &Val)
template<class T >
static const T& TMath::InRange |
( |
const T & |
Val, |
|
|
const T & |
Mn, |
|
|
const T & |
Mx |
|
) |
| |
|
inlinestatic |
Definition at line 75 of file xmath.h.
static const T & Mn(const T &LVal, const T &RVal)
static const T & Mx(const T &LVal, const T &RVal)
static double TMath::Inv |
( |
const double & |
x | ) |
|
|
inlinestatic |
template<class T >
static bool TMath::IsInEps |
( |
const T & |
Val, |
|
|
const T & |
Eps |
|
) |
| |
|
inlinestatic |
Definition at line 83 of file xmath.h.
84 return Val >= -Eps && Val <= Eps;}
template<class T >
static bool TMath::IsInRange |
( |
const T & |
Val, |
|
|
const T & |
Mn, |
|
|
const T & |
Mx |
|
) |
| |
|
inlinestatic |
Definition at line 79 of file xmath.h.
static const T & Mn(const T &LVal, const T &RVal)
static const T & Mx(const T &LVal, const T &RVal)
static double TMath::Log |
( |
const double & |
Val | ) |
|
|
inlinestatic |
static double TMath::Log2 |
( |
const double & |
Val | ) |
|
|
inlinestatic |
template<class T >
static const T& TMath::Median |
( |
const T & |
Val1, |
|
|
const T & |
Val2, |
|
|
const T & |
Val3 |
|
) |
| |
|
inlinestatic |
Definition at line 62 of file xmath.h.
64 if (Val2 < Val3)
return Val2;
65 else if (Val3 < Val1)
return Val1;
68 if (Val1 < Val3)
return Val1;
69 else if (Val3 < Val2)
return Val2;
template<class T >
static const T& TMath::Mn |
( |
const T & |
LVal, |
|
|
const T & |
RVal |
|
) |
| |
|
inlinestatic |
Definition at line 36 of file xmath.h.
37 return LVal < RVal ? LVal : RVal;}
template<class T >
static const T& TMath::Mn |
( |
const T & |
Val1, |
|
|
const T & |
Val2, |
|
|
const T & |
Val3 |
|
) |
| |
|
inlinestatic |
Definition at line 51 of file xmath.h.
53 if (Val1 < Val3)
return Val1;
56 if (Val2 < Val3)
return Val2;
template<class T >
static const T& TMath::Mx |
( |
const T & |
LVal, |
|
|
const T & |
RVal |
|
) |
| |
|
inlinestatic |
Definition at line 32 of file xmath.h.
33 return LVal > RVal ? LVal : RVal;}
template<class T >
static const T& TMath::Mx |
( |
const T & |
Val1, |
|
|
const T & |
Val2, |
|
|
const T & |
Val3 |
|
) |
| |
|
inlinestatic |
Definition at line 40 of file xmath.h.
42 if (Val1 > Val3)
return Val1;
45 if (Val2 > Val3)
return Val2;
static uint TMath::Pow2 |
( |
const int & |
pow | ) |
|
|
inlinestatic |
Definition at line 24 of file xmath.h.
24 {
return uint(1u<<pow);}
static double TMath::Power |
( |
const double & |
Base, |
|
|
const double & |
Exponent |
|
) |
| |
|
inlinestatic |
Definition at line 25 of file xmath.h.
26 return exp(log(Base)*Exponent);}
static double TMath::Round |
( |
const double & |
Val | ) |
|
|
inlinestatic |
Definition at line 16 of file xmath.h.
17 return (Val>0)?floor(Val+0.5):ceil(Val-0.5);}
static double TMath::Round |
( |
const double & |
Val, |
|
|
int |
Decs |
|
) |
| |
|
inlinestatic |
Definition at line 18 of file xmath.h.
19 const double pwr=pow(10.0, Decs);
return Round(Val * pwr) / pwr;}
static double Round(const double &Val)
template<typename T >
static int TMath::Sign |
( |
const T & |
Val | ) |
|
|
inlinestatic |
Definition at line 29 of file xmath.h.
29 {
return Val<0?-1:(Val>0?1:0);}
static double TMath::Sqr |
( |
const double & |
x | ) |
|
|
inlinestatic |
static double TMath::Sqrt |
( |
const double & |
x | ) |
|
|
inlinestatic |
double TMath::E =2.71828182845904523536 |
|
static |
double TMath::LogOf2 =log(double(2)) |
|
static |
double TMath::Pi =3.14159265358979323846 |
|
static |
The documentation for this class was generated from the following files: