~ubuntu-branches/ubuntu/utopic/nwchem/utopic

« back to all changes in this revision

Viewing changes to src/lapack/double/dorglq.f

  • Committer: Package Import Robot
  • Author(s): Michael Banck, Daniel Leidert, Andreas Tille, Michael Banck
  • Date: 2013-07-04 12:14:55 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20130704121455-5tvsx2qabor3nrui
Tags: 6.3-1
* New upstream release.
* Fixes anisotropic properties (Closes: #696361).
* New features include:
  + Multi-reference coupled cluster (MRCC) approaches
  + Hybrid DFT calculations with short-range HF 
  + New density-functionals including Minnesota (M08, M11) and HSE hybrid
    functionals
  + X-ray absorption spectroscopy (XAS) with TDDFT
  + Analytical gradients for the COSMO solvation model
  + Transition densities from TDDFT 
  + DFT+U and Electron-Transfer (ET) methods for plane wave calculations
  + Exploitation of space group symmetry in plane wave geometry optimizations
  + Local density of states (LDOS) collective variable added to Metadynamics
  + Various new XC functionals added for plane wave calculations, including
    hybrid and range-corrected ones
  + Electric field gradients with relativistic corrections 
  + Nudged Elastic Band optimization method
  + Updated basis sets and ECPs 

[ Daniel Leidert ]
* debian/watch: Fixed.

[ Andreas Tille ]
* debian/upstream: References

[ Michael Banck ]
* debian/upstream (Name): New field.
* debian/patches/02_makefile_flags.patch: Refreshed.
* debian/patches/06_statfs_kfreebsd.patch: Likewise.
* debian/patches/07_ga_target_force_linux.patch: Likewise.
* debian/patches/05_avoid_inline_assembler.patch: Removed, no longer needed.
* debian/patches/09_backported_6.1.1_fixes.patch: Likewise.
* debian/control (Build-Depends): Added gfortran-4.7 and gcc-4.7.
* debian/patches/10_force_gcc-4.7.patch: New patch, explicitly sets
  gfortran-4.7 and gcc-4.7, fixes test suite hang with gcc-4.8 (Closes:
  #701328, #713262).
* debian/testsuite: Added tests for COSMO analytical gradients and MRCC.
* debian/rules (MRCC_METHODS): New variable, required to enable MRCC methods.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
*> \brief \b DORGLQ
 
2
*
 
3
*  =========== DOCUMENTATION ===========
 
4
*
 
5
* Online html documentation available at 
 
6
*            http://www.netlib.org/lapack/explore-html/ 
 
7
*
 
8
*> \htmlonly
 
9
*> Download DORGLQ + dependencies 
 
10
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dorglq.f"> 
 
11
*> [TGZ]</a> 
 
12
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dorglq.f"> 
 
13
*> [ZIP]</a> 
 
14
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dorglq.f"> 
 
15
*> [TXT]</a>
 
16
*> \endhtmlonly 
 
17
*
 
18
*  Definition:
 
19
*  ===========
 
20
*
 
21
*       SUBROUTINE DORGLQ( M, N, K, A, LDA, TAU, WORK, LWORK, INFO )
 
22
 
23
*       .. Scalar Arguments ..
 
24
*       INTEGER            INFO, K, LDA, LWORK, M, N
 
25
*       ..
 
26
*       .. Array Arguments ..
 
27
*       DOUBLE PRECISION   A( LDA, * ), TAU( * ), WORK( * )
 
28
*       ..
 
29
*  
 
30
*
 
31
*> \par Purpose:
 
32
*  =============
 
33
*>
 
34
*> \verbatim
 
35
*>
 
36
*> DORGLQ generates an M-by-N real matrix Q with orthonormal rows,
 
37
*> which is defined as the first M rows of a product of K elementary
 
38
*> reflectors of order N
 
39
*>
 
40
*>       Q  =  H(k) . . . H(2) H(1)
 
41
*>
 
42
*> as returned by DGELQF.
 
43
*> \endverbatim
 
44
*
 
45
*  Arguments:
 
46
*  ==========
 
47
*
 
48
*> \param[in] M
 
49
*> \verbatim
 
50
*>          M is INTEGER
 
51
*>          The number of rows of the matrix Q. M >= 0.
 
52
*> \endverbatim
 
53
*>
 
54
*> \param[in] N
 
55
*> \verbatim
 
56
*>          N is INTEGER
 
57
*>          The number of columns of the matrix Q. N >= M.
 
58
*> \endverbatim
 
59
*>
 
60
*> \param[in] K
 
61
*> \verbatim
 
62
*>          K is INTEGER
 
63
*>          The number of elementary reflectors whose product defines the
 
64
*>          matrix Q. M >= K >= 0.
 
65
*> \endverbatim
 
66
*>
 
67
*> \param[in,out] A
 
68
*> \verbatim
 
69
*>          A is DOUBLE PRECISION array, dimension (LDA,N)
 
70
*>          On entry, the i-th row must contain the vector which defines
 
71
*>          the elementary reflector H(i), for i = 1,2,...,k, as returned
 
72
*>          by DGELQF in the first k rows of its array argument A.
 
73
*>          On exit, the M-by-N matrix Q.
 
74
*> \endverbatim
 
75
*>
 
76
*> \param[in] LDA
 
77
*> \verbatim
 
78
*>          LDA is INTEGER
 
79
*>          The first dimension of the array A. LDA >= max(1,M).
 
80
*> \endverbatim
 
81
*>
 
82
*> \param[in] TAU
 
83
*> \verbatim
 
84
*>          TAU is DOUBLE PRECISION array, dimension (K)
 
85
*>          TAU(i) must contain the scalar factor of the elementary
 
86
*>          reflector H(i), as returned by DGELQF.
 
87
*> \endverbatim
 
88
*>
 
89
*> \param[out] WORK
 
90
*> \verbatim
 
91
*>          WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK))
 
