PAL 2D Arrays: Float Setup and Arithmetic

Initialization, copying, movement, addition, subtraction, multiplication, and division for two-dimensional Float arrays.

PAL 2D Arrays: Float Setup and Arithmetic — 27 functions

KiratPalAdd2DFloatTo2DFloat

Signature
void KiratPalAdd2DFloatTo2DFloat( T_FLOAT** ppfSource, T_FLOAT** ppfDestination, T_INT iSizeDim1, T_INT iSizeDim2);
Description
Adds scalar, vector, or array values element-wise; ToDest writes to a separate destination, while Acc accumulates into an existing destination.
Mathematical operation
\(d_{\mathbf i}\leftarrow d_{\mathbf i}+s_{\mathbf i}\) (or \(+c\) for a scalar source).
Supported implementations
  • ANSI C - portable reference implementation
  • Intel/AMD processors - Intel IPP library support

KiratPalAdd2DFloatTo2DFloatToDest

Signature
void KiratPalAdd2DFloatTo2DFloatToDest( T_FLOAT** ppfSource1, T_FLOAT** ppfSource2, T_FLOAT** ppfDestination, T_INT iSizeDim1, T_INT iSizeDim2);
Description
Adds scalar, vector, or array values element-wise; ToDest writes to a separate destination, while Acc accumulates into an existing destination.
Mathematical operation
\(d_{\mathbf i}=a_{\mathbf i}+b_{\mathbf i}\) (or source element plus scalar, according to the signature).
Supported implementations
  • ANSI C - portable reference implementation
  • Intel/AMD processors - Intel IPP library support

KiratPalAddFloatTo2DFloat

Signature
T_INT KiratPalAddFloatTo2DFloat( T_FLOAT fSource, T_FLOAT** ppfDestination, T_INT iSizeDim1, T_INT iSizeDim2);
Description
Adds scalar, vector, or array values element-wise; ToDest writes to a separate destination, while Acc accumulates into an existing destination.
Mathematical operation
\(d_{\mathbf i}\leftarrow d_{\mathbf i}+c\).
Supported implementations
  • ANSI C - portable reference implementation

KiratPalAddFloatTo2DFloatToDest

Signature
void KiratPalAddFloatTo2DFloatToDest( const T_FLOAT* const* ppfSource, T_FLOAT fValue, T_FLOAT** ppfDestination, T_INT iSizeDim1, T_INT iSizeDim2);
Description
Adds scalar, vector, or array values element-wise; ToDest writes to a separate destination, while Acc accumulates into an existing destination.
Mathematical operation
\(d_{\mathbf i}\leftarrow d_{\mathbf i}+c\).
Supported implementations
  • ANSI C - portable reference implementation

KiratPalCopy2DFloat

Signature
void KiratPalCopy2DFloat( const T_FLOAT* const* ppfSource, T_FLOAT** ppfDestination, T_INT iSizeDim1, T_INT iSizeDim2);
Description
Copies the specified data or subrange to the destination.
Mathematical operation
\(D_{\mathbf i}\leftarrow S_{\mathbf i}\) element-wise (with type conversion where indicated by the function name).
Supported implementations
  • ANSI C - portable reference implementation

KiratPalCopy2DFloatFromRingBuffer

Signature
void KiratPalCopy2DFloatFromRingBuffer( T_FLOAT** ppfSource, T_FLOAT** ppfDestination, T_INT iNumChannels, T_INT iStartOffset, T_INT iSamples, T_INT iRingBufferLength);
Description
Copies the specified data or subrange to the destination.
Mathematical operation
Data are copied with circular indexing: the physical buffer index is taken modulo the ring-buffer length while the logical samples remain in sequential order.
Supported implementations
  • ANSI C - portable reference implementation

KiratPalCopy2DFloatToRingBuffer

Signature
void KiratPalCopy2DFloatToRingBuffer( T_FLOAT** ppfSource, T_FLOAT** ppfDestination, T_INT iNumChannels, T_INT iStartOffset, T_INT iSamples, T_INT iRingBufferLength);
Description
Copies the specified data or subrange to the destination.
Mathematical operation
Data are copied with circular indexing: the physical buffer index is taken modulo the ring-buffer length while the logical samples remain in sequential order.
Supported implementations
  • ANSI C - portable reference implementation

KiratPalDivide2DFloatWith2DFloat

Signature
void KiratPalDivide2DFloatWith2DFloat( T_FLOAT** ppfSource, T_FLOAT** ppfDestination, T_INT iSizeDim1, T_INT iSizeDim2);
Description
Divides element-wise; some implementations add SYS_EPS or another small safeguard to avoid division by zero.
Mathematical operation
\(D_{ij}\leftarrow D_{ij}/X_{ij}\).
Supported implementations
  • ANSI C - portable reference implementation
  • Intel/AMD processors - Intel IPP library support

KiratPalDivide2DFloatWith2DFloatToDest

Signature
T_INT KiratPalDivide2DFloatWith2DFloatToDest( T_FLOAT** ppfSource1, T_FLOAT** ppfSource2, T_FLOAT** ppfDestination, T_INT iSizeDim1, T_INT iSizeDim2);
Description
Divides element-wise; some implementations add SYS_EPS or another small safeguard to avoid division by zero.
Mathematical operation
\(D_{ij}=X^{(2)}_{ij}/X^{(1)}_{ij}\).
Supported implementations
  • ANSI C - portable reference implementation
  • Intel/AMD processors - Intel IPP library support

KiratPalDivide2DFloatWithFloat

Signature
void KiratPalDivide2DFloatWithFloat( T_FLOAT** ppfDestination, T_FLOAT fValue, T_INT iSizeDim1, T_INT iSizeDim2);
Description
Divides element-wise; some implementations add SYS_EPS or another small safeguard to avoid division by zero.
Mathematical operation
\(D_{ij}\leftarrow D_{ij}/c\).
Supported implementations
  • ANSI C - portable reference implementation

KiratPalDivide2DFloatWithFloatToDest

Signature
void KiratPalDivide2DFloatWithFloatToDest( const T_FLOAT* const* ppfSource, T_FLOAT** ppfDestination, T_FLOAT fValue, T_INT iSizeDim1, T_INT iSizeDim2);
Description
Divides element-wise; some implementations add SYS_EPS or another small safeguard to avoid division by zero.
Mathematical operation
\(D_{ij}=X_{ij}/c\).
Supported implementations
  • ANSI C - portable reference implementation

KiratPalMove2DFloat

Signature
T_INT KiratPalMove2DFloat( const T_FLOAT* const* ppfSource, T_FLOAT** ppfDestination, T_INT iOffset, T_INT iSize1, T_INT iSize2);
Description
Moves/copies data safely even when source and destination memory regions overlap.
Mathematical operation
\(D_{\mathbf i}\leftarrow S_{\mathbf i}\) element-wise (with type conversion where indicated by the function name).
Supported implementations
  • ANSI C - portable reference implementation

KiratPalMult2DFloatWith1DFloat

Signature
void KiratPalMult2DFloatWith1DFloat( T_FLOAT** ppfDestination, T_FLOAT* pfFactor, T_INT iSizeDim1, T_INT iSizeDim2);
Description
Multiplies scalar, vector, or array values element-wise; Acc variants add the product to the destination.
Mathematical operation
\(d_{\mathbf i}\leftarrow d_{\mathbf i}s_{\mathbf i}\).
Supported implementations
  • ANSI C - portable reference implementation

KiratPalMult2DFloatWith1DFloatToDest

