PAL 2D Arrays: Float Analysis, Conversion, and Remapping

Magnitude, extrema, logarithmic and trigonometric transforms, norms, ring buffers, conversions, comparisons, normalization, and remapping of two-dimensional Float arrays.

PAL 2D Arrays: Float Analysis, Conversion, and Remapping — 23 functions

KiratPal2DFloatAbs

Signature
void KiratPal2DFloatAbs(T_FLOAT** ppfDestination, T_INT iSizeDim1, T_INT iSizeDim2);
Description
Calculates the element-wise absolute value/magnitude.
Mathematical operation
\(y_{\mathbf i}=|x_{\mathbf i}|\).
Supported implementations
  • ANSI C - portable reference implementation
  • Intel/AMD processors - Intel IPP library support

KiratPal2DFloatAbsToDest

Signature
void KiratPal2DFloatAbsToDest( T_FLOAT** ppfSource, T_FLOAT** ppfDestination, T_INT iSizeDim1, T_INT iSizeDim2);
Description
Calculates the element-wise absolute value/magnitude.
Mathematical operation
\(y_{\mathbf i}=|x_{\mathbf i}|\).
Supported implementations
  • ANSI C - portable reference implementation
  • Intel/AMD processors - Intel IPP library support

KiratPal2DFloatLog10Approx

Signature
T_INT KiratPal2DFloatLog10Approx(T_FLOAT** ppfSource, T_INT iSizeDim1, T_INT iSizeDim2);
Description
Calculates a fast element-wise approximation of log10.
Mathematical operation
\(y_{\mathbf i}\approx\log_{10}(x_{\mathbf i})\) using the PAL approximate log implementation.
Supported implementations
  • ANSI C - portable reference implementation
  • Intel/AMD processors - Intel IPP library support

KiratPal2DFloatLog10ApproxToDest

Signature
T_INT KiratPal2DFloatLog10ApproxToDest( T_FLOAT** ppfSource, T_FLOAT** ppfDestination, T_INT iSizeDim1, T_INT iSizeDim2);
Description
Calculates a fast element-wise approximation of log10.
Mathematical operation
\(y_{\mathbf i}\approx\log_{10}(x_{\mathbf i})\) using the PAL approximate log implementation.
Supported implementations
  • ANSI C - portable reference implementation
  • Intel/AMD processors - Intel IPP library support

KiratPal2DFloatRowsConcatenateTo1DFloatDest

Signature
void KiratPal2DFloatRowsConcatenateTo1DFloatDest( T_FLOAT** ppfSource, T_FLOAT* pfDestination, T_INT iSizeDim1, T_INT iSizeDim2);
Description
Concatenates rows or subarrays into a one-dimensional destination vector.
Mathematical operation
\(y[iN_2+j]=A_{ij}\): rows are concatenated in row-major order.
Supported implementations
  • ANSI C - portable reference implementation

KiratPal2DFloatSqrt

Signature
void KiratPal2DFloatSqrt(T_FLOAT** ppfDestination, T_INT iSizeDim1, T_INT iSizeDim2);
Description
Calculates the element-wise square root.
Mathematical operation
\(y_{\mathbf i}=\sqrt{x_{\mathbf i}}\).
Supported implementations
  • ANSI C - portable reference implementation
  • Intel/AMD processors - Intel IPP library support

KiratPal2DFloatSqrtToDest

Signature
void KiratPal2DFloatSqrtToDest( T_FLOAT** ppfSource, T_FLOAT** ppfDestination, T_INT iSizeDim1, T_INT iSizeDim2);
Description
Calculates the element-wise square root.
Mathematical operation
\(y_{\mathbf i}=\sqrt{x_{\mathbf i}}\).
Supported implementations
  • ANSI C - portable reference implementation
  • Intel/AMD processors - Intel IPP library support

KiratPalAppendMatrixABRowWiseToDest

Signature
void KiratPalAppendMatrixABRowWiseToDest( T_FLOAT** ppfA, T_FLOAT** ppfB, T_FLOAT** ppfDest, T_INT mAB, T_INT nA, T_INT nB);
Description
Appends matrix B to the right of matrix A, producing [A B].
Mathematical operation
\(C=[A\;B]\) horizontally: \(C_{j,i}=A_{j,i}\) for \(0\le i<n_A\), and \(C_{j,n_A+k}=B_{j,k}\) for \(0\le k<n_B\).
Supported implementations
  • ANSI C - portable reference implementation

