2 Specification

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.

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:
LDA≥N.

7: B(N×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.

7 Accuracy

Not applicable.

8 Further Comments

None.

9 Example

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