ext/cvode/source/cvspgmr.c
static int CVSpgmrSetup(CVodeMem cv_mem, int convfail, N_Vector ypred,
			N_Vector fpred, boole *jcurPtr, N_Vector vtemp1,
			N_Vector vtemp2, N_Vector vtemp3)
{
  boole jbad, jok;
  real dgamma;
  int  ier;
  CVSpgmrMem cvspgmr_mem;

  cvspgmr_mem = (CVSpgmrMem) lmem;

  /* Use nst, gamma/gammap, and convfail to set J eval. flag jok */
  dgamma = ABS((gamma/gammap) - ONE);
  jbad = (nst == 0) || (nst > nstlpre + CVSPGMR_MSBPRE) ||
         ((convfail == FAIL_BAD_J) && (dgamma < CVSPGMR_DGMAX)) ||
 	 (convfail == FAIL_OTHER);
  *jcurPtr = jbad;
  jok = !jbad;

  /* Call precond routine and possibly reset jcur */
  ier = precond(N, tn, ypred, fpred, jok, jcurPtr, gamma, ewt, h,
		uround, &nfe, P_data, vtemp1, vtemp2, vtemp3);
  if (jbad) *jcurPtr = TRUE;

  /* If jcur = TRUE, increment npe and save nst value */
  if (*jcurPtr) {
    npe++;
    nstlpre = nst;
  }

  /* Set npe, and return the same value ier that precond returned */
  if (iopt != NULL) iopt[SPGMR_NPE] = npe;
  return(ier);
}
/*************** CVSpgmrSetup ****************************************

 This routine does the setup operations for the Spgmr linear solver.
 It makes a decision as to whether or not to signal for re-evaluation
 of Jacobian data in the precond routine, based on various state
 variables, then it calls precond.  If we signal for re-evaluation,
 then we reset jcur = *jcurPtr to TRUE, regardless of the precond output.
 In any case, if jcur == TRUE, we increment npe and save nst in nstlpre.

**********************************************************************/
CVSpgmrSetup
This routine does the setup operations for the Spgmr linear solver.
It makes a decision as to whether or not to signal for re-evaluation
of Jacobian data in the precond routine, based on various state
variables, then it calls precond.  If we signal for re-evaluation,
then we reset jcur = *jcurPtr to TRUE, regardless of the precond output.
In any case, if jcur == TRUE, we increment npe and save nst in nstlpre.
CVSpgmrSetup This routine does the setup operations for the Spgmr linear solver . It makes a decision as to whether or not to signal for re - evaluation of Jacobian data in the precond routine based on various state variables then it calls precond . If we signal for re - evaluation then we reset jcur = * jcurPtr to TRUE regardless of the precond output . In any case if jcur == TRUE we increment npe and save nst in nstlpre .
static int CVSpgmrSetup(CVodeMem cv_mem, int convfail, N_Vector ypred,
			N_Vector fpred, boole *jcurPtr, N_Vector vtemp1,
			N_Vector vtemp2, N_Vector vtemp3)
{
  boole jbad, jok;
  real dgamma;
  int  ier;
  CVSpgmrMem cvspgmr_mem;
  cvspgmr_mem = (CVSpgmrMem) lmem;
  dgamma = ABS((gamma/gammap) - ONE);
  jbad = (nst == 0) || (nst > nstlpre + CVSPGMR_MSBPRE) ||
         ((convfail == FAIL_BAD_J) && (dgamma < CVSPGMR_DGMAX)) ||
 	 (convfail == FAIL_OTHER);
  *jcurPtr = jbad;
  jok = !jbad;
  ier = precond(N, tn, ypred, fpred, jok, jcurPtr, gamma, ewt, h,
		uround, &nfe, P_data, vtemp1, vtemp2, vtemp3);
  if (jbad) *jcurPtr = TRUE;
  if (*jcurPtr) {
    npe++;
    nstlpre = nst;
  }
  if (iopt != NULL) iopt[SPGMR_NPE] = npe;
  return(ier);
}
static int CVSpgmrSetup ( CVodeMem cv_mem , int convfail , N_Vector ypred , N_Vector fpred , boole * jcurPtr , N_Vector vtemp1 , N_Vector vtemp2 , N_Vector vtemp3 ) { boole jbad , jok ; real dgamma ; int ier ; CVSpgmrMem cvspgmr_mem ; cvspgmr_mem = ( CVSpgmrMem ) lmem ; dgamma = ABS ( ( gamma / gammap ) - ONE ) ; jbad = ( nst == 0 ) || ( nst > nstlpre + CVSPGMR_MSBPRE ) || ( ( convfail == FAIL_BAD_J ) && ( dgamma < CVSPGMR_DGMAX ) ) || ( convfail == FAIL_OTHER ) ; * jcurPtr = jbad ; jok = ! jbad ; ier = precond ( N , tn , ypred , fpred , jok , jcurPtr , gamma , ewt , h , uround , & nfe , P_data , vtemp1 , vtemp2 , vtemp3 ) ; if ( jbad ) * jcurPtr = TRUE ; if ( * jcurPtr ) { npe ++ ; nstlpre = nst ; } if ( iopt != NULL ) iopt [ SPGMR_NPE ] = npe ; return ( ier ) ; }
CVSpgmrSetup 
This routine does the setup operations for the Spgmr linear solver.
CVSpgmrSetup This routine does the setup operations for the Spgmr linear solver .
/* Use nst, gamma/gammap, and convfail to set J eval. flag jok */ /* Call precond routine and possibly reset jcur */ /* If jcur = TRUE, increment npe and save nst value */ /* Set npe, and return the same value ier that precond returned */