6 extern void C2F(dgesv)(int*, int*, double*, int*, int*, double*, int*, int*);
7 extern double C2F(dlamch)(const char*);
8 typedef void (*resfunc)(double*, double*, double*, double*, int*, double*, int*);
10 void C2F(pjac1)(resfunc res, int *ires, int *nequations, double *tOld, double *actual, double *actualP,
11 double *rewt, double *savr, double *wk, double *h, double *cj, double *wp, int *iwp,
12 int *ier, double *rpar, int *ipar)
24 int neq = *nequations;
25 double SQuround = sqrt(C2F(dlamch)("P"));
29 e = (double*) calloc(neq, sizeof(double));
31 for (i = 0 ; i < neq ; ++i)
33 del = Max(SQuround * Max(fabs(actual[i]), fabs(*h * actualP[i])), 1. / rewt[i]);
34 del *= (*h * actualP[i] >= 0) ? 1 : -1;
38 actualP[i] += *cj * del;
39 res(&tx, actual, actualP, e, ires, rpar, ipar);
49 for (j = 0 ; j < neq ; j++)
51 wp[nrow + j] = (e[j] - savr[j]) * delinv;
53 if (ISNAN(wp[nrow + j]))
59 iwp[nrow + j] = i + 1;
60 iwp[nrow + j + neq * neq] = j + 1;
70 void C2F(psol1)(int *nequations, double *tOld, double *actual, double *actualP,
71 double *savr, double *wk, double *cj, double *wght, double *wp,
72 int *iwp, double *b, double *eplin, int *ier, double *dummy1, int *dummy2)
79 ipiv = (int *) malloc(*nequations * sizeof(int));
81 C2F(dgesv) (nequations, &nColB, wp, nequations, ipiv, b, nequations, &info);
86 for (i = 0; i < *nequations; ++i)