NAG FL Interface
f01zcf (real_​band_​pack)

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 <nag.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)
The routine may be called by the names f01zcf or nagf_matop_real_band_pack.

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 Integer Input
3: n Integer Input
On entry: m and n, the number of rows and columns of the band matrix, respectively.
Constraints:
  • m>0;
  • n>0.
4: kl Integer Input
On entry: kl, the number of subdiagonals of the band matrix.
Constraint: kl0.
5: ku Integer Input
On entry: ku, the number of superdiagonals of the band matrix.
Constraint: ku0.
6: aldan Real (Kind=nag_wp) array Input/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 Integer Input
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) array Input/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 Integer Input
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 Integer Input/Output
On entry: ifail must be set to 0, -1 or 1 to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of 0 causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of -1 means that an error message is printed while a value of 1 means that it is not.
If halting is not appropriate, the value -1 or 1 is recommended. If message printing is undesirable, then the value 1 is recommended. Otherwise, the value 0 is recommended. 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=value.
Constraint: job='P' or 'U'.
ifail=2
On entry, kl=value.
Constraint: kl0.
ifail=3
On entry, ku=value.
Constraint: ku0.
ifail=4
On entry, lda=value and m=value.
Constraint: ldam.
ifail=5
On entry, ldb=value, kl=value and ku=value.
Constraint: ldbkl+ku+1.
ifail=6
On entry, m=value.
Constraint: m>0.
On entry, n=value.
Constraint: n>0.
ifail=-99
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
ifail=-399
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library FL Interface for further information.
ifail=-999
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface 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)