# CxGenLinEqs

Advanced Analysis Library Only

AnalysisLibErrType CxGenLinEqs (void *inputArray, int numberOfRows, int numberOfColumns, ComplexNum rightHandSide[], int matrixType, ComplexNum outputVector[]);

## Purpose

| Note This function is obsolete. National Instruments recommends that you use CxSolveEqs instead.

Solves for the unknown vector x in the linear system of equations:

Ax = y

where | A is the real input matrix
| y is the known vector on the right side

The input matrix can be square or rectangular. The number of elements in rightHandSide must equal the number of rows in the matrix inputArray.

CxGenLinEqs calculates the solution using the Singular Value Decomposition technique.

In the case of non-singular, square matrices, in which no row or column is a linear combination of any other row or column, CxGenLinEqs solves for the unique solution x.

Two possibilities exist in the case of rectangular matrices. If the number of rows is greater than the number of columns, the system has more equations than unknowns and is an overdetermined system. Because the solution that satisfies the previous equation might not exist, this procedure finds the least square solution x, which minimizes ||Ax - y||2. If the number of rows is less than the number of columns, the system has more unknowns than equations and is an underdetermined system. It might have infinite solutions that satisfy the previous equation. This procedure calculates the minimum 2-norm solution.

If the input matrix is rank-deficient, CxGenLinEqs returns a warning.

The matrixType parameter specifies the type of the input matrix. The input matrix can be an upper or lower triangular matrix, a general matrix, or a positive definite matrix.

## Parameters

Input
Name | Type | Description
inputArray | numeric array | Input complex matrix. The matrix can be square or rectangular. 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 | integer | Number of rows in inputArray.
numberOfColumns | integer | Number of columns in inputArray.
rightHandSide | ComplexNum array | Complex array that contains the set of known vector coefficients. The following C typedef statement defines the ComplexNum structure: typedef struct { double real; double imaginary; } ComplexNum;
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
outputVector | ComplexNum array | Solution to the linear system of equations. 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.