~ubuntu-branches/ubuntu/trusty/nwchem/trusty-proposed

« back to all changes in this revision

Viewing changes to src/blas/double/dsyr.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
 
      SUBROUTINE DSYR  ( UPLO, N, ALPHA, X, INCX, A, LDA )
 
1
*> \brief \b DSYR
 
2
*
 
3
*  =========== DOCUMENTATION ===========
 
4
*
 
5
* Online html documentation available at 
 
6
*            http://www.netlib.org/lapack/explore-html/ 
 
7
*
 
8
*  Definition:
 
9
*  ===========
 
10
*
 
11
*       SUBROUTINE DSYR(UPLO,N,ALPHA,X,INCX,A,LDA)
 
12
 
13
*       .. Scalar Arguments ..
 
14
*       DOUBLE PRECISION ALPHA
 
15
*       INTEGER INCX,LDA,N
 
16
*       CHARACTER UPLO
 
17
*       ..
 
18
*       .. Array Arguments ..
 
19
*       DOUBLE PRECISION A(LDA,*),X(*)
 
20
*       ..
 
21
*  
 
22
*
 
23
*> \par Purpose:
 
24
*  =============
 
25
*>
 
26
*> \verbatim
 
27
*>
 
28
*> DSYR   performs the symmetric rank 1 operation
 
29
*>
 
30
*>    A := alpha*x*x**T + A,
 
31
*>
 
32
*> where alpha is a real scalar, x is an n element vector and A is an
 
33
*> n by n symmetric matrix.
 
34
*> \endverbatim
 
35
*
 
36
*  Arguments:
 
37
*  ==========
 
38
*
 
39
*> \param[in] UPLO
 
40
*> \verbatim
 
41
*>          UPLO is CHARACTER*1
 
42
*>           On entry, UPLO specifies whether the upper or lower
 
43
*>           triangular part of the array A is to be referenced as
 
44
*>           follows:
 
45
*>
 
46
*>              UPLO = 'U' or 'u'   Only the upper triangular part of A
 
47
*>                                  is to be referenced.
 
48
*>
 
49
*>              UPLO = 'L' or 'l'   Only the lower triangular part of A
 
50
*>                                  is to be referenced.
 
51
*> \endverbatim
 
52
*>
 
53
*> \param[in] N
 
54
*> \verbatim
 
55
*>          N is INTEGER
 
56
*>           On entry, N specifies the order of the matrix A.
 
57
*>           N must be at least zero.
 
58
*> \endverbatim
 
59
*>
 
60
*> \param[in] ALPHA
 
61
*> \verbatim
 
62
*>          ALPHA is DOUBLE PRECISION.
 
63
*>           On entry, ALPHA specifies the scalar alpha.
 
64
*> \endverbatim
 
65
*>
 
66
*> \param[in] X
 
67
*> \verbatim
 
68
*>          X is DOUBLE PRECISION array of dimension at least
 
69
*>           ( 1 + ( n - 1 )*abs( INCX ) ).
 
70
*>           Before entry, the incremented array X must contain the n
 
71
*>           element vector x.
 
72
*> \endverbatim
 
73
*>
 
74
*> \param[in] INCX
 
75
*> \verbatim
 
76
*>          INCX is INTEGER
 
77
*>           On entry, INCX specifies the increment for the elements of
 
78
*>           X. INCX must not be zero.
 
79
*> \endverbatim
 
80
*>
 
81
*> \param[in,out] A
 
82
*> \verbatim
 
83
*>          A is DOUBLE PRECISION array of DIMENSION ( LDA, n ).
 
84
*>           Before entry with  UPLO = 'U' or 'u', the leading n by n
 
85
*>           upper triangular part of the array A must contain the upper
 
86
*>           triangular part of the symmetric matrix and the strictly
 
87
*>           lower triangular part of A is not referenced. On exit, the
 
88
*>           upper triangular part of the array A is overwritten by the
 
89
*>           upper triangular part of the updated matrix.
 
90
*>           Before entry with UPLO = 'L' or 'l', the leading n by n
 
91
*>           lower triangular part of the array A must contain the lower
 
92
*>           triangular part of the symmetric matrix and the strictly
 
93
*>           upper triangular part of A is not referenced. On exit, the
 
94
*>           lower triangular part of the array A is overwritten by the
 
95
*>           lower triangular part of the updated matrix.
 
96
*> \endverbatim
 
97
*>
 
98
*> \param[in] LDA
 
99
*> \verbatim
 
100
*>          LDA is INTEGER
 
101
*>           On entry, LDA specifies the first dimension of A as declared
 
