qr#

swordfish.function.qr()#

Perform the QR decomposition of a matrix. Decompose a matrix A into an orthogonal matrix Q and an upper triangular matrix R, with A=Q*R.

Given an m-by-n matrix A:

  • If mode=”full”, return 2 matrices: Q (m-by-m) and R (m-by-n).

  • If mode=”economic”, return 2 matrices: Q (m-by-k) and R (k-by-n) with k=min(m,n).

  • If mode=”r”, only return matrix R (m-by-n).

If pivoting= true, also return a vector P which has the same length as the number of columns of the matrix. P is the pivoting for rank-revealing QR decomposition indicating the location of 1s in the permutation matrix.

Parameters:
  • obj (Constant) – A matrix.

  • mode (Constant, optional) – A string indicating what information is to be returned. It can be “full”, “economic” or “r”. The default value is “full”.

  • pivoting (Constant, optional) – A Boolean value. The default value is false.