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

NAG Library Routine Document

F01ZDF

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

F01ZDF copies a complex band matrix stored in a packed array into an unpacked array, or vice versa.

2  Specification

SUBROUTINE F01ZDF ( JOB, M, N, KL, KU, A, LDA, B, LDB, IFAIL)
INTEGER  M, N, KL, KU, LDA, LDB, IFAIL
COMPLEX (KIND=nag_wp)  A(LDA,N), B(LDB,*)
CHARACTER(1)  JOB

3  Description

F01ZDF unpacks a band matrix that is stored in a packed array, or packs a band matrix that is stored in an unpacked array. The band matrix has m rows, n columns, kl nonzero subdiagonals, and ku nonzero superdiagonals. This routine is intended for possible use in conjunction with routines from Chapters F06, F07 and F08, where routines that use band matrices store them in the packed form described below.

4  References

None.

5  Parameters

1:     JOB – CHARACTER(1)Input
On entry: specifies whether the band matrix is to be packed or unpacked.
JOB='P' (Pack)
The band matrix is to be packed into array B.
JOB='U' (Unpack)
The band matrix is to be unpacked into array A.
Constraint: JOB='P' or 'U'.
2:     M – INTEGERInput
3:     N – INTEGERInput
On entry: m and n, the number of rows and columns of the band matrix, respectively.
Constraints:
  • M>0;
  • N>0.
4:     KL – INTEGERInput
On entry: kl, the number of subdiagonals of the band matrix.
Constraint: KL0.
5:     KU – INTEGERInput
On entry: ku, the number of superdiagonals of the band matrix.
Constraint: KU0.
6:     A(LDA,N) – COMPLEX (KIND=nag_wp) arrayInput/Output
On entry: if JOB='P', then the leading m by n part of A must contain the band matrix stored in unpacked form. Elements of the array that lie outside the banded part of the matrix are not referenced and need not be assigned.
On exit: if JOB='U', then the leading m by n part of A contains the band matrix stored in unpacked form. Elements of the leading m by n part of A that are not within the banded part of the matrix are assigned the value zero.
7:     LDA – INTEGERInput
On entry: the first dimension of the array A as declared in the (sub)program from which F01ZDF is called.
Constraint: LDAM.
8:     B(LDB,*) – COMPLEX (KIND=nag_wp) arrayInput/Output
Note: the second dimension of the array B must be at least minM+KU,N.
On entry: if JOB='U', then B must contain the band matrix in packed form, in the leading kl+ku+1 by minm+ku,n part of the array. The matrix is packed column by column, with the leading diagonal of the matrix in row ku+1 of B, the first superdiagonal starting at position 2 in row ku, the first subdiagonal starting at position 1 in row ku+2, and so on. Elements of B that are not needed to store the band matrix, for instance the leading ku by ku triangle, are not referenced and need not be assigned.
On exit: if JOB='P', then B contains the band matrix stored in packed form. Elements of B that are not needed to store the band matrix are not referenced.
9:     LDB – INTEGERInput
On entry: the first dimension of the array B as declared in the (sub)program from which F01ZDF is called.
Constraint: LDBKL+KU+1.
10:   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,KL<0.
IFAIL=3
On entry,KU<0.
IFAIL=4
On entry,LDA<M.
IFAIL=5
On entry,LDB<KL+KU+1.
IFAIL=6
On entry,M<1,
orN<1.

7  Accuracy

Not applicable.

8  Further Comments

None.

9  Example

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

9.1  Program Text

Program Text (f01zdfe.f90)

9.2  Program Data

Program Data (f01zdfe.d)

9.3  Program Results

Program Results (f01zdfe.r)


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

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