|
NAG[x04ccc] NAG[nag_pack_real_mat_print] - Print real packed triangular matrix (easy-to-use)
|
|
Calling Sequence
x04ccc(uplo, diag, n, a, title, 'outfile'=outfile, 'fail'=fail)
nag_pack_real_mat_print(. . .)
Parameters
|
uplo - String;
|
|
|
On entry: indicates the type of the matrix to be printed
|
|
The matrix is lower triangular.
|
|
The matrix is upper triangular.
|
|
Constraint: "Nag_Lower" or "Nag_Upper". .
|
|
|
diag - String;
|
|
|
On entry: indicates whether the diagonal elements of the matrix are to be printed.
|
|
The diagonal elements of the matrix are not referenced and not printed.
|
|
The diagonal elements of the matrix are not referenced, but are assumed all to be unity, and are printed as such.
|
|
The diagonal elements of the matrix are referenced and printed.
|
|
Constraint: "Nag_NonRefDiag", "Nag_UnitDiag" or "Nag_NonUnitDiag". .
|
|
|
n - integer;
|
|
|
On entry: the order of the matrix to be printed.
|
|
If n is less than 1, nag_pack_real_mat_print (x04ccc) will exit immediately after printing title; no row or column labels are printed.
|
|
|
a - Vector(1..dim, datatype=float[8]);
|
|
|
Note: the dimension, dim, of the array a must be at least .
|
|
On entry: the matrix to be printed. The storage of elements depends on the storage order and uplo arguments as follows:
|
|
Note that a must have space for the diagonal elements of the matrix, even if these are not stored.
|
|
|
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 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.
|
|
|
'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_pack_real_mat_print (x04ccc) is an easy-to-use function to print a double triangular matrix stored in a packed one-dimensional array.
|
|
Error Indicators and Warnings
|
|
"NE_ALLOC_FAIL"
Dynamic memory allocation failed.
"NE_BAD_PARAM"
On entry, argument 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 consult NAG for assistance.
"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.
|
|
Further Comments
|
|
A call to nag_pack_real_mat_print (x04ccc) is equivalent to a call to x04cdc (nag_pack_real_mat_print_comp) with the following argument values:
ncols = 80
indent = 0
labrow = "Nag_IntegerLabels"
labcol = "Nag_IntegerLabels"
form = 0
|
|
|
Examples
|
|
>
|
uplo := "Nag_Lower":
diag := "Nag_NonUnitDiag":
n := 4:
title := "Factor":
a := Vector([2.039607805437114, -1.529705854077835, 1.640121946685673, 0.2745625891934577, -0.2499814119483738, 0.7887488055748053, -0.049029033784546, 0.6737303907389099, 0.6616575633742564, 0.5346894269298686], datatype=float[8]):
try
FileTools[Remove]("matout.txt"):
catch "file does not exist":
end try:
NAG:-x04ccc(uplo, diag, n, a, title, '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"):
#
|
Factor
1 2 3 4
1 2.0396
2 -1.5297 -0.2500
3 1.6401 0.7887 0.6737
4 0.2746 -0.0490 0.6617 0.5347
|
|