MURBV
Multiplies a real band matrix in band storage mode by a real vector.
Required Arguments
A — Real NLCA + NUCA + 1 by N band matrix stored in band mode. (Input)
NLCA — Number of lower codiagonals in A. (Input)
NUCA — Number of upper codiagonals in A. (Input)
X — Real vector of length NX. (Input)
Y — Real vector of length NY containing the product A * X if IPATH is equal to 1 and the product trans(A) * X if IPATH is equal to 2. (Output)
Optional Arguments
N — Order of the matrix. (Input)
Default: N = SIZE (A,2).
LDA — Leading dimension of A exactly as specified in the dimension statement of the calling program. (Input)
Default: LDA = SIZE (A,1).
NX — Length of the vector X. (Input)
NX must be equal to N.
Default: NX = SIZE (X,1).
IPATH — Integer flag. (Input)
IPATH = 1 means the product Y = A * X is computed. IPATH = 2 means the product Y = trans(A) * X is computed, where trans(A) is the transpose of A.
Default: IPATH = 1.
NY — Length of vector Y. (Input)
NY must be equal to N.
Default: NY = SIZE (Y,1).
FORTRAN 90 Interface
Generic: CALL MURBV (A, NLCA, NUCA, X, Y [, …])
Specific: The specific interface names are S_MURBV and D_MURBV.
FORTRAN 77 Interface
Single: CALL MURBV (N, A, LDA, NLCA, NUCA, NX, X, IPATH, NY, Y)
Double: The double precision name is DMURBV.
Description
If IPATH = 1, MURBV computes y = Ax, where A is a real band matrix and x and y are real vectors. If IPATH = 2, MURBV computes y = ATx.
Example
Multiply a real band matrix of order 6, with two upper codiagonals and two lower codiagonals stored in band mode, by a real vector of length 6. The output vector will be a real vector of length 6.
USE MURBV_INT
USE WRRRN_INT
IMPLICIT NONE
! Declare variables
INTEGER LDA, N, NLCA, NUCA, NX, NY
PARAMETER (LDA=5, N=6, NLCA=2, NUCA=2, NX=6, NY=6)
!
INTEGER IPATH
REAL A(LDA,N), X(NX), Y(NY)
! Set values for A (in band mode)
! A = ( 0.0 0.0 1.0 2.0 3.0 4.0 )
! ( 0.0 1.0 2.0 3.0 4.0 5.0 )
! ( 1.0 2.0 3.0 4.0 5.0 6.0 )
! (-1.0 -2.0 -3.0 -4.0 -5.0 0.0 )
! (-5.0 -6.0 -7.0 -8.0 0.0 0.0 )
!
! Set values for X
! X = (-1.0 2.0 -3.0 4.0 -5.0 6.0 )
!
DATA A/0.0, 0.0, 1.0, -1.0, -5.0, 0.0, 1.0, 2.0, -2.0, -6.0, &
1.0, 2.0, 3.0, -3.0, -7.0, 2.0, 3.0, 4.0, -4.0, -8.0, 3.0, &
4.0, 5.0, -5.0, 0.0, 4.0, 5.0, 6.0, 0.0, 0.0/
DATA X/-1.0, 2.0, -3.0, 4.0, -5.0, 6.0/
! Compute y = Ax
IPATH = 1
CALL MURBV (A, NLCA, NUCA, X, Y)
! Print results
CALL WRRRN ('y = Ax', Y, 1, NY, 1)
END
y = Ax
1 2 3 4 5 6
-2.00 7.00 -11.00 17.00 10.00 29.00