BUG: fix QRMatrix (#1261, #1240)
QRMatrix (i.e. QR decomposition, QR factorisation or orthogonal-triangular decomposition) decomposes a scalar/complex matrix \c A into the following matrix product: \verbatim A = Q*R, \endverbatim where \c Q is a unitary similarity matrix, \c R is an upper triangular matrix. Usage Input types: - \c A can be a \c SquareMatrix<Type> or \c RectangularMatrix<Type> Output types: - \c Q is always of the type of the matrix \c A - \c R is always of the type of the matrix \c A Options for the output forms of \c QRMatrix (for an (m-by-n) input matrix \c A with k = min(m, n)): - outputTypes::FULL_R: computes only \c R (m-by-n) - outputTypes::FULL_QR: computes both \c R and \c Q (m-by-m) - outputTypes::REDUCED_R: computes only reduced \c R (k-by-n) Options where to store \c R: - storeMethods::IN_PLACE: replaces input matrix content with \c R - storeMethods::OUT_OF_PLACE: creates new object of \c R Options for the computation of column pivoting: - colPivoting::FALSE: switches off column pivoting - colPivoting::TRUE: switches on column pivoting Direct solution of linear systems A x = b is possible by solve() alongside the following limitations: - \c A = a scalar square matrix - output type = outputTypes::FULL_QR - store method = storeMethods::IN_PLACE Notes - QR decomposition is not unique if \c R is not positive diagonal \c R. - The option combination: - outputTypes::REDUCED_R - storeMethods::IN_PLACE will not modify the rows of input matrix \c A after its nth row. - Both FULL_R and REDUCED_R QR decompositions execute the same number of operations. Yet REDUCED_R QR decomposition returns only the first n rows of \c R if m > n for an input m-by-n matrix \c A. - For m <= n, FULL_R and REDUCED_R will produce the same matrices
Showing
- applications/test/QRMatrix/Make/files 3 additions, 0 deletionsapplications/test/QRMatrix/Make/files
- applications/test/QRMatrix/Make/options 2 additions, 0 deletionsapplications/test/QRMatrix/Make/options
- applications/test/QRMatrix/Test-QRMatrix.C 1484 additions, 0 deletionsapplications/test/QRMatrix/Test-QRMatrix.C
- src/OpenFOAM/matrices/QRMatrix/QRMatrix.C 409 additions, 105 deletionssrc/OpenFOAM/matrices/QRMatrix/QRMatrix.C
- src/OpenFOAM/matrices/QRMatrix/QRMatrix.H 276 additions, 20 deletionssrc/OpenFOAM/matrices/QRMatrix/QRMatrix.H
- src/OpenFOAM/matrices/QRMatrix/QRMatrixI.H 145 additions, 7 deletionssrc/OpenFOAM/matrices/QRMatrix/QRMatrixI.H
Please register or sign in to comment