Admin Production ni-theme
Current Publication

CxConditionNumber

LabWindows/CVI

CxConditionNumber

Advanced Analysis Library Only

AnalysisLibErrType CxConditionNumber (void *inputMatrix, ssize_t numberOfRows, ssize_t numberOfColumns, int normType, double *conditionNumber);

Purpose

Calculates the condition number of a complex 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.

Parameters

Input
Name Type Description
inputMatrix void * Input complex, square 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 ComplexNum.

The following C typedef statement defines the ComplexNum structure:

typedef struct {

double real;

double imaginary;

} ComplexNum;

numberOfRows ssize_t Number of rows in inputMatrix.
numberOfColumns ssize_t The number of columns in inputMatrix.
normType int Type of p-norm function to use to calculate the condition number.

The following table shows valid norm type values.

Norm Type Value Meaning
2-norm 0 Largest singular value of inputMatrix.
1-norm 1 Largest column sum of inputMatrix.
Frobenius-norm 2 Square root of the sum of the diagonal elements of ATA, where AT is the complex conjugate transpose of A.
Infinite-norm 3 Largest row sum of inputMatrix.
Output
Name Type Description
conditionNumber double Complex condition number of the 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.

Additional Information

Library: Advanced Analysis Library

Include file: analysis.h

LabWindows/CVI compatibility: LabWindows/CVI 5.0 and later