92
*>          On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
 
93
*> \endverbatim
 
94
*>
 
95
*> \param[in] LWORK
 
96
*> \verbatim
 
97
*>          LWORK is INTEGER
 
98
*>          The dimension of the array WORK. LWORK >= max(1,M).
 
99
*>          For optimum performance LWORK >= M*NB, where NB is
 
100
*>          the optimal blocksize.
 
101
*>
 
102
*>          If LWORK = -1, then a workspace query is assumed; the routine
 
103
*>          only calculates the optimal size of the WORK array, returns
 
104
*>          this value as the first entry of the WORK array, and no error
 
105
*>          message related to LWORK is issued by XERBLA.
 
106
*> \endverbatim
 
107
*>
 
108
*> \param[out] INFO
 
109
*> \verbatim
 
110
*>          INFO is INTEGER
 
111
*>          = 0:  successful exit
 
112
*>          < 0:  if INFO = -i, the i-th argument has an illegal value
 
113
*> \endverbatim
 
114
*
 
115
*  Authors:
 
116
*  ========
 
117
*
 
118
*> \author Univ. of Tennessee 
 
119
*> \author Univ. of California Berkeley 
 
120
*> \author Univ. of Colorado Denver 
 
121
*> \author NAG Ltd. 
 
122
*
 
123
*> \date November 2011
 
124
*
 
125
*> \ingroup doubleOTHERcomputational
 
126
*
 
127
*  =====================================================================
1
128
      SUBROUTINE DORGLQ( M, N, K, A, LDA, TAU, WORK, LWORK, INFO )
2
129
*
3
 
*  -- LAPACK routine (version 2.0) --
4
 
*     Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
5
 
*     Courant Institute, Argonne National Lab, and Rice University
6
 
*     September 30, 1994
 
130
*  -- LAPACK computational routine (version 3.4.0) --
 
131
*  -- LAPACK is a software package provided by Univ. of Tennessee,    --
 
132
*  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
 
133
*     November 2011
7
134
*
8
135
*     .. Scalar Arguments ..
9
136
      INTEGER            INFO, K, LDA, LWORK, M, N
10
137
*     ..
11
138
*     .. Array Arguments ..
12
 
      DOUBLE PRECISION   A( LDA, * ), TAU( * ), WORK( LWORK )
 
139
      DOUBLE PRECISION   A( LDA, * ), TAU( * ), WORK( * )
13
140
*     ..
14
141
*
15
 
c
16
 
* $Id: dorglq.f 19697 2010-10-29 16:57:34Z d3y133 $
17
 
c
18
 
*  Purpose
19
 
*  =======
20
 
*
21
 
*  DORGLQ generates an M-by-N real matrix Q with orthonormal rows,
22
 
*  which is defined as the first M rows of a product of K elementary
23
 
*  reflectors of order N
24
 
*
25
 
*        Q  =  H(k) . . . H(2) H(1)
26
 
*
27
 
*  as returned by DGELQF.
28
 
*
29
 
*  Arguments
30
 
*  =========
31
 
*
32
 
*  M       (input) INTEGER
33
 
*          The number of rows of the matrix Q. M >= 0.
34
 
*
35
 
*  N       (input) INTEGER
36
 
*          The number of columns of the matrix Q. N >= M.
37
 
*
38
 
*  K       (input) INTEGER
39
 
*          The number of elementary reflectors whose product defines the
40
 
*          matrix Q. M >= K >= 0.
41
 
*
42
 
*  A       (input/output) DOUBLE PRECISION array, dimension (LDA,N)
43
 
*          On entry, the i-th row must contain the vector which defines
44
 
