NAG Library Routine Document

f01zcf  (real_band_pack)

 Contents

    1  Purpose
    7  Accuracy

1
Purpose

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

2
Specification

Fortran Interface
Subroutine f01zcf ( job, m, n, kl, ku, a, lda, b, ldb, ifail)
Integer, Intent (In):: m, n, kl, ku, lda, ldb
Integer, Intent (Inout):: ifail
Real (Kind=nag_wp), Intent (Inout):: a(lda,n), b(ldb,*)
Character (1), Intent (In):: job
C Header Interface
#include nagmk26.h
void  f01zcf_ ( const char *job, const Integer *m, const Integer *n, const Integer *kl, const Integer *ku, double a[], const Integer *lda, double b[], const Integer *ldb, Integer *ifail, const Charlen length_job)

3
Description

f01zcf 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
Arguments

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:     aldan – Real (Kind=nag_wp) arrayInput/Output
On entry: if job='P', 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', 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 f01zcf is called.
Constraint: ldam.
8:     bldb* – Real (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', 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', 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 f01zcf 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 argument you should refer to Section 3.4 in How to Use the NAG Library and its Documentation 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 argument, 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.
ifail=-99
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 3.9 in How to Use the NAG Library and its Documentation for further information.
ifail=-399
Your licence key may have expired or may not have been installed correctly.
See Section 3.8 in How to Use the NAG Library and its Documentation for further information.
ifail=-999
Dynamic memory allocation failed.
See Section 3.7 in How to Use the NAG Library and its Documentation for further information.

7
Accuracy

Not applicable.

8
Parallelism and Performance

f01zcf is not threaded in any implementation.

9
Further Comments

None.

10
Example

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

10.1
Program Text

Program Text (f01zcfe.f90)

10.2
Program Data

Program Data (f01zcfe.d)

10.3
Program Results

Program Results (f01zcfe.r)

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