GenInvMatrix

Advanced Analysis Library Only

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

Purpose

Calculates the inverse of the real, square input matrix.

If B denotes the inverse of the matrix A, then

AB = I

where I is the identity matrix

In contrast to InvMatrix, GenInvMatrix allows you to specify the type of the input matrix with the matrixType parameter. 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 type of the matrix.

Parameters

Input
Name Type Description
inputMatrix numeric array Input square matrix. This matrix must be an array of doubles.
matrixSize integer Number of elements in one dimension of the input matrix.
matrixType integer Type of the matrix. Choose the matrix type correctly because it significantly affects the speed of computation.

The following table lists the valid matrixType values.

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

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.