|
NAG[x04dfc] NAG[nag_band_complx_mat_print_comp] - Print complex packed banded matrix (comprehensive)
|
|
Calling Sequence
x04dfc(m, n, kl, ku, a, cmplxform, format, title, labrow, rlabs, labcol, clabs, ncols, indent, 'outfile'=outfile, 'fail'=fail)
nag_band_complx_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_complx_mat_print_comp (x04dfc) 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=complex[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.
|
|
|
cmplxform - String;
|
|
|
On entry: indicates how the value of format is to be used to print matrix elements.
|
|
The format code in format 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 format for this cmplxform option might be %11.4e.
|
|
The format code in format 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: .
|
|
Constraint: "Nag_AboveForm", "Nag_BracketForm" or "Nag_DirectForm". .
|
|
|
format - character;
|
|
|
On entry: a valid C format code. This should be of the form , where indicates that up to two digits may be used to specify the field width and precision respectively. Only % and must be present. can be one of , , or # and can be e, E, f, g or G. Thus, possible formats include %f, %-11.4G, %.6e. format is used in conjunction with argument cmplxform, to print elements of the matrix .
|
|
In addition, nag_band_complx_mat_print_comp (x04dfc) chooses its own format code when format is NULL or .
|
|
If , 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 format, to print a complex number in a desired form, may be used. See the description of argument cmplxform above for more details.
|
|
|
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_complx_mat_print_comp (x04dfc) prints a complex band matrix.
|
|
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.
|
|
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+I, -6.98+I, 2.46+I, -2.73+I, 0],
[0.0329512893982808+I, 2.56+I, 2.46+I, 4.07+I, 0],
[0.9605233703438396+I, -5.932930470988539+I, -3.839143870881089+I, 0, 0],
[0.8056726812110376+I, -0.7269066639923109+I, 0, 0, 0]],
datatype=complex[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):
cmplxform := "Nag_BracketForm":
try
FileTools[Remove]("matout.txt"):
catch "file does not exist":
end try:
NAG:-x04dfc(m, n, kl, ku, a, cmplxform, 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"):
#
|
Details of factorization
1 2
1 ( -6.9800, 1.0000) ( 2.4600, 1.0000)
2 ( 0.0330, 1.0000) ( 2.5600, 1.0000)
3 ( 0.9605, 1.0000)
4
3 4
1 ( -2.7300, 1.0000)
2 ( 2.4600, 1.0000) ( 4.0700, 1.0000)
3 ( -5.9329, 1.0000) ( -3.8391, 1.0000)
4 ( 0.8057, 1.0000) ( -0.7269, 1.0000)
|
|