![]() |
PIP 5.6.1
Platform-Independent Primitives
|
Basic mathematical constants and helper algorithms. More...
Functions | |
| int | sign (const float &x) |
| Returns the sign of a floating-point value. | |
| int | sign (const double &x) |
| Returns the sign of a floating-point value. | |
| int | sign (const ldouble &x) |
| Returns the sign of a floating-point value. | |
| int | pow2 (const int p) |
Returns 2 raised to integer power p. | |
| float | pow10 (const float &e) |
Returns 10 raised to the specified power. | |
| double | pow10 (const double &e) |
Returns 10 raised to the specified power. | |
| ldouble | pow10 (const ldouble &e) |
Returns 10 raised to the specified power. | |
| double | sinc (const double &v) |
Returns normalized sinc, sin(pi*x)/(pi*x). | |
| constexpr float | toRad (float deg) |
| Converts degrees to radians. | |
| constexpr double | toRad (double deg) |
| Converts degrees to radians. | |
| constexpr ldouble | toRad (ldouble deg) |
| Converts degrees to radians. | |
| constexpr float | toDeg (float rad) |
| Converts radians to degrees. | |
| constexpr double | toDeg (double rad) |
| Converts radians to degrees. | |
| constexpr ldouble | toDeg (ldouble rad) |
| Converts radians to degrees. | |
| template<typename T > | |
| constexpr T | sqr (const T &v) |
| Returns square of a value. | |
| template<typename T > | |
| constexpr T | toDb (T val) |
| Converts a power ratio to decibels. | |
| template<typename T > | |
| constexpr T | fromDb (T val) |
| Converts decibels to a linear power ratio. | |
| double | randomd () |
Returns a pseudo-random value in the range [-1; 1]. | |
| double | randomn (double dv=0., double sv=1.) |
| Returns a normally distributed pseudo-random value with mean dv and deviation sv. | |
| template<typename T > | |
| PIVector< T > | piAbs (const PIVector< T > &v) |
| Returns vector with absolute values of each element. | |
| template<typename T > | |
| void | normalizeAngleDeg360 (T &a) |
Normalizes an angle to the [0; 360] degree range in place. | |
| template<typename T > | |
| double | normalizedAngleDeg360 (T a) |
Returns an angle normalized to the [0; 360] degree range. | |
| template<typename T > | |
| void | normalizeAngleDeg180 (T &a) |
Normalizes an angle to the [-180; 180] degree range in place. | |
| template<typename T > | |
| double | normalizedAngleDeg180 (T a) |
Returns an angle normalized to the [-180; 180] degree range. | |
| template<typename T > | |
| bool | OLS_Linear (const PIVector< PIPair< T, T > > &input, T *out_a, T *out_b) |
Fits a linear model y = a*x + b with ordinary least squares. More... | |
| template<typename T > | |
| bool | WLS_Linear (const PIVector< PIPair< T, T > > &input, const PIVector< T > &weights, T *out_a, T *out_b) |
Fits a weighted linear model y = a*x + b. More... | |
Bessel functions | |
Bessel function of the first kind of order 0 Bessel function of the first kind J0(x), solution to Bessel's differential equation | |
| double | piJ0 (const double &v) |
| double | piJ1 (const double &v) |
| Bessel function of the first kind of order 1 Bessel function of the first kind J1(x), solution to Bessel's differential equation. More... | |
| double | piJn (int n, const double &v) |
| Bessel function of the first kind of order n Bessel function of the first kind Jn(n, x), solution to Bessel's differential equation. More... | |
| double | piY0 (const double &v) |
| Bessel function of the second kind of order 0 Bessel function of the second kind Y0(x), also known as Neumann function. More... | |
| double | piY1 (const double &v) |
| Bessel function of the second kind of order 1 Bessel function of the second kind Y1(x), also known as Neumann function. More... | |
| double | piYn (int n, const double &v) |
| Bessel function of the second kind of order n Bessel function of the second kind Yn(n, x), also known as Neumann function. More... | |
Basic mathematical constants and helper algorithms.
| double piJ1 | ( | const double & | v | ) |
Bessel function of the first kind of order 1 Bessel function of the first kind J1(x), solution to Bessel's differential equation.
| double piJn | ( | int | n, |
| const double & | v | ||
| ) |
Bessel function of the first kind of order n Bessel function of the first kind Jn(n, x), solution to Bessel's differential equation.
| double piY0 | ( | const double & | v | ) |
| double piY1 | ( | const double & | v | ) |
| double piYn | ( | int | n, |
| const double & | v | ||
| ) |
| bool OLS_Linear | ( | const PIVector< PIPair< T, T > > & | input, |
| T * | out_a, | ||
| T * | out_b | ||
| ) |
Fits a linear model y = a*x + b with ordinary least squares.
Returns false when fewer than two sample pairs are provided.