NAG Library Routine Document

1Purpose

f01vbf (ztrttp) copies a complex triangular matrix, stored in a full format array, to a packed format array.

2Specification

Fortran Interface
 Subroutine f01vbf ( uplo, n, a, lda, ap, info)
 Integer, Intent (In) :: n, lda Integer, Intent (Out) :: info Complex (Kind=nag_wp), Intent (In) :: a(lda,*) Complex (Kind=nag_wp), Intent (Out) :: ap(n*(n+1)/2) Character (1), Intent (In) :: uplo
#include nagmk26.h
 void f01vbf_ (const char *uplo, const Integer *n, const Complex a[], const Integer *lda, Complex ap[], Integer *info, const Charlen length_uplo)
The routine may be called by its LAPACK name ztrttp.

3Description

f01vbf (ztrttp) packs a complex $n$ by $n$ triangular matrix $A$, stored conventionally in a full format array, into an array of length $n\left(n+1\right)/2$. The matrix is packed by columns. This routine is intended for possible use in conjunction with routines from Chapters F06, F07, F08 and F16 where some routines use triangular matrices stored in the packed form. Packed storage format is described in Section 3.3.2 in the F07 Chapter Introduction.

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{n}$ – IntegerInput
On entry: $n$, the order of the matrix $A$.
Constraint: ${\mathbf{n}}\ge 0$.
3:     $\mathbf{a}\left({\mathbf{lda}},*\right)$ – Complex (Kind=nag_wp) arrayInput
Note: the second dimension of the array a must be at least ${\mathbf{n}}$.
On entry: the triangular matrix $A$.
• If ${\mathbf{uplo}}=\text{'U'}$, $A$ is upper triangular and the elements of the array below the diagonal are not referenced.
• If ${\mathbf{uplo}}=\text{'L'}$, $A$ is lower triangular and the elements of the array above the diagonal are not referenced.
4:     $\mathbf{lda}$ – IntegerInput
On entry: the first dimension of the array a as declared in the (sub)program from which f01vbf (ztrttp) is called.
Constraint: ${\mathbf{lda}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
5:     $\mathbf{ap}\left({\mathbf{n}}×\left({\mathbf{n}}+1\right)/2\right)$ – Complex (Kind=nag_wp) arrayOutput
On exit: the $n$ by $n$ triangular matrix $A$, packed by columns.
More precisely,
• if ${\mathbf{uplo}}=\text{'U'}$, the upper triangle of $A$ is 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$ is stored with element ${A}_{ij}$ in ${\mathbf{ap}}\left(i+\left(2n-j\right)\left(j-1\right)/2\right)$ for $i\ge j$.
6:     $\mathbf{info}$ – IntegerOutput
On exit: ${\mathbf{info}}=0$ unless the routine detects an error (see Section 6).

6Error Indicators and Warnings

${\mathbf{info}}<0$
If ${\mathbf{info}}=-i$, argument $i$ had an illegal value. An explanatory message is output, and execution of the program is terminated.

Not applicable.

8Parallelism and Performance

f01vbf (ztrttp) is not threaded in any implementation.

None.

10Example

This example reads in a triangular matrix and copies it to packed format.

10.1Program Text

Program Text (f01vbfe.f90)

10.2Program Data

Program Data (f01vbfe.d)

10.3Program Results

Program Results (f01vbfe.r)

© The Numerical Algorithms Group Ltd, Oxford, UK. 2017