*          the elementary reflector H(i), for i = 1,2,...,k, as returned
45
 
*          by DGELQF in the first k rows of its array argument A.
46
 
*          On exit, the M-by-N matrix Q.
47
 
*
48
 
*  LDA     (input) INTEGER
49
 
*          The first dimension of the array A. LDA >= max(1,M).
50
 
*
51
 
*  TAU     (input) DOUBLE PRECISION array, dimension (K)
52
 
*          TAU(i) must contain the scalar factor of the elementary
53
 
*          reflector H(i), as returned by DGELQF.
54
 
*
55
 
*  WORK    (workspace/output) DOUBLE PRECISION array, dimension (LWORK)
56
 
*          On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
57
 
*
58
 
*  LWORK   (input) INTEGER
59
 
*          The dimension of the array WORK. LWORK >= max(1,M).
60
 
*          For optimum performance LWORK >= M*NB, where NB is
61
 
*          the optimal blocksize.
62
 
*
63
 
*  INFO    (output) INTEGER
64
 
*          = 0:  successful exit
65
 
*          < 0:  if INFO = -i, the i-th argument has an illegal value
66
 
*
67
142
*  =====================================================================
68
143
*
69
144
*     .. Parameters ..
71
146
      PARAMETER          ( ZERO = 0.0D+0 )
72
147
*     ..
73
148
*     .. Local Scalars ..
74
 
      INTEGER            I, IB, IINFO, IWS, J, KI, KK, L, LDWORK, NB,
75
 
     $                   NBMIN, NX
 
149
      LOGICAL            LQUERY
 
150
      INTEGER            I, IB, IINFO, IWS, J, KI, KK, L, LDWORK,
 
151
     $                   LWKOPT, NB, NBMIN, NX
76
152
*     ..
77
153
*     .. External Subroutines ..
78
154
      EXTERNAL           DLARFB, DLARFT, DORGL2, XERBLA
89
165
*     Test the input arguments
90
166
*
91
167
      INFO = 0
 
168
      NB = ILAENV( 1, 'DORGLQ', ' ', M, N, K, -1 )
 
169
      LWKOPT = MAX( 1, M )*NB
 
170
      WORK( 1 ) = LWKOPT
 
171
      LQUERY = ( LWORK.EQ.-1 )
92
172
      IF( M.LT.0 ) THEN
93
173
         INFO = -1
94
174
      ELSE IF( N.LT.M ) THEN
97
177
         INFO = -3
98
178
      ELSE IF( LDA.LT.MAX( 1, M ) ) THEN
99
179
         INFO = -5
100
 
      ELSE IF( LWORK.LT.MAX( 1, M ) ) THEN
 
180
      ELSE IF( LWORK.LT.MAX( 1, M ) .AND. .NOT.LQUERY ) THEN
101
181
         INFO = -8
102
182
      END IF
103
183
      IF( INFO.NE.0 ) THEN
104
184
         CALL XERBLA( 'DORGLQ', -INFO )
105
185
         RETURN
 
186
      ELSE IF( LQUERY ) THEN
 
187
         RETURN
106
188
      END IF
107
189
*
108
190
*     Quick return if possible
112
194
         RETURN
113
195
      END IF
114
196
*
115
 
*     Determine the block size.
116
 
*
117
 
      NB = ILAENV( 1, 'DORGLQ', ' ', M, N, K, -1 )
118
197
      NBMIN = 2
119
198
      NX = 0
120
199
      IWS = M
140
219
         END IF
141
220
      END IF
142
221
*
143
 
*  The following line is to take care of compiler warnings.
144
 
*
145
 
      KI = 1
146
222
      IF( NB.GE.NBMIN .AND. NB.LT.K .AND. NX.LT.K ) THEN
147
223
*
148
224
*        Use blocked code after the last block.
182
258
               CALL DLARFT( 'Forward', 'Rowwise', N-I+1, IB, A( I, I ),
183
259
     $                      LDA, TAU( I ), WORK, LDWORK )
184
260
*
185
 
*              Apply H' to A(i+ib:m,i:n) from the right
 
261
*              Apply H**T to A(i+ib:m,i:n) from the right
186
262
*
187
263
               CALL DLARFB( 'Right', 'Transpose', 'Forward', 'Rowwise',
188
264
     $                      M-I-IB+1, N-I+1, IB, A( I, I ), LDA, WORK,
190
266
     $                      LDWORK )
191
267
            END IF
192
268
*
193
 
*           Apply H' to columns i:n of current block
 
269
*           Apply H**T to columns i:n of current block
194
270
*
195
271
            CALL DORGL2( IB, N-I+1, IB, A( I, I ), LDA, TAU( I ), WORK,
196
272
     $                   IINFO )