F06 Chapter Contents
F06 Chapter Introduction
NAG Library Manual

# NAG Library Routine DocumentF06SAF (ZGEMV)

Note:  before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.

## 1  Purpose

F06SAF (ZGEMV) computes the matrix-vector product for a complex general matrix, its transpose or its conjugate transpose.

## 2  Specification

 SUBROUTINE F06SAF ( TRANS, M, N, ALPHA, A, LDA, X, INCX, BETA, Y, INCY)
 INTEGER M, N, LDA, INCX, INCY COMPLEX (KIND=nag_wp) ALPHA, A(LDA,*), X(*), BETA, Y(*) CHARACTER(1) TRANS
The routine may be called by its BLAS name zgemv.

## 3  Description

F06SAF (ZGEMV) performs one of the matrix-vector operations
 $y←αAx + βy , y←αATx + βy or y←αAHx + βy ,$
where $A$ is an $m$ by $n$ complex matrix, $x$ and $y$ are complex vectors, and $\alpha$ and $\beta$ are complex scalars.
If $m=0$ or $n=0$, no operation is performed.

None.

## 5  Parameters

1:     TRANS – CHARACTER(1)Input
On entry: specifies the operation to be performed.
${\mathbf{TRANS}}=\text{'N'}$
$y←\alpha Ax+\beta y$.
${\mathbf{TRANS}}=\text{'T'}$
$y←\alpha {A}^{\mathrm{T}}x+\beta y$.
${\mathbf{TRANS}}=\text{'C'}$
$y←\alpha {A}^{\mathrm{H}}x+\beta y$.
Constraint: ${\mathbf{TRANS}}=\text{'N'}$, $\text{'T'}$ or $\text{'C'}$.
2:     M – INTEGERInput
On entry: $m$, the number of rows of the matrix $A$.
Constraint: ${\mathbf{M}}\ge 0$.
3:     N – INTEGERInput
On entry: $n$, the number of columns of the matrix $A$.
Constraint: ${\mathbf{N}}\ge 0$.
4:     ALPHA – COMPLEX (KIND=nag_wp)Input
On entry: the scalar $\alpha$.
5:     A(LDA,$*$) – COMPLEX (KIND=nag_wp) arrayInput
Note: the second dimension of the array A must be at least ${\mathbf{N}}$.
On entry: the $m$ by $n$ matrix $A$.
6:     LDA – INTEGERInput
On entry: the first dimension of the array A as declared in the (sub)program from which F06SAF (ZGEMV) is called.
Constraint: ${\mathbf{LDA}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{M}}\right)$.
7:     X($*$) – COMPLEX (KIND=nag_wp) arrayInput
Note: the dimension of the array X must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,1+\left({\mathbf{N}}-1\right)×\left|{\mathbf{INCX}}\right|\right)$ if ${\mathbf{TRANS}}=\text{'N'}$ and at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,1+\left({\mathbf{M}}-1\right)×\left|{\mathbf{INCX}}\right|\right)$ if ${\mathbf{TRANS}}=\text{'T'}$ or $\text{'C'}$.
On entry: the vector $x$.
If ${\mathbf{TRANS}}=\text{'N'}$,
• if ${\mathbf{INCX}}>0$, ${x}_{\mathit{i}}$ must be stored in ${\mathbf{X}}\left(1+\left(\mathit{i}-1\right)×{\mathbf{INCX}}\right)$, for $\mathit{i}=1,2,\dots ,{\mathbf{N}}$;
• if ${\mathbf{INCX}}<0$, ${x}_{\mathit{i}}$ must be stored in ${\mathbf{X}}\left(1-\left({\mathbf{N}}-\mathit{i}\right)×{\mathbf{INCX}}\right)$, for $\mathit{i}=1,2,\dots ,{\mathbf{N}}$.
If ${\mathbf{TRANS}}=\text{'T'}$ or $\text{'C'}$,
• if ${\mathbf{INCX}}>0$, ${x}_{\mathit{i}}$ must be stored in ${\mathbf{X}}\left(1+\left(\mathit{i}-1\right)×{\mathbf{INCX}}\right)$, for $\mathit{i}=1,2,\dots ,{\mathbf{M}}$;
• if ${\mathbf{INCX}}<0$, ${x}_{\mathit{i}}$ must be stored in ${\mathbf{X}}\left(1-\left({\mathbf{M}}-\mathit{i}\right)×{\mathbf{INCX}}\right)$, for $\mathit{i}=1,2,\dots ,{\mathbf{M}}$.
8:     INCX – INTEGERInput
On entry: the increment in the subscripts of X between successive elements of $x$.
Constraint: ${\mathbf{INCX}}\ne 0$.
9:     BETA – COMPLEX (KIND=nag_wp)Input
On entry: the scalar $\beta$.
10:   Y($*$) – COMPLEX (KIND=nag_wp) arrayInput/Output
Note: the dimension of the array Y must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,1+\left({\mathbf{M}}-1\right)×\left|{\mathbf{INCY}}\right|\right)$ if ${\mathbf{TRANS}}=\text{'N'}$ and at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,1+\left({\mathbf{N}}-1\right)×\left|{\mathbf{INCY}}\right|\right)$ if ${\mathbf{TRANS}}=\text{'T'}$ or $\text{'C'}$.
On entry: the vector $y$, if ${\mathbf{BETA}}=0.0$, Y need not be set.
If ${\mathbf{TRANS}}=\text{'N'}$,
• if ${\mathbf{INCY}}>0$, ${y}_{\mathit{i}}$ must be stored in ${\mathbf{Y}}\left(1+\left(\mathit{i}-1\right)×{\mathbf{INCY}}\right)$, for $\mathit{i}=1,2,\dots ,{\mathbf{M}}$;
• if ${\mathbf{INCY}}<0$, ${y}_{\mathit{i}}$ must be stored in ${\mathbf{Y}}\left(1-\left({\mathbf{M}}-\mathit{i}\right)×{\mathbf{INCY}}\right)$, for $\mathit{i}=1,2,\dots ,{\mathbf{M}}$.
If ${\mathbf{TRANS}}=\text{'T'}$ or $\text{'C'}$,
• if ${\mathbf{INCY}}>0$, ${y}_{\mathit{i}}$ must be stored in ${\mathbf{Y}}\left(1+\left(\mathit{i}-1\right)×{\mathbf{INCY}}\right)$, for $\mathit{i}=1,2,\dots ,{\mathbf{N}}$;
• if ${\mathbf{INCY}}<0$, ${y}_{\mathit{i}}$ must be stored in ${\mathbf{Y}}\left(1-\left({\mathbf{N}}-\mathit{i}\right)×{\mathbf{INCY}}\right)$, for $\mathit{i}=1,2,\dots ,{\mathbf{N}}$.
On exit: the updated vector $y$ stored in the array elements used to supply the original vector $y$.
11:   INCY – INTEGERInput
On entry: the increment in the subscripts of Y between successive elements of $y$.
Constraint: ${\mathbf{INCY}}\ne 0$.

None.

Not applicable.

None.

None.