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

« back to all changes in this revision

Viewing changes to interfaces/blas/F77/src/zher2k.f

  • Committer: Bazaar Package Importer
  • Author(s): Camm Maguire
  • Date: 2002-04-13 10:07:52 UTC
  • Revision ID: james.westby@ubuntu.com-20020413100752-va9zm0rd4gpurdkq
Tags: upstream-3.2.1ln
ImportĀ upstreamĀ versionĀ 3.2.1ln

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
      SUBROUTINE ZHER2K( UPLO, TRANS, N, K, ALPHA, A, LDA, B, LDB,
 
2
     $                   BETA, C, LDC )
 
3
*
 
4
*  -- Automatically Tuned Linear Algebra Software (ATLAS)
 
5
*     (C) Copyright 2000 All Rights Reserved
 
6
*
 
7
*  -- ATLAS routine -- F77 Interface -- Version 3.2 -- December 15, 2000
 
8
*
 
9
*  -- Suggestions,  comments,  bugs reports should be sent to the follo-
 
10
*     wing e-mail address: atlas@cs.utk.edu
 
11
*
 
12
*  Author         : Antoine P. Petitet
 
13
*  University of Tennessee - Innovative Computing Laboratory
 
14
*  Knoxville TN, 37996-1301, USA.
 
15
*
 
16
*  ---------------------------------------------------------------------
 
17
*
 
18
*  -- Copyright notice and Licensing terms:
 
19
*
 
20
*  Redistribution  and  use in  source and binary forms, with or without
 
21
*  modification, are  permitted provided  that the following  conditions
 
22
*  are met:
 
23
*
 
24
*  1. Redistributions  of  source  code  must retain the above copyright
 
25
*     notice, this list of conditions and the following disclaimer.
 
26
*  2. Redistributions in binary form must reproduce  the above copyright
 
27
*     notice,  this list of conditions, and the  following disclaimer in
 
28
*     the documentation and/or other materials provided with the distri-
 
29
*     bution.
 
30
*  3. The name of the University,  the ATLAS group,  or the names of its
 
31
*     contributors  may not be used to endorse or promote products deri-
 
32
*     ved from this software without specific written permission.
 
33
*
 
34
*  -- Disclaimer:
 
35
*
 
36
*  THIS  SOFTWARE  IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 
37
*  ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,  INCLUDING,  BUT NOT
 
38
*  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 
39
*  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY
 
40
*  OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,  INDIRECT, INCIDENTAL, SPE-
 
41
*  CIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
 
42
*  TO,  PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
 
43
*  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEO-
 
