Performs the QR decomposition of a matrix with the option of column pivoting.
An m-by-n matrix, where m is the number of rows in the matrix and n is the number of columns in the matrix.
This input accepts a 2D array of double-precision, floating point numbers or 2D array of complex double-precision, floating point numbers.
The matrix can be either a square or rectangular matrix.
A Boolean that specifies whether the node uses column pivoting to decompose the input matrix.
True | Uses column pivoting. The following equation decomposes the matrix A: A P = Q R. The node returns the absolute values of the diagonals of matrix R in descending order. |
False | Does not use column pivoting. The following equation decomposes the matrix A: A = Q R. |
Default: False
A value that specifies how the node generates the Q matrix.
This input must take one of the following values, where m is the number of rows in matrix A, and n is the number of columns in matrix A.
Name | Value | Description |
---|---|---|
Full Size Q | 0 | The size of matrix Q is m-by-m, and the size of matrix R is m-by-n. |
Economy Size Q | 1 | The size of matrix Q is m-by-min(m, n), and the size of matrix R is min(m, n)-by-n. |
No Q | 2 | The node does not generate matrix Q, and the size of matrix R is min(m, n)-by-n. |
Default: Full Size Q
Error conditions that occur before this node runs.
The node responds to this input according to standard error behavior.
Standard Error Behavior
Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.
Default: No error
The orthogonal matrix.
The upper triangular matrix.
The n-by-n permutation matrix, where n is the number of columns in the input matrix.
If pivot? is False, this output is an empty array.
Error information.
The node produces this output according to standard error behavior.
Standard Error Behavior
Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.
The following equation defines the QR decomposition:
where
You can use QR decomposition to calculate the determinant of a square matrix. For example, consider the following equation: det(A) = det(Q)*det(R). Because Q is orthogonal, the following is true: |det(Q)| = 1. Thus, the following also is true:
You can use QR decomposition to solve the least-squares problem of a linear system A x = b when A is full rank and m ≥ n. For example, consider the following system:
where the following are true:
Because min(||b - A x||_{2}) depends on min(||Q _{1} ^{ T } b - R _{1} x||_{2}), you can obtain the solution x by solving the following new linear system: R _{1} x = Q _{1} ^{ T } b.
Where This Node Can Run:
Desktop OS: Windows
FPGA: Not supported
Web Server: Not supported in VIs that run in a web application