# Matrix Computations

- enum FadasCompMat\_ZGEMMMethod

    - ZGEMM method to be performed. C = alpha \* op(A) \* op(B) + beta \* C.

*Values:*

- enumerator FADAS\_COMPMATRIX\_NOOP\_HERM

    - 

- enumerator FADAS\_COMPMATRIX\_HERM\_NOOP

    - For ZGEMM operation with op(A) = A, op(B) = B\*.

- enumerator FADAS\_COMPMATRIX\_HERM\_HERM

    - For ZGEMM operation with op(A) = A\*, op(B) = B.

- enumerator FADAS\_COMPMATRIX\_NOOP\_NOOP

    - For ZGEMM operation with op(A) = A\*, op(B) = B\*.

- typedef struct FadasCompMatrixf32 FadasCompMatrixf32\_t

    - Matrix structure with fp32 input data.

- Param plane:

    - Array with pointers to fp32 input data

- Param numRows:

    - Number of rows in a matrix

- Param numCols:

    - Number of columns in a matrix.

- Param Stride:

    - Number of bytes between the two rows of a matrix.

- Param numPlanes:

    - Number of planes in a matrix

- typedef struct FadasCompMatrixf16 FadasCompMatrixf16\_t

    - Matrix structure with fp16 data.

- Param plane:

    - Array with pointers to fp16 input data

- Param numRows:

    - Number of rows in a matrix

- Param numCols:

    - Number of columns in a matrix.

- Param Stride:

    - Number of bytes between the two rows of a matrix.

- Param numPlanes:

    - Number of planes in a matrix

- typedef struct FadasCompVectorf32 FadasCompVectorf32\_t

    - Complex vector structure.

- Param len:

    - Length of a vector

- Param plane:

    - Array with pointers to the planes of a vectors

- Param numPlanes:

    - Number of planes in a vector

- typedef enum FadasCompMat\_ZGEMMMethod FadasCompMat\_ZGEMMMethod\_e

    - ZGEMM method to be performed. C = alpha \* op(A) \* op(B) + beta \* C.

- FadasError\_e FadasCompMat\_Init(const char \*licenseKey)

    - Initialize FastADAS Linear Algebra Complex Matrix feature. **WARNING:** Must be called once before other FastADAS functions except FadasVersion().

- Parameters:

    - **licenseKey** – Pointer to the license key string.

- Returns:

    - FADAS\_ERROR\_NONE — Success.

- FadasError\_e FadasCompMat\_DeInit(void)

    - Deinitialize FastADAS Linear Algebra Complex Matrix feature. **WARNING:** Must be called once after all other FastADAS functions.

- FadasError\_e FadasCompMat\_SetIdentity(FadasCompMatrixf32\_t \*matI)

    - Generate complex Identity matrix of size n x n with 32-bit float data.

- Parameters:

    - **matI** – Pointer to Identity Matrix

- Returns:

    - FADAS\_ERROR\_NONE : Success

- FadasError\_e FadasCompMat\_SetRev(FadasCompMatrixf32\_t \*matRev)

    - Generate complex Reversal matrix of size n x n with 32-bit float data.

- Parameters:

    - **matRev** – Pointer to Reversal Matrix

- Returns:

    - FADAS\_ERROR\_NONE : Success

- FadasError\_e FadasCompMat\_HermitianTranspose(const FadasCompMatrixf32\_t \*matIn, FadasCompMatrixf32\_t \*matOut)

    - Generate Hermitian Transpose of Input Complex Matrix with 32-bit float data.

- Parameters:

    - - **matIn** – Pointer to Input Matrix
- **matOut** – Pointer to Output Matrix

- Returns:

    - FADAS\_ERROR\_NONE : Success

- FadasCompMat\_ZGEMM\_t \*FadasCompMat\_ZGEMM\_Create(const FadasCompMat\_ZGEMMMethod\_e method, const FadasCompMatrixf32\_t \*matA, const FadasCompMatrixf32\_t \*matB)

    - Generates a pointer to structure with required memory to be allocated.

- Parameters:

    - - **method** – enum to determine op(A) and op(B) for ZGEMM
- **matA** – Pointer to matrix A in ZGEMM
- **matB** – Pointer to matrix B in ZGEMM

- Returns:

    - nullptr : Failure void pointer : Success

