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

« back to all changes in this revision

Viewing changes to src/lapack/double/zlange.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 ZLANGE returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value of any element of a general rectangular matrix.
 
2
*
 
3
*  =========== DOCUMENTATION ===========
 
4
*
 
5
* Online html documentation available at 
 
6
*            http://www.netlib.org/lapack/explore-html/ 
 
7
*
 
8
*> \htmlonly
 
9
*> Download ZLANGE + dependencies 
 
10
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zlange.f"> 
 
11
*> [TGZ]</a> 
 
12
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zlange.f"> 
 
13
*> [ZIP]</a> 
 
14
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zlange.f"> 
 
15
*> [TXT]</a>
 
16
*> \endhtmlonly 
 
17
*
 
18
*  Definition:
 
19
*  ===========
 
20
*
 
21
*       DOUBLE PRECISION FUNCTION ZLANGE( NORM, M, N, A, LDA, WORK )
 
22
 
23
*       .. Scalar Arguments ..
 
24
*       CHARACTER          NORM
 
25
*       INTEGER            LDA, M, N
 
26
*       ..
 
27
*       .. Array Arguments ..
 
28
*       DOUBLE PRECISION   WORK( * )
 
29
*       COMPLEX*16         A( LDA, * )
 
30
*       ..
 
31
*  
 
32
*
 
33
*> \par Purpose:
 
34
*  =============
 
35
*>
 
36
*> \verbatim
 
37
*>
 
38
*> ZLANGE  returns the value of the one norm,  or the Frobenius norm, or
 
39
*> the  infinity norm,  or the  element of  largest absolute value  of a
 
40
*> complex matrix A.
 
41
*> \endverbatim
 
42
*>
 
43
*> \return ZLANGE
 
44
*> \verbatim
 
45
*>
 
