|
NAG[x04cac] NAG[nag_gen_real_mat_print] - Print real general matrix (easy-to-use)
|
|
Calling Sequence
x04cac(matrix_type, diag, m, n, a, title, 'outfile'=outfile, 'fail'=fail)
nag_gen_real_mat_print(. . .)
Parameters
|
matrix_type - String;
|
|
|
On entry: indicates the part of the matrix to be printed.
|
|
The whole of the rectangular matrix.
|
|
The lower triangle of the matrix, or the lower trapezium if the matrix has more rows than columns.
|
|
The upper triangle of the matrix, or the upper trapezium if the matrix has more columns than rows.
|
|
Constraint: "Nag_GeneralMatrix", "Nag_LowerMatrix" or "Nag_UpperMatrix". .
|
|
|
diag - String;
|
|
|
On entry: unless , diag must specify 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.
|
|
If , then diag must be set to .
|
|
|
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_gen_real_mat_print (x04cac) will exit immediately after printing title; no row or column labels are printed.
|
|
|
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.
|
|
On entry: the matrix to be printed. Only the elements that will be referred to, as specified by arguments matrix_type and diag, need be set.
|
|
|
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_gen_real_mat_print (x04cac) is an easy-to-use function to print a real matrix .
|
|
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_gen_real_mat_print (x04cac) is equivalent to a call to x04cbc (nag_gen_real_mat_print_comp) with the following argument values:
ncols = 80
indent = 0
labrow = "Nag_IntegerLabels"
labcol = "Nag_IntegerLabels"
form = 0
|
|
|
Examples
|
|
>
|
matrix_type := "Nag_GeneralMatrix":
diag := "Nag_NonUnitDiag":
m := 4:
n := 2:
title := "Least-squares solution(s)":
a := Matrix([[1.514573356202664, -1.583819423696999], [1.86213216368428, 0.553604654704574], [-1.446655239581599, 1.349113056401247], [0.03964010119092619, 2.96002940117532]], datatype=float[8]):
try
FileTools[Remove]("matout.txt"):
catch "file does not exist":
end try:
NAG:-x04cac(matrix_type, diag, m, 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"):
#
|
Least-squares solution(s)
1 2
1 1.5146 -1.5838
2 1.8621 0.5536
3 -1.4467 1.3491
4 0.0396 2.9600
|
|