computes a QR factorization using Householder transformations.
This function uses Householder transformations with optional column pivoting to compute a QR factorization of the M by N matrix A. That is, QRFAC determines an orthogonal matrix Q, a permutation matrix P, and an upper trapezoidal matrix R with diagonal elements of nonincreasing magnitude, such that AP = QR.
The Householder transformation for column K, K = 1,2,...,min(M,N), is of the form:
I - ( 1 / U(K) ) * U * U'
where U has zeros in the first K-1 positions.
The form of this transformation and the method of pivoting first appeared in the corresponding LINPACK routine.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer | :: | m |
In - number of rows of A. |
|||
| integer | :: | n |
In - number of columns of A. |
|||
| real(kind=dp) | :: | a(lda,n) |
In/Out - before/after QR factosiation size should be the M by N array. On input, A contains the matrix for which the QR factorization is to be computed. On output, the strict upper trapezoidal part of A contains the strict upper trapezoidal part of R, and the lower trapezoidal part of A contains a factored form of Q, the non-trivial elements of the U vectors described above. |
|||
| integer | :: | lda |
In - leading dimension of A, which must be no less than M. |
|||
| logical | :: | pivot |
Out - is TRUE if column pivoting is to be carried out |
|||
| integer | :: | ipvt(lipvt) |
Out - defines the permutation matrix P such that AP = QR. Column J of P is column IPVT(J) of the identity matrix. If PIVOT is false, IPVT is not referenced. |
|||
| integer | :: | lipvt |
In - dimension of IPVT, which should be N if pivoting is used. |
|||
| real(kind=dp) | :: | rdiag(n) |
Out - contains the diagonal elements of R. |
|||
| real(kind=dp) | :: | acnorm(n) |