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

« back to all changes in this revision

Viewing changes to src/lapack/double/zlassq.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 ZLASSQ updates a sum of squares represented in scaled form.
 
2
*
 
3
*  =========== DOCUMENTATION ===========
 
4
*
 
5
* Online html documentation available at 
 
6
*            http://www.netlib.org/lapack/explore-html/ 
 
7
*
 
8
*> \htmlonly
 
9
*> Download ZLASSQ + dependencies 
 
10
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zlassq.f"> 
 
11
*> [TGZ]</a> 
 
12
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zlassq.f"> 
 
13
*> [ZIP]</a> 
 
14
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zlassq.f"> 
 
15
*> [TXT]</a>
 
16
*> \endhtmlonly 
 
17
*
 
18
*  Definition:
 
19
*  ===========
 
20
*
 
21
*       SUBROUTINE ZLASSQ( N, X, INCX, SCALE, SUMSQ )
 
22
 
23
*       .. Scalar Arguments ..
 
24
*       INTEGER            INCX, N
 
25
*       DOUBLE PRECISION   SCALE, SUMSQ
 
26
*       ..
 
27
*       .. Array Arguments ..
 
28
*       COMPLEX*16         X( * )
 
29
*       ..
 
30
*  
 
31
*
 
32
*> \par Purpose:
 
33
*  =============
 
34
*>
 
35
*> \verbatim
 
36
*>
 
37
*> ZLASSQ returns the values scl and ssq such that
 
38
*>
 
39
*>    ( scl**2 )*ssq = x( 1 )**2 +...+ x( n )**2 + ( scale**2 )*sumsq,
 
40
*>
 
41
*> where x( i ) = abs( X( 1 + ( i - 1 )*INCX ) ). The value of sumsq is
 
42
*> assumed to be at least unity and the value of ssq will then satisfy
 
43
*>
 
44
*>    1.0 .le. ssq .le. ( sumsq + 2*n ).
 
45
*>
 
46
*> scale is assumed to be non-negative and scl returns the value
 
47
*>
 
48
*>    scl = max( scale, abs( real( x( i ) ) ), abs( aimag( x( i ) ) ) ),
 
49
*>           i
 
50
*>
 
51
*> scale and sumsq must be supplied in SCALE and SUMSQ respectively.
 
52
*> SCALE and SUMSQ are overwritten by scl and ssq respectively.
 
53
*>
 
54
*> The routine makes only one pass through the vector X.
 
55
*> \endverbatim
 
56
*
 
57
*  Arguments:
 
58
*  ==========
 
59
*
 
60
*> \param[in] N
 
61
*> \verbatim
 
62
*>          N is INTEGER
 
63
*>          The number of elements to be used from the vector X.
 
64
*> \endverbatim
 
65
*>
 
66
*> \param[in] X
 
67
*> \verbatim
 
68
*>          X is COMPLEX*16 array, dimension (N)
 
69
*>          The vector x as described above.
 
70
*>             x( i )  = X( 1 + ( i - 1 )*INCX ), 1 <= i <= n.
 
71
*> \endverbatim
 
72
*>
 
73
*> \param[in] INCX
 
74
*> \verbatim
 
75
*>          INCX is INTEGER
 
76
*>          The increment between successive values of the vector X.
 
77
*>          INCX > 0.
 
78
*> \endverbatim
 
79
*>
 
80
*> \param[in,out] SCALE
 
81
*> \verbatim
 
82
*>          SCALE is DOUBLE PRECISION
 
83
*>          On entry, the value  scale  in the equation above.
 
84
*>          On exit, SCALE is overwritten with the value  scl .
 
85
*> \endverbatim
 
86
*>
 
87
*> \param[in,out] SUMSQ
 
88
*> \verbatim
 
89
*>          SUMSQ is DOUBLE PRECISION
 
90
*>          On entry, the value  sumsq  in the equation above.
 
91
*>          On exit, SUMSQ is overwritten with the value  ssq .
 
92
*> \endverbatim
 
93
*
 
94
*  Authors:
 
95
*  ========
 
96
*
 
97
*> \author Univ. of Tennessee 
 
98
*> \author Univ. of California Berkeley 
 
99
*> \author Univ. of Colorado Denver 
 
100
*> \author NAG Ltd. 
 
101
*
 
102
*> \date September 2012
 
103
*
 
104
*> \ingroup complex16OTHERauxiliary
 
105
*
 
106
*  =====================================================================
1
107
      SUBROUTINE ZLASSQ( N, X, INCX, SCALE, SUMSQ )
2
108
*
3
 
*  -- LAPACK auxiliary routine (version 2.0) --
4
 
*     Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
5
 
