Advanced Analysis Library Only
AnalysisLibErrType ConditionNumber (void *inputMatrix, int numberOfRows, int numberOfColumns, int normType, double *conditionNumber);
Calculates the condition number of a real input matrix. The normType parameter indicates what type of norm to use to calculate the condition number. The input matrix can be either square or rectangular when normType is 2-norm.
The following formula defines the condition number c of a matrix A:
is the p-norm of the matrix A
The normType value defines the p-norm behavior. For a 2-norm normType, c is the ratio of the largest singular value of A to the smallest singular value of A.
The condition number of a matrix indicates how near to singular the matrix is. A matrix with a large condition number is nearly singular, and a matrix with a condition number close to one is far from singular. The condition number of a matrix is always greater than or equal to one, and it can help assess the accuracy of a solution to a linear system of equations and matrix inversion.
Input | |||||||||||||||||
Name | Type | Description | |||||||||||||||
inputMatrix | numeric array | Input matrix. If normType is 2-norm, the matrix can be square or rectangular; otherwise, it must be square. This matrix must be an array of doubles. | |||||||||||||||
numberOfRows | integer | Number of rows in inputMatrix. | |||||||||||||||
numberOfColumns | integer | Number of columns in inputMatrix. | |||||||||||||||
normType | integer | Norm type to use to calculate the condition number. The following table shows valid norm type values.
|
|||||||||||||||
Output | |||||||||||||||||
Name | Type | Description | |||||||||||||||
conditionNumber | double-precision | Condition number of the matrix. |
Name | Type | Description |
status | AnalysisLibErrType | A value that specifies the type of error that occurred. Refer to analysis.h for definitions of these constants. |