/* nag_check_deriv_1(c05zcc) Example Program * * Copyright 1998 Numerical Algorithms Group. * * Mark 5, 1998. * Mark 7 revised, 2001. */ #include #include #include #include #ifdef __cplusplus extern "C" { #endif static void f(Integer n, double xc[], double fvecc[], double fjacc[], Integer tdj, Integer *userflag, Nag_User *comm); #ifdef __cplusplus } #endif int main(void) { #define NMAX 5 double fjac[NMAX][NMAX], fvec[NMAX], x[NMAX]; Integer i, j, n, tdfjac; static NagError fail; Nag_User comm; fail.print = TRUE; Vprintf("c05zcc Example Program Results\n"); n = 3; tdfjac = NMAX; /* Set up an arbitrary point at which to check the 1st derivatives */ x[0] = 9.2e-01; x[1] = 1.3e-01; x[2] = 5.4e-01; Vprintf("The test point is "); for (j=0; j0) fvec[k] -= x[k-1]; if (k0) FJAC(k,k-1) = -1.0; if (k