102
*>           in the calling (sub) program. LDA must be at least
 
103
*>           max( 1, n ).
 
104
*> \endverbatim
 
105
*
 
106
*  Authors:
 
107
*  ========
 
108
*
 
109
*> \author Univ. of Tennessee 
 
110
*> \author Univ. of California Berkeley 
 
111
*> \author Univ. of Colorado Denver 
 
112
*> \author NAG Ltd. 
 
113
*
 
114
*> \date November 2011
 
115
*
 
116
*> \ingroup double_blas_level2
 
117
*
 
118
*> \par Further Details:
 
119
*  =====================
 
120
*>
 
121
*> \verbatim
 
122
*>
 
123
*>  Level 2 Blas routine.
 
124
*>
 
125
*>  -- Written on 22-October-1986.
 
126
*>     Jack Dongarra, Argonne National Lab.
 
127
*>     Jeremy Du Croz, Nag Central Office.
 
128
*>     Sven Hammarling, Nag Central Office.
 
129
*>     Richard Hanson, Sandia National Labs.
 
130
*> \endverbatim
 
131
*>
 
132
*  =====================================================================
 
133
      SUBROUTINE DSYR(UPLO,N,ALPHA,X,INCX,A,LDA)
 
134
*
 
135
*  -- Reference BLAS level2 routine (version 3.4.0) --
 
136
*  -- Reference BLAS is a software package provided by Univ. of Tennessee,    --
 
137
*  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
 
138
*     November 2011
 
139
*
2
140
*     .. Scalar Arguments ..
3
 
C     $Id: dsyr.f 19695 2010-10-29 16:51:02Z d3y133 $
4
 
      DOUBLE PRECISION   ALPHA
5
 
      INTEGER            INCX, LDA, N
6
 
      CHARACTER*1        UPLO
 
141
      DOUBLE PRECISION ALPHA
 
142
      INTEGER INCX,LDA,N
 
143
      CHARACTER UPLO
 
144
*     ..
7
145
*     .. Array Arguments ..
8
 
      DOUBLE PRECISION   A( LDA, * ), X( * )
 
146
      DOUBLE PRECISION A(LDA,*),X(*)
9
147
*     ..
10
148
*
11
 
*  Purpose
12
 
*  =======
13
 
*
14
 
*  DSYR   performs the symmetric rank 1 operation
15
 
*
16
 
*     A := alpha*x*x' + A,
17
 
*
18
 
*  where alpha is a real scalar, x is an n element vector and A is an
19
 
*  n by n symmetric matrix.
20
 
*
21
 
*  Parameters
22
 
*  ==========
23
 
*
24
 
*  UPLO   - CHARACTER*1.
25
 
*           On entry, UPLO specifies whether the upper or lower
26
 
*           triangular part of the array A is to be referenced as
27
 
*           follows:
28
 
*
29
 
*              UPLO = 'U' or 'u'   Only the upper triangular part of A
30
 
*                                  is to be referenced.
31
 
*
32
 
*              UPLO = 'L' or 'l'   Only the lower triangular part of A
33
 
*                                  is to be referenced.
34
 
*
35
 
*           Unchanged on exit.
36
 
*
37
 
*  N      - INTEGER.
38
 
*           On entry, N specifies the order of the matrix A.
39
 
*           N must be at least zero.
40
 
*           Unchanged on exit.
41
 
*
42
 
*  ALPHA  - DOUBLE PRECISION.
43
 
*           On entry, ALPHA specifies the scalar alpha.
44
 
*           Unchanged on exit.
45
 
*
46
 
*  X      - DOUBLE PRECISION array of dimension at least
47
 
*           ( 1 + ( n - 1 )*abs( INCX ) ).
48
 
*           Before entry, the incremented array X must contain the n
49
 
*           element vector x.
50
 
*           Unchanged on exit.
51
 
*
52
 
*  INCX   - INTEGER.
53
 
*           On entry, INCX specifies the increment for the elements of
54
 
*           X. INCX must not be zero.
55
 
*           Unchanged on exit.
56
 
*
57
 
*  A      - DOUBLE PRECISION array of DIMENSION ( LDA, n ).
58
 
*           Before entry with  UPLO = 'U' or 'u', the leading n by n
59
 
*           upper triangular part of the array A must contain the upper
60
 
*           triangular part of the symmetric matrix and the strictly
61
 
*           lower triangular part of A is not referenced. On exit, the
62
 
*           upper triangular part of the array A is overwritten by the
63
 
*           upper triangular part of the updated matrix.
64
 