KiratPalCompare2DFloatWith2DFloatToDest

Signature
void KiratPalCompare2DFloatWith2DFloatToDest( T_FLOAT** ppfSource1, T_FLOAT** ppfSource2, T_BOOL** ppfDestination, T_INT iSizeDim1, T_INT iSizeDim2);
Description
Compares corresponding elements of two arrays and writes the Boolean result to the destination.
Mathematical operation
\(D_{ij}=\mathbf1[\operatorname{cmp}(A_{ij},B_{ij})]\), where `cmp` is the comparison mode passed to the function/backend.
Supported implementations
  • ANSI C - portable reference implementation
  • Intel/AMD processors - Intel IPP library support

KiratPalCopySubmatrixBFromMatrixA

Signature
void KiratPalCopySubmatrixBFromMatrixA( T_FLOAT** ppfA, T_FLOAT** ppfB, T_INT mB, T_INT nB, T_INT iRow, T_INT iCol);
Description
Copies the specified data or subrange to the destination.
Mathematical operation
\(D_{\mathbf i}=S_{\mathbf i+\mathbf o}\) on the requested subset/ROI, with offsets and extents given by the function arguments.
Supported implementations
  • ANSI C - portable reference implementation

KiratPalCosOf2DFloatToDest

Signature
T_INT KiratPalCosOf2DFloatToDest( const T_FLOAT* const* ppfSource, T_FLOAT** ppfDest, T_INT iSizeDim1, T_INT iSizeDim2);
Description
Calculates the element-wise cosine.
Mathematical operation
\(y_{\mathbf i}=\cos(x_{\mathbf i})\).
Supported implementations
  • ANSI C - portable reference implementation
  • Intel/AMD processors - Intel IPP library support

KiratPalFroNormOf2DFloat

Signature
T_FLOAT KiratPalFroNormOf2DFloat(T_FLOAT** ppfSource, T_INT iSizeDim1, T_INT iSizeDim2);
Description
Calculates the Frobenius norm of a matrix.
Mathematical operation
\(\|A\|_F=\sqrt{\sum_{i=0}^{N_1-1}\sum_{j=0}^{N_2-1}A_{ij}^2}\).
Supported implementations
  • ANSI C - portable reference implementation

KiratPalGetMax2DFloat

Signature
T_FLOAT KiratPalGetMax2DFloat(T_FLOAT** ppfVector, T_INT iSize1, T_INT iSize2);
Description
Returns the largest value in the array.
Mathematical operation
\(y=\max_{\mathbf i}x_{\mathbf i}\).
Supported implementations
  • ANSI C - portable reference implementation

KiratPalGetMaxValAndIndex2DFloat

Signature
T_FLOAT KiratPalGetMaxValAndIndex2DFloat( T_FLOAT** ppfVector, T_INT iSize1, T_INT iSize2, T_INT* piIndex1, T_INT* piIndex2);
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\).
Supported implementations
  • ANSI C - portable reference implementation

KiratPalGetMin2DFloat

Signature
T_FLOAT KiratPalGetMin2DFloat(T_FLOAT** ppfVector, T_INT iSize1, T_INT iSize2);
Description
Returns the smallest value in the array.
Mathematical operation
\(y=\min_{\mathbf i}x_{\mathbf i}\).
Supported implementations
  • ANSI C - portable reference implementation

KiratPalGetMinValAndIndex2DFloat

Signature
T_FLOAT KiratPalGetMinValAndIndex2DFloat( T_FLOAT** ppfVector, T_INT iSize1, T_INT iSize2, T_INT* piIndex1, T_INT* piIndex2);
Description
Finds the minimum value and its corresponding index.
Mathematical operation
\(y=\min_{\mathbf i}x_{\mathbf i}\) and the function returns/stores an index \(\mathbf i^*\) satisfying \(x_{\mathbf i^*}=y\).
Supported implementations
  • ANSI C - portable reference implementation

KiratPalInverse2DFloat

