LAPACK  3.10.0
LAPACK: Linear Algebra PACKage

◆ sla_gbamv()

subroutine sla_gbamv ( integer  TRANS,
integer  M,
integer  N,
integer  KL,
integer  KU,
real  ALPHA,
real, dimension( ldab, * )  AB,
integer  LDAB,
real, dimension( * )  X,
integer  INCX,
real  BETA,
real, dimension( * )  Y,
integer  INCY 
)

SLA_GBAMV performs a matrix-vector operation to calculate error bounds.

Download SLA_GBAMV + dependencies [TGZ] [ZIP] [TXT]

Purpose:
 SLA_GBAMV  performs one of the matrix-vector operations

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

 where alpha and beta are scalars, x and y are vectors and A is an
 m by n matrix.

 This function is primarily used in calculating error bounds.
 To protect against underflow during evaluation, components in
 the resulting vector are perturbed away from zero by (N+1)
 times the underflow threshold.  To prevent unnecessarily large
 errors for block-structure embedded in general matrices,
 "symbolically" zero components are not perturbed.  A zero
 entry is considered "symbolic" if all multiplications involved
 in computing that entry have at least one zero multiplicand.
Parameters
[in]TRANS
          TRANS is INTEGER
           On entry, TRANS specifies the operation to be performed as
           follows:

             BLAS_NO_TRANS      y := alpha*abs(A)*abs(x) + beta*abs(y)
             BLAS_TRANS         y := alpha*abs(A**T)*abs(x) + beta*abs(y)
             BLAS_CONJ_TRANS    y := alpha*abs(A**T)*abs(x) + beta*abs(y)

           Unchanged on exit.
[in]M
          M is INTEGER
           On entry, M specifies the number of rows of the matrix A.
           M must be at least zero.
           Unchanged on exit.
[in]N
          N is INTEGER
           On entry, N specifies the number of columns of the matrix A.
           N must be at least zero.
           Unchanged on exit.
[in]KL
          KL is INTEGER
           The number of subdiagonals within the band of A.  KL >= 0.
[in]KU
          KU is INTEGER
           The number of superdiagonals within the band of A.  KU >= 0.
[in]ALPHA
          ALPHA is REAL
           On entry, ALPHA specifies the scalar alpha.
           Unchanged on exit.
[in]AB
          AB is REAL array, dimension ( LDAB, n )
           Before entry, the leading m by n part of the array AB must
           contain the matrix of coefficients.
           Unchanged on exit.
[in]LDAB
          LDAB is INTEGER
           On entry, LDA specifies the first dimension of AB as declared
           in the calling (sub) program. LDAB must be at least
           max( 1, m ).
           Unchanged on exit.