*           Before entry with UPLO = 'L' or 'l', the leading n by n
65
 
*           lower triangular part of the array A must contain the lower
66
 
*           triangular part of the symmetric matrix and the strictly
67
 
*           upper triangular part of A is not referenced. On exit, the
68
 
*           lower triangular part of the array A is overwritten by the
69
 
*           lower triangular part of the updated matrix.
70
 
*
71
 
*  LDA    - INTEGER.
72
 
*           On entry, LDA specifies the first dimension of A as declared
73
 
*           in the calling (sub) program. LDA must be at least
74
 
*           max( 1, n ).
75
 
*           Unchanged on exit.
76
 
*
77
 
*
78
 
*  Level 2 Blas routine.
79
 
*
80
 
*  -- Written on 22-October-1986.
81
 
*     Jack Dongarra, Argonne National Lab.
82
 
*     Jeremy Du Croz, Nag Central Office.
83
 
*     Sven Hammarling, Nag Central Office.
84
 
*     Richard Hanson, Sandia National Labs.
85
 
*
 
149
*  =====================================================================
86
150
*
87
151
*     .. Parameters ..
88
 
      DOUBLE PRECISION   ZERO
89
 
      PARAMETER        ( ZERO = 0.0D+0 )
 
152
      DOUBLE PRECISION ZERO
 
153
      PARAMETER (ZERO=0.0D+0)
 
154
*     ..
90
155
*     .. Local Scalars ..
91
 
      DOUBLE PRECISION   TEMP
92
 
      INTEGER            I, INFO, IX, J, JX, KX
 
156
      DOUBLE PRECISION TEMP
 
157
      INTEGER I,INFO,IX,J,JX,KX
 
158
*     ..
93
159
*     .. External Functions ..
94
 
      LOGICAL            LSAME
95
 
      EXTERNAL           LSAME
 
160
      LOGICAL LSAME
 
161
      EXTERNAL LSAME
 
162
*     ..
96
163
*     .. External Subroutines ..
97
 
      EXTERNAL           XERBLA
 
164
      EXTERNAL XERBLA
 
165
*     ..
98
166
*     .. Intrinsic Functions ..
99
 
      INTRINSIC          MAX
 
167
      INTRINSIC MAX
100
168
*     ..
101
 
*     .. Executable Statements ..
102
169
*
103
170
*     Test the input parameters.
104
171
*
105
172
      INFO = 0
106
 
      IF     ( .NOT.LSAME( UPLO, 'U' ).AND.
107
 
     $         .NOT.LSAME( UPLO, 'L' )      )THEN
108
 
         INFO = 1
109
 
      ELSE IF( N.LT.0 )THEN
110
 
         INFO = 2
111
 
      ELSE IF( INCX.EQ.0 )THEN
112
 
         INFO = 5
113
 
      ELSE IF( LDA.LT.MAX( 1, N ) )THEN
114
 
         INFO = 7
 
173
      IF (.NOT.LSAME(UPLO,'U') .AND. .NOT.LSAME(UPLO,'L')) THEN
 
174
          INFO = 1
 
175
      ELSE IF (N.LT.0) THEN
 
176
          INFO = 2
 
177
      ELSE IF (INCX.EQ.0) THEN
 
178
          INFO = 5
 
179
      ELSE IF (LDA.LT.MAX(1,N)) THEN
 
180
          INFO = 7
115
181
      END IF
116
 
      IF( INFO.NE.0 )THEN
117
 
         CALL XERBLA( 'DSYR  ', INFO )
118
 
         RETURN
 
182
      IF (INFO.NE.0) THEN
 
183
          CALL XERBLA('DSYR  ',INFO)
 
184
          RETURN
119
185
      END IF
120
186
*
121
187
*     Quick return if possible.
122
188
*
123
 
      IF( ( N.EQ.0 ).OR.( ALPHA.EQ.ZERO ) )
124
 
     $   RETURN
 
189
      IF ((N.EQ.0) .OR. (ALPHA.EQ.ZERO)) RETURN
125
190
*
126
191
*     Set the start point in X if the increment is not unity.
127
192
*
128
 
      IF( INCX.LE.0 )THEN
129
 
         KX = 1 - ( N - 1 )*INCX
130
 
      ELSE IF( INCX.NE.1 )THEN
131
 
         KX = 1
 
193
      IF (INCX.LE.0) THEN
 
194
          KX = 1 - (N-1)*INCX
 
195
      ELSE IF (INCX.NE.1) THEN
 
196
          KX = 1
132
197
      END IF