Signature
T_INT KiratPalInverse2DFloat(T_FLOAT** ppfSrcDest, T_INT iSizeDim1, T_INT iSizeDim2);
Description
Calculates the element-wise reciprocal; threshold variants limit critically small denominators.
Mathematical operation
\(X_{ij}\leftarrow1/X_{ij}\); the 2-D routine applies the 1-D reciprocal row-wise.
Supported implementations
  • ANSI C - portable reference implementation
  • Intel/AMD processors - Intel IPP library support

KiratPalNormalize2DFloat

Signature
void KiratPalNormalize2DFloat(T_FLOAT** ppfSignalIn, T_INT iSignalDim1, T_INT iSignalDim2);
Description
Applies min-max normalization to the complete 2D matrix, mapping it to [0,1] if max−min is greater than SYS_EPS.
Mathematical operation
Let \(m=\min_{ij}A_{ij}\) and \(M=\max_{ij}A_{ij}\). If \(M-m>\varepsilon_{\mathrm{SYS}}\), \(A_{ij}\leftarrow(A_{ij}-m)/(M-m)\); otherwise the matrix is not divided by a near-zero range.
Supported implementations
  • ANSI C - portable reference implementation

KiratPalRemap2DFloat

Signature
void KiratPalRemap2DFloat( T_FLOAT* pfSource, T_FLOAT* pfDestination, T_FLOAT* pfXMap, T_FLOAT* pfYMap, T_INT iSizeSrcDim1, T_INT iSizeSrcDim2, T_INT iRoiStartSrcDim1, T_INT iRoiStartSrcDim2, T_INT iRoiLengthSrcDim1, T_INT iRoiLengthSrcDim2, T_INT iSizeDstDim1, T_INT iSizeDstDim2, T_INT iInterpolationType);
Description
Remaps/resamples a 2D surface using X/Y maps and a selectable interpolation method. The generic ANSI-C implementation is currently not implemented; Intel IPP is supported.
Mathematical operation
\(Y_{uv}=X(X_{map,uv},Y_{map,uv})\) using the requested interpolation mode; the generic ANSI-C branch is currently not implemented.
Supported implementations
  • ANSI C - portable reference implementation
  • Intel/AMD processors - Intel IPP library support

KiratPalSinCosOf2DFloatToDest

Signature
T_INT KiratPalSinCosOf2DFloatToDest( const T_FLOAT* const* ppfSource, T_FLOAT** ppfDestSin, T_FLOAT** ppfDestCos, T_INT iSizeDim1, T_INT iSizeDim2);
Description
Calculates element-wise sine and cosine into separate destination arrays.
Mathematical operation
\(s_{\mathbf i}=\sin(x_{\mathbf i}),\quad c_{\mathbf i}=\cos(x_{\mathbf i})\).
Supported implementations
  • ANSI C - portable reference implementation
  • Intel/AMD processors - Intel IPP library support

KiratPalSinOf2DFloatToDest

Signature
T_INT KiratPalSinOf2DFloatToDest( const T_FLOAT* const* ppfSource, T_FLOAT** ppfDest, T_INT iSizeDim1, T_INT iSizeDim2);
Description
Calculates the element-wise sine.
Mathematical operation
\(y_{\mathbf i}=\sin(x_{\mathbf i})\).
Supported implementations
  • ANSI C - portable reference implementation
  • Intel/AMD processors - Intel IPP library support

KiratPalSquared2DFloatTo2DFloat

Signature
void KiratPalSquared2DFloatTo2DFloat( T_FLOAT** ppfSource, T_FLOAT** ppfDestiantion, T_INT iSizeDim1, T_INT iSizeDim2);
Description
Calculates element-wise squares or complex squared magnitudes.
Mathematical operation
\(y_{ij}=x_{ij}^2\).
Supported implementations
  • ANSI C - portable reference implementation
  • Intel/AMD processors - Intel IPP library support

KiratPalSquaredNormOf2DFloat

Signature
void KiratPalSquaredNormOf2DFloat( T_FLOAT** ppfSource, T_FLOAT* pfNorm, T_INT iSizeDim1, T_INT iSizeDim2);
Description
Calculates the sum of squared magnitudes or squared values.
Mathematical operation
\(s_j=\sum_{i=0}^{N_1-1}x_{ij}^2\) for each column \(j\).
Supported implementations
  • ANSI C - portable reference implementation