LAPACK 3.11.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ dgbmv()

subroutine dgbmv ( character  TRANS,
integer  M,
integer  N,
integer  KL,
integer  KU,
double precision  ALPHA,
double precision, dimension(lda,*)  A,
integer  LDA,
double precision, dimension(*)  X,
integer  INCX,
double precision  BETA,
double precision, dimension(*)  Y,
integer  INCY 
)

DGBMV

Purpose:
 DGBMV  performs one of the matrix-vector operations

    y := alpha*A*x + beta*y,   or   y := alpha*A**T*x + beta*y,

 where alpha and beta are scalars, x and y are vectors and A is an
 m by n band matrix, with kl sub-diagonals and ku super-diagonals.
Parameters
[in]TRANS
          TRANS is CHARACTER*1
           On entry, TRANS specifies the operation to be performed as
           follows:

              TRANS = 'N' or 'n'   y := alpha*A*x + beta*y.

              TRANS = 'T' or 't'   y := alpha*A**T*x + beta*y.

              TRANS = 'C' or 'c'   y := alpha*A**T*x + beta*y.
[in]M
          M is INTEGER
           On entry, M specifies the number of rows of the matrix A.
           M must be at least zero.
[in]N
          N is INTEGER
           On entry, N specifies the number of columns of the matrix A.
           N must be at least zero.
[in]KL
          KL is INTEGER
           On entry, KL specifies the number of sub-diagonals of the
           matrix A. KL must satisfy  0 .le. KL.
[in]KU
          KU is INTEGER
           On entry, KU specifies the number of super-diagonals of the
           matrix A. KU must satisfy  0 .le. KU.
[in]ALPHA
          ALPHA is DOUBLE PRECISION.
           On entry, ALPHA specifies the scalar alpha.
[in]A
          A is DOUBLE PRECISION array, dimension ( LDA, N )
           Before entry, the leading ( kl + ku + 1 ) by n part of the
           array A must contain the matrix of coefficients, supplied
           column by column, with the leading diagonal of the matrix in
           row ( ku + 1 ) of the array, the first super-diagonal
           starting at position 2 in row ku, the first sub-diagonal
           starting at position 1 in row ( ku + 2 ), and so on.
           Elements in the array A that do not correspond to elements
           in the band matrix (such as the top left ku by ku triangle)
           are not referenced.
           The following program segment will transfer a band matrix
           from conventional full matrix storage to band storage:

                 DO 20, J = 1, N
                    K = KU + 1 - J
                    DO 10, I = MAX( 1, J - KU ), MIN( M, J + KL )
                       A( K + I, J ) = matrix( I, J )
              10    CONTINUE
              20 CONTINUE
[in]LDA
          LDA is INTEGER
           On entry, LDA specifies the first dimension of A as declared
           in the calling (sub) program. LDA must be at least
           ( kl + ku + 1 ).
[in]X
          X is DOUBLE PRECISION array, dimension at least
           ( 1 + ( n - 1 )*abs( INCX ) ) when TRANS = 'N' or 'n'
           and at least
           ( 1 + ( m - 1 )*abs( INCX ) ) otherwise.
           Before entry, the incremented array X must contain the
           vector x.
[in]INCX
          INCX is INTEGER
           On entry, INCX specifies the increment for the elements of
           X. INCX must not be zero.
[in]BETA
          BETA is DOUBLE PRECISION.
           On entry, BETA specifies the scalar beta. When BETA is
           supplied as zero then Y need not be set on input.
[in,out]Y
          Y is DOUBLE PRECISION array, dimension at least
           ( 1 + ( m - 1 )*abs( INCY ) ) when TRANS = 'N' or 'n'
           and at least
           ( 1 + ( n - 1 )*abs( INCY ) ) otherwise.
           Before entry, the incremented array Y must contain the
           vector y. On exit, Y is overwritten by the updated vector y.
[in]INCY
          INCY is INTEGER
           On entry, INCY specifies the increment for the elements of
           Y. INCY must not be zero.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Further Details:
  Level 2 Blas routine.
  The vector and matrix arguments are not referenced when N = 0, or M = 0

  -- Written on 22-October-1986.
     Jack Dongarra, Argonne National Lab.
     Jeremy Du Croz, Nag Central Office.
     Sven Hammarling, Nag Central Office.
     Richard Hanson, Sandia National Labs.

Definition at line 184 of file dgbmv.f.

