This subroutine computes the QR factorization of a real general matrix
A = QR
where:
A, tau, work | Subroutine |
Long-precision real | DGEQRF |
Fortran | CALL DGEQRF(m, n, a, lda, tau, work, lwork, info) |
C and C++ | dgeqrf (m, n, a, lda, tau, work, lwork, info); |
PL/I | CALL DGEQRF (m, n, a, lda, tau, work, lwork, info); |
Specified as: a fullword integer; m >= 0.
Specified as: a fullword integer; n >= 0.
Specified as: an lda by (at least) n array, containing numbers of the data type indicated in Table 119.
Specified as: a fullword integer; lda > 0 and lda >= m.
If lwork = 0, work is ignored.
If lwork <> 0, work is the work area used by this subroutine, where:
Specified as: an area of storage containing numbers of data type indicated in Table 119.
Specified as: a fullword integer; where:
lwork >= max(1, n)
The elements on and above the diagonal of the array contain the min(m, n) × n upper trapezoidal matrix R (R is upper triangular if m >= n). The elements below the diagonal with tau represent the orthogonal matrix Q as a product of min(m, n) elementary reflectors.
Returned as: an lda by (at least) n array, containing numbers of the data type indicated in Table 119.
Returned as: a one-dimensional array of (at least) length min(m, n), containing numbers of the data type indicated in Table 119.
If lwork <> 0 and lwork <> -1, its size is (at least) of length lwork.
If lwork = -1, its size is (at least) of length 1.
Returned as: an area of storage, where:
If lwork >= 1 or lwork = -1, then work1 is set to the optimal lwork value and contains numbers of the data type indicated in Table 119. Except for work1, the contents of work are overwritten on return.
Returned as: a fullword integer; info = 0.
Compute the QR factorization of a real general matrix A
A = QR
where:
where:
If m = 0 or n = 0, no computation is performed and the subroutine returns after doing some parameter checking.
See references [52,8,65,50,51].
lwork = 0 and unable to allocate work space.
None.
This example shows the QR factorization of a general matrix A of size 6 × 2.
M N A LDA TAU WORK LWORK INFO | | | | | | | | CALL DGEQRF ( 6 , 2 , A , 6 , TAU , WORK , 0 , INFO)
General matrix A of size 6 × 2:
* * | .000000 2.000000 | | 2.000000 -1.000000 | A = | 2.000000 -1.000000 | | .000000 1.500000 | | 2.000000 -1.000000 | | 2.000000 -1.000000 | * *
Output:
General matrix A of size 6 × 2.
* * | -4.000000 2.000000 | | .500000 2.500000 | A = | .500000 .285714 | | .000000 -.428571 | | .500000 .285714 | | .500000 .285714 | * *
Vector tau of length 2:
* * TAU = | 1.000000 1.400000 | * * INFO = 0
This example shows the QR factorization of a general matrix A of size 4x5.
M N A LDA TAU WORK LWORK INFO | | | | | | | | CALL DGEQRF ( 4 , 5 , A , 4 , TAU , WORK , 0 , INFO)
General matrix A of size 4 × 5:
* * | .500000 .500000 1.207107 .000000 1.707107 | A = | .500000 -1.500000 -.500000 2.414214 .707107 | | .500000 .500000 .207107 .000000 .292893 | | .500000 -1.500000 -.500000 -.414214 -.707107 | * *
Output:
General matrix A of size 4 × 5:
* * | -1.000000 1.000000 -.207107 -1.000000 -1.000000 | A = | .333333 2.000000 1.207107 -1.000000 1.000000 | | .333333 -.200000 .707107 .000000 1.000000 | | .333333 .400000 .071068 -2.000000 -1.000000 | * *
Vector tau of length 4:
* * TAU = | 1.500000 1.666667 1.989949 .000000 | * * INFO = 0