# GenDeterminant

Advanced Analysis Library Only

AnalysisLibErrType GenDeterminant (void *inputMatrix, int matrixSize, int matrixType, double *determinant);

## Purpose

Calculates the determinant of the real, square input matrix A. In contrast to Determinant, GenDeterminant allows you to specify the type of matrix type with the matrixType parameter. The input matrix can be upper or lower triangular, general, or positive definite.

For upper or lower triangular matrices, the determinant equals the product of the diagonal elements of the matrix. For a positive definite matrix, GenDeterminant first calculates the Cholesky factorization of the input matrix and then calculates the determinant as the square of the determinant of the upper triangular matrix R.

## 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 shows valid matrix type values.
Matrix Type | Value
General matrix | 0
Positive definite | 1
Upper triangular | 2
Lower triangular | 3
Output
Name | Type | Description
determinant | double | Determinant of the input matrix.

## 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.