Previous Next Contents Generated Index Doc Set Home



QL Factorization of a General Matrix

The subroutines described in this section compute a QL factorization of a general matrix A.

Calling Sequence

CALL DGEQLF 
(M, N, DA, LDA, DTAU, DWORK, LDWORK, INFO)
CALL SGEQLF 
(M, N, SA, LDA, STAU, SWORK, LDWORK, INFO)
CALL ZGEQLF 
(M, N, ZA, LDA, ZTAU, ZWORK, LDWORK, INFO)
CALL CGEQLF 
(M, N, CA, LDA, CTAU, CWORK, LDWORK, INFO)






void dgeqlf 
(int m, int n, double *da, int lda, double *dtau, int 
*info)
void sgeqlf 
(int m, int n, float *sa, int lda, float *stau, int 
*info)
void zgeqlf 
(int m, int n, doublecomplex *za, int lda, 
doublecomplex *ztau, int *info)
void cgeqlf 
(int m, int n, complex *ca, int lda, complex *ctau, int 
*info)

Arguments

M

Number of rows of the matrix A. M 0.

N

Number of columns of the matrix A. N 0.

xA

On entry, the matrix A.
On exit, A and TAU contain a QL factorization of the matrix A.

LDA

Leading dimension of the array A as specified in a dimension or type statement. LDA max(1, M).

xTAU

On exit, the min(M, N) scalar factors of the elementary reflectors. The elementary reflectors in xTAU together with xA contain a QL factorization of the matrix A that can be used by other LAPACK subroutines that operate on the matrix A.

xWORK

Scratch array with a dimension of LDWORK.

LDWORK

Leading dimension of the array WORK as specified in a dimension or type statement. LDWORK max(1, N).

INFO

On exit:

INFO = 0

Subroutine completed normally.

INFO < 0

The ith argument, where i = |INFO|, had an illegal value.

Sample Program




      PROGRAM TEST
      IMPLICIT NONE
C
      INTEGER           LDA, LDL, LDWORK, M, N
      PARAMETER        (M = 4)
      PARAMETER        (N = 3)
      PARAMETER        (LDA = M)
      PARAMETER        (LDL = N)
      PARAMETER        (LDWORK = N)
C
      DOUBLE PRECISION  A(LDA,N), L(LDL,N), TAU(N), WORK(LDWORK)
      INTEGER           ICOL, INFO, IROW
C
      EXTERNAL          DCOPY, DGEQLF, DORGQL
      INTRINSIC         ABS
C
C     Initialize the array A to store the matrix A shown below.
C
C         1   2   2
C     A = 1   0  -2
C         1   0   2
C         1  -2  -2
C
      DATA A / 1.0D0,  1.0D0, 1.0D0,  1.0D0,
     $         2.0D0,  0.0D0, 0.0D0, -2.0D0,
     $         2.0D0, -2.0D0, 2.0D0, -2.0D0 /
C
C     Print the initial value of A.
C
      PRINT 1000
      PRINT 1010, ((A(IROW,ICOL), ICOL = 1, N), IROW = 1, M)
C
C     Compute the QL factorization of A.
C
      CALL DGEQLF (M, N, A, LDA, TAU, WORK, LDWORK, INFO)
      IF (INFO .NE. 0) THEN
        PRINT 1020, ABS(INFO)
        STOP 1
      END IF
      DO 100, ICOL = 1, N
        CALL DCOPY (N, A(M-N+1,ICOL), 1, L(1,ICOL), 1)
  100 CONTINUE
C
C     Compute and print the matrix Q used in the QL factorization
C     of A.
C
      CALL DORGQL (M, N, N, A, LDA, TAU, WORK, LDWORK, INFO)
      IF (INFO .NE. 0) THEN
        PRINT 1030, ABS(INFO)
        STOP 2
      END IF
      PRINT 1040
      PRINT 1010, ((A(IROW,ICOL), ICOL = 1, N), IROW = 1, M)
      PRINT 1050
      DO 110, IROW = 1, N
        PRINT 1010, (L(IROW,ICOL), ICOL = 1, IROW),
     $              (0.0D0, ICOL = IROW + 1, N)
  110 CONTINUE
C
 1000 FORMAT (1X, 'A:')
 1010 FORMAT (3(3X, F8.4))
 1020 FORMAT (1X, 'Illegal value for argument #', I1,
     $        ' in DGEQLF.')
 1030 FORMAT (1X, 'Illegal value for argument #', I1,
     $        ' in DORGQL.')
 1040 FORMAT (/1X, 'Q:')
 1050 FORMAT (/1X, 'L:')
C
      END
 

Sample Output

 
 A:
     1.0000     2.0000     2.0000
     1.0000     0.0000    -2.0000
     1.0000     0.0000     2.0000
     1.0000    -2.0000    -2.0000



 Q:
    -0.5000     0.5000     0.5000
    -0.5000     0.5000    -0.5000
    -0.5000    -0.5000     0.5000
    -0.5000    -0.5000    -0.5000



 L:
    -2.0000     0.0000     0.0000
     0.0000     2.0000     0.0000
     0.0000     2.0000     4.0000






Previous Next Contents Generated Index Doc Set Home