LevelS C++ support library
3.83
|
Functions | |
template<typename F > | |
bool | approx (F a, F b, F epsilon=1e-5) |
template<typename F > | |
bool | abs_approx (F a, F b, F epsilon=1e-5) |
template<typename I , typename F > | |
I | ifloor (F arg) |
template<typename I , typename F > | |
I | nearest (F arg) |
double | fmodulo (double v1, double v2) |
template<typename I > | |
I | imodulo (I v1, I v2) |
template<typename T > | |
T | sign (const T &signvalue) |
template<typename T , typename I > | |
T | xpow (I m, T val) |
template<typename I > | |
uint32 | isqrt (I arg) |
template<typename I > | |
int | ilog2 (I arg) |
double | safe_atan2 (double y, double x) |
template<typename T , typename Iter , typename Comp > | |
void | interpol_helper (const Iter &begin, const Iter &end, const T &val, Comp comp, tsize &idx, T &frac) |
template<typename T , typename Iter > | |
void | interpol_helper (const Iter &begin, const Iter &end, const T &val, tsize &idx, T &frac) |
|
inline |
Returns true if | a-b | <= epsilon * | b |, else false.
Definition at line 44 of file math_utils.h.
|
inline |
Returns true if | a-b | <= epsilon, else false.
Definition at line 51 of file math_utils.h.
|
inline |
Returns the largest integer which is smaller than (or equal to) arg.
Definition at line 58 of file math_utils.h.
|
inline |
Returns the integer which is nearest to arg.
Definition at line 65 of file math_utils.h.
|
inline |
Returns the remainder of the division v1/v2. The result is non-negative. v1 can be positive or negative; v2 must be positive.
Definition at line 71 of file math_utils.h.
|
inline |
Returns the remainder of the division v1/v2. The result is non-negative. v1 can be positive or negative; v2 must be positive.
Definition at line 84 of file math_utils.h.
|
inline |
Returns -1 if signvalue is negative, else +1.
Definition at line 88 of file math_utils.h.
|
inline |
Returns val*pow(-1,m)
Definition at line 92 of file math_utils.h.
|
inline |
Returns the integer n, which fulfills n*n<=arg<(n+1)*(n+1).
Definition at line 121 of file math_utils.h.
|
inline |
Returns the largest integer n that fulfills 2^n<=arg.
Definition at line 125 of file math_utils.h.
|
inline |
Returns atan2(y,x) if x!=0 or y!=0; else returns 0.
Definition at line 179 of file math_utils.h.
|
inline |
Helper function for linear interpolation (or extrapolation). The array must be ordered in ascending order; no two values may be equal.
Definition at line 188 of file math_utils.h.
|
inline |
Helper function for linear interpolation (or extrapolation). The array must be ordered in ascending order; no two values may be equal.
Definition at line 202 of file math_utils.h.