46
*>    ZLANGE = ( max(abs(A(i,j))), NORM = 'M' or 'm'
 
47
*>             (
 
48
*>             ( norm1(A),         NORM = '1', 'O' or 'o'
 
49
*>             (
 
50
*>             ( normI(A),         NORM = 'I' or 'i'
 
51
*>             (
 
52
*>             ( normF(A),         NORM = 'F', 'f', 'E' or 'e'
 
53
*>
 
54
*> where  norm1  denotes the  one norm of a matrix (maximum column sum),
 
55
*> normI  denotes the  infinity norm  of a matrix  (maximum row sum) and
 
56
*> normF  denotes the  Frobenius norm of a matrix (square root of sum of
 
57
*> squares).  Note that  max(abs(A(i,j)))  is not a consistent matrix norm.
 
58
*> \endverbatim
 
59
*
 
60
*  Arguments:
 
61
*  ==========
 
62
*
 
63
*> \param[in] NORM
 
64
*> \verbatim
 
65
*>          NORM is CHARACTER*1
 
66
*>          Specifies the value to be returned in ZLANGE as described
 
67
*>          above.
 
68
*> \endverbatim
 
69
*>
 
70
*> \param[in] M
 
71
*> \verbatim
 
72
*>          M is INTEGER
 
73
*>          The number of rows of the matrix A.  M >= 0.  When M = 0,
 
74
*>          ZLANGE is set to zero.
 
75
*> \endverbatim
 
76
*>
 
77
*> \param[in] N
 
78
*> \verbatim
 
79
*>          N is INTEGER
 
80
*>          The number of columns of the matrix A.  N >= 0.  When N = 0,
 
81
*>          ZLANGE is set to zero.
 
82
*> \endverbatim
 
83
*>
 
84
*> \param[in] A
 
85
*> \verbatim
 
86
*>          A is COMPLEX*16 array, dimension (LDA,N)
 
87
*>          The m by n matrix A.
 
88
*> \endverbatim
 
89
*>
 
90
*> \param[in] LDA
 
91
*> \verbatim
 
92
*>          LDA is INTEGER
 
93
*>          The leading dimension of the array A.  LDA >= max(M,1).
 
94
*> \endverbatim
 
95
*>
 
96
*> \param[out] WORK
 
97
*> \verbatim
 
98
*>          WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK)),
 
99
*>          where LWORK >= M when NORM = 'I'; otherwise, WORK is not
 
100
*>          referenced.
 
101
*> \endverbatim
 
102
*
 
103
*  Authors:
 
104
*  ========
 
105
*
 
106
*> \author Univ. of Tennessee 
 
107
*> \author Univ. of California Berkeley 
 
108
*> \author Univ. of Colorado Denver 
 
109
*> \author NAG Ltd. 
 
110
*
 
111
*> \date September 2012
 
112
*
 
113
*> \ingroup complex16GEauxiliary
 
114
*
 
115
*  =====================================================================
1
116
      DOUBLE PRECISION FUNCTION ZLANGE( NORM, M, N, A, LDA, WORK )
2
 
C$Id: zlange.f 19697 2010-10-29 16:57:34Z d3y133 $                          
3
117
*
4
 
*  -- LAPACK auxiliary routine (version 3.0) --
5
 
*     Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
6
 
*     Courant Institute, Argonne National Lab, and Rice University
7
 
*     October 31, 1992
 
118
*  -- LAPACK auxiliary routine (version 3.4.2) --
 
119
*  -- LAPACK is a software package provided by Univ. of Tennessee,    --
 
120
*  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
 
121
*     September 2012
8
122
*
9
123
*     .. Scalar Arguments ..
10
124
      CHARACTER          NORM
15
129
      COMPLEX*16         A( LDA, * )
16
130
*     ..
17
131
*
18
 
*  Purpose
19
 
*  =======
20
 
*
21
 
*  ZLANGE  returns the value of the one norm,  or the Frobenius norm, or
22
 
*  the  infinity norm,  or the  element of  largest absolute value  of a
23
 
*  complex matrix A.
24
 
*
25
 
*  Description
26
 
*  ===========
27
 
*
28
 
*  ZLANGE returns the value
29
 
*
30
 
*     ZLANGE = ( max(abs(A(i,j))), NORM = 'M' or 'm'
31
 
*              (
32
 
*              ( norm1(A),         NORM = '1', 'O' or 'o'
33
 
*              (
34
 
*              ( normI(A),         NORM = 'I' or 'i'
35
 
*              (
36
 
*              ( normF(A),         NORM = 'F', 'f', 'E' or 'e'
37
 
*
38
 
*  where  norm1  denotes the  one norm of a matrix (maximum column sum),
39
 
*  normI  denotes the  infinity norm  of a matrix  (maximum row sum) and
40
 
*  normF  denotes the  Frobenius norm of a matrix (square root of sum of
41
 
*  squares).  Note that  max(abs(A(i,j)))  is not a  matrix norm.
42
 
*
43
 
*  Arguments
44
 
*  =========
45
 
*
46
 
*  NORM    (input) CHARACTER*1
47
 
*          Specifies the value to be returned in ZLANGE as described
48
 
*          above.
49
 
*
50
 
*  M       (input) INTEGER
51
 
*          The number of rows of the matrix A.  M >= 0.  When M = 0,
52
 
*          ZLANGE is set to zero.
53
 
*
54
 
*  N       (input) INTEGER
55
 
*          The number of columns of the matrix A.  N >= 0.  When N = 0,
56
 
*          ZLANGE is set to zero.
57
 
*
58
 
*  A       (input) COMPLEX*16 array, dimension (LDA,N)
59
 
*          The m by n matrix A.
60
 
*
61
 
*  LDA     (input) INTEGER
62
 
*          The leading dimension of the array A.  LDA >= max(M,1).
63
 
*
64
 
*  WORK    (workspace) DOUBLE PRECISION array, dimension (LWORK),
65
 
*          where LWORK >= M when NORM = 'I'; otherwise, WORK is not
66
 
*          referenced.
67
 
*
68
132
* =====================================================================
69
133
*
70
134
*     .. Parameters ..
73
137
*     ..
74
138
*     .. Local Scalars ..
75
139
      INTEGER            I, J
76
 
      DOUBLE PRECISION   SCALE, SUM, VALUE
 
140
      DOUBLE PRECISION   SCALE, SUM, VALUE, TEMP
77
141
*     ..
78
142
*     .. External Functions ..
79
 
      LOGICAL            LSAME
80
 
      EXTERNAL           LSAME
 
143
      LOGICAL            LSAME, DISNAN
 
144
      EXTERNAL           LSAME, DISNAN
81
145
*     ..
82
146
*     .. External Subroutines ..
83
147
      EXTERNAL           ZLASSQ
84
148
*     ..
85
149
*     .. Intrinsic Functions ..
86
 
      INTRINSIC          ABS, MAX, MIN, SQRT
 
150
      INTRINSIC          ABS, MIN, SQRT
87
151
*     ..
88
152
*     .. Executable Statements ..
89
153
*
96
160
         VALUE = ZERO
97
161
         DO 20 J = 1, N
98
162
            DO 10 I = 1, M
99
 
               VALUE = MAX( VALUE, ABS( A( I, J ) ) )
 
163
               TEMP = ABS( A( I, J ) )
 
164
               IF( VALUE.LT.TEMP .OR. DISNAN( TEMP ) ) VALUE = TEMP
100
165
   10       CONTINUE
101
166
   20    CONTINUE
102
167
      ELSE IF( ( LSAME( NORM, 'O' ) ) .OR. ( NORM.EQ.'1' ) ) THEN
109
174
            DO 30 I = 1, M
110
175
               SUM = SUM + ABS( A( I, J ) )
111
176
   30       CONTINUE
112
 
            VALUE = MAX( VALUE, SUM )
 
177
            IF( VALUE.LT.SUM .OR. DISNAN( SUM ) ) VALUE = SUM
113
178
   40    CONTINUE
114
179
      ELSE IF( LSAME( NORM, 'I' ) ) THEN
115
180
*
125
190
   70    CONTINUE
126
191
         VALUE = ZERO
127
192
         DO 80 I = 1, M
128
 
            VALUE = MAX( VALUE, WORK( I ) )
 
193
            TEMP = WORK( I )
 
194
            IF( VALUE.LT.TEMP .OR. DISNAN( TEMP ) ) VALUE = TEMP
129
195
   80    CONTINUE
130
196
      ELSE IF( ( LSAME( NORM, 'F' ) ) .OR. ( LSAME( NORM, 'E' ) ) ) THEN
131
197
*