Home

gemv

gemv, short for general matrix–vector multiplication, is a routine from the BLAS (Basic Linear Algebra Subprograms) library. It computes a linear combination of a matrix–vector product and a scaled existing vector, delivering y = alpha * op(A) * x + beta * y, where A is a general matrix, x and y are vectors, and alpha and beta are scalars. The routine supports real and complex data and can apply a transpose or conjugate transpose to A.

The operation uses an input matrix A of size m by n and two vectors x and

In practice, gemv is used for matrix–vector products within iterative solvers, projections, and various linear algebra

y.
The
parameter
TRANS
determines
how
A
is
used:
'N'
uses
A
as
is
(op(A)
=
A),
'T'
uses
A
transposed
(op(A)
=
A^T),
and
'C'
uses
the
conjugate
transpose
(op(A)
=
A^H)
for
complex
data.
When
TRANS
=
'N',
y
has
length
m
and
x
has
length
n;
when
TRANS
=
'T'
or
'C',
y
has
length
n
and
x
has
length
m.
The
routine
also
requires
the
leading
dimension
LDA
of
A
(LDA
>=
max(1,
m)
for
TRANS
=
'N'),
and
increments
INCX
and
INCY
for
the
elements
of
x
and
y.
operations.
Implementations
exist
in
many
libraries
(NetLIB
BLAS,
OpenBLAS,
Intel
MKL)
and
exploit
cache-friendly
and
vectorized
code
paths.
The
routine
is
typically
accessed
through
language
bindings
that
adapt
the
Fortran
BLAS
interface
to
C,
C++,
or
other
environments,
with
column-major
storage
assumed
by
default
in
standard
BLAS
conventions.