ext/cvode/source/cvband.c
static int CVBandSetup(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;
  integer ier;
  CVBandMem   cvband_mem;
  
  cvband_mem = (CVBandMem) lmem;

  /* Use nst, gamma/gammap, and convfail to set J eval. flag jok */

  dgamma = ABS((gamma/gammap) - ONE);
  jbad = (nst == 0) || (nst > nstlj + CVB_MSBJ) ||
         ((convfail == FAIL_BAD_J) && (dgamma < CVB_DGMAX)) ||
         (convfail == FAIL_OTHER);
  jok = !jbad;
  
  if (jok) {
    /* If jok = TRUE, use saved copy of J */
    *jcurPtr = FALSE;
    BandCopy(savedJ, M, mu, ml);
  } else {
    /* If jok = FALSE, call jac routine for new J value */
    nje++;
    if (iopt != NULL) iopt[BAND_NJE] = nje;
    nstlj = nst;
    *jcurPtr = TRUE;
    BandZero(M); 
    jac(N, mu, ml, M, f, f_data, tn, ypred, fpred, ewt,
	h, uround, J_data, &nfe, vtemp1, vtemp2, vtemp3);
    BandCopy(M, savedJ, mu, ml);
  }
  
  /* Scale and add I to get M = I - gamma*J */
  BandScale(-gamma, M);
  BandAddI(M);

  /* Do LU factorization of M */
  ier = BandFactor(M, pivots);

  /* Return 0 if the LU was complete; otherwise return 1 */
  if (ier > 0) return(1);
  return(0);
}
/*************** CVBandSetup *****************************************

 This routine does the setup operations for the band linear solver.
 It makes a decision whether or not to call the Jacobian evaluation
 routine based on various state variables, and if not it uses the 
 saved copy.  In any case, it constructs the Newton matrix 
 M = I - gamma*J, updates counters, and calls the band LU 
 factorization routine.

**********************************************************************/
CVBandSetup
This routine does the setup operations for the band linear solver.
It makes a decision whether or not to call the Jacobian evaluation
routine based on various state variables, and if not it uses the
saved copy.  In any case, it constructs the Newton matrix
M = I - gamma*J, updates counters, and calls the band LU
factorization routine.
CVBandSetup This routine does the setup operations for the band linear solver . It makes a decision whether or not to call the Jacobian evaluation routine based on various state variables and if not it uses the saved copy . In any case it constructs the Newton matrix M = I - gamma * J updates counters and calls the band LU factorization routine .
static int CVBandSetup(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;
  integer ier;
  CVBandMem   cvband_mem;
  cvband_mem = (CVBandMem) lmem;
  dgamma = ABS((gamma/gammap) - ONE);
  jbad = (nst == 0) || (nst > nstlj + CVB_MSBJ) ||
         ((convfail == FAIL_BAD_J) && (dgamma < CVB_DGMAX)) ||
         (convfail == FAIL_OTHER);
  jok = !jbad;
  if (jok) {
    *jcurPtr = FALSE;
    BandCopy(savedJ, M, mu, ml);
  } else {
    nje++;
    if (iopt != NULL) iopt[BAND_NJE] = nje;
    nstlj = nst;
    *jcurPtr = TRUE;
    BandZero(M); 
    jac(N, mu, ml, M, f, f_data, tn, ypred, fpred, ewt,
	h, uround, J_data, &nfe, vtemp1, vtemp2, vtemp3);
    BandCopy(M, savedJ, mu, ml);
  }
  BandScale(-gamma, M);
  BandAddI(M);
  ier = BandFactor(M, pivots);
  if (ier > 0) return(1);
  return(0);
}
static int CVBandSetup ( 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 ; integer ier ; CVBandMem cvband_mem ; cvband_mem = ( CVBandMem ) lmem ; dgamma = ABS ( ( gamma / gammap ) - ONE ) ; jbad = ( nst == 0 ) || ( nst > nstlj + CVB_MSBJ ) || ( ( convfail == FAIL_BAD_J ) && ( dgamma < CVB_DGMAX ) ) || ( convfail == FAIL_OTHER ) ; jok = ! jbad ; if ( jok ) { * jcurPtr = FALSE ; BandCopy ( savedJ , M , mu , ml ) ; } else { nje ++ ; if ( iopt != NULL ) iopt [ BAND_NJE ] = nje ; nstlj = nst ; * jcurPtr = TRUE ; BandZero ( M ) ; jac ( N , mu , ml , M , f , f_data , tn , ypred , fpred , ewt , h , uround , J_data , & nfe , vtemp1 , vtemp2 , vtemp3 ) ; BandCopy ( M , savedJ , mu , ml ) ; } BandScale ( - gamma , M ) ; BandAddI ( M ) ; ier = BandFactor ( M , pivots ) ; if ( ier > 0 ) return ( 1 ) ; return ( 0 ) ; }
CVBandSetup 
This routine does the setup operations for the band linear solver.
CVBandSetup This routine does the setup operations for the band linear solver .
/* Use nst, gamma/gammap, and convfail to set J eval. flag jok */ /* If jok = TRUE, use saved copy of J */ /* If jok = FALSE, call jac routine for new J value */ /* Scale and add I to get M = I - gamma*J */ /* Do LU factorization of M */ /* Return 0 if the LU was complete; otherwise return 1 */