185*
186* -- Reference BLAS level2 routine --
187* -- Reference BLAS is a software package provided by Univ. of Tennessee, --
188* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
189*
190* .. Scalar Arguments ..
191 DOUBLE PRECISION ALPHA,BETA
192 INTEGER INCX,INCY,KL,KU,LDA,M,N
193 CHARACTER TRANS
194* ..
195* .. Array Arguments ..
196 DOUBLE PRECISION A(LDA,*),X(*),Y(*)
197* ..
198*
199* =====================================================================
200*
201* .. Parameters ..
202 DOUBLE PRECISION ONE,ZERO
203 parameter(one=1.0d+0,zero=0.0d+0)
204* ..
205* .. Local Scalars ..
206 DOUBLE PRECISION TEMP
207 INTEGER I,INFO,IX,IY,J,JX,JY,K,KUP1,KX,KY,LENX,LENY
208* ..
209* .. External Functions ..
210 LOGICAL LSAME
211 EXTERNAL lsame
212* ..
213* .. External Subroutines ..
214 EXTERNAL xerbla
215* ..
216* .. Intrinsic Functions ..
217 INTRINSIC max,min
218* ..
219*
220* Test the input parameters.
221*
222 info = 0
223 IF (.NOT.lsame(trans,'N') .AND. .NOT.lsame(trans,'T') .AND.
224 + .NOT.lsame(trans,'C')) THEN
225 info = 1
226 ELSE IF (m.LT.0) THEN
227 info = 2
228 ELSE IF (n.LT.0) THEN
229 info = 3
230 ELSE IF (kl.LT.0) THEN
231 info = 4
232 ELSE IF (ku.LT.0) THEN
233 info = 5
234 ELSE IF (lda.LT. (kl+ku+1)) THEN
235 info = 8
236 ELSE IF (incx.EQ.0) THEN
237 info = 10
238 ELSE IF (incy.EQ.0) THEN
239 info = 13
240 END IF
241 IF (info.NE.0) THEN
242 CALL xerbla('DGBMV ',info)
243 RETURN
244 END IF
245*
246* Quick return if possible.
247*
248 IF ((m.EQ.0) .OR. (n.EQ.0) .OR.
249 + ((alpha.EQ.zero).AND. (beta.EQ.one))) RETURN
250*
251* Set LENX and LENY, the lengths of the vectors x and y, and set
252* up the start points in X and Y.
253*
254 IF (lsame(trans,'N')) THEN
255 lenx = n
256 leny = m
257 ELSE
258 lenx = m
259 leny = n
260 END IF
261 IF (incx.GT.0) THEN
262 kx = 1
263 ELSE
264 kx = 1 - (lenx-1)*incx
265 END IF
266 IF (incy.GT.0) THEN
267 ky = 1
268 ELSE
269 ky = 1 - (leny-1)*incy
270 END IF
271*
272* Start the operations. In this version the elements of A are
273* accessed sequentially with one pass through the band part of A.
274*
275* First form y := beta*y.
276*
277 IF (beta.NE.one) THEN
278 IF (incy.EQ.1) THEN
279 IF (beta.EQ.zero) THEN
280 DO 10 i = 1,leny
281 y(i) = zero
282 10 CONTINUE
283 ELSE
284 DO 20 i = 1,leny
285 y(i) = beta*y(i)
286 20 CONTINUE
287 END IF
288 ELSE
289 iy = ky
290 IF (beta.EQ.zero) THEN
291 DO 30 i = 1,leny
292 y(iy) = zero
293 iy = iy + incy
294 30 CONTINUE
295 ELSE
296 DO 40 i = 1,leny
297 y(iy) = beta*y(iy)
298 iy = iy + incy
299 40 CONTINUE
300 END IF
301 END IF
302 END IF
303 IF (alpha.EQ.zero) RETURN
304 kup1 = ku + 1
305 IF (lsame(trans,'N')) THEN
306*
307* Form y := alpha*A*x + y.
308*
309 jx = kx
310 IF (incy.EQ.1) THEN
311 DO 60 j = 1,n
312 temp = alpha*x(jx)
313 k = kup1 - j
314 DO 50 i = max(1,j-ku),min(m,j+kl)
315 y(i) = y(i) + temp*a(k+i,j)
316 50 CONTINUE
317 jx = jx + incx
318 60 CONTINUE
319 ELSE
320 DO 80 j = 1,n
321 temp = alpha*x(jx)
322 iy = ky
323 k = kup1 - j
324 DO 70 i = max(1,j-ku),min(m,j+kl)
325 y(iy) = y(iy) + temp*a(k+i,j)
326 iy = iy + incy
327 70 CONTINUE
328 jx = jx + incx
329 IF (j.GT.ku) ky = ky + incy
330 80 CONTINUE
331 END IF
332 ELSE
333*
334* Form y := alpha*A**T*x + y.
335*
336 jy = ky
337 IF (incx.EQ.1) THEN
338 DO 100 j = 1,n
339 temp = zero
340 k = kup1 - j
341 DO 90 i = max(1,j-ku),min(m,j+kl)
342 temp = temp + a(k+i,j)*x(i)
343 90 CONTINUE
344 y(jy) = y(jy) + alpha*temp
345 jy = jy + incy
346 100 CONTINUE
347 ELSE
348 DO 120 j = 1,n
349 temp = zero
350 ix = kx
351 k = kup1 - j
352 DO 110 i = max(1,j-ku),min(m,j+kl)
353 temp = temp + a(k+i,j)*x(ix)
354 ix = ix + incx
355 110 CONTINUE
356 y(jy) = y(jy) + alpha*temp
357 jy = jy + incy
358 IF (j.GT.ku) kx = kx + incx
359 120 CONTINUE
360 END IF
361 END IF
362*
363 RETURN
364*
365* End of DGBMV
366*
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:60
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:53
Here is the call graph for this function:
Here is the caller graph for this function: