nag_gen_real_mat_print_comp (x04cbc) prints a real matrix.
nag_gen_real_mat_print_comp (x04cbc) prints a double matrix, or part of it, using a format specifier supplied by you.
The matrix is output to the file specified by
outfile or, by default, to standard output.
None.
Not applicable.
Not applicable.
nag_gen_real_mat_print_comp (x04cbc) may be used to print a vector, either as a row or as a column. The following code fragment illustrates possible calls.
#include <nag.h>
#include <nagx04.h>
#include <nag_stdlib.h>
double *a = 0;
Integer n = 4;
if ( !(a = NAG_ALLOC(n, double)) )
{
Vprintf("Allocation failure\n");
return -1;
}
/* Read A from data file */
for (i = 0; i < n; ++i)
Vscanf("%lf", &a[i]);
/* Print vector A as a row vector */
x04cbc(Nag_RowMajor, Nag_GeneralMatrix, Nag_NonUnitDiag,
1, n, a, n, 0, 0, Nag_NoLabels, 0, Nag_IntegerLabels, 0,
0, 0, 0, NAGERR_DEFAULT);
/* Print vector A as a column vector */
x04cbc(Nag_RowMajor, Nag_GeneralMatrix, Nag_NonUnitDiag,
n, 1, a, 1, 0, 0, Nag_IntegerLabels, 0, Nag_NoLabels, 0,
0, 0, 0, NAGERR_DEFAULT);
None.