1
SUBROUTINE ZHER2K( UPLO, TRANS, N, K, ALPHA, A, LDA, B, LDB,
4
* -- Automatically Tuned Linear Algebra Software (ATLAS)
5
* (C) Copyright 2000 All Rights Reserved
7
* -- ATLAS routine -- F77 Interface -- Version 3.2 -- December 15, 2000
9
* -- Suggestions, comments, bugs reports should be sent to the follo-
10
* wing e-mail address: atlas@cs.utk.edu
12
* Author : Antoine P. Petitet
13
* University of Tennessee - Innovative Computing Laboratory
14
* Knoxville TN, 37996-1301, USA.
16
* ---------------------------------------------------------------------
18
* -- Copyright notice and Licensing terms:
20
* Redistribution and use in source and binary forms, with or without
21
* modification, are permitted provided that the following conditions
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-
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.
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.
48
* ---------------------------------------------------------------------
50
* .. Scalar Arguments ..
51
CHARACTER*1 UPLO, TRANS
52
INTEGER N, K, LDA, LDB, LDC
56
* .. Array Arguments ..
57
COMPLEX*16 A( LDA, * ), B( LDB, * ), C( LDC, * )
63
* ZHER2K performs one of the Hermitian rank 2k operations
65
* C := alpha * A * conjg( B )' + conjg( alpha ) * B * conjg( A )' +
70
* C := alpha * conjg( A' ) * B + conjg( alpha ) * conjg( B' ) * A +
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.
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:
84
* UPLO = 'U' or 'u' Only the upper triangular part of C
85
* is to be referenced.
87
* UPLO = 'L' or 'l' Only the lower triangular part of C
88
* is to be referenced.
92
* TRANS (input) CHARACTER*1
93
* On entry, TRANS specifies the operation to be performed as
97
* C := alpha*A*conjg( B' ) + conjg( alpha )*B*conjg( A' ) +
101
* C := alpha*conjg( A' )*B + conjg( alpha )*conjg( B' )*A +
107
* On entry, N specifies the order of the matrix C. N must be at
108
* least zero. Unchanged on exit.
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.
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.
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
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.
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
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.
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.
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.
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.
179
* For further information on the Level 1 BLAS specification, see:
181
* ``A Proposal for Standard Linear Algebra Subprograms'' by R. Hanson,
182
* F. Krogh and C. Lawson, ACM SIGNUM Newsl., 8(16), 1973,
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.
188
* For further information on the Level 2 BLAS specification, see:
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.
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.
199
* For further information on the Level 3 BLAS specification, see:
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.
205
* =====================================================================
208
INTEGER ILOWER, IUPPER
209
PARAMETER ( IUPPER = 121, ILOWER = 122 )
210
INTEGER ICOTRAN, INOTRAN, ITRAN
211
PARAMETER ( INOTRAN = 111, ITRAN = 112, ICOTRAN = 113 )
213
* .. Local Scalars ..
214
INTEGER INFO, ITRANS, IUPLO, NROWA
216
* .. External Subroutines ..
217
EXTERNAL ATL_F77WRAP_ZHER2K, XERBLA
219
* .. External Functions ..
223
* .. Intrinsic Functions ..
226
* .. Executable Statements ..
230
IF( LSAME( UPLO , 'L' ) ) THEN
232
ELSE IF( LSAME( UPLO , 'U' ) ) THEN
239
IF( LSAME( TRANS, 'N' ) ) THEN
242
ELSE IF( LSAME( TRANS, 'C' ) ) THEN
245
ELSE IF( INFO.EQ.0 ) THEN
254
ELSE IF( K .LT.0 ) THEN
256
ELSE IF( LDA.LT.MAX( 1, NROWA ) ) THEN
258
ELSE IF( LDB.LT.MAX( 1, NROWA ) ) THEN
260
ELSE IF( LDC.LT.MAX( 1, N ) ) THEN
266
CALL XERBLA( 'ZHER2K', INFO )
270
CALL ATL_F77WRAP_ZHER2K( IUPLO, ITRANS, N, K, ALPHA, A, LDA,
271
$ B, LDB, BETA, C, LDC )