Multiplies a real rectangular matrix by a vector.
A — Real NRA by NCA rectangular matrix. (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)
NRA — Number of
rows of A.
(Input)
Default: NRA = size
(A,1).
NCA — Number of
columns of A.
(Input)
Default: NCA = 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 NCA if
IPATH is equal
to 1. NX must be
equal to NRA if
IPATH is equal
to 2.
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
the vector Y. (Input)
NY must be
equal to NRA if
IPATH is equal
to 1. NY must be
equal to NCA if
IPATH is equal
to 2.
Default: NY = size
(Y,1).
Generic: CALL MURRV (A, X, Y [,…])
Specific: The specific interface names are S_MURRV and D_MURRV.
Single: CALL MURRV (NRA, NCA, A, LDA, NX, X, IPATH, NY, Y)
Double: The double precision name is DMURRV.
If IPATH = 1, MURRV computes y = Ax, where A is a real general matrix and x and y are real vectors. If IPATH = 2, MURRV computes y = ATx.
Multiply a 3 ´ 3 real matrix by a real vector of length 3. The output vector will be a real vector of length 3.
USE MURRV_INT
USE WRRRN_INT
IMPLICIT NONE
! Declare variables
INTEGER LDA, NCA, NRA, NX, NY
PARAMETER (NCA=3, NRA=3, NX=3, NY=3)
!
INTEGER IPATH
REAL A(NRA,NCA), X(NX), Y(NY)
! Set values for A and X
! A = ( 1.0 0.0 2.0 )
! ( 0.0 3.0 0.0 )
! ( 4.0 1.0 2.0 )
!
! X = ( 1.0 2.0 1.0 )
!
!
DATA A/1.0, 0.0, 4.0, 0.0, 3.0, 1.0, 2.0, 0.0, 2.0/
DATA X/1.0, 2.0, 1.0/
! Compute y = Ax
IPATH = 1
CALL MURRV (A, X, Y)
! Print results
CALL WRRRN ('y = Ax', Y, 1, NY, 1)
END
y =
Ax
1
2 3
3.000 6.000
8.000
Visual Numerics, Inc. PHONE: 713.784.3131 FAX:713.781.9260 |