ext/cvode/source/cvspgmr.c
void CVSpgmr(void *cvode_mem, int pretype, int gstype, int maxl, real delt,
	     CVSpgmrPrecondFn precond, CVSpgmrPSolveFn psolve, void *P_data)

{
  CVodeMem cv_mem;
  CVSpgmrMem cvspgmr_mem;

  /* Return immediately if cvode_mem is NULL */
  cv_mem = (CVodeMem) cvode_mem;
  if (cv_mem == NULL) return;  /* CVode reports this error */

  /* Set four main function fields in cv_mem */
  linit  = CVSpgmrInit;
  lsetup = CVSpgmrSetup;
  lsolve = CVSpgmrSolve;
  lfree  = CVSpgmrFree;

  /* Get memory for CVSpgmrMemRec */
  lmem = cvspgmr_mem = (CVSpgmrMem) malloc(sizeof(CVSpgmrMemRec));
  if (cvspgmr_mem == NULL) return;  /* CVSpgmrInit reports this error */

  /* Set Spgmr parameters that have been passed in call sequence */
  cvspgmr_mem->g_pretype = pretype;
  cvspgmr_mem->g_gstype  = gstype;
  cvspgmr_mem->g_maxl    = (maxl <= 0) ? MIN(CVSPGMR_MAXL, N) : maxl;
  cvspgmr_mem->g_delt    = (delt == ZERO) ? CVSPGMR_DELT : delt;
  cvspgmr_mem->g_P_data  = P_data;
  cvspgmr_mem->g_precond = precond;
  cvspgmr_mem->g_psolve  = psolve;
}
/*************** CVSpgmr *********************************************

 This routine initializes the memory record and sets various function
 fields specific to the Spgmr linear solver module. CVSpgmr sets the
 cv_linit, cv_lsetup, cv_lsolve, and cv_lfree fields in (*cvode_mem)
 to be CVSpgmrInit, CVSpgmrSetup, CVSpgmrSolve, and CVSpgmrFree,
 respectively. It allocates memory for a structure of type
 CVSpgmrMemRec and sets the cv_lmem field in (*cvode_mem) to the
 address of this structure. CVSpgmr sets the following fields in the
 CVSpgmrMemRec structure:                                       

   g_pretype = pretype                                       
   g_maxl    = MIN(N,CVSPGMR_MAXL)  if maxl <= 0             
             = maxl                 if maxl > 0              
   g_delt    = CVSPGMR_DELT if delt == 0.0                     
             = delt         if delt != 0.0                     
   g_P_data  = P_data                                        
   g_precond = precond                                       
   g_psolve  = psolve                                        

**********************************************************************/
CVSpgmr
This routine initializes the memory record and sets various function
fields specific to the Spgmr linear solver module.


CVSpgmr This routine initializes the memory record and sets various function fields specific to the Spgmr linear solver module .
void CVSpgmr(void *cvode_mem, int pretype, int gstype, int maxl, real delt,
	     CVSpgmrPrecondFn precond, CVSpgmrPSolveFn psolve, void *P_data)
{
  CVodeMem cv_mem;
  CVSpgmrMem cvspgmr_mem;
  cv_mem = (CVodeMem) cvode_mem;
  if (cv_mem == NULL) return;  
  linit  = CVSpgmrInit;
  lsetup = CVSpgmrSetup;
  lsolve = CVSpgmrSolve;
  lfree  = CVSpgmrFree;
  lmem = cvspgmr_mem = (CVSpgmrMem) malloc(sizeof(CVSpgmrMemRec));
  if (cvspgmr_mem == NULL) return;  
  cvspgmr_mem->g_pretype = pretype;
  cvspgmr_mem->g_gstype  = gstype;
  cvspgmr_mem->g_maxl    = (maxl <= 0) ? MIN(CVSPGMR_MAXL, N) : maxl;
  cvspgmr_mem->g_delt    = (delt == ZERO) ? CVSPGMR_DELT : delt;
  cvspgmr_mem->g_P_data  = P_data;
  cvspgmr_mem->g_precond = precond;
  cvspgmr_mem->g_psolve  = psolve;
}
void CVSpgmr ( void * cvode_mem , int pretype , int gstype , int maxl , real delt , CVSpgmrPrecondFn precond , CVSpgmrPSolveFn psolve , void * P_data ) { CVodeMem cv_mem ; CVSpgmrMem cvspgmr_mem ; cv_mem = ( CVodeMem ) cvode_mem ; if ( cv_mem == NULL ) return ; linit = CVSpgmrInit ; lsetup = CVSpgmrSetup ; lsolve = CVSpgmrSolve ; lfree = CVSpgmrFree ; lmem = cvspgmr_mem = ( CVSpgmrMem ) malloc ( sizeof ( CVSpgmrMemRec ) ) ; if ( cvspgmr_mem == NULL ) return ; cvspgmr_mem -> g_pretype = pretype ; cvspgmr_mem -> g_gstype = gstype ; cvspgmr_mem -> g_maxl = ( maxl <= 0 ) ? MIN ( CVSPGMR_MAXL , N ) : maxl ; cvspgmr_mem -> g_delt = ( delt == ZERO ) ? CVSPGMR_DELT : delt ; cvspgmr_mem -> g_P_data = P_data ; cvspgmr_mem -> g_precond = precond ; cvspgmr_mem -> g_psolve = psolve ; }
CVSpgmr 
This routine initializes the memory record and sets various function
fields specific to the Spgmr linear solver module.
CVSpgmr This routine initializes the memory record and sets various function fields specific to the Spgmr linear solver module .
/* Return immediately if cvode_mem is NULL */ /* CVode reports this error */ /* Set four main function fields in cv_mem */ /* Get memory for CVSpgmrMemRec */ /* CVSpgmrInit reports this error */ /* Set Spgmr parameters that have been passed in call sequence */