# NAG CL Interfacex04cec (print_​matrix_​real_​band)

## 1Purpose

x04cec is an easy-to-use function to print a double band matrix .

## 2Specification

 #include
 void x04cec (Nag_OrderType order, Integer m, Integer n, Integer kl, Integer ku, const double a[], Integer pda, const char *title, const char *outfile, NagError *fail)
The function may be called by the names: x04cec, nag_file_print_matrix_real_band or nag_band_real_mat_print.

## 3Description

x04cec prints a double band matrix stored in packed form. It is an easy-to-use driver for x04cfc. The function uses default values for the format in which numbers are printed, for labelling the rows and columns, and for output record length.
x04cec will choose a format code such that numbers will be printed with a $%8.4\mathrm{f}$, a $%11.4\mathrm{f}$ or a $%13.4\mathrm{e}$ format. The $%8.4\mathrm{f}$ code is chosen if the sizes of all the matrix elements to be printed lie between $0.001$ and $1.0$. The $%11.4\mathrm{f}$ code is chosen if the sizes of all the matrix elements to be printed lie between $0.001$ and $9999.9999$. Otherwise the $%13.4\mathrm{e}$ code is chosen.
The matrix is printed with integer row and column labels, and with a maximum record length of $80$.
The matrix is output to the file specified by outfile or, by default, to standard output.

None.

## 5Arguments

1: $\mathbf{order}$Nag_OrderType Input
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.1.3 in the Introduction to the NAG Library CL Interface for a more detailed explanation of the use of this argument.
Constraint: ${\mathbf{order}}=\mathrm{Nag_RowMajor}$ or $\mathrm{Nag_ColMajor}$.
2: $\mathbf{m}$Integer Input
3: $\mathbf{n}$Integer Input
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$, x04cec will exit immediately after printing title; no row or column labels are printed.
4: $\mathbf{kl}$Integer Input
On entry: the number of subdiagonals of the band matrix $A$.
Constraint: ${\mathbf{kl}}\ge 0$.
5: $\mathbf{ku}$Integer Input
On entry: the number of superdiagonals of the band matrix $A$.
Constraint: ${\mathbf{ku}}\ge 0$.
6: $\mathbf{a}\left[\mathit{dim}\right]$const double Input
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}$Integer Input
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{title}$const char * Input
On entry: a title to be printed above the matrix.
If ${\mathbf{title}}=\mathbf{NULL}$, no title (and no blank line) will be printed.
If title contains more than $80$ characters, the contents of title will be wrapped onto more than one line, with the break after $80$ characters.
Any trailing blank characters in title are ignored.
9: $\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.
10: $\mathbf{fail}$NagError * Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).

## 6Error Indicators and Warnings

NE_ALLOC_FAIL
Memory allocation failed.
On entry, argument $〈\mathit{\text{value}}〉$ had an illegal 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_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.

## 8Parallelism and Performance

x04cec is not threaded in any implementation.

```