/* nag_check_deriv(c05zbc) Example Program * * Copyright 1991 Numerical Algorithms Group. * * Mark 2, 1991. * 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); #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; fail.print = TRUE; Vprintf("c05zbc 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