F06SHF (ZTPMV) (PDF version)
F06 Chapter Contents
F06 Chapter Introduction
NAG Library Manual

# NAG Library Routine DocumentF06SHF (ZTPMV)

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

F06SHF (ZTPMV) computes the matrix-vector product for a complex triangular matrix, its transpose or its conjugate transpose, stored in packed form.

## 2  Specification

 SUBROUTINE F06SHF ( UPLO, TRANS, DIAG, N, AP, X, INCX)
 INTEGER N, INCX COMPLEX (KIND=nag_wp) AP(*), X(*) CHARACTER(1) UPLO, TRANS, DIAG
The routine may be called by its BLAS name ztpmv.

## 3  Description

F06SHF (ZTPMV) performs one of the matrix-vector operations
 $x←Ax , x←ATx or x←AHx ,$
where $A$ is an $n$ by $n$ complex triangular matrix, stored in packed form, and $x$ is an $n$-element complex vector.
None.

## 5  Parameters

1:     $\mathrm{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:     $\mathrm{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:     $\mathrm{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:     $\mathrm{N}$ – INTEGERInput
On entry: $n$, the order of the matrix $A$.
Constraint: ${\mathbf{N}}\ge 0$.
5:     $\mathrm{AP}\left(*\right)$ – COMPLEX (KIND=nag_wp) arrayInput
Note: the dimension of the array AP must be at least ${\mathbf{N}}×\left({\mathbf{N}}+1\right)/2$.
On entry: the $n$ by $n$ triangular matrix $A$, packed by columns.
More precisely,
• if ${\mathbf{UPLO}}=\text{'U'}$, the upper triangle of $A$ must be stored with element ${A}_{ij}$ in ${\mathbf{AP}}\left(i+j\left(j-1\right)/2\right)$ for $i\le j$;
• if ${\mathbf{UPLO}}=\text{'L'}$, the lower triangle of $A$ must be stored with element ${A}_{ij}$ in ${\mathbf{AP}}\left(i+\left(2n-j\right)\left(j-1\right)/2\right)$ for $i\ge j$.
If ${\mathbf{DIAG}}=\text{'U'}$, the diagonal elements of $A$ are assumed to be $1$, and are not referenced; the same storage scheme is used whether ${\mathbf{DIAG}}=\text{'N'}$ or ‘U’.
6:     $\mathrm{X}\left(*\right)$ – COMPLEX (KIND=nag_wp) arrayInput/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$.
7:     $\mathrm{INCX}$ – INTEGERInput
On entry: the increment in the subscripts of X between successive elements of $x$.
Constraint: ${\mathbf{INCX}}\ne 0$.

None.

Not applicable.

Not applicable.

None.

## 10  Example

None.

F06SHF (ZTPMV) (PDF version)
F06 Chapter Contents
F06 Chapter Introduction
NAG Library Manual