|
NAG[x04cfc] NAG[nag_band_real_mat_print_comp] - Print real packed banded matrix (comprehensive)
|
|
Calling Sequence
x04cfc(m, n, kl, ku, a, format, title, labrow, rlabs, labcol, clabs, ncols, indent, 'outfile'=outfile, 'fail'=fail)
nag_band_real_mat_print_comp(. . .)
Parameters
|
m - integer;
n - integer;
|
|
|
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_real_mat_print_comp (x04cfc) will exit immediately after printing title; no row or column labels are printed.
|
|
|
kl - integer;
|
|
|
On entry: the number of subdiagonals of the band matrix .
|
|
Constraint: . .
|
|
|
ku - integer;
|
|
|
On entry: the number of superdiagonals of the band matrix .
|
|
Constraint: . .
|
|
|
a - Matrix(1..dim1, 1..dim2, datatype=float[8], order=order);
|
|
|
Note: this array may be supplied in Fortran_order or C_order , as specified by order. All array parameters must use a consistent order.
|
|
|
format - character;
|
|
|
In addition, nag_band_real_mat_print_comp (x04cfc) chooses its own format code when format is NULL or .
|
|
If , nag_band_real_mat_print_comp (x04cfc) 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.
|
|
Constraint: format must be of the form . .
|
|
|
title - character;
|
|
|
On entry: a title to be printed above the matrix.
|
|
If , 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.
|
|
|
labrow - String;
|
|
|
On entry: indicates the type of labelling to be applied to the rows of the matrix.
|
|
Prints no row labels.
|
|
Prints integer row labels.
|
|
Prints character labels, which must be supplied in array rlabs.
|
|
Constraint: "Nag_NoLabels", "Nag_IntegerLabels" or "Nag_CharacterLabels". .
|
|
|
rlabs - Vector(1..dim, datatype=string);
|
|
|
Note: the dimension, dim, of the array rlabs must be at least
|
|
when ;
|
|
otherwise.
|
|
On entry: if , must contain labels for the rows of the matrix.
|
|
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.
|
|
|
labcol - String;
|
|
|
On entry: indicates the type of labelling to be applied to the columns of the matrix.
|
|
Prints no column labels.
|
|
Prints integer column labels.
|
|
Prints character labels, which must be supplied in array clabs.
|
|
Constraint: "Nag_NoLabels", "Nag_IntegerLabels" or "Nag_CharacterLabels". .
|
|
|
clabs - Vector(1..dim, datatype=string);
|
|
|
Note: the dimension, dim, of the array clabs must be at least
|
|
when ;
|
|
otherwise.
|
|
On entry: if , must contain labels for the columns of the matrix.
|
|
Labels are right-justified when output. Any label that is too long for the column width, which is determined by format, is truncated.
|
|
|
ncols - integer;
|
|
|
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 format. If a value less than or equal to 0 or greater than 132 is supplied for ncols, then the value 80 is used instead.
|
|
|
indent - integer;
|
|
|
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.
|
|
|
'outfile'=outfile - character; (optional)
|
|
|
On entry: The name of a file to which intermediate or diagnostic output should be appended. If a value is not provided for this parameter then the behaviour of this routine is platform dependent. Usually all output will be suppressed, however on some platforms output will be produced and will be displayed in the Maple session.
|
|
|
'fail'=fail - table; (optional)
|
|
|
The NAG error argument, see the documentation for NagError.
|
|
|
|
Description
|
|
|
Purpose
|
|
nag_band_real_mat_print_comp (x04cfc) prints a double band matrix .
|
|
Description
|
|
nag_band_real_mat_print_comp (x04cfc) prints a double 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.
|
|
Error Indicators and Warnings
|
|
"NE_ALLOC_FAIL"
Dynamic memory allocation failed.
"NE_BAD_PARAM"
On entry, argument had an illegal value.
"NE_COL_WIDTH"
is not wide enough to hold at least one matrix column. , .
"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 consult NAG for assistance.
"NE_INVALID_FORMAT"
The string , has not been recognized as a valid format.
"NE_NOT_APPEND_FILE"
Cannot open file for appending.
"NE_NOT_CLOSE_FILE"
Cannot close file .
"NE_NOT_WRITE_FILE"
Cannot open file for writing.
|
|
|
Examples
|
|
>
|
m := 4:
n := 4:
kl := 1:
ku := 2:
title := "Details of factorization":
a := Matrix([[0, -6.98, 2.46, -2.73, 0], [0.0329512893982808, 2.56, 2.46, 4.07, 0], [0.9605233703438396, -5.932930470988539, -3.839143870881089, 0, 0], [0.8056726812110376, -0.7269066639923109, 0, 0, 0]], datatype=float[8], order='C_order'):
ncols := 80:
indent := 0:
format := "%11.4f":
labrow := "Nag_IntegerLabels":
labcol := "Nag_IntegerLabels":
rlabs := Vector(0, datatype=string):
clabs := Vector(0, datatype=string):
if kernelopts(system) = "IBM INTEL LINUX"
and [NAG[NAGVersion]()][1] = 8 then
printf("x04cfc is not available in Mark 8 on IBM INTEL LINUX\n",%s) else
try
FileTools[Remove]("matout.txt"):
catch "file does not exist":
end try:
NAG:-x04cfc(m, n, kl, ku, a, format, title, labrow, labcol, ncols, indent, 'rlabs' = rlabs, 'clabs' = clabs, 'outfile'="matout.txt"):
do
outstring := FileTools[Text][ReadLine]("matout.txt"):
if outstring = 0 or outstring = NULL then break; end if:
printf("%s\n",outstring): od:
FileTools[Text][Close]("matout.txt"):
end if:
#
|
Details of factorization
1 2 3 4
1 -6.9800 2.4600 -2.7300
2 0.0330 2.5600 2.4600 4.0700
3 0.9605 -5.9329 -3.8391
4 0.8057 -0.7269
|
|