CxGenInvMatrix

Advanced Analysis Library Only

AnalysisLibErrType CxGenInvMatrix (void *inputMatrix, int matrixSize, int matrixType, void *matrixInverse);

Purpose

Calculates the inverse of a complex, square input matrix. If B denotes the inverse of the matrix A, then

AB = I

where I is the identity matrix

The input matrix can be an upper or lower triangular matrix, a general, square matrix, or a positive definite matrix. You can save significant computation time if you properly specify the input matrix type.

Parameters

Input
Name Type Description
inputMatrix numeric array Input complex, square matrix. This matrix must be an array of ComplexNum.

The following C typedef statement defines the ComplexNum structure:

typedef struct {

double real;

double imaginary;

} ComplexNum;

matrixSize integer Number of elements in one dimension of the matrix.
matrixType integer Type of the input matrix. Choose the matrix type correctly because it significantly affects the speed of computation.

The following table shows valid matrix type values.

Matrix Type Value
General matrix 0
Positive definite 1
Upper triangular 2
Lower triangular 3
Output
Name Type Description
matrixInverse numeric array Result complex inverse matrix, as an array of ComplexNum.

The following C typedef statement defines the ComplexNum structure:

typedef struct {

double real;

double imaginary;

} ComplexNum;

Return Value

Name Type Description
status AnalysisLibErrType A value that specifies the type of error that occurred. Refer to analysis.h for definitions of these constants.