PAL Matrix Operations: Linear Systems and Transposition

Transpose helpers, LU back substitution, QR-based solving, forward/backward substitution, determinants, and power iteration.

PAL Matrix Operations: Linear Systems and Transposition — 14 functions

KiratPalMatrixBoolTranspose

Signature
void KiratPalMatrixBoolTranspose( T_BOOL** ppbSource, T_BOOL** ppbDestination, T_INT iSizeDim1, T_INT iSizeDim2);
Description
Transposes a matrix; ROI variants operate only on a selected region.
Mathematical operation
\(B_{ij}=A_{ji}\); ROI variants apply the same mapping only to the requested submatrix.
Supported implementations
  • ANSI C - portable reference implementation
  • Intel/AMD processors - Intel IPP library support

KiratPalMatrixComplexLuBacksubstitution

Signature
T_INT KiratPalMatrixComplexLuBacksubstitution( T_COMPLEX** ppcLUdcmp, T_COMPLEX* pcB, T_INT* piBufferPivotIndices, T_INT iSize);
Description
Performs back substitution after an LU decomposition.
Mathematical operation
Using the stored LU factors and pivot vector, solve \(LUx=Pb\) (equivalently \(Ax=b\) for the matrix represented by the LU decomposition).
Supported implementations
  • ANSI C - portable reference implementation

KiratPalMatrixComplexTranspose

Signature
void KiratPalMatrixComplexTranspose( T_COMPLEX** ppcSource, T_COMPLEX** ppcDestination, T_INT iSizeSourceDim1, T_INT iSizeSourceDim2);
Description
Transposes a matrix; ROI variants operate only on a selected region.
Mathematical operation
\(B_{ij}=A_{ji}\); ROI variants apply the same mapping only to the requested submatrix.
Supported implementations
  • ANSI C - portable reference implementation
  • Intel PC — processor-specific Intel branch

KiratPalMatrixComplexTransposeRoi

Signature
void KiratPalMatrixComplexTransposeRoi( T_COMPLEX** ppcSource, T_INT iSourceRow, T_INT iSourceColumn, T_INT iSourceWidth, T_COMPLEX** ppcDestination, T_INT iDestRow, T_INT iDestColumn, T_INT iDestWidth, T_INT iSizeDim1, T_INT iSizeDim2);
Description
Transposes a matrix; ROI variants operate only on a selected region.
Mathematical operation
\(B_{ij}=A_{ji}\); ROI variants apply the same mapping only to the requested submatrix.
Supported implementations
  • ANSI C - portable reference implementation
  • Intel PC — processor-specific Intel branch

KiratPalMatrixFloatBackwardSubstition

Signature
void KiratPalMatrixFloatBackwardSubstition( T_FLOAT** ppfR, T_FLOAT* pfB, T_FLOAT* pfX, T_INT iDim);
Description
Solves R x = b for an upper-triangular matrix using back substitution.
Mathematical operation
\(x_i=(b_i-\sum_{j>i}R_{ij}x_j)/R_{ii}\), evaluated from the last row upward.
Supported implementations
  • ANSI C - portable reference implementation

KiratPalMatrixFloatDeterminant

Signature
void KiratPalMatrixFloatDeterminant(T_FLOAT** ppfLUdcmp, T_FLOAT* fDet, T_INT* iD, T_INT iDim);
Description
Calculates the determinant from an LU decomposition and the permutation sign.
Mathematical operation
\(\det(A)=s_P\prod_i U_{ii}\) from the LU factors and permutation sign \(s_P\).
Supported implementations
  • ANSI C - portable reference implementation

KiratPalMatrixFloatForwardSubstition

Signature
void KiratPalMatrixFloatForwardSubstition(T_FLOAT** ppfL, T_FLOAT* pfB, T_FLOAT* pfX, T_INT iDim);
Description
Solves L x = b for a lower-triangular matrix using forward substitution.
Mathematical operation
\(x_i=(b_i-\sum_{j<i}L_{ij}x_j)/L_{ii}\).
Supported implementations
  • ANSI C - portable reference implementation