[in]X
          X is REAL array, dimension
           ( 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.
           Unchanged on exit.
[in]INCX
          INCX is INTEGER
           On entry, INCX specifies the increment for the elements of
           X. INCX must not be zero.
           Unchanged on exit.
[in]BETA
          BETA is REAL
           On entry, BETA specifies the scalar beta. When BETA is
           supplied as zero then Y need not be set on input.
           Unchanged on exit.
[in,out]Y
          Y is REAL array, dimension
           ( 1 + ( m - 1 )*abs( INCY ) ) when TRANS = 'N' or 'n'
           and at least
           ( 1 + ( n - 1 )*abs( INCY ) ) otherwise.
           Before entry with BETA non-zero, 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.
           Unchanged on exit.

  Level 2 Blas routine.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 183 of file sla_gbamv.f.

185 *
186 * -- LAPACK computational routine --
187 * -- LAPACK 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  REAL ALPHA, BETA
192  INTEGER INCX, INCY, LDAB, M, N, KL, KU, TRANS
193 * ..
194 * .. Array Arguments ..
195  REAL AB( LDAB, * ), X( * ), Y( * )
196 * ..
197 *
198 * =====================================================================
199 * .. Parameters ..
200  REAL ONE, ZERO
201  parameter( one = 1.0e+0, zero = 0.0e+0 )
202 * ..
203 * .. Local Scalars ..
204  LOGICAL SYMB_ZERO
205  REAL TEMP, SAFE1
206  INTEGER I, INFO, IY, J, JX, KX, KY, LENX, LENY, KD, KE
207 * ..
208 * .. External Subroutines ..
209  EXTERNAL xerbla, slamch
210  REAL SLAMCH
211 * ..
212 * .. External Functions ..
213  EXTERNAL ilatrans
214  INTEGER ILATRANS
215 * ..
216 * .. Intrinsic Functions ..
217  INTRINSIC max, abs, sign
218 * ..
219 * .. Executable Statements ..
220 *
221 * Test the input parameters.
222 *
223  info = 0
224  IF ( .NOT.( ( trans.EQ.ilatrans( 'N' ) )
225  $ .OR. ( trans.EQ.ilatrans( 'T' ) )
226  $ .OR. ( trans.EQ.ilatrans( 'C' ) ) ) ) THEN
227  info = 1
228  ELSE IF( m.LT.0 )THEN
229  info = 2
230  ELSE IF( n.LT.0 )THEN
231  info = 3
232  ELSE IF( kl.LT.0 .OR. kl.GT.m-1 ) THEN
233  info = 4
234  ELSE IF( ku.LT.0 .OR. ku.GT.n-1 ) THEN
235  info = 5
236  ELSE IF( ldab.LT.kl+ku+1 )THEN
237  info = 6
238  ELSE IF( incx.EQ.0 )THEN
239  info = 8
240  ELSE IF( incy.EQ.0 )THEN
241  info = 11
242  END IF
243  IF( info.NE.0 )THEN
244  CALL xerbla( 'SLA_GBAMV ', info )
245  RETURN
246  END IF
247 *
248 * Quick return if possible.
249 *
250  IF( ( m.EQ.0 ).OR.( n.EQ.0 ).OR.
251  $ ( ( alpha.EQ.zero ).AND.( beta.EQ.one ) ) )
252  $ RETURN
253 *
254 * Set LENX and LENY, the lengths of the vectors x and y, and set
255 * up the start points in X and Y.
256 *
257  IF( trans.EQ.ilatrans( 'N' ) )THEN
258  lenx = n
259  leny = m
260  ELSE
261  lenx = m
262  leny = n
263  END IF
264  IF( incx.GT.0 )THEN
265  kx = 1
266  ELSE
267  kx = 1 - ( lenx - 1 )*incx
268  END IF
269  IF( incy.GT.0 )THEN
270  ky = 1
271  ELSE
272  ky = 1 - ( leny - 1 )*incy
273  END IF
274 *
275 * Set SAFE1 essentially to be the underflow threshold times the
276 * number of additions in each row.
277 *
278  safe1 = slamch( 'Safe minimum' )
279  safe1 = (n+1)*safe1
280 *
281 * Form y := alpha*abs(A)*abs(x) + beta*abs(y).
282 *
283 * The O(M*N) SYMB_ZERO tests could be replaced by O(N) queries to
284 * the inexact flag. Still doesn't help change the iteration order
285 * to per-column.
286 *
287  kd = ku + 1
288  ke = kl + 1
289  iy = ky
290  IF ( incx.EQ.1 ) THEN
291  IF( trans.EQ.ilatrans( 'N' ) )THEN
292  DO i = 1, leny
293  IF ( beta .EQ. zero ) THEN
294  symb_zero = .true.
295  y( iy ) = 0.0
296  ELSE IF ( y( iy ) .EQ. zero ) THEN
297  symb_zero = .true.
298  ELSE
299  symb_zero = .false.
300  y( iy ) = beta * abs( y( iy ) )
301  END IF
302  IF ( alpha .NE. zero ) THEN
303  DO j = max( i-kl, 1 ), min( i+ku, lenx )
304  temp = abs( ab( kd+i-j, j ) )
305  symb_zero = symb_zero .AND.
306  $ ( x( j ) .EQ. zero .OR. temp .EQ. zero )
307 
308  y( iy ) = y( iy ) + alpha*abs( x( j ) )*temp
309  END DO
310  END IF
311 
312  IF ( .NOT.symb_zero )
313  $ y( iy ) = y( iy ) + sign( safe1, y( iy ) )
314  iy = iy + incy
315  END DO
316  ELSE
317  DO i = 1, leny
318  IF ( beta .EQ. zero ) THEN
319  symb_zero = .true.
320  y( iy ) = 0.0
321  ELSE IF ( y( iy ) .EQ. zero ) THEN
322  symb_zero = .true.
323  ELSE
324  symb_zero = .false.
325  y( iy ) = beta * abs( y( iy ) )
326  END IF
327  IF ( alpha .NE. zero ) THEN
328  DO j = max( i-kl, 1 ), min( i+ku, lenx )
329  temp = abs( ab( ke-i+j, i ) )
330  symb_zero = symb_zero .AND.
331  $ ( x( j ) .EQ. zero .OR. temp .EQ. zero )
332 
333  y( iy ) = y( iy ) + alpha*abs( x( j ) )*temp
334  END DO
335  END IF
336 
337  IF ( .NOT.symb_zero )
338  $ y( iy ) = y( iy ) + sign( safe1, y( iy ) )
339  iy = iy + incy
340  END DO
341  END IF
342  ELSE
343  IF( trans.EQ.ilatrans( 'N' ) )THEN
344  DO i = 1, leny
345  IF ( beta .EQ. zero ) THEN
346  symb_zero = .true.
347  y( iy ) = 0.0
348  ELSE IF ( y( iy ) .EQ. zero ) THEN
349  symb_zero = .true.
350  ELSE
351  symb_zero = .false.
352  y( iy ) = beta * abs( y( iy ) )
353  END IF
354  IF ( alpha .NE. zero ) THEN
355  jx = kx
356  DO j = max( i-kl, 1 ), min( i+ku, lenx )
357  temp = abs( ab( kd+i-j, j ) )
358  symb_zero = symb_zero .AND.
359  $ ( x( jx ) .EQ. zero .OR. temp .EQ. zero )
360 
361  y( iy ) = y( iy ) + alpha*abs( x( jx ) )*temp
362  jx = jx + incx
363  END DO
364  END IF
365 
366  IF ( .NOT.symb_zero )
367  $ y( iy ) = y( iy ) + sign( safe1, y( iy ) )
368 
369  iy = iy + incy
370  END DO
371  ELSE
372  DO i = 1, leny
373  IF ( beta .EQ. zero ) THEN
374  symb_zero = .true.
375  y( iy ) = 0.0
376  ELSE IF ( y( iy ) .EQ. zero ) THEN
377  symb_zero = .true.
378  ELSE
379  symb_zero = .false.
380  y( iy ) = beta * abs( y( iy ) )
381  END IF
382  IF ( alpha .NE. zero ) THEN
383  jx = kx
384  DO j = max( i-kl, 1 ), min( i+ku, lenx )
385  temp = abs( ab( ke-i+j, i ) )
386  symb_zero = symb_zero .AND.
387  $ ( x( jx ) .EQ. zero .OR. temp .EQ. zero )
388 
389  y( iy ) = y( iy ) + alpha*abs( x( jx ) )*temp
390  jx = jx + incx
391  END DO
392  END IF
393 
394  IF ( .NOT.symb_zero )
395  $ y( iy ) = y( iy ) + sign( safe1, y( iy ) )
396 
397  iy = iy + incy
398  END DO
399  END IF
400 
401  END IF
402 *
403  RETURN
404 *
405 * End of SLA_GBAMV
406 *
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:60
integer function ilatrans(TRANS)
ILATRANS
Definition: ilatrans.f:58
real function slamch(CMACH)
SLAMCH
Definition: slamch.f:68
Here is the call graph for this function:
Here is the caller graph for this function: