Admin Production ni-theme
Current Publication

CxQREx

LabWindows/CVI

CxQREx

Advanced Analysis Library Only

AnalysisLibErrType CxQREx (void *inputMatrix, ssize_t numberOfRows, ssize_t numberOfColumns, int pivot, int sizeOption, void *pivotInfo, void *qMatrix, void *rMatrix);

Purpose

Performs the QR factorization for a complex matrix. CxQREx factorizes matrix A as AP = QR, where P is a permutation matrix, Q is a unitary matrix, and R is an upper triangular matrix. If numberOfRows > numberOfColumns, sizeOption is ECONOMY_SIZE and rMatrix is NULL or inputMatrix. On output, the leading numberOfColumns rows in inputMatrix are the upper triangular matrix R.

National Instruments recommends you use this function instead of CxQR. CxQREx includes additional parameters, which make it more versatile than CxQR.

Parameters

Input
Name Type Description
inputMatrix void * The matrix to be factorized.
numberOfRows ssize_t The number of rows of inputMatrix.
numberOfColumns ssize_t The number of columns of inputMatrix.
pivot int Specifies how to pivot inputMatrix. pivot must be one of the following values:
  • NOT_PIVOT (0): Do not pivot inputMatrix. That is, factorize inputMatrix as inputMatrix = QR. In this case, pivotInfo is not referenced.
  • PIVOT_VECTOR (1): Pivot inputMatrix and record the pivoting information as a vector in pivotInfo. That is, factorize inputMatrix as AP = QR, where A is inputMatrix. The size of pivotInfo must be numberOfColumns.
  • PIVOT_MATRIX (2): Pivot inputMatrix and record the pivoting information as a matrix in pivotInfo. That is, factorize inputMatrix as AP = QR, where A is inputMatrix. The size of pivotInfo must be numberOfColumns * numberOfColumns.

With pivoting, inputMatrix is pivoted so that abs(diag(rMatrix)) are in descending order.
sizeOption int The size of Q and rMatrix. sizeOption must one of the following values:
  • FULL_SIZE (0): The size of Q is numberOfRows * numberOfRows, and the size of rMatrix is numberOfRows * numberOfColumns.
  • ECONOMY_SIZE (1): The size of Q is numberOfRows * min(numberOfRows, numberOfColumns), and the size of R is min(numberOfRows, numberOfColumns) * numberOfColumns.
Output
Name Type Description
pivotInfo void * The pivoting information if pivot is PIVOT_VECTOR or PIVOT_MATRIX.
  • If pivot = PIVOT_VECTOR, pivotInfo is a numberOfColumns element vector. The columns of AP are the columns of A in the following order: pivotInfo[0], pivotInfo[1], pivotInfo[2], . . . , pivotInfo[colA-1].
  • If pivot = PIVOT_MATRIX, pivotInfo is directly the permutation matrix P in AP = QR.
If pivot is NOT_PIVOT, you can pass NULL to pivotInfo.
qMatrix void * The unitary matrix Q. If Q = NULL, qMatrix is not generated.
rMatrix void * The upper triangular matrix R. rMatrix can be NULL. This function supports in place operation. That is, you can call the function with rMatrix = inputMatrix.

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 8.0 and later