KiratPalMatrixFloatForwardSubstitionSystem

Signature
void KiratPalMatrixFloatForwardSubstitionSystem( T_FLOAT** ppfL, T_FLOAT** ppfB, T_FLOAT** ppfX, T_INT iDim);
Description
Solves L X = B column by column using forward substitution.
Mathematical operation
For every right-hand-side column \(j\), solve \(Lx^{(j)}=b^{(j)}\) by forward substitution.
Supported implementations
  • ANSI C - portable reference implementation

KiratPalMatrixFloatQrMultQTransposedWithVec

Signature
void KiratPalMatrixFloatQrMultQTransposedWithVec( T_FLOAT** ppfQR, T_FLOAT* pfB, T_INT mQR, T_INT nQR);
Description
Multiplies a vector by Qᵀ from a QR decomposition.
Mathematical operation
\(b\leftarrow Q^Tb\) using the stored Givens rotations.
Supported implementations
  • ANSI C - portable reference implementation

KiratPalMatrixFloatSolveQrDecomp

Signature
void KiratPalMatrixFloatSolveQrDecomp( T_FLOAT** ppfQR, T_FLOAT* pfB, T_FLOAT* pfX, T_INT mQR, T_INT nQR);
Description
Computes a QR decomposition A = QR; the implementation stores R and Givens-rotation weights in compact form.
Mathematical operation
Given the compact QR representation, the solver computes \(y=Q^Tb\) and then solves the upper-triangular system \(Rx=y\) by back substitution.
Supported implementations
  • ANSI C - portable reference implementation

KiratPalMatrixFloatTranspose

Signature
void KiratPalMatrixFloatTranspose( T_FLOAT** ppfSource, T_FLOAT** ppfDestination, T_INT iSizeDim1, T_INT iSizeDim2);
Description
Transposes a matrix; ROI variants operate only on a selected region.
Mathematical operation
\(B_{ij}=A_{ji}\); ROI variants apply the same mapping only to the requested submatrix.
Supported implementations
  • ANSI C - portable reference implementation
  • Intel/AMD processors - Intel IPP library support

KiratPalMatrixFloatTransposeRoi

Signature
void KiratPalMatrixFloatTransposeRoi( T_FLOAT** ppfSource, T_INT iSourceRow, T_INT iSourceColumn, T_INT iSourceWidth, T_FLOAT** ppfDestination, T_INT iDestRow, T_INT iDestColumn, T_INT iDestWidth, T_INT iSizeDim1, T_INT iSizeDim2);
Description
Transposes a matrix; ROI variants operate only on a selected region.
Mathematical operation
\(B_{ij}=A_{ji}\); ROI variants apply the same mapping only to the requested submatrix.
Supported implementations
  • ANSI C - portable reference implementation
  • Intel/AMD processors - Intel IPP library support

KiratPalPowerIteration

Signature
T_FLOAT KiratPalPowerIteration( T_FLOAT** ppfA, T_FLOAT* pfX, T_FLOAT* pfAux1, T_FLOAT* pfAux2, T_INT iDim, T_FLOAT fEps, T_INT iMaxIter);
Description
Runs power iteration to estimate the eigenvector associated with the dominant eigenvalue.
Mathematical operation
\(x_{k+1}=Ax_k/\|Ax_k\|_2\) until the iteration criterion is met; the dominant eigenvalue is estimated from the converged vector.
Supported implementations
  • ANSI C - portable reference implementation

KiratPalTransposeMatrixComplexToDest

Signature
void KiratPalTransposeMatrixComplexToDest( T_COMPLEX** ppcSource, T_COMPLEX** ppcDestination, T_INT iSizeDim1, T_INT iSizeDim2);
Description
Transposes a matrix; ROI variants operate only on a selected region.
Mathematical operation
\(B_{ij}=A_{ji}\); ROI variants apply the same mapping only to the requested submatrix.
Supported implementations
  • ANSI C - portable reference implementation