/* Simplified example program for F01CTF (Example 1 only)
C Version. NAG Copyright 1999. */
#include
#include
#include "nagmk20.h"
#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;
puts("F01CTF Example Program Results");
m = NROW;
n = NCOL;
/* F01TCF is called with the transpose option specified for a and b.
Character string arguments have an extra length argument
immediately after each. */
F01CTF("T", 1, "T", 1, &m, &n, &alpha, (double *) a, &n, &beta,
(double *) b, &n, (double *) c, &m, &ifail);
/* Result matrix c is in column major order -
F01CRF transposes the matrix in place */
F01CRF((double *)c, &m, &n, &mn, move, &lmove, &ifail);
/* Print out array c in row major order */
for (i=0; i