/* Simplified example program for F01CTF/E (Example 1 only)
C Version. NAG Copyright 1999. */
#include
#include
#include
#define NROW 4
#define NCOL 3
main()
{
int ifail = 0, i, j, m, n, mn = NROW*NCOL, lmove = (NROW+NCOL)/2;
int move[(NROW+NCOL)/2];
/* Matrix a is loaded in row major order */
double a[NROW][NCOL] = {1.0, 2.5, 3.0,
-2.0, 2.0, -1.5,
3.5, 2.0, -2.5,
1.5, -2.0, 1.0};
/* Matrix b is loaded in row major order */
double b[NROW][NCOL] = {2.0, -2.5, -2.0,
1.0, 1.0, 1.0,
-1.5, 2.5, -2.5,
2.0, -2.0, 1.0};
double c[NROW][NCOL];
double alpha = 1.0, beta = 1.0;
FTCHAR ftnstring;
puts("F01CTF Example Program Results");
m = NROW;
n = NCOL;
/* F01TCF/E is called with the transpose option specified for a and b.
Each character string argument has an extra length argument
at the end of the argument list. */
ftnstring.s = "T";
ftnstring.len = 1;
F01CTE(ftnstring, ftnstring, &m, &n, &alpha, (double *) a, &n, &beta,
(double *) b, &n, (double *) c, &m, &ifail);
/* Result matrix c is in column major order -
F01CRF/E transposes the matrix in place */
F01CRE((double *)c, &m, &n, &mn, move, &lmove, &ifail);
/* Print out array c in row major order */
for (i=0; i