F01ZBF (PDF version)
F01 Chapter Contents
F01 Chapter Introduction
NAG Library Manual

NAG Library Routine Document

F01ZBF

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.

 Contents

    1  Purpose
    7  Accuracy

1  Purpose

F01ZBF copies a complex triangular matrix stored in a packed one-dimensional array into an unpacked two-dimensional array, or vice versa.

2  Specification

SUBROUTINE F01ZBF ( JOB, UPLO, DIAG, N, A, LDA, B, IFAIL)
INTEGER  N, LDA, IFAIL
COMPLEX (KIND=nag_wp)  A(LDA,N), B((N*(N+1))/2)
CHARACTER(1)  JOB, UPLO, DIAG

3  Description

F01ZBF unpacks a triangular matrix stored in a vector into a two-dimensional array, or packs a triangular matrix stored in a two-dimensional array into a vector. The matrix is packed by column. This routine is intended for possible use in conjunction with routines from Chapters F06, F07 and F08, where some routines that use triangular matrices store them in the packed form described below.

4  References

None.

5  Parameters

1:     JOB – CHARACTER(1)Input
On entry: specifies whether the triangular matrix is to be packed or unpacked.
JOB='P' (Pack)
The matrix is to be packed into array B.
JOB='U' (Unpack)
The matrix is to be unpacked into array A.
Constraint: JOB='P' or 'U'.
2:     UPLO – CHARACTER(1)Input
On entry: specifies the type of the matrix to be copied
UPLO='L' (Lower)
The matrix is lower triangular. In this case the packed vector holds, or will hold on exit, the matrix elements in the following order: 1,1,2,1,,N,1, 2,2,3,2,,N,2, etc..
UPLO='U' (Upper)
The matrix is upper triangular. In this case the packed vector holds, or will hold on exit, the matrix elements in the following order: 1,1, 1,2, 2,2, 1,3, 2,3, 3,3, 1,4, etc..
Constraint: UPLO='L' or 'U'.
3:     DIAG – CHARACTER(1)Input
On entry: must specify whether the diagonal elements of the matrix are to be copied.
DIAG='B' (Blank)
The diagonal elements of the matrix are not referenced and not copied.
DIAG='U' (Unit diagonal)
The diagonal elements of the matrix are not referenced, but are assumed all to be unity, and are copied as such.
DIAG='N' (Non-unit diagonal)
The diagonal elements of the matrix are referenced and copied.
Constraint: DIAG='B', 'U' or 'N'.
4:     N – INTEGERInput
On entry: N must specify the number of rows and columns of the triangular matrix.
Constraint: N>0.
5:     ALDAN – COMPLEX (KIND=nag_wp) arrayInput/Output
On entry: if JOB='P', then the leading N by N part of A must contain the matrix to be copied, stored in unpacked form, in the upper or lower triangle depending on parameter UPLO. The opposite triangle of A is not referenced and need not be assigned.
On exit: if JOB='U', then the leading N by N part of array A contains the copied matrix, stored in unpacked form, in the upper or lower triangle depending on parameter UPLO. The opposite triangle of A is not referenced.
6:     LDA – INTEGERInput
On entry: the first dimension of the array A as declared in the (sub)program from which F01ZBF is called.
Constraint: LDAN.
7:     BN×N+1/2 – COMPLEX (KIND=nag_wp) arrayInput/Output
On entry: if JOB='U', then B must contain the triangular matrix packed by column.
On exit: if JOB='P', then B contains the triangular matrix packed by column.
Note that B must have space for the diagonal elements of the matrix, even if these are not stored.
8:     IFAIL – INTEGERInput/Output
On entry: IFAIL must be set to 0, -1​ or ​1. If you are unfamiliar with this parameter you should refer to Section 3.3 in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value -1​ or ​1 is recommended. If the output of error messages is undesirable, then the value 1 is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is 0. When the value -1​ or ​1 is used it is essential to test the value of IFAIL on exit.
On exit: IFAIL=0 unless the routine detects an error or a warning has been flagged (see Section 6).

6  Error Indicators and Warnings

If on entry IFAIL=0 or -1, explanatory error messages are output on the current error message unit (as defined by X04AAF).
Errors or warnings detected by the routine:
IFAIL=1
On entry,JOB'P' or 'U'.
IFAIL=2
On entry,UPLO'L' or 'U'.
IFAIL=3
On entry,DIAG'N', 'U' or 'B'.
IFAIL=4
On entry,N<1.
IFAIL=5
On entry,LDA<N.
IFAIL=-99
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 3.8 in the Essential Introduction for further information.
IFAIL=-399
Your licence key may have expired or may not have been installed correctly.
See Section 3.7 in the Essential Introduction for further information.
IFAIL=-999
Dynamic memory allocation failed.
See Section 3.6 in the Essential Introduction for further information.

7  Accuracy

Not applicable.

8  Parallelism and Performance

Not applicable.

9  Further Comments

None.

10  Example

This example reads in a triangular matrix A, and copies it to the packed matrix B.

10.1  Program Text

Program Text (f01zbfe.f90)

10.2  Program Data

Program Data (f01zbfe.d)

10.3  Program Results

Program Results (f01zbfe.r)


F01ZBF (PDF version)
F01 Chapter Contents
F01 Chapter Introduction
NAG Library Manual

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