ext/cvode/source/cvdense.c
static int CVDenseInit(CVodeMem cv_mem, boole *setupNonNull)
{
  CVDenseMem cvdense_mem;
  
  cvdense_mem = (CVDenseMem) lmem;

  /* Print error message and return if cvdense_mem is NULL */  
  if (cvdense_mem == NULL) {
    fprintf(errfp, MSG_MEM_FAIL);
    return(LINIT_ERR);
  }

  /* Set flag setupNonNull = TRUE */  
  *setupNonNull = TRUE;
  
  /* Allocate memory for M, savedJ, and pivot array */
  
  M = DenseAllocMat(N);
  if (M == NULL) {
    fprintf(errfp, MSG_MEM_FAIL);
    return(LINIT_ERR);
  }
  savedJ = DenseAllocMat(N);
  if (savedJ == NULL) {
    fprintf(errfp, MSG_MEM_FAIL);
    DenseFreeMat(M);
    return(LINIT_ERR);
  }
  pivots = DenseAllocPiv(N);
  if (pivots == NULL) {
    fprintf(errfp, MSG_MEM_FAIL);
    DenseFreeMat(M);
    DenseFreeMat(savedJ);
    return(LINIT_ERR);
  }
  
  /* Initialize nje and nstlj, and set workspace lengths */
   
  nje = 0;
  if (iopt != NULL) {
   iopt[DENSE_NJE] = nje;
   iopt[DENSE_LRW] = 2*N*N;
   iopt[DENSE_LIW] = N;
  }
  nstlj = 0;
  
  return(LINIT_OK);
}
/*************** CVDenseInit *****************************************

 This routine initializes remaining memory specific to the dense
 linear solver.  If any memory request fails, all memory previously
 allocated is freed, and an error message printed, before returning.

**********************************************************************/
CVDenseInit
This routine initializes remaining memory specific to the dense
linear solver.  If any memory request fails, all memory previously
allocated is freed, and an error message printed, before returning.
CVDenseInit This routine initializes remaining memory specific to the dense linear solver . If any memory request fails all memory previously allocated is freed and an error message printed before returning .
static int CVDenseInit(CVodeMem cv_mem, boole *setupNonNull)
{
  CVDenseMem cvdense_mem;
  cvdense_mem = (CVDenseMem) lmem;
  if (cvdense_mem == NULL) {
    fprintf(errfp, MSG_MEM_FAIL);
    return(LINIT_ERR);
  }
  *setupNonNull = TRUE;
  M = DenseAllocMat(N);
  if (M == NULL) {
    fprintf(errfp, MSG_MEM_FAIL);
    return(LINIT_ERR);
  }
  savedJ = DenseAllocMat(N);
  if (savedJ == NULL) {
    fprintf(errfp, MSG_MEM_FAIL);
    DenseFreeMat(M);
    return(LINIT_ERR);
  }
  pivots = DenseAllocPiv(N);
  if (pivots == NULL) {
    fprintf(errfp, MSG_MEM_FAIL);
    DenseFreeMat(M);
    DenseFreeMat(savedJ);
    return(LINIT_ERR);
  }
  nje = 0;
  if (iopt != NULL) {
   iopt[DENSE_NJE] = nje;
   iopt[DENSE_LRW] = 2*N*N;
   iopt[DENSE_LIW] = N;
  }
  nstlj = 0;
  return(LINIT_OK);
}
static int CVDenseInit ( CVodeMem cv_mem , boole * setupNonNull ) { CVDenseMem cvdense_mem ; cvdense_mem = ( CVDenseMem ) lmem ; if ( cvdense_mem == NULL ) { fprintf ( errfp , MSG_MEM_FAIL ) ; return ( LINIT_ERR ) ; } * setupNonNull = TRUE ; M = DenseAllocMat ( N ) ; if ( M == NULL ) { fprintf ( errfp , MSG_MEM_FAIL ) ; return ( LINIT_ERR ) ; } savedJ = DenseAllocMat ( N ) ; if ( savedJ == NULL ) { fprintf ( errfp , MSG_MEM_FAIL ) ; DenseFreeMat ( M ) ; return ( LINIT_ERR ) ; } pivots = DenseAllocPiv ( N ) ; if ( pivots == NULL ) { fprintf ( errfp , MSG_MEM_FAIL ) ; DenseFreeMat ( M ) ; DenseFreeMat ( savedJ ) ; return ( LINIT_ERR ) ; } nje = 0 ; if ( iopt != NULL ) { iopt [ DENSE_NJE ] = nje ; iopt [ DENSE_LRW ] = 2 * N * N ; iopt [ DENSE_LIW ] = N ; } nstlj = 0 ; return ( LINIT_OK ) ; }
CVDenseInit 
This routine initializes remaining memory specific to the dense
linear solver.
CVDenseInit This routine initializes remaining memory specific to the dense linear solver .
/* Print error message and return if cvdense_mem is NULL */ /* Set flag setupNonNull = TRUE */ /* Allocate memory for M, savedJ, and pivot array */ /* Initialize nje and nstlj, and set workspace lengths */