# NAG Library Routine Document

## 1Purpose

f01vdf (ztpttr) unpacks a complex triangular matrix, stored in a standard packed format array, to a full format array.

## 2Specification

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

## 3Description

f01vdf (ztpttr) unpacks a complex $n$ by $n$ triangular matrix $A$, stored in an array of length $n\left(n+1\right)/2$, to conventional storage in a full format array. 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{ap}\left({\mathbf{n}}×\left({\mathbf{n}}+1\right)/2\right)$ – Complex (Kind=nag_wp) arrayInput
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$.
4:     $\mathbf{a}\left({\mathbf{lda}},*\right)$ – Complex (Kind=nag_wp) arrayOutput
Note: the second dimension of the array a must be at least ${\mathbf{n}}$.
On exit: 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.
5:     $\mathbf{lda}$ – IntegerInput
On entry: the first dimension of the array a as declared in the (sub)program from which f01vdf (ztpttr) is called.
Constraint: ${\mathbf{lda}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
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

f01vdf (ztpttr) is not threaded in any implementation.

None.

## 10Example

This example reads in a triangular matrix packed by columns and unpacks it to full format.

### 10.1Program Text

Program Text (f01vdfe.f90)

### 10.2Program Data

Program Data (f01vdfe.d)

### 10.3Program Results

Program Results (f01vdfe.r)

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