133
198
*
134
199
*     Start the operations. In this version the elements of A are
135
200
*     accessed sequentially with one pass through the triangular part
136
201
*     of A.
137
202
*
138
 
      IF( LSAME( UPLO, 'U' ) )THEN
 
203
      IF (LSAME(UPLO,'U')) THEN
139
204
*
140
205
*        Form  A  when A is stored in upper triangle.
141
206
*
142
 
         IF( INCX.EQ.1 )THEN
143
 
            DO 20, J = 1, N
144
 
               IF( X( J ).NE.ZERO )THEN
145
 
                  TEMP = ALPHA*X( J )
146
 
                  DO 10, I = 1, J
147
 
                     A( I, J ) = A( I, J ) + X( I )*TEMP
148
 
   10             CONTINUE
149
 
               END IF
150
 
   20       CONTINUE
151
 
         ELSE
152
 
            JX = KX
153
 
            DO 40, J = 1, N
154
 
               IF( X( JX ).NE.ZERO )THEN
155
 
                  TEMP = ALPHA*X( JX )
156
 
                  IX   = KX
157
 
                  DO 30, I = 1, J
158
 
                     A( I, J ) = A( I, J ) + X( IX )*TEMP
159
 
                     IX        = IX        + INCX
160
 
   30             CONTINUE
161
 
               END IF
162
 
               JX = JX + INCX
163
 
   40       CONTINUE
164
 
         END IF
 
207
          IF (INCX.EQ.1) THEN
 
208
              DO 20 J = 1,N
 
209
                  IF (X(J).NE.ZERO) THEN
 
210
                      TEMP = ALPHA*X(J)
 
211
                      DO 10 I = 1,J
 
212
                          A(I,J) = A(I,J) + X(I)*TEMP
 
213
   10                 CONTINUE
 
214
                  END IF
 
215
   20         CONTINUE
 
216
          ELSE
 
217
              JX = KX
 
218
              DO 40 J = 1,N
 
219
                  IF (X(JX).NE.ZERO) THEN
 
220
                      TEMP = ALPHA*X(JX)
 
221
                      IX = KX
 
222
                      DO 30 I = 1,J
 
223
                          A(I,J) = A(I,J) + X(IX)*TEMP
 
224
                          IX = IX + INCX
 
225
   30                 CONTINUE
 
226
                  END IF
 
227
                  JX = JX + INCX
 
228
   40         CONTINUE
 
229
          END IF
165
230
      ELSE
166
231
*
167
232
*        Form  A  when A is stored in lower triangle.
168
233
*
169
 
         IF( INCX.EQ.1 )THEN
170
 
            DO 60, J = 1, N
171
 
               IF( X( J ).NE.ZERO )THEN
172
 
                  TEMP = ALPHA*X( J )
173
 
                  DO 50, I = J, N
174
 
                     A( I, J ) = A( I, J ) + X( I )*TEMP
175
 
   50             CONTINUE
176
 
               END IF
177
 
   60       CONTINUE
178
 
         ELSE
179
 
            JX = KX
180
 
            DO 80, J = 1, N
181
 
               IF( X( JX ).NE.ZERO )THEN
182
 
                  TEMP = ALPHA*X( JX )
183
 
                  IX   = JX
184
 
                  DO 70, I = J, N
185
 
                     A( I, J ) = A( I, J ) + X( IX )*TEMP
186
 
                     IX        = IX        + INCX
187
 
   70             CONTINUE
188
 
               END IF
189
 
               JX = JX + INCX
190
 
   80       CONTINUE
191
 
         END IF
 
234
          IF (INCX.EQ.1) THEN
 
235
              DO 60 J = 1,N
 
236
                  IF (X(J).NE.ZERO) THEN
 
237
                      TEMP = ALPHA*X(J)
 
238
                      DO 50 I = J,N
 
239
                          A(I,J) = A(I,J) + X(I)*TEMP
 
240
   50                 CONTINUE
 
241
                  END IF
 
242
   60         CONTINUE
 
243
          ELSE
 
244
              JX = KX
 
245
              DO 80 J = 1,N
 
246
                  IF (X(JX).NE.ZERO) THEN
 
247
                      TEMP = ALPHA*X(JX)
 
248
                      IX = JX
 
249
                      DO 70 I = J,N
 
250
                          A(I,J) = A(I,J) + X(IX)*TEMP
 
251
                          IX = IX + INCX
 
252
   70                 CONTINUE
 
253
                  END IF
 
254
                  JX = JX + INCX
 
255
   80         CONTINUE
 
256
          END IF
192
257
      END IF
193
258
*
194
259
      RETURN