/* nag_2d_scat_interpolant(e01sac) Example Program * * Copyright 1996 Numerical Algorithms Group. * * Mark 4, 1996. */ #include #include #include #include #define MMAX 100 #define NMAX 10 #define NXYM NMAX*NMAX #define TDX MMAX #define TDQ MMAX+1 int main(void) { Integer i, isel, j, m, n, nx, ny; double xhi, xlo, yhi, ylo; double f[MMAX], pf[NXYM], px[NXYM], py[NXYM], x[MMAX], y[MMAX]; Nag_Scat_Struct comm; Nag_2d_Scat_Method method; Nag_E01_Opt optional; Vprintf("e01sac Example Program Results\n"); /* Skip heading in data file */ Vscanf("%*[^\n]"); /* Input the number of nodes. */ Vscanf("%ld", &m); if (m>=1 && m<=MMAX) { /* Input the nodes (x,y) and heights, f. */ for (i=0; i= 0; --i) { Vprintf("%8.2f ", py[nx * i]); for (j = 0; j < nx; j++) Vprintf("%8.2f", pf[nx * i + j]); Vprintf("\n"); } } /* Free the memory allocated to the pointers in structure comm. */ e01szc(&comm); } return EXIT_SUCCESS; } else { Vfprintf(stderr, "m is out of range: m = %-3ld\n", m); return EXIT_FAILURE; } }