PAL Mathematics: Basic Numeric Operations
Scalar absolute values, minima/maxima, rounding, interpolation, limiting, square roots, validity checks, and small numerical utilities.
|
|
|---|---|
KiratPalAbsdSignature
T_DOUBLE KiratPalAbsd(T_DOUBLE dValue);Description
Calculates the element-wise absolute value/magnitude. Mathematical operation
\(y=|x|\) |
|
KiratPalAbsfSignature
T_FLOAT KiratPalAbsf(T_FLOAT fValue);Description
Calculates the element-wise absolute value/magnitude. Mathematical operation
\(y=|x|\) |
|
KiratPalAbsiSignature
T_INT KiratPalAbsi(T_INT iValue);Description
Calculates the element-wise absolute value/magnitude. Mathematical operation
\(y=|x|\) |
|
KiratPalAbslSignature
T_LONG KiratPalAbsl(T_LONG lValue);Description
Calculates the element-wise absolute value/magnitude. Mathematical operation
\(y=|x|\) |
|
KiratPalCeilcSignature
T_COMPLEX KiratPalCeilc(T_COMPLEX cValue);Description
Rounds each element up using ceil(). Mathematical operation
\(y=\lceil\Re z\rceil+j\lceil\Im z\rceil\) |
|
KiratPalCeilfSignature
T_INT KiratPalCeilf(T_FLOAT fValue);Description
Rounds each element up using ceil(). Mathematical operation
\(y=\lceil x\rceil\) |
|
KiratPalFloatBubbleSortSignature
void KiratPalFloatBubbleSort(T_FLOAT* pfArray, T_INT iLength);Description
Sorts a Float array using the bubble-sort algorithm. Mathematical operation
\(y_{(0)}\le y_{(1)}\le\cdots\le y_{(N-1)}\), where \(y\) is a permutation of the input elements. |
|
KiratPalFloorfSignature
T_INT KiratPalFloorf(T_FLOAT fValue);Description
Rounds each element down using floor(). Mathematical operation
\(y=\operatorname{trunc}(x)\) (C cast from `float` to `int`); despite the function name, negative values are truncated toward zero rather than mathematically floored. |
|
KiratPalGetMaxAbsBiasedApprox1DComplexSignature
T_FLOAT KiratPalGetMaxAbsBiasedApprox1DComplex(const T_COMPLEX* pcVector, T_INT iSize);Description
Returns the largest value in the array. Mathematical operation
\(y=\max_i\left(|\Re z_i|+|\Im z_i|\right)\). |
|
KiratPalGetMaxValAndIndex1DFloatSignature
T_FLOAT KiratPalGetMaxValAndIndex1DFloat(const T_FLOAT* pfVector, T_INT iSize, T_INT* piIndex);Description
Finds the maximum value (or maximum magnitude measure) and its corresponding index. Mathematical operation
\(y=\max_{\mathbf i}x_{\mathbf i}\) and the function returns/stores an index \(\mathbf i^*\) satisfying \(x_{\mathbf i^*}=y\). |
|
KiratPalIsNormalSignature
T_BOOL KiratPalIsNormal(T_FLOAT fValue);Description
Checks whether a Float value is finite and normal (not NaN/Inf, subnormal, or zero according to isnormal). Mathematical operation
\(\operatorname{isnormal}(x)\) |
|
KiratPalLimitSignature
T_FLOAT KiratPalLimit(T_FLOAT fValue, T_FLOAT fMin, T_FLOAT fMax);Description
Limits/clamps the input to a minimum and maximum value. Mathematical operation
\(y=\max(x_{min},\min(x_{max},x))\) |
|
KiratPalLimitiSignature
T_INT KiratPalLimiti(T_INT iValue, T_INT iMin, T_INT iMax);Description
Limits/clamps the input to a minimum and maximum value. Mathematical operation
\(y=\max(x_{min},\min(x_{max},x))\) |
|
KiratPalLinInterpSignature
T_FLOAT KiratPalLinInterp(T_FLOAT fA, T_FLOAT fB, T_FLOAT fPercentA);Description
Performs linear interpolation between two scalar values. Mathematical operation
\(y=(1-p)a+pb\) |
|
KiratPalLinInterpdSignature
T_DOUBLE KiratPalLinInterpd(T_DOUBLE dA, T_DOUBLE dB, T_DOUBLE dPercentage);Description
Performs linear interpolation between two scalar values. Mathematical operation
\(y=(1-p)a+pb\) |
|
KiratPalMaxdSignature
T_DOUBLE KiratPalMaxd(T_DOUBLE dA, T_DOUBLE dB);Description
Returns the maximum of two values. Mathematical operation
\(y=\max(a,b)\) |
|
KiratPalMaxfSignature
T_FLOAT KiratPalMaxf(T_FLOAT fA, T_FLOAT fB);Description
Returns the maximum of two values. Mathematical operation
\(y=\max(a,b)\) |
|
KiratPalMaxiSignature
T_INT KiratPalMaxi(T_INT iA, T_INT iB);Description
Returns the maximum of two values. Mathematical operation
\(y=\max(a,b)\) |
|
KiratPalMindSignature
T_DOUBLE KiratPalMind(T_DOUBLE dA, T_DOUBLE dB);Description
Returns the minimum of two values. Mathematical operation
\(y=\min(a,b)\) |
|
KiratPalMinfSignature
T_FLOAT KiratPalMinf(T_FLOAT fA, T_FLOAT fB);Description
Returns the minimum of two values. Mathematical operation
\(y=\min(a,b)\) |
|
KiratPalMiniSignature
T_INT KiratPalMini(T_INT iA, T_INT iB);Description
Returns the minimum of two values. Mathematical operation
\(y=\min(a,b)\) |
|
KiratPalNaNSignature
T_FLOAT KiratPalNaN(T_CHAR* cValue);Description
Returns a NaN Float value. Mathematical operation
\(y=\mathrm{NaN}\) |
|
KiratPalNextPow2Signature
T_INT KiratPalNextPow2(T_INT iValue);Description
Determines a power of two suitable for the input value, typically for FFT lengths. Mathematical operation
For the documented non-negative input range: \(y=0\) for \(x=0\); \(y=2\) for \(1\le x\le2\); and \(y=2^{\lceil\log_2x\rceil}\) for \(x>2\). The loop starts at 2, so 1 is intentionally mapped to 2. |
|
KiratPalRoundSignature
T_INT KiratPalRound(T_FLOAT fValue);Description
Rounds each element to the nearest integer. Mathematical operation
\(y=\begin{cases}\operatorname{trunc}(x+0.5),&x>0,\\\operatorname{trunc}(x-0.5),&x\le0,\end{cases}\) i.e. nearest-integer rounding with half-way cases away from zero. |
|
KiratPalSqrtSignature
T_FLOAT KiratPalSqrt(T_FLOAT fValue);Description
Calculates the element-wise square root. Mathematical operation
\(y=\sqrt{x}\) |
|
KiratPalSqrtApproxSignature
T_FLOAT KiratPalSqrtApprox(T_FLOAT fValue);Description
Calculates the element-wise square root. Mathematical operation
\(y=\sqrt{x}\) in all currently implemented processor branches. |
|
KiratPalSquareSignature
T_FLOAT KiratPalSquare(T_FLOAT fValue);Description
Squares a Float value. Mathematical operation
\(y=x^2\) |