Signature
void KiratPalMult2DFloatWith1DFloatToDest( const T_FLOAT* const* ppfSource, T_FLOAT* pfFactor, T_FLOAT** ppfDestination, T_INT iSizeDim1, T_INT iSizeDim2);
Description
Multiplies scalar, vector, or array values element-wise; Acc variants add the product to the destination.
Mathematical operation
\(d_{\mathbf i}=a_{\mathbf i}b_{\mathbf i}\).
Supported implementations
  • ANSI C - portable reference implementation

KiratPalMult2DFloatWith2DFloat

Signature
void KiratPalMult2DFloatWith2DFloat( T_FLOAT** ppfSource, T_FLOAT** ppfDestination, T_INT iSizeDim1, T_INT iSizeDim2);
Description
Multiplies scalar, vector, or array values element-wise; Acc variants add the product to the destination.
Mathematical operation
\(d_{\mathbf i}\leftarrow d_{\mathbf i}s_{\mathbf i}\).
Supported implementations
  • ANSI C - portable reference implementation
  • Intel/AMD processors - Intel IPP library support

KiratPalMult2DFloatWith2DFloatToDest

Signature
T_INT KiratPalMult2DFloatWith2DFloatToDest( T_FLOAT** ppfSource1, T_FLOAT** ppfSource2, T_FLOAT** ppfDestination, T_INT iSizeDim1, T_INT iSizeDim2);
Description
Multiplies scalar, vector, or array values element-wise; Acc variants add the product to the destination.
Mathematical operation
\(d_{\mathbf i}=a_{\mathbf i}b_{\mathbf i}\).
Supported implementations
  • ANSI C - portable reference implementation
  • Intel/AMD processors - Intel IPP library support

KiratPalMult2DFloatWithFloat

Signature
void KiratPalMult2DFloatWithFloat( T_FLOAT** ppfDestination, T_FLOAT fFactor, T_INT iSizeDim1, T_INT iSizeDim2);
Description
Multiplies scalar, vector, or array values element-wise; Acc variants add the product to the destination.
Mathematical operation
\(d_{\mathbf i}\leftarrow c\,d_{\mathbf i}\).
Supported implementations
  • ANSI C - portable reference implementation
  • Intel/AMD processors - Intel IPP library support

KiratPalMult2DFloatWithFloatToDest

Signature
void KiratPalMult2DFloatWithFloatToDest( T_FLOAT** ppfSource, T_FLOAT** ppfDestination, T_FLOAT fFactor, T_INT iSizeDim1, T_INT iSizeDim2);
Description
Multiplies scalar, vector, or array values element-wise; Acc variants add the product to the destination.
Mathematical operation
\(d_{\mathbf i}=c\,s_{\mathbf i}\).
Supported implementations
  • ANSI C - portable reference implementation
  • Intel/AMD processors - Intel IPP library support

KiratPalSet2DFloatToLowPowerNoise

Signature
void KiratPalSet2DFloatToLowPowerNoise( T_FLOAT** ppfDestination, T_INT iSizeDim1, T_INT iSizeDim2);
Description
Fills the array with very low-level noise.
Mathematical operation
\(x_i=10^{-10}u_i\), with \(u_i\approx\mathcal U[-1,1)\).
Supported implementations
  • ANSI C - portable reference implementation

KiratPalSet2DFloatToValue

Signature
void KiratPalSet2DFloatToValue( T_FLOAT** ppfDestination, T_INT iSizeDim1, T_INT iSizeDim2, T_FLOAT fValue);
Description
Sets all elements of the array to a constant value.
Mathematical operation
\(d_{\mathbf i}\leftarrow c\) for every array index \(\mathbf i\).
Supported implementations
  • ANSI C - portable reference implementation
  • Intel/AMD processors - Intel IPP library support

KiratPalSet2DFloatToValueIfAboveTheshold