- FadasError\_e FadasCompMat\_ZGEMM\_Run(FadasCompMat\_ZGEMM\_t \*hZGEMM, const FadasCompMat\_ZGEMMMethod\_e method, const float32\_t alpha, const float32\_t beta, const FadasCompMatrixf32\_t \*matA, const FadasCompMatrixf32\_t \*matB, FadasCompMatrixf32\_t \*matC)

    - Perform the Operation ( C = alpha \* op(A) \* op(B) + beta \* C )

- Parameters:

    - - **hZGEMM** – ZGEMM handle
- **method** – Method to determine op(A) and op(B)
- **alpha** – Scalar to be multiplied with op(A) \* op(B)
- **beta** – Scalar to be multiplied with C
- **matA** – Pointer to the matrix structure with matrix A’s data
- **matB** – Pointer to the matrix structure with matrix B’s data
- **matC** – Pointer to the matrix structure with matrix C’s data

- Returns:

    - FADAS\_ERROR\_NONE : Success Appropriate error code : Failure

- FadasError\_e FadasCompMat\_ZGEMM\_Destroy(FadasCompMat\_ZGEMM\_t \*hZGEMM)

    - Function to free the buffers allocated in FadasCompMat\_ZGEMM\_Create.

- Parameters:

    - **hZGEMM** – ZGEMM handle

- Returns:

    - FADAS\_ERROR\_NONE : Success Appropriate error code : Failure

- FadasCompMat\_EVD\_t \*FadasCompMat\_EVD\_Create(const FadasCompMatrixf32\_t \*matA)

    - Generates a pointer to structure with required memory to be allocated.

- Parameters:

    - **matA** – input matrix

- Returns:

    - nullptr : Failure FadasCompMat\_EVD\_t pointer : Success

- FadasError\_e FadasCompMat\_EVD\_Run(FadasCompMat\_EVD\_t \*hEVD, const FadasCompMatrixf32\_t \*matA, FadasCompVectorf32\_t \*vecEigenVal, FadasCompMatrixf32\_t \*matEigenVec)

    - Function to find eigen values and eigen vectors of a matrix.

- Parameters:

    - - **hEVD** – EVD handle
- **matA** – Pointer to the matrix structure with input matrix data
- **vecEigenVal** – Pointer to the vector structure with Eigen Values of matA
- **matEigenVec** – Pointer to the matrix structure with Eigen Vectors of matA

- Returns:

    - FADAS\_ERROR\_NONE : Success Appropriate error code : Failure

- FadasError\_e FadasCompMat\_EVD\_Destroy(FadasCompMat\_EVD\_t \*hEVD)

    - Function to free the buffers allocated in FadasCompMat\_EVD\_Create.

- Parameters:

    - **hEVD** – EVD Handle

- Returns:

    - FADAS\_ERROR\_NONE : Success Appropriate error code : Failure

- struct FadasCompMatrixf32

    - Matrix structure with fp32 input data.

- Param plane:

    - Array with pointers to fp32 input data

- Param numRows:

    - Number of rows in a matrix

- Param numCols:

    - Number of columns in a matrix.

- Param Stride:

    - Number of bytes between the two rows of a matrix.

- Param numPlanes:

    - Number of planes in a matrix

Public Members

- float32\_t \*plane[FADAS\_NUM\_COMPMAT\_PLANES]

    - 

- uint32\_t numRows

    - 

- uint32\_t numCols

    - 

- uint32\_t stride

    - 

- uint32\_t numPlanes

    -

- struct FadasCompMatrixf16

    - Matrix structure with fp16 data.

- Param plane:

    - Array with pointers to fp16 input data

- Param numRows:

    - Number of rows in a matrix

- Param numCols:

    - Number of columns in a matrix.

- Param Stride:

    - Number of bytes between the two rows of a matrix.

- Param numPlanes:

    - Number of planes in a matrix

Public Members

- float16\_t \*plane[FADAS\_NUM\_COMPMAT\_PLANES]

    - 

- uint32\_t numRows

    - 

- uint32\_t numCols

    - 

- uint32\_t stride

    - 

- uint32\_t numPlanes

    -

- struct FadasCompVectorf32

    - Complex vector structure.

- Param len:

    - Length of a vector

- Param plane:

    - Array with pointers to the planes of a vectors

- Param numPlanes:

    - Number of planes in a vector

Public Members

- uint32\_t len

    - 

- float32\_t \*plane[FADAS\_NUM\_COMPMAT\_PLANES]

    - 

- uint32\_t numPlanes

    -

Last Published: Sep 30, 2024

Previous Topic
 
Project Points Next Topic

Convex Quadratic Programming