x04 Chapter Contents
x04 Chapter Introduction
NAG Library Manual

# NAG Library Function Documentnag_band_complx_mat_print_comp (x04dfc)

## 1  Purpose

nag_band_complx_mat_print_comp (x04dfc) prints a Complex band matrix.

## 2  Specification

 #include #include
 void nag_band_complx_mat_print_comp (Nag_OrderType order, Integer m, Integer n, Integer kl, Integer ku, const Complex a[], Integer pda, Nag_ComplexFormType cmplxform, const char *form, const char *title, Nag_LabelType labrow, const char *rlabs[], Nag_LabelType labcol, const char *clabs[], Integer ncols, Integer indent, const char *outfile, NagError *fail)

## 3  Description

nag_band_complx_mat_print_comp (x04dfc) prints a Complex band matrix stored in packed form, using a format specifier supplied by you. The matrix is output to the file specified by outfile or, by default, to standard output.

None.

## 5  Arguments

1:    $\mathbf{order}$Nag_OrderTypeInput
On entry: the order argument specifies the two-dimensional storage scheme being used, i.e., row-major ordering or column-major ordering. C language defined storage is specified by ${\mathbf{order}}=\mathrm{Nag_RowMajor}$. See Section 3.2.1.3 in the Essential Introduction for a more detailed explanation of the use of this argument.
Constraint: ${\mathbf{order}}=\mathrm{Nag_RowMajor}$ or $\mathrm{Nag_ColMajor}$.
2:    $\mathbf{m}$IntegerInput
3:    $\mathbf{n}$IntegerInput
On entry: the number of rows and columns of the band matrix, respectively, to be printed.
If either m or n is less than $1$, nag_band_complx_mat_print_comp (x04dfc) will exit immediately after printing title; no row or column labels are printed.
4:    $\mathbf{kl}$IntegerInput
On entry: the number of subdiagonals of the band matrix $A$.
Constraint: ${\mathbf{kl}}\ge 0$.
5:    $\mathbf{ku}$IntegerInput
On entry: the number of superdiagonals of the band matrix $A$.
Constraint: ${\mathbf{ku}}\ge 0$.
6:    $\mathbf{a}\left[\mathit{dim}\right]$const ComplexInput
Note: the dimension, dim, of the array a must be at least
• $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{pda}}×{\mathbf{n}}\right)$ when ${\mathbf{order}}=\mathrm{Nag_ColMajor}$;
• $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{m}}×{\mathbf{pda}}\right)$ when ${\mathbf{order}}=\mathrm{Nag_RowMajor}$.
On entry: the band matrix to be printed.
This is stored as a notional two-dimensional array with row elements or column elements stored contiguously. The storage of elements ${A}_{ij}$, for row $i=1,\dots ,m$ and column $j=\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,i-{k}_{l}\right),\dots ,\mathrm{min}\phantom{\rule{0.125em}{0ex}}\left(n,i+{k}_{u}\right)$, depends on the order argument as follows:
• if ${\mathbf{order}}=\mathrm{Nag_ColMajor}$, ${A}_{ij}$ is stored as ${\mathbf{a}}\left[\left(j-1\right)×{\mathbf{pda}}+{\mathbf{ku}}+i-j\right]$;
• if ${\mathbf{order}}=\mathrm{Nag_RowMajor}$, ${A}_{ij}$ is stored as ${\mathbf{a}}\left[\left(i-1\right)×{\mathbf{pda}}+{\mathbf{kl}}+j-i\right]$.
7:    $\mathbf{pda}$IntegerInput
On entry: the stride separating row or column elements (depending on the value of order) of the matrix $A$ in the array a.
Constraint: ${\mathbf{pda}}\ge {\mathbf{kl}}+{\mathbf{ku}}+1$.
8:    $\mathbf{cmplxform}$Nag_ComplexFormTypeInput
On entry: indicates how the value of form is to be used to print matrix elements.
${\mathbf{cmplxform}}=\mathrm{Nag_AboveForm}$
The format code in form is assumed to contain a single real edit-descriptor which is to be used to print the real and imaginary parts of each Complex number one above the other. Each row of the matrix is separated by a blank line, and any row labels are attached only to the real parts. This option means that about twice as many columns can be fitted into ncols characters than if any other cmplxform option is used. A typical value of form for this cmplxform option might be %11.4e.
${\mathbf{cmplxform}}=\mathrm{Nag_BracketForm}$
The format code in form is assumed to contain a single edit-descriptor such as %13.4f, * or NULL, which is used to print the real and imaginary parts of each Complex number separated by a comma, and surrounded by brackets. Thus a matrix element printed with this cmplxform option might look like this: $\left(12.345,-11.323\right)$.
${\mathbf{cmplxform}}=\mathrm{Nag_DirectForm}$
The format code in form is used unaltered to print a Complex number. This cmplxform option allows you flexibility to specify exactly how the number is printed. With this option for cmplxform and a suitable value for form it is possible, for example, to print a Complex number in the form $\left(0.123+3.214i\right)$ or $\left(\text{0.123e−02},\text{0.234e−01}\right)$.
Constraint: ${\mathbf{cmplxform}}=\mathrm{Nag_AboveForm}$, $\mathrm{Nag_BracketForm}$ or $\mathrm{Nag_DirectForm}$.
9:    $\mathbf{form}$const char *Input
On entry: a valid C format code. This should be of the form $%\left[\mathit{flag}\right]ww.pp\left[\mathit{format}\text{​ ​}\mathit{indicator}\right]$, where $\mathit{ww}.pp$ indicates that up to two digits may be used to specify the field width and precision respectively. Only % and $\mathit{format}\text{​ ​}\mathit{indicator}$ must be present. $\mathit{flag}$ can be one of $-$, $+$, $<\text{space}>$ or # and $\mathit{format}\text{​ ​}\mathit{indicator}$ can be e, E, f, g or G. Thus, possible formats include %f, $%-11.4\mathrm{G}$, %.6e. form is used in conjunction with argument cmplxform, to print elements of the matrix $A$.
In addition, nag_band_complx_mat_print_comp (x04dfc) chooses its own format code when form is NULL or ${\mathbf{form}}=\text{'*'}$.
If ${\mathbf{form}}=\mathbf{NULL}$, nag_band_complx_mat_print_comp (x04dfc) will choose a format code such that numbers will be printed with either a %8.4f, a %11.4f or a %13.4e format. The %8.4f code is chosen if the sizes of all the matrix elements to be printed lie between $0.001$ and $1.0$. The %11.4f code is chosen if the sizes of all the matrix elements to be printed lie between $0.001$ and $9999.9999$. Otherwise the %13.4e code is chosen.
If ${\mathbf{form}}=\text{'*'}$, nag_band_complx_mat_print_comp (x04dfc) will choose a format code such that numbers will be printed to as many significant digits as are necessary to distinguish between neighbouring machine numbers. Thus any two numbers that are stored with different internal representations should look different on output.
More complicated values of form, to print a Complex number in a desired form, may be used. See the description of argument cmplxform above for more details.
Constraint: if ${\mathbf{cmplxform}}=\mathrm{Nag_AboveForm}$ or $\mathrm{Nag_BracketForm}$, form must be of the form $%\left[\mathit{flag}\right]ww.pp\left[\mathit{format}\text{​ ​}\mathit{indicator}\right]$.
10:  $\mathbf{title}$const char *Input
On entry: a title to be printed above the matrix, or name of the matrix.
If ${\mathbf{title}}=\mathbf{NULL}$, no title (and no blank line) will be printed.
If title contains more than ncols characters, the contents of title will be wrapped onto more than one line, with the break after ncols characters.
Any trailing blank characters in title are ignored.
11:  $\mathbf{labrow}$Nag_LabelTypeInput
On entry: indicates the type of labelling to be applied to the rows of the matrix.
${\mathbf{labrow}}=\mathrm{Nag_NoLabels}$
Prints no row labels.
${\mathbf{labrow}}=\mathrm{Nag_IntegerLabels}$
Prints integer row labels.
${\mathbf{labrow}}=\mathrm{Nag_CharacterLabels}$
Prints character labels, which must be supplied in array rlabs.
Constraint: ${\mathbf{labrow}}=\mathrm{Nag_NoLabels}$, $\mathrm{Nag_IntegerLabels}$ or $\mathrm{Nag_CharacterLabels}$.
12:  $\mathbf{rlabs}\left[\mathit{dim}\right]$const char *Input
Note: the dimension, dim, of the array rlabs must be at least
• ${\mathbf{m}}$ when ${\mathbf{labrow}}=\mathrm{Nag_CharacterLabels}$;
• otherwise rlabs may be NULL.
On entry: if ${\mathbf{labrow}}=\mathrm{Nag_CharacterLabels}$, rlabs must contain labels for the rows of the matrix; otherwise rlabs is not referenced and may be NULL.
Labels are right-justified when output, in a field which is as wide as necessary to hold the longest row label. Note that this field width is subtracted from the number of usable columns, ncols.
13:  $\mathbf{labcol}$Nag_LabelTypeInput
On entry: indicates the type of labelling to be applied to the columns of the matrix.
${\mathbf{labcol}}=\mathrm{Nag_NoLabels}$
Prints no column labels.
${\mathbf{labcol}}=\mathrm{Nag_IntegerLabels}$
Prints integer column labels.
${\mathbf{labcol}}=\mathrm{Nag_CharacterLabels}$
Prints character labels, which must be supplied in array clabs.
Constraint: ${\mathbf{labcol}}=\mathrm{Nag_NoLabels}$, $\mathrm{Nag_IntegerLabels}$ or $\mathrm{Nag_CharacterLabels}$.
14:  $\mathbf{clabs}\left[\mathit{dim}\right]$const char *Input
Note: the dimension, dim, of the array clabs must be at least
• ${\mathbf{n}}$ when ${\mathbf{labcol}}=\mathrm{Nag_CharacterLabels}$;
• otherwise clabs may be NULL.
On entry: if ${\mathbf{labcol}}=\mathrm{Nag_CharacterLabels}$, clabs must contain labels for the columns of the matrix; otherwise clabs is not referenced and may be NULL.
Labels are right-justified when output. Any label that is too long for the column width, which is determined by form, is truncated.
15:  $\mathbf{ncols}$IntegerInput
On entry: the maximum output record length. If the number of columns of the matrix is too large to be accommodated in ncols characters, the matrix will be printed in parts, containing the largest possible number of matrix columns, and each part separated by a blank line.
ncols must be large enough to hold at least one column of the matrix using the format specifier in form. If a value less than or equal to 0 or greater than $132$ is supplied for ncols, then the value $80$ is used instead.
16:  $\mathbf{indent}$IntegerInput
On entry: the number of columns by which the matrix (and any title and labels) should be indented. The effective value of ncols is reduced by indent columns. If a value less than $0$ or greater than ncols is supplied for indent, the value $0$ is used instead.
17:  $\mathbf{outfile}$const char *Input
On entry: the name of a file to which output will be directed. If outfile is NULL the output will be directed to standard output.
18:  $\mathbf{fail}$NagError *Input/Output
The NAG error argument (see Section 3.6 in the Essential Introduction).

## 6  Error Indicators and Warnings

NE_ALLOC_FAIL
Memory allocation failed.
On entry, argument $〈\mathit{\text{value}}〉$ had an illegal value.
NE_COL_WIDTH
$〈\mathit{\text{value}}〉$ is not wide enough to hold at least one matrix column. ${\mathbf{ncols}}=〈\mathit{\text{value}}〉$ and ${\mathbf{indent}}=〈\mathit{\text{value}}〉$.
NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
NE_INVALID_FORMAT
The string $〈\mathit{\text{value}}〉$ has not been recognized as a valid format.
NE_NOT_APPEND_FILE
Cannot open file $〈\mathit{\text{value}}〉$ for appending.
NE_NOT_CLOSE_FILE
Cannot close file $〈\mathit{\text{value}}〉$.
NE_NOT_WRITE_FILE
Cannot open file $〈\mathit{\text{value}}〉$ for writing.

Not applicable.

Not applicable.