GenLinEqs
Advanced Analysis Library Only
AnalysisLibErrType GenLinEqs (void *inputArray, ssize_t numberOfRows, ssize_t numberOfColumns, double rightHandSide[], int matrixType, double outputArray[]);
Purpose
![]() |
Note This function has been superseded by SolveEqs. |
Solves for the unknown vector x in the linear system of equations:
Ax = y
where | inputArray is the real input matrix |
rightHandSide 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.
GenLinEqs 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, GenLinEqs 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, GenLinEqs 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 | void * | Input matrix. The matrix can be square or rectangular.This matrix must be an array of doubles. |
numberOfRows | ssize_t | The number of rows in inputArray. |
numberOfColumns | ssize_t | The number of columns in inputArray. |
rightHandSide | double [] | Complex array that contains the set of known vector coefficients. |
matrixType | int | The type of matrix inputArray. The following list shows valid matrix type values.
|
Output | ||
Name | Type | Description |
outputArray | double [] | Solution to the linear system of equations. |
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