*     Courant Institute, Argonne National Lab, and Rice University
6
 
*     October 31, 1992
 
109
*  -- LAPACK auxiliary routine (version 3.4.2) --
 
110
*  -- LAPACK is a software package provided by Univ. of Tennessee,    --
 
111
*  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
 
112
*     September 2012
7
113
*
8
114
*     .. Scalar Arguments ..
9
115
      INTEGER            INCX, N
13
119
      COMPLEX*16         X( * )
14
120
*     ..
15
121
*
16
 
c
17
 
* $Id: zlassq.f 19697 2010-10-29 16:57:34Z d3y133 $
18
 
c
19
 
*  Purpose
20
 
*  =======
21
 
*
22
 
*  ZLASSQ returns the values scl and ssq such that
23
 
*
24
 
*     ( scl**2 )*ssq = x( 1 )**2 +...+ x( n )**2 + ( scale**2 )*sumsq,
25
 
*
26
 
*  where x( i ) = abs( X( 1 + ( i - 1 )*INCX ) ). The value of sumsq is
27
 
*  assumed to be at least unity and the value of ssq will then satisfy
28
 
*
29
 
*     1.0 .le. ssq .le. ( sumsq + 2*n ).
30
 
*
31
 
*  scale is assumed to be non-negative and scl returns the value
32
 
*
33
 
*     scl = max( scale, abs( real( x( i ) ) ), abs( aimag( x( i ) ) ) ),
34
 
*            i
35
 
*
36
 
*  scale and sumsq must be supplied in SCALE and SUMSQ respectively.
37
 
*  SCALE and SUMSQ are overwritten by scl and ssq respectively.
38
 
*
39
 
*  The routine makes only one pass through the vector X.
40
 
*
41
 
*  Arguments
42
 
*  =========
43
 
*
44
 
*  N       (input) INTEGER
45
 
*          The number of elements to be used from the vector X.
46
 
*
47
 
*  X       (input) DOUBLE PRECISION
48
 
*          The vector x as described above.
49
 
*             x( i )  = X( 1 + ( i - 1 )*INCX ), 1 <= i <= n.
50
 
*
51
 
*  INCX    (input) INTEGER
52
 
*          The increment between successive values of the vector X.
53
 
*          INCX > 0.
54
 
*
55
 
*  SCALE   (input/output) DOUBLE PRECISION
56
 
*          On entry, the value  scale  in the equation above.
57
 
*          On exit, SCALE is overwritten with the value  scl .
58
 
*
59
 
*  SUMSQ   (input/output) DOUBLE PRECISION
60
 
*          On entry, the value  sumsq  in the equation above.
61
 
*          On exit, SUMSQ is overwritten with the value  ssq .
62
 
*
63
122
* =====================================================================
64
123
*
65
124
*     .. Parameters ..
70
129
      INTEGER            IX
71
130
      DOUBLE PRECISION   TEMP1
72
131
*     ..
 
132
*     .. External Functions ..
 
133
      LOGICAL            DISNAN
 
134
      EXTERNAL           DISNAN
 
135
*     ..
73
136
*     .. Intrinsic Functions ..
74
137
      INTRINSIC          ABS, DBLE, DIMAG
75
138
*     ..
77
140
*
78
141
      IF( N.GT.0 ) THEN
79
142
         DO 10 IX = 1, 1 + ( N-1 )*INCX, INCX
80
 
            IF( DBLE( X( IX ) ).NE.ZERO ) THEN
81
 
               TEMP1 = ABS( DBLE( X( IX ) ) )
 
143
            TEMP1 = ABS( DBLE( X( IX ) ) )
 
144
            IF( TEMP1.GT.ZERO.OR.DISNAN( TEMP1 ) ) THEN
82
145
               IF( SCALE.LT.TEMP1 ) THEN
83
146
                  SUMSQ = 1 + SUMSQ*( SCALE / TEMP1 )**2
84
147
                  SCALE = TEMP1
86
149
                  SUMSQ = SUMSQ + ( TEMP1 / SCALE )**2
87
150
               END IF
88
151
            END IF
89
 
            IF( DIMAG( X( IX ) ).NE.ZERO ) THEN
90
 
               TEMP1 = ABS( DIMAG( X( IX ) ) )
 
152
            TEMP1 = ABS( DIMAG( X( IX ) ) )
 
153
            IF( TEMP1.GT.ZERO.OR.DISNAN( TEMP1 ) ) THEN
91
154
               IF( SCALE.LT.TEMP1 ) THEN
92
155
                  SUMSQ = 1 + SUMSQ*( SCALE / TEMP1 )**2
93
156
                  SCALE = TEMP1