/* nag_2d_spline_eval_rect(e02dfc) Example Program * * Copyright 1991 Numerical Algorithms Group. * * Mark 2, 1991. */ #include #include #include #include #define MXMAX 20 #define MYMAX 20 #define FF(I,J) ff[my*(I)+(J)] int main(void) { Integer i, j, mx, my; double x[MXMAX], y[MYMAX], ff[MXMAX*MYMAX]; Nag_2dSpline spline; Vprintf("e02dfc Example Program Results\n"); /* Skip heading in data file */ Vscanf("%*[^\n]"); /* Read mx and my, the number of grid points in the x and y * directions respectively. */ Vscanf("%ld%ld",&mx,&my); if (mx<=MXMAX && my<=MYMAX) { /* Read spline.nx and spline.ny, the number of knots * in the x and y directions. */ Vscanf("%ld%ld",&(spline.nx),&(spline.ny)); spline.c = NAG_ALLOC((spline.nx-4)*(spline.ny-4), double); spline.lamda = NAG_ALLOC(spline.nx, double); spline.mu = NAG_ALLOC(spline.ny,double); if (spline.c != (double *)0 && spline.lamda != (double *)0 && spline.mu != (double *)0) { /* Read the knots spline.lamda[0]...spline.lamda[nx-1] * and spline.mu[0]...spline.mu[ny-1]. */ for (i=0; i