|
CoreComponents 4.0.0
A Modern C++ Toolkit
|
Number rounding and other common utility functions. More...
Classes | |
| class | Vector< T, N > |
| Algebraic vector. More... | |
Functions | |
| template<class S, class T, int N> | |
| Vector< T, N > | operator* (S a, const Vector< T, N > &b) |
| Multiply a scalar with a vector. | |
Fast Fourier Transform (FFT) | |
| template<template< class > class Vector, class Complex> | |
| void | fft (Vector< Complex > *vf, const Vector< Complex > &vt) |
| Translate vt from time domain to vf in frequency domain. | |
| template<template< class > class Vector, class Complex> | |
| void | fft (Vector< Complex > *v) |
| Translate v in-place from time domain to frequency domain. | |
| template<template< class > class Vector, class Complex> | |
| void | ift (Vector< Complex > *vf, const Vector< Complex > &vt) |
| Translate vf from frequency domain to vt in time domain. | |
| template<template< class > class Vector, class Complex> | |
| void | ift (Vector< Complex > *v) |
| Translate v in-place from frequency domain to time domain. | |
Rounding Functions | |
| double | roundNearestOrOut (double x) |
| Round x towards nearest integral number or if ambigious towards +-infinity. | |
| double | roundNearestOrIn (double x) |
| Round x towards nearest integral number or if ambigious towards zero. | |
| double | roundNearestOrIn (double x, double y) |
| Round x towards the nearest multiple of y or if ambiguous towards zero. | |
| double | roundNearestOrOut (double x, double y) |
| Round x towards the nearest multiple of y or if ambiguous towards +-infinity. | |
| double | roundOut (double x) |
| Round x towards next integral number towards +-infinity. | |
| double | roundIn (double x) |
| Round x towards next integral number towards zero. | |
| double | roundUp (double x) |
| Round x towards the next integral number towards +infinity. | |
| double | roundDown (double x) |
| Round x towards the next integral number towards -infinity. | |
| template<class G, class X> | |
| X | downToNext (G g, X x) |
| Round x down to the next multiple of a whole number g. | |
| template<class G, class X> | |
| X | upToNext (G g, X x) |
| Round x up to the next multiple of a whole number g. | |
| template<int B> | |
| int | ilog (int n) |
| Rounded up logarithm of n to base B. | |
Utility Functions | |
| template<class T> | |
| int | sign (T x) |
| Return sign of x -1 if x < 0, +1 if x >= 0) | |
| template<class T> | |
| int | sgn (T x) |
| Return signum of x (-1 if x < 0, +1 if x > 0, 0 if x == 0) | |
| template<class T> | |
| T | bound (T min, T x, T max) |
| Limit x to the range [min, max]. | |
Number rounding and other common utility functions.
| void fft | ( | Vector< Complex > * | vf, |
| const Vector< Complex > & | vt ) |
Translate vt from time domain to vf in frequency domain.
| void fft | ( | Vector< Complex > * | v | ) |
Translate v in-place from time domain to frequency domain.
| void ift | ( | Vector< Complex > * | vf, |
| const Vector< Complex > & | vt ) |
Translate vf from frequency domain to vt in time domain.
| void ift | ( | Vector< Complex > * | v | ) |
Translate v in-place from frequency domain to time domain.
| double roundNearestOrOut | ( | double | x | ) |
Round x towards nearest integral number or if ambigious towards +-infinity.
| int sign | ( | T | x | ) |
Return sign of x -1 if x < 0, +1 if x >= 0)
Multiply a scalar with a vector.
| double roundNearestOrIn | ( | double | x | ) |
Round x towards nearest integral number or if ambigious towards zero.
| double roundNearestOrIn | ( | double | x, |
| double | y ) |
Round x towards the nearest multiple of y or if ambiguous towards zero.
| double roundNearestOrOut | ( | double | x, |
| double | y ) |
Round x towards the nearest multiple of y or if ambiguous towards +-infinity.
| double roundOut | ( | double | x | ) |
Round x towards next integral number towards +-infinity.
| double roundIn | ( | double | x | ) |
Round x towards next integral number towards zero.
| double roundUp | ( | double | x | ) |
Round x towards the next integral number towards +infinity.
| double roundDown | ( | double | x | ) |
Round x towards the next integral number towards -infinity.
| X downToNext | ( | G | g, |
| X | x ) |
Round x down to the next multiple of a whole number g.
| X upToNext | ( | G | g, |
| X | x ) |
Round x up to the next multiple of a whole number g.
| int ilog | ( | int | n | ) |
Rounded up logarithm of n to base B.
| int sgn | ( | T | x | ) |
Return signum of x (-1 if x < 0, +1 if x > 0, 0 if x == 0)
| T bound | ( | T | min, |
| T | x, | ||
| T | max ) |
Limit x to the range [min, max].