Signature
void KiratPalSet2DFloatToValueIfAboveTheshold( T_FLOAT** ppfDestination, T_INT iSizeDim1, T_INT iSizeDim2, T_FLOAT fValue, T_FLOAT fThreshold);
Description
Replaces elements by specified values depending on a threshold condition.
Mathematical operation
\(d_{\mathbf i}\leftarrow v\) if \(d_{\mathbf i}>t\); otherwise the element is unchanged.
Supported implementations
  • ANSI C - portable reference implementation

KiratPalSet2DFloatToValueIfBelowTheshold

Signature
void KiratPalSet2DFloatToValueIfBelowTheshold( T_FLOAT** ppfDestination, T_INT iSizeDim1, T_INT iSizeDim2, T_FLOAT fValue, T_FLOAT fThreshold);
Description
Replaces elements by specified values depending on a threshold condition.
Mathematical operation
\(d_{\mathbf i}\leftarrow v\) if \(d_{\mathbf i}<t\); otherwise the element is unchanged.
Supported implementations
  • ANSI C - portable reference implementation
  • Intel/AMD processors - Intel IPP library support

KiratPalSet2DFloatToValuesIfNotLyingBetweenThesholds

Signature
void KiratPalSet2DFloatToValuesIfNotLyingBetweenThesholds( T_FLOAT** ppfDestination, T_INT iSizeDim1, T_INT iSizeDim2, T_FLOAT fMinValue, T_FLOAT fMinThreshold, T_FLOAT fMaxValue, T_FLOAT fMaxThreshold);
Description
Replaces elements by specified values depending on a threshold condition.
Mathematical operation
\(d_{ij}\leftarrow v_{low}\) below the lower threshold and \(d_{ij}\leftarrow v_{high}\) above the upper threshold; values inside the interval are retained.
Supported implementations
  • ANSI C - portable reference implementation

KiratPalSet2DFloatToZero

Signature
void KiratPalSet2DFloatToZero(T_FLOAT** ppfDestination, T_INT iSizeDim1, T_INT iSizeDim2);
Description
Sets all elements of the array to zero.
Mathematical operation
\(d_{\mathbf i}\leftarrow0\) for every array index \(\mathbf i\).
Supported implementations
  • ANSI C - portable reference implementation

KiratPalSet2DFloatToZeroOrFillWithLowPowerNoise

Signature
void KiratPalSet2DFloatToZeroOrFillWithLowPowerNoise( T_FLOAT** ppfDestination, T_INT iSizeDim1, T_INT iSizeDim2);
Description
Sets the array to zero or, depending on the configuration, fills it with very low-level noise to avoid numerical corner cases.
Mathematical operation
Current real-valued default path selects the local zero mode, so \(x_i=0\); the alternative code path would use uniform noise of gain \(10^{-10}\).
Supported implementations
  • ANSI C - portable reference implementation

KiratPalSubtract2DFloatFrom2DFloat

Signature
void KiratPalSubtract2DFloatFrom2DFloat( T_FLOAT** ppfDestination, T_FLOAT** ppfSource, T_INT iSizeDim1, T_INT iSizeDim2);
Description
Subtracts scalar, vector, or array values element-wise; “A from B” means B−A mathematically.
Mathematical operation
\(D_{ij}\leftarrow D_{ij}-X_{ij}\).
Supported implementations
  • ANSI C - portable reference implementation
  • Intel/AMD processors - Intel IPP library support

KiratPalSubtract2DFloatFrom2DFloatToDest

Signature
void KiratPalSubtract2DFloatFrom2DFloatToDest( T_FLOAT** ppfSource1, T_FLOAT** ppfSource2, T_FLOAT** ppfDestination, T_INT iSizeDim1, T_INT iSizeDim2);
Description
Subtracts scalar, vector, or array values element-wise; “A from B” means B−A mathematically.
Mathematical operation
\(D_{ij}=X^{(1)}_{ij}-X^{(2)}_{ij}\).
Supported implementations
  • ANSI C - portable reference implementation
  • Intel/AMD processors - Intel IPP library support