~ubuntu-branches/ubuntu/vivid/atlas/vivid

« back to all changes in this revision

Viewing changes to interfaces/lapack/F77/src/dgeqrf.f

  • Committer: Package Import Robot
  • Author(s): Sébastien Villemot
  • Date: 2013-06-11 15:58:16 UTC
  • mfrom: (1.1.3 upstream)
  • mto: (2.2.21 experimental)
  • mto: This revision was merged to the branch mainline in revision 26.
  • Revision ID: package-import@ubuntu.com-20130611155816-b72z8f621tuhbzn0
Tags: upstream-3.10.1
Import upstream version 3.10.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
      SUBROUTINE DGEQRF( M, N, A, LDA, TAU, WORK, LWORK, INFO )
 
2
*
 
3
*  -- LAPACK routine (version 3.2) --
 
4
*  -- LAPACK is a software package provided by Univ. of Tennessee,    --
 
5
*  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
 
6
*     November 2006
 
7
*
 
8
*  -- Modified by R. Clint Whaley for ATLAS Fortran77 LAPACK interface, 2009
 
9
*
 
10
*     .. Scalar Arguments ..
 
11
      INTEGER            INFO, LDA, LWORK, M, N
 
12
*     ..
 
13
*     .. Array Arguments ..
 
14
      DOUBLE PRECISION A( LDA, * ), TAU( * ), WORK( * )
 
15
*     ..
 
16
*
 
17
*  Purpose
 
18
*  =======
 
19
*
 
20
*  DGEQRF computes a QR factorization of a real M-by-N matrix A:
 
21
*  A = Q * R.
 
22
*
 
23
*  Arguments
 
24
*  =========
 
25
*
 
26
*  M       (input) INTEGER
 
27
*          The number of rows of the matrix A.  M >= 0.
 
28
*
 
29
*  N       (input) INTEGER
 
30
*          The number of columns of the matrix A.  N >= 0.
 
31
*
 
32
*  A       (input/output) COMPLEX*16 array, dimension (LDA,N)
 
33
*          On entry, the M-by-N matrix A.
 
34
*          On exit, the elements on and above the diagonal of the array
 
35
*          contain the min(M,N)-by-N upper trapezoidal matrix R (R is
 
36
*          upper triangular if m >= n); the elements below the diagonal,
 
37
*          with the array TAU, represent the orthogonal matrix Q as a
 
38
*          product of min(m,n) elementary reflectors (see Further
 
39
*          Details).
 
40
*
 
41
*  LDA     (input) INTEGER
 
42
*          The leading dimension of the array A.  LDA >= max(1,M).
 
43
*
 
44
*  TAU     (output) DOUBLE PRECISION array, dimension (min(M,N))
 
45
*          The scalar factors of the elementary reflectors (see Further
 
46
*          Details).
 
47
*
 
48
*  WORK    (workspace/output) DOUBLE PRECISION array, dimension (MAX(1,LWORK))
 
49
*          On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
 
50
*
 
51
*  LWORK   (input) INTEGER
 
52
*          The dimension of the array WORK.  LWORK >= max(1,N).
 
53
*          For optimum performance LWORK >= N*NB, where NB is
 
54
*          the optimal blocksize.
 
55
*
 
56
*          If LWORK = -1, then a workspace query is assumed; the routine
 
57
*          only calculates the optimal size of the WORK array, returns
 
58
*          this value as the first entry of the WORK array, and no error
 
59
*          message related to LWORK is issued by XERBLA.
 
60
*
 
61
*  INFO    (output) INTEGER
 
62
*          = 0:  successful exit
 
63
*          < 0:  if INFO = -i, the i-th argument had an illegal value
 
64
*
 
65
*  Further Details
 
66
*  ===============
 
67
*
 
68
*  The matrix Q is represented as a product of elementary reflectors
 
69
*
 
70
*     Q = H(1) H(2) . . . H(k), where k = min(m,n).
 
71
*
 
72
*  Each H(i) has the form
 
73
*
 
74
*     H(i) = I - tau * v * v**T
 
75
*
 
76
*  where tau is a real scalar, and v is a real vector with
 
77
*  v(1:i-1) = 0 and v(i) = 1; v(i+1:m) is stored on exit in A(i+1:m,i),
 
78
*  and tau in TAU(i).
 
79
*
 
80
*  =====================================================================
 
81
*
 
82
*     .. Local Scalars ..
 
83
      INTEGER            I, IB, IINFO, IWS, K, LDWORK, LWKOPT, NB,
 
84
     $                   NBMIN, NX
 
85
*     ..
 
86
*     .. External Subroutines ..
 
87
      EXTERNAL           XERBLA, ZGEQR2, ZLARFB, ZLARFT
 
88
*     ..
 
89
*     .. Intrinsic Functions ..
 
90
      INTRINSIC          MAX, MIN
 
91
*     ..
 
92
*     .. External Functions ..
 
93
      INTEGER            ILAENV
 
94
      EXTERNAL           ILAENV
 
95
*     ..
 
96
*     .. Executable Statements ..
 
97
*
 
98
*     Test the input arguments
 
99
*
 
100
      INFO = 0
 
101
      IF( M.LT.0 ) THEN
 
102
         INFO = -1
 
103
      ELSE IF( N.LT.0 ) THEN
 
104
         INFO = -2
 
105
      ELSE IF( LDA.LT.MAX( 1, M ) ) THEN
 
106
         INFO = -4
 
107
      END IF
 
108
      IF( INFO.NE.0 ) THEN
 
109
         CALL XERBLA( 'Dgeqrf', -INFO )
 
110
         RETURN
 
111
      END IF
 
112
*
 
113
*     Quick return if possible
 
114
*
 
115
      K = MIN( M, N )
 
116
      IF( K.EQ.0 ) THEN
 
117
         WORK( 1 ) = 1
 
118
         RETURN
 
119
      END IF
 
120
*
 
121
      CALL ATL_F77WRAP_DGEQRF(M, N, A, LDA, TAU, WORK, LWORK, INFO)
 
122
*
 
123
      RETURN
 
124
*
 
125
*     End of DGEQRF
 
126
*
 
127
      END