MURRV

Multiplies a real rectangular matrix by a vector.

Required Arguments

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)

Optional Arguments

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).

FORTRAN 90 Interface

Generic: CALL MURRV (A, X, Y [])

Specific: The specific interface names are S_MURRV and D_MURRV.

FORTRAN 77 Interface

Single: CALL MURRV (NRA, NCA, A, LDA, NX, X, IPATH, NY, Y)

Double: The double precision name is DMURRV.

Description

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.

Example

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

Output

 

y = Ax

1 2 3

3.000 6.000 8.000