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

« back to all changes in this revision

Viewing changes to interfaces/blas/F77/src/zgbmv.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 ZGBMV( TRANS, M, N, KL, KU, ALPHA, A, LDA, X, INCX,
 
2
     $                  BETA, Y, INCY )
 
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        TRANS
 
52
      INTEGER            INCX, INCY, KL, KU, LDA, M, N
 
53
      COMPLEX*16         ALPHA, BETA
 
54
*     ..
 
55
*     .. Array Arguments ..
 
56
      COMPLEX*16         A( LDA, * ), X( * ), Y( * )
 
57
*     ..
 
58
*
 
59
*  Purpose
 
60
*  =======
 
61
*
 
62
*  ZGBMV performs one of the matrix-vector operations
 
63
*
 
64
*     y := alpha*A*x + beta*y,   or   y := alpha*A'*x + beta*y,   or
 
65
*
 
66
*     y := alpha*conjg( A' )*x + beta*y,
 
67
*
 
68
*  where  alpha and beta are scalars, x and y are vectors and  A is an m
 
69
*  by n band matrix, with kl sub-diagonals and ku super-diagonals.
 
70
*
 
71
*  Arguments
 
72
*  =========
 
73
*
 
74
*  TRANS   (input)                       CHARACTER*1
 
75
*          On entry,  TRANS  specifies the  operation to be performed as
 
76
*          follows:
 
77
*
 
78
*             TRANS = 'N' or 'n',    y := alpha*A *x + beta*y,
 
79
*
 
80
*             TRANS = 'T' or 't',    y := alpha*A'*x + beta*y,
 
81
*
 
82
*             TRANS = 'C' or 'c',    y := alpha*conjg( A' )*x + beta*y.
 
83
*
 
84
*          Unchanged on exit.
 
85
*
 
86
*  M       (input)                       INTEGER
 
87
*          On entry,  M  specifies the number of rows of  the matrix  A.
 
88
*          M must be at least zero. Unchanged on exit.
 
89
*
 
90
*  N       (input)                       INTEGER
 
91
*          On entry, N  specifies the number of columns of the matrix A.
 
92
*          N  must be at least zero. Unchanged on exit.
 
93
*
 
94
*  KL      (input)                       INTEGER
 
95
*          On entry, KL specifies the number of sub-diagonals of the ma-
 
96
*          trix A. KL must satisfy  0 .le. KL. Unchanged on exit.
 
97
*
 
98
*  KU      (input)                       INTEGER
 
99
*          On entry, KU specifies the number of  super-diagonals of  the
 
100
*          matrix A. KU must satisfy  0 .le. KU. Unchanged on exit.
 
101
*
 
102
*  ALPHA   (input)                       COMPLEX*16
 
103
*          On entry, ALPHA specifies the scalar alpha.   When  ALPHA  is
 
104
*          supplied as zero then  A and X  need not be set on input. Un-
 
105
*          changed on exit.
 
106
*
 
107
*  A       (input)                       COMPLEX*16 array
 
108
*          On entry,  A  is an array of DIMENSION ( LDA, n ). Before en-
 
109
*          try, the leading (kl+ku+1) by n part of the array A must con-
 
110
*          tain the matrix of coefficients, supplied column  by  column,
 
111
*          with the leading diagonal of the matrix in row (ku+1)  of the
 
112
*          array, the first super-diagonal starting at position 2 in row
 
113
*          ku,  the  first  sub-diagonal  starting  at position 1 in row
 
114
*          (ku+2), and so on. Elements in the array  A  that do not cor-
 
115
*          respond to elements in the band matrix (such as the top  left
 
116
*          ku by ku triangle) are not referenced.
 
117
*          The  following  program  segment  will transfer a band matrix
 
118
*          from conventional full matrix storage to band storage:
 
119
*
 
120
*                 DO 20, J = 1, N
 
121
*                    K = KU + 1 - J
 
122
*                    DO 10, I = MAX( 1, J - KU ), MIN( M, J + KL )
 
123
*                       A( K + I, J ) = matrix( I, J )
 
124
*              10    CONTINUE
 
125
*              20 CONTINUE
 
126
*
 
127
*           Unchanged on exit.
 
128
*
 
129
*  LDA     (input)                       INTEGER
 
130
*          On entry, LDA  specifies the first dimension of A as declared
 
131
*          in the calling (sub) program. LDA must be at least (kl+ku+1).
 
132
*          Unchanged on exit.
 
133
*
 
134
*  X       (input)                       COMPLEX*16 array
 
135
*          On entry,  X  is an incremented array of dimension  at  least
 
136
*          ( 1 + ( n - 1 ) * abs( INCX ) ) when  TRANS = 'N' or 'n'  and
 
137
*          at  least ( 1 + ( m - 1 ) * abs( INCX ) )  otherwise.  Before
 
138
*          entry, the incremented array X must contain the vector x. Un-
 
139
*          changed on exit.
 
140
*
 
141
*  INCX    (input)                       INTEGER
 
142
*          On entry, INCX specifies the increment for the elements of X.
 
143
*          INCX must not be zero. Unchanged on exit.
 
144
*
 
145
*  BETA    (input)                       COMPLEX*16
 
146
*          On entry,  BETA  specifies the scalar  beta.   When  BETA  is
 
147
*          supplied as zero then Y  need not be set on input.  Unchanged
 
148
*          on exit.
 
149
*
 
150
*  Y       (input/output)                COMPLEX*16 array
 
151
*          On entry,  Y  is an incremented array of dimension  at  least
 
152
*          ( 1 + ( m - 1 ) * abs( INCY ) ) when  TRANS = 'N' or 'n'  and
 
153
*          at  least ( 1 + ( n - 1 ) * abs( INCY ) )  otherwise.  Before
 
154
*          entry with BETA non-zero, the incremented array  Y  must con-
 
155
*          tain the vector y. On exit,  Y  is overwritten by the updated
 
156
*          vector y.
 
157
*
 
158
*  INCY    (input)                       INTEGER
 
159
*          On entry, INCY specifies the increment for the elements of Y.
 
160
*          INCY must not be zero. Unchanged on exit.
 
161
*
 
162
*  Further Details
 
163
*  ===============
 
164
*
 
165
*  For further information on the Level 1 BLAS specification, see:
 
166
*
 
167
*  ``A Proposal for Standard Linear Algebra Subprograms''  by R. Hanson,
 
168
*  F. Krogh and C. Lawson, ACM SIGNUM Newsl., 8(16), 1973,
 
169
*
 
170
*  ``Basic Linear Algebra Subprograms for Fortran Usage''  by C. Lawson,
 
171
*  R. Hanson, D. Kincaid and F. Krogh,  ACM Transactions on Mathematical
 
172
*  Software, 5(3) pp 308-323, 1979.
 
173
*
 
174
*  For further information on the Level 2 BLAS specification, see:
 
175
*
 
176
*  ``An  Extended Set of  FORTRAN  Basic Linear Algebra Subprograms'' by
 
177
*  J. Dongarra,  J. Du Croz,  S. Hammarling and R. Hanson,  ACM Transac-
 
178
*  tions on Mathematical Software, 14(1) pp 1-17, 1988.
 
179
*
 
180
*  ``Algorithm 656: An extended Set of Basic Linear Algebra Subprograms:
 
181
*  Model Implementation and Test Programs''  by J. Dongarra, J. Du Croz,
 
182
*  S. Hammarling and R. Hanson,  ACM  Transactions on Mathematical Soft-
 
183
*  ware, 14(1) pp 18-32, 1988.
 
184
*
 
185
*  For further information on the Level 3 BLAS specification, see:
 
186
*
 
187
*  ``A Set of Level 3 Basic Linear Algebra Subprograms'' by J. Dongarra,
 
188
*  J. Du Croz, I. Duff and S. Hammarling, ACM Transactions on Mathemati-
 
189
*  cal Software, 16(1), pp 1-17, 1990.
 
190
*
 
191
*  =====================================================================
 
192
*
 
193
*     .. Parameters ..
 
194
      INTEGER            ICOTRAN, INOTRAN, ITRAN
 
195
      PARAMETER          ( INOTRAN = 111, ITRAN = 112, ICOTRAN = 113 )
 
196
*     ..
 
197
*     .. Local Scalars ..
 
198
      INTEGER            INFO, ITRANS
 
199
*     ..
 
200
*     .. External Subroutines ..
 
201
      EXTERNAL           ATL_F77WRAP_ZGBMV, XERBLA
 
202
*     ..
 
203
*     .. External Functions ..
 
204
      EXTERNAL           LSAME
 
205
      LOGICAL            LSAME
 
206
*     ..
 
207
*     .. Executable Statements ..
 
208
*
 
209
      INFO = 0
 
210
*
 
211
      IF(      LSAME( TRANS, 'N' ) ) THEN
 
212
         ITRANS = INOTRAN
 
213
      ELSE IF( LSAME( TRANS, 'T' ) ) THEN
 
214
         ITRANS = ITRAN
 
215
      ELSE IF( LSAME( TRANS, 'C' ) ) THEN
 
216
         ITRANS = ICOTRAN
 
217
      ELSE IF( INFO.EQ.0 ) THEN
 
218
         INFO  = 1
 
219
      END IF
 
220
*
 
221
      IF( INFO.EQ.0 ) THEN
 
222
         IF( M.LT.0 ) THEN
 
223
            INFO = 2
 
224
         ELSE IF( N.LT.0 ) THEN
 
225
            INFO = 3
 
226
         ELSE IF( KL.LT.0 ) THEN
 
227
            INFO = 4
 
228
         ELSE IF( KU.LT.0 ) THEN
 
229
            INFO = 5
 
230
         ELSE IF( LDA.LT.( KL + KU + 1 ) ) THEN
 
231
            INFO = 8
 
232
         ELSE IF( INCX.EQ.0 ) THEN
 
233
            INFO = 10
 
234
         ELSE IF( INCY.EQ.0 ) THEN
 
235
            INFO = 13
 
236
         END IF
 
237
      END IF
 
238
*
 
239
      IF( INFO.NE.0 ) THEN
 
240
         CALL XERBLA( 'ZGBMV ', INFO )
 
241
         RETURN
 
242
      END IF
 
243
*
 
244
      CALL ATL_F77WRAP_ZGBMV( ITRANS, M, N, KL, KU, ALPHA, A, LDA,
 
245
     $                        X, INCX, BETA, Y, INCY )
 
246
*
 
247
      RETURN
 
248
*
 
249
*     End of ZGBMV
 
250
*
 
251
      END