QR decomposition
In linear algebra, a QR decomposition, also known as a QR factorization or QU factorization, is a decomposition of a matrix A into a product A = QR of an orthonormal matrix Q and an upper triangular matrix R. QR decomposition is often used to solve the linear least squares (LLS) problem and is the basis for a particular eigenvalue algorithm, the QR algorithm. == Cases and definitions == === Square matrix === Any real square matrix A may be decomposed as A = Q R , {\displaystyle A=QR,} where Q is an orthogonal matrix (its columns are orthogonal unit vectors meaning Q T = Q − 1 {\displaystyle Q^{\textsf {T}}=Q^{-1}} ) and R is an upper triangular matrix (also called right triangular matrix).