# NAG FL Interfacef06sgf (ztbmv)

## 1Purpose

f06sgf computes the matrix-vector product for a complex triangular band matrix, its transpose or its conjugate transpose.

## 2Specification

Fortran Interface
 Subroutine f06sgf ( uplo, diag, n, k, a, lda, x, incx)
 Integer, Intent (In) :: n, k, lda, incx Complex (Kind=nag_wp), Intent (In) :: a(lda,*) Complex (Kind=nag_wp), Intent (Inout) :: x(*) Character (1), Intent (In) :: uplo, trans, diag
#include <nag.h>
 void f06sgf_ (const char *uplo, const char *trans, const char *diag, const Integer *n, const Integer *k, const Complex a[], const Integer *lda, Complex x[], const Integer *incx, const Charlen length_uplo, const Charlen length_trans, const Charlen length_diag)
The routine may be called by the names f06sgf, nagf_blas_ztbmv or its BLAS name ztbmv.

## 3Description

f06sgf performs one of the matrix-vector operations
 $x←Ax , x←ATx or x←AHx ,$
where $A$ is an $n$ by $n$ complex triangular band matrix with $k$ subdiagonals or superdiagonals, and $x$ is an $n$-element complex vector.

None.

## 5Arguments

1: $\mathbf{uplo}$Character(1) Input
On entry: specifies whether $A$ is upper or lower triangular.
${\mathbf{uplo}}=\text{'U'}$
$A$ is upper triangular.
${\mathbf{uplo}}=\text{'L'}$
$A$ is lower triangular.
Constraint: ${\mathbf{uplo}}=\text{'U'}$ or $\text{'L'}$.
2: $\mathbf{trans}$Character(1) Input
On entry: specifies the operation to be performed.
${\mathbf{trans}}=\text{'N'}$
$x←Ax$.
${\mathbf{trans}}=\text{'T'}$
$x←{A}^{\mathrm{T}}x$.
${\mathbf{trans}}=\text{'C'}$
$x←{A}^{\mathrm{H}}x$.
Constraint: ${\mathbf{trans}}=\text{'N'}$, $\text{'T'}$ or $\text{'C'}$.
3: $\mathbf{diag}$Character(1) Input
On entry: specifies whether $A$ has nonunit or unit diagonal elements.
${\mathbf{diag}}=\text{'N'}$
The diagonal elements are stored explicitly.
${\mathbf{diag}}=\text{'U'}$
The diagonal elements are assumed to be $1$, and are not referenced.
Constraint: ${\mathbf{diag}}=\text{'N'}$ or $\text{'U'}$.
4: $\mathbf{n}$Integer Input
On entry: $n$, the order of the matrix $A$.
Constraint: ${\mathbf{n}}\ge 0$.
5: $\mathbf{k}$Integer Input
On entry: $k$, the number of subdiagonals or superdiagonals of the matrix $A$.
Constraint: ${\mathbf{k}}\ge 0$.
6: $\mathbf{a}\left({\mathbf{lda}},*\right)$Complex (Kind=nag_wp) array Input
Note: the second dimension of the array a must be at least ${\mathbf{n}}$.
On entry: the $n$ by $n$ triangular band matrix $A$
The matrix is stored in rows $1$ to $k+1$, more precisely,
• if ${\mathbf{uplo}}=\text{'U'}$, the elements of the upper triangle of $A$ within the band must be stored with element ${A}_{ij}$ in ${\mathbf{a}}\left(k+1+i-j,j\right)\text{​ for ​}\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,j-k\right)\le i\le j$;
• if ${\mathbf{uplo}}=\text{'L'}$, the elements of the lower triangle of $A$ within the band must be stored with element ${A}_{ij}$ in ${\mathbf{a}}\left(1+i-j,j\right)\text{​ for ​}j\le i\le \mathrm{min}\phantom{\rule{0.125em}{0ex}}\left(n,j+k\right)\text{.}$
If ${\mathbf{diag}}=\text{'U'}$, the diagonal elements of $A$ are assumed to be $1$, and are not referenced.
7: $\mathbf{lda}$Integer Input
On entry: the first dimension of the array a as declared in the (sub)program from which f06sgf is called.
Constraint: ${\mathbf{lda}}\ge {\mathbf{k}}+1$.
8: $\mathbf{x}\left(*\right)$Complex (Kind=nag_wp) array Input/Output
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)$.
On entry: the vector $x$.
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}}$.
On exit: the updated vector $x$ stored in the array elements used to supply the original vector $x$.
9: $\mathbf{incx}$Integer Input
On entry: the increment in the subscripts of x between successive elements of $x$.
Constraint: ${\mathbf{incx}}\ne 0$.

None.

Not applicable.

## 8Parallelism and Performance

f06sgf is not threaded in any implementation.