44
*  RY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT  (IN-
 
45
*  CLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 
46
*  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
47
*
 
48
*  ---------------------------------------------------------------------
 
49
*
 
50
*     .. Scalar Arguments ..
 
51
      CHARACTER*1        UPLO, TRANS
 
52
      INTEGER            N, K, LDA, LDB, LDC
 
53
      DOUBLE PRECISION   BETA
 
54
      COMPLEX*16         ALPHA
 
55
*     ..
 
56
*     .. Array Arguments ..
 
57
      COMPLEX*16         A( LDA, * ), B( LDB, * ), C( LDC, * )
 
58
*     ..
 
59
*
 
60
*  Purpose
 
61
*  =======
 
62
*
 
63
*  ZHER2K  performs one of the Hermitian rank 2k operations
 
64
*
 
65
*     C := alpha * A * conjg( B )' + conjg( alpha ) * B * conjg( A )' +
 
66
*          beta * C,
 
67
*
 
68
*  or
 
69
*
 
70
*     C := alpha * conjg( A' ) * B + conjg( alpha ) * conjg( B' ) * A +
 
71
*          beta * C,
 
72
*
 
73
*  where  alpha  and  beta are scalars with  beta  real,  C is an n by n
 
74
*  Hermitian matrix and  A  and  B are n by k matrices in the first case
 
75
*  and k by n matrices in the second case.
 
76
*
 
77
*  Arguments
 
78
*  =========
 
79
*
 
80
*  UPLO    (input)                       CHARACTER*1
 
81
*          On entry, UPLO  specifies whether the upper or lower triangu-
 
82
*          lar part of the array C is to be referenced as follows:
 
83
*
 
84
*              UPLO = 'U' or 'u'   Only the upper triangular part of C
 
85
*                                  is to be referenced.
 
86
*
 
87
*              UPLO = 'L' or 'l'   Only the lower triangular part of C
 
88
*                                  is to be referenced.
 
89
*
 
90
*          Unchanged on exit.
 
91
*
 
92
*  TRANS   (input)                       CHARACTER*1
 
93
*          On entry,  TRANS  specifies the  operation to be performed as
 
94
*          follows:
 
95
*
 
96
*             TRANS = 'N' or 'n'
 
97
*             C := alpha*A*conjg( B' ) + conjg( alpha )*B*conjg( A' ) +
 
98
*                  beta*C,
 
99
*
 
100
*             TRANS = 'C' or 'c'
 
101
*             C := alpha*conjg( A' )*B + conjg( alpha )*conjg( B' )*A +
 
102
*                  beta*C.
 
103
*
 
104
*          Unchanged on exit.
 
105
*
 
106
*  N       (input)                       INTEGER
 
107
*          On entry, N specifies the order of the matrix C. N must be at
 
108
*          least zero. Unchanged on exit.
 
109
*
 
110
*  K       (input)                       INTEGER
 
111
*          On entry, with TRANS = 'N' or 'n',  K specifies the number of
 
112
*          columns of the matrices A and B, and with TRANS = 'C' or 'c',
 
113
*          K  specifies  the  number  of  rows  of the matrices A and B.
 
114
*          K  must be at least zero. Unchanged on exit.
 
115
*
 
116
*  ALPHA   (input)                       COMPLEX*16
 
117
*          On entry, ALPHA specifies the scalar alpha.   When  ALPHA  is
 
118
*          supplied  as  zero  then  the entries of the matrices A and B
 
119
*          need not be set on input. Unchanged on exit.
 
120
*
 
121
*  A       (input)                       COMPLEX*16 array
 
122
*          On entry, A is an array of DIMENSION ( LDA, ka ), where ka is
 
123
*          k  when  TRANS = 'N' or 'n', and is n otherwise. Before entry
 
124
*          with TRANS = 'N' or 'n', the leading n by k part of the array
 
125
*          A must contain the matrix A,  otherwise  the  leading  k by n
 
126
*          part of the array A must contain the matrix A.  Unchanged  on
 
127
*          exit.
 
128
*
 
129
*  LDA     (input)                       INTEGER
 
130
*          On entry, LDA  specifies the first dimension of A as declared
 
131
*          in  the   calling  (sub)  program.   When  TRANS = 'N' or 'n'
 
132
*          then  LDA  must be at least  max( 1, n ), otherwise  LDA must
 
133
*          be at least  max( 1, k ). Unchanged on exit.
 
134
*
 
135
*  B       (input)                       COMPLEX*16 array
 
136
*          On entry, B is an array of DIMENSION ( LDB, kb ), where kb is
 
137
*          k  when  TRANS = 'N' or 'n', and is n otherwise. Before entry
 
138
*          with TRANS = 'N' or 'n', the leading n by k part of the array
 
139
*          B must contain the matrix B,  otherwise  the  leading  k by n
 
140
*          part of the array B must contain the matrix  B.  Unchanged on
 
141
*          exit.
 
142
*
 
143
*  LDB     (input)                       INTEGER
 
144
*          On entry, LDB  specifies the first dimension of B as declared
 
145
*          in  the   calling  (sub)  program.   When  TRANS = 'N' or 'n'
 
146
*          then  LDB  must be at least  max( 1, n ), otherwise  LDB must
 
147
*          be at least  max( 1, k ). Unchanged on exit.
 
148
*
 
149
*  BETA    (input)                       DOUBLE PRECISION
 
150
*          On entry,  BETA  specifies the scalar  beta.   When  BETA  is
 
151
*          supplied as zero  then  the  entries of the matrix C need not
 
152
*          be set on input. Unchanged on exit.
 
153
*
 
154
*  C       (input/output)                COMPLEX*16 array
 
155
*          On entry, C is an array of DIMENSION ( LDC, n ). Before entry
 
156
*          with  UPLO = 'U' or 'u',  the leading n by n upper triangular
 
157
*          part of the array C must contain the upper triangular part of
 
158
*          the  Hermitian matrix  and the strictly lower triangular part
 
159
*          of C is not referenced. On exit, the upper triangular part of
 
160
*          the array  C  is  overwritten by the upper triangular part of
 
161
*          the updated matrix. Before entry with  UPLO = 'L' or 'l', the
 
162
*          leading n by n lower triangular part of the array C must con-
 
163
*          tain the lower triangular part of the  Hermitian  matrix  and
 
164
*          the strictly upper triangular part of C is not referenced. On
 
165
*          exit, the lower triangular part of the array C is overwritten
 
166
*          by the lower triangular part of the updated matrix.
 
167
*          Note  that  the imaginary parts of the diagonal elements of C
 
168
*          need not  be  set,  they are assumed to be zero,  and on exit
 
169
*          they are set to zero.
 
170
*
 
171
*  LDC     (input)                       INTEGER
 
172
*          On entry,  LDC specifies the first dimension of C as declared
 
173
*          in   the  calling  (sub)  program.   LDC  must  be  at  least
 
174
*          max( 1, n ). Unchanged on exit.
 
175
*
 
176
*  Further Details
 
177
*  ===============
 
178
*
 
179
*  For further information on the Level 1 BLAS specification, see:
 
180
*
 
181
*  ``A Proposal for Standard Linear Algebra Subprograms''  by R. Hanson,
 
182
*  F. Krogh and C. Lawson, ACM SIGNUM Newsl., 8(16), 1973,
 
183
*
 
184
*  ``Basic Linear Algebra Subprograms for Fortran Usage''  by C. Lawson,
 
185
*  R. Hanson, D. Kincaid and F. Krogh,  ACM Transactions on Mathematical
 
186
*  Software, 5(3) pp 308-323, 1979.
 
187
*
 
188
*  For further information on the Level 2 BLAS specification, see:
 
189
*
 
190
*  ``An  Extended Set of  FORTRAN  Basic Linear Algebra Subprograms'' by
 
191
*  J. Dongarra,  J. Du Croz,  S. Hammarling and R. Hanson,  ACM Transac-
 
192
*  tions on Mathematical Software, 14(1) pp 1-17, 1988.
 
193
*
 
194
*  ``Algorithm 656: An extended Set of Basic Linear Algebra Subprograms:
 
195
*  Model Implementation and Test Programs''  by J. Dongarra, J. Du Croz,
 
196
*  S. Hammarling and R. Hanson,  ACM  Transactions on Mathematical Soft-
 
197
*  ware, 14(1) pp 18-32, 1988.
 
198
*
 
199
*  For further information on the Level 3 BLAS specification, see:
 
200
*
 
201
*  ``A Set of Level 3 Basic Linear Algebra Subprograms'' by J. Dongarra,
 
202
*  J. Du Croz, I. Duff and S. Hammarling, ACM Transactions on Mathemati-
 
203
*  cal Software, 16(1), pp 1-17, 1990.
 
204
*
 
205
*  =====================================================================
 
206
*
 
207
*     .. Parameters ..
 
208
      INTEGER            ILOWER, IUPPER
 
209
      PARAMETER          ( IUPPER = 121, ILOWER = 122 )
 
210
      INTEGER            ICOTRAN, INOTRAN, ITRAN
 
211
      PARAMETER          ( INOTRAN = 111, ITRAN = 112, ICOTRAN = 113 )
 
212
*     ..
 
213
*     .. Local Scalars ..
 
214
      INTEGER            INFO, ITRANS, IUPLO, NROWA
 
215
*     ..
 
216
*     .. External Subroutines ..
 
217
      EXTERNAL           ATL_F77WRAP_ZHER2K, XERBLA
 
218
*     ..
 
219
*     .. External Functions ..
 
220
      EXTERNAL           LSAME
 
221
      LOGICAL            LSAME
 
222
*     ..
 
223
*     .. Intrinsic Functions ..
 
224
      INTRINSIC          MAX
 
225
*     ..
 
226
*     .. Executable Statements ..
 
227
*
 
228
      INFO = 0
 
229
*
 
230
      IF(      LSAME( UPLO , 'L' ) ) THEN
 
231
         IUPLO = ILOWER
 
232
      ELSE IF( LSAME( UPLO , 'U' ) ) THEN
 
233
         IUPLO = IUPPER
 
234
      ELSE
 
235
         IUPLO = ILOWER
 
236
         INFO  = 1
 
237
      END IF
 
238
*
 
239
      IF(      LSAME( TRANS, 'N' ) ) THEN
 
240
         ITRANS = INOTRAN
 
241
         NROWA  = N
 
242
      ELSE IF( LSAME( TRANS, 'C' ) ) THEN
 
243
         ITRANS = ICOTRAN
 
244
         NROWA  = K
 
245
      ELSE IF( INFO.EQ.0 ) THEN
 
246
         ITRANS = INOTRAN
 
247
         NROWA  = 0
 
248
         INFO   = 2
 
249
      END IF
 
250
*
 
251
      IF( INFO.EQ.0 ) THEN
 
252
         IF(      N  .LT.0               ) THEN
 
253
            INFO = 3
 
254
         ELSE IF( K  .LT.0               ) THEN
 
255
            INFO = 4
 
256
         ELSE IF( LDA.LT.MAX( 1, NROWA ) ) THEN
 
257
            INFO = 7
 
258
         ELSE IF( LDB.LT.MAX( 1, NROWA ) ) THEN
 
259
            INFO = 9
 
260
         ELSE IF( LDC.LT.MAX( 1, N     ) ) THEN
 
261
            INFO = 12
 
262
         END IF
 
263
      END IF
 
264
*
 
265
      IF( INFO.NE.0 ) THEN
 
266
         CALL XERBLA( 'ZHER2K', INFO )
 
267
         RETURN
 
268
      END IF
 
269
*
 
270
      CALL ATL_F77WRAP_ZHER2K( IUPLO, ITRANS, N, K, ALPHA, A, LDA,
 
271
     $                         B, LDB, BETA, C, LDC )
 
272
*
 
273
      RETURN
 
274
*
 
275
*     End of ZHER2K
 
276
*
 
277
      END