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

◆ chbmv()

subroutine chbmv ( character  uplo,
integer  n,
integer  k,
complex  alpha,
complex, dimension(lda,*)  a,
integer  lda,
complex, dimension(*)  x,
integer  incx,
complex  beta,
complex, dimension(*)  y,
integer  incy 
)

CHBMV

Purpose:
 CHBMV  performs the matrix-vector  operation

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

 where alpha and beta are scalars, x and y are n element vectors and
 A is an n by n hermitian band matrix, with k super-diagonals.
Parameters
[in]UPLO
          UPLO is CHARACTER*1
           On entry, UPLO specifies whether the upper or lower
           triangular part of the band matrix A is being supplied as
           follows:

              UPLO = 'U' or 'u'   The upper triangular part of A is
                                  being supplied.

              UPLO = 'L' or 'l'   The lower triangular part of A is
                                  being supplied.
[in]N
          N is INTEGER
           On entry, N specifies the order of the matrix A.
           N must be at least zero.
[in]K
          K is INTEGER
           On entry, K specifies the number of super-diagonals of the
           matrix A. K must satisfy  0 .le. K.
[in]ALPHA
          ALPHA is COMPLEX
           On entry, ALPHA specifies the scalar alpha.
[in]A
          A is COMPLEX array, dimension ( LDA, N )
           Before entry with UPLO = 'U' or 'u', the leading ( k + 1 )
           by n part of the array A must contain the upper triangular
           band part of the hermitian matrix, supplied column by
           column, with the leading diagonal of the matrix in row
           ( k + 1 ) of the array, the first super-diagonal starting at
           position 2 in row k, and so on. The top left k by k triangle
           of the array A is not referenced.
           The following program segment will transfer the upper
           triangular part of a hermitian band matrix from conventional
           full matrix storage to band storage:

                 DO 20, J = 1, N
                    M = K + 1 - J
                    DO 10, I = MAX( 1, J - K ), J
                       A( M + I, J ) = matrix( I, J )
              10    CONTINUE
              20 CONTINUE

           Before entry with UPLO = 'L' or 'l', the leading ( k + 1 )
           by n part of the array A must contain the lower triangular
           band part of the hermitian matrix, supplied column by
           column, with the leading diagonal of the matrix in row 1 of
           the array, the first sub-diagonal starting at position 1 in
           row 2, and so on. The bottom right k by k triangle of the
           array A is not referenced.
           The following program segment will transfer the lower
           triangular part of a hermitian band matrix from conventional
           full matrix storage to band storage:

                 DO 20, J = 1, N
                    M = 1 - J
                    DO 10, I = J, MIN( N, J + K )
                       A( M + I, J ) = matrix( I, J )
              10    CONTINUE
              20 CONTINUE

           Note that the imaginary parts of the diagonal elements need
           not be set and are assumed to be zero.
[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
           ( k + 1 ).
[in]X
          X is COMPLEX array, dimension at least
           ( 1 + ( n - 1 )*abs( INCX ) ).
           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 COMPLEX
           On entry, BETA specifies the scalar beta.
[in,out]Y
          Y is COMPLEX array, dimension at least
           ( 1 + ( n - 1 )*abs( INCY ) ).
           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 186 of file chbmv.f.

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