示例#1
0
SCIP_Bool create_graph (int n, int m, GRAPH** gr)
{
   assert( gr != NULL );

   BMSallocMemory(gr);
   if( *gr == NULL )
      return FALSE;

   BMSallocMemoryArray( &(*gr)->nodes, n );
   if( (*gr)->nodes == NULL )
   {
      BMSfreeMemory(gr);
      return FALSE;
   }

   BMSallocMemoryArray( &(*gr)->edges, m );
   if( (*gr)->edges == NULL )
   {
      BMSfreeMemoryArray(&(*gr)->nodes);
      BMSfreeMemory(gr);
      return FALSE;
   }
   (*gr)->nuses = 1;
   (*gr)->nnodes = n;
   (*gr)->nedges = m/2;
   (*gr)->nedgesnonzero = m/2;
   return TRUE;
}
示例#2
0
static 
void free_graph (GRAPH** gr)
{
   assert(gr != NULL);
   assert(*gr != NULL);
   assert((*gr)->nuses == 0);
   BMSfreeMemory(&(*gr)->nodes);
   BMSfreeMemory(&(*gr)->edges);
   BMSfreeMemory(gr);
}
示例#3
0
/** prints warning message with the current message handler, or buffers the message if no newline exists */
static
void messagePrintWarning(
   SCIP_MESSAGEHDLR*     messagehdlr,        /**< message handler */
   const char*           msg,                /**< message to print; NULL to flush the output buffer */
   int                   msglength           /**< message length if bigger than SCIP_MAXSTRLEN, or SCIP_MAXSTRLEN */
   )
{
   if( messagehdlr != NULL && messagehdlr->messagewarning != NULL && (!messagehdlr->quiet || messagehdlr->logfile != NULL) )
   {
      char* outmsg;
      int outmsgsize;

      outmsgsize = msglength + 1;

      if( BMSallocMemorySize(&outmsg, outmsgsize) == NULL )
         return;

      if( !bufferMessage(messagehdlr->warningbuffer, &messagehdlr->warningbufferlen, msg, outmsg, &outmsgsize) )
      {
         assert(outmsgsize > msglength + 1);
         if( BMSreallocMemorySize(&outmsg, outmsgsize) != NULL )
         {
#ifndef NDEBUG
            SCIP_Bool ret;

            ret = bufferMessage(messagehdlr->warningbuffer, &messagehdlr->warningbufferlen, msg, outmsg, &outmsgsize);
            assert(ret);
#else
            bufferMessage(messagehdlr->warningbuffer, &messagehdlr->warningbufferlen, msg, outmsg, &outmsgsize);
#endif
         }
         else
         {
            BMSfreeMemory(&outmsg);
            return;
         }
      }

      if( *outmsg != '\0' )
      {
         if( !messagehdlr->quiet )
            messagehdlr->messagewarning(messagehdlr, stderr, outmsg);
         if( messagehdlr->logfile != NULL )
            messagehdlr->messagewarning(messagehdlr, messagehdlr->logfile, outmsg);
      }

      BMSfreeMemory(&outmsg);
   }
}
示例#4
0
/** remove top element from stack and deletes it
 *
 *  TRUE if ok, FALSE otherwise
 */
static
XML_Bool pop_pstack(
   PPOS*                 ppos                /**< input stream position */
   )
{
   PSTACK* p;
   int     result;

   assert(ppos != NULL);

   if (ppos->top == NULL)
   {
      xml_error(ppos, "Stack underflow");
      result = FALSE;
   }
   else
   {
      result    = TRUE;
      p         = ppos->top;
      ppos->top = p->next;

      debugMessage("Poping %s\n", p->node->name);
      BMSfreeMemory(&p);
   }
   return result;
}
示例#5
0
文件: stat.c 项目: hhexiy/scip
/** frees problem statistics data */
SCIP_RETCODE SCIPstatFree(
   SCIP_STAT**           stat,               /**< pointer to problem statistics data */
   BMS_BLKMEM*           blkmem              /**< block memory */
   )
{
   assert(stat != NULL);
   assert(*stat != NULL);

   SCIPclockFree(&(*stat)->solvingtime);
   SCIPclockFree(&(*stat)->presolvingtime);
   SCIPclockFree(&(*stat)->primallptime);
   SCIPclockFree(&(*stat)->duallptime);
   SCIPclockFree(&(*stat)->lexduallptime);
   SCIPclockFree(&(*stat)->barrierlptime);
   SCIPclockFree(&(*stat)->divinglptime);
   SCIPclockFree(&(*stat)->strongbranchtime);
   SCIPclockFree(&(*stat)->conflictlptime);
   SCIPclockFree(&(*stat)->lpsoltime);
   SCIPclockFree(&(*stat)->pseudosoltime);
   SCIPclockFree(&(*stat)->sbsoltime);
   SCIPclockFree(&(*stat)->nodeactivationtime);
   SCIPclockFree(&(*stat)->nlpsoltime);
   SCIPclockFree(&(*stat)->copyclock);
   SCIPclockFree(&(*stat)->strongpropclock);

   SCIPhistoryFree(&(*stat)->glbhistory, blkmem);
   SCIPhistoryFree(&(*stat)->glbhistorycrun, blkmem);
   SCIPvbcFree(&(*stat)->vbc);

   BMSfreeMemory(stat);

   return SCIP_OKAY;
}
示例#6
0
文件: message.c 项目: hhexiy/scip
/** frees message handler */
static
SCIP_RETCODE messagehdlrFree(
   SCIP_MESSAGEHDLR**    messagehdlr         /**< pointer to the message handler */
   )
{
   assert(messagehdlr != NULL);

   if( *messagehdlr != NULL )
   {
      /* flush message buffers */
      messagePrintWarning(*messagehdlr, NULL);
      messagePrintDialog(*messagehdlr, NULL, NULL);
      messagePrintInfo(*messagehdlr, NULL, NULL);

      if( (*messagehdlr)->messagehdlrfree != NULL )
      {
         /* call destructor method of message handler to free the message handler data */
         SCIP_CALL( (*messagehdlr)->messagehdlrfree(*messagehdlr) );
      }

      /* close the log file if one exists */
      if( (*messagehdlr)->logfile != NULL )
      {
         fclose((*messagehdlr)->logfile);
      }

      /* free buffer arrays */
      BMSfreeMemoryArrayNull(&(*messagehdlr)->warningbuffer);
      BMSfreeMemoryArrayNull(&(*messagehdlr)->dialogbuffer);
      BMSfreeMemoryArrayNull(&(*messagehdlr)->infobuffer);
      BMSfreeMemory(messagehdlr);
   }

   return SCIP_OKAY;
}
示例#7
0
/** frees memory of reader */
SCIP_RETCODE SCIPreaderFree(
   SCIP_READER**         reader,             /**< pointer to reader data structure */
   SCIP_SET*             set                 /**< global SCIP settings */
   )
{
   assert(reader != NULL);
   assert(*reader != NULL);
   assert(set != NULL);

   /* call destructor of reader */
   if( (*reader)->readerfree != NULL )
   {
      SCIP_CALL( (*reader)->readerfree(set->scip, *reader) );
   }

   /* free clock */
   SCIPclockFree(&(*reader)->readingtime);

   BMSfreeMemoryArray(&(*reader)->name);
   BMSfreeMemoryArray(&(*reader)->desc);
   BMSfreeMemoryArray(&(*reader)->extension);
   BMSfreeMemory(reader);

   return SCIP_OKAY;
}
示例#8
0
文件: heur.c 项目: gorhan/LFOS
/** calls destructor and frees memory of primal heuristic */
SCIP_RETCODE SCIPheurFree(
   SCIP_HEUR**           heur,               /**< pointer to primal heuristic data structure */
   SCIP_SET*             set                 /**< global SCIP settings */
   )
{
   int d;
   assert(heur != NULL);
   assert(*heur != NULL);
   assert(!(*heur)->initialized);
   assert(set != NULL);
   assert((*heur)->divesets != NULL || (*heur)->ndivesets == 0);

   /* call destructor of primal heuristic */
   if( (*heur)->heurfree != NULL )
   {
      SCIP_CALL( (*heur)->heurfree(set->scip, *heur) );
   }

   for( d = 0; d < (*heur)->ndivesets; ++d )
   {
      assert((*heur)->divesets[d] != NULL);
      divesetFree(&((*heur)->divesets[d]));
   }
   BMSfreeMemoryArrayNull(&(*heur)->divesets);
   SCIPclockFree(&(*heur)->heurclock);
   SCIPclockFree(&(*heur)->setuptime);
   BMSfreeMemoryArray(&(*heur)->name);
   BMSfreeMemoryArray(&(*heur)->desc);
   BMSfreeMemory(heur);

   return SCIP_OKAY;
}
示例#9
0
/** free node */
void xml_free_node(
   XML_NODE*             node
   )
{
   XML_NODE* n;

   if (node == NULL)
      return;

   n = node->first_child;
   while (n != NULL)
   {
      XML_NODE* m;
      m = n->next_sibl;
      xml_free_node(n);
      n = m;
   }

   xml_free_attr(node->attr_list);

   if (node->data != NULL)
   {
      BMSfreeMemoryArray(&node->data);
   }
   assert(node->name != NULL);

   BMSfreeMemoryArray(&node->name);
   BMSfreeMemory(&node);

#if 0
   if (n != NULL)
   {
      xml_free_node(n->first_child);
      xml_free_node(n->next_sibl);
      xml_free_attr(n->attr_list);

      if (n->data != NULL)
      {
         BMSfreeMemoryArray(&n->data);
      }
      assert(n->name != NULL);

      BMSfreeMemoryArray(&n->name);
      BMSfreeMemory(&n);
   }
#endif
}
示例#10
0
/** frees global relaxation data */
SCIP_RETCODE SCIPrelaxationFree(
   SCIP_RELAXATION**     relaxation          /**< global relaxation data */
   )
{
   assert(relaxation != NULL);

   BMSfreeMemory(relaxation);

   return SCIP_OKAY;
}
示例#11
0
/** frees a clique */
static
void freeClique(
   CLIQUE**         clique              /**< pointer to the clique */
   )
{
   assert(clique != NULL);
   assert(*clique != NULL);

   BMSfreeMemoryArray(&(*clique)->nodes);
   BMSfreeMemory(clique);
}
示例#12
0
文件: heur.c 项目: gorhan/LFOS
/** frees memory of a diveset */
static
void divesetFree(
   SCIP_DIVESET**        diveset             /**< general diving settings */
   )
{
   assert(*diveset != NULL);
   assert((*diveset)->name != NULL);

   BMSfreeMemoryArray(&(*diveset)->name);
   BMSfreeMemory(diveset);
}
示例#13
0
/** frees VBC Tool data structure */
void SCIPvbcFree(
   SCIP_VBC**            vbc                 /**< pointer to store the VBC information */
   )
{
   assert(vbc != NULL);
   assert(*vbc != NULL);
   assert((*vbc)->file == NULL);
   assert((*vbc)->nodenum == NULL);

   BMSfreeMemory(vbc);
}
示例#14
0
/** frees visualization data structure */
void SCIPvisualFree(
   SCIP_VISUAL**         visual              /**< pointer to store visualization information */
   )
{
   assert( visual != NULL );
   assert( *visual != NULL );
   assert( (*visual)->vbcfile == NULL );
   assert( (*visual)->bakfile == NULL );
   assert( (*visual)->nodenum == NULL );

   BMSfreeMemory(visual);
}
示例#15
0
文件: message.c 项目: hhexiy/scip
/** prints a message into a file depending on the verbosity level, acting like the vfprintf() command */
void SCIPmessageVFPrintVerbInfo(
   SCIP_MESSAGEHDLR*     messagehdlr,        /**< message handler */
   SCIP_VERBLEVEL        verblevel,          /**< current verbosity level */
   SCIP_VERBLEVEL        msgverblevel,       /**< verbosity level of this message */
   FILE*                 file,               /**< file stream to print into, or NULL for stdout */
   const char*           formatstr,          /**< format string like in printf() function */
   va_list               ap                  /**< variable argument list */
   )
{
   assert(msgverblevel > SCIP_VERBLEVEL_NONE);
   assert(msgverblevel <= SCIP_VERBLEVEL_FULL);
   assert(verblevel <= SCIP_VERBLEVEL_FULL);

   if( msgverblevel <= verblevel )
   {
      char msg[SCIP_MAXSTRLEN];
      int n;
      va_list aq;

      va_copy(aq, ap);

      n = vsnprintf(msg, SCIP_MAXSTRLEN, formatstr, ap);
      if( n < 0 )
         msg[SCIP_MAXSTRLEN-1] = '\0';
      else if( n >= SCIP_MAXSTRLEN )
      {
         char* bigmsg;
#ifndef NDEBUG
         int m;
#endif

         if( BMSallocMemorySize(&bigmsg, n+1) == NULL )
         {
            va_end(aq);
            return;
         }

#ifndef NDEBUG
         m = vsnprintf(bigmsg, (size_t) n+1, formatstr, aq);
#else
         vsnprintf(bigmsg, (size_t) n+1, formatstr, aq);
#endif
         assert(m == n);
         va_end(aq);
         messagePrintInfo(messagehdlr, file, bigmsg);
         BMSfreeMemory(&bigmsg);
         return;
      }
      messagePrintInfo(messagehdlr, file, msg);
      va_end(aq);
   }
}
示例#16
0
文件: mem.c 项目: hhexiy/scip
/** frees block memory structures */
SCIP_RETCODE SCIPmemFree(
   SCIP_MEM**            mem                 /**< pointer to block memory structure */
   )
{
   assert(mem != NULL);

   BMSdestroyBlockMemory(&(*mem)->probmem);
   BMSdestroyBlockMemory(&(*mem)->setmem);

   BMSfreeMemory(mem);

   return SCIP_OKAY;
}
示例#17
0
/** frees the table for storing cliques and all inserted cliques */
static
void freeCliquehash(
   CLIQUEHASH**     cliquehash          /**< pointer to the clique hash table */
   )
{
   assert(cliquehash != NULL);
   assert(*cliquehash != NULL);

   /* free the cliques in the table */
   clearCliquehash(*cliquehash);

   /* free the table data structure */
   BMSfreeMemoryArray(&(*cliquehash)->cliques);
   BMSfreeMemory(cliquehash);
}
示例#18
0
/** free attribute */
static
void xml_free_attr(
   XML_ATTR*             attr
   )
{
   XML_ATTR* a;

   a = attr;
   while (a != NULL)
   {
      XML_ATTR* b;
      b = a->next;

      assert(a->name  != NULL);
      assert(a->value != NULL);
      
      BMSfreeMemoryArray(&a->name);
      BMSfreeMemoryArray(&a->value);
      BMSfreeMemory(&a);
      a = b;
   }

#if 0
   if (a != NULL)
   {
      xml_free_attr(a->next);

      assert(a->name  != NULL);
      assert(a->value != NULL);

      BMSfreeMemoryArray(&a->name);
      BMSfreeMemoryArray(&a->value);
      BMSfreeMemory(&a);
   }
#endif
}
示例#19
0
/** frees separation storage */
SCIP_RETCODE SCIPsepastoreFree(
   SCIP_SEPASTORE**           sepastore                /**< pointer to store separation storage */
   )
{
   assert(sepastore != NULL);
   assert(*sepastore != NULL);
   assert((*sepastore)->ncuts == 0);

   BMSfreeMemoryArrayNull(&(*sepastore)->cuts);
   BMSfreeMemoryArrayNull(&(*sepastore)->efficacies);
   BMSfreeMemoryArrayNull(&(*sepastore)->objparallelisms);
   BMSfreeMemoryArrayNull(&(*sepastore)->orthogonalities);
   BMSfreeMemoryArrayNull(&(*sepastore)->scores);
   BMSfreeMemory(sepastore);

   return SCIP_OKAY;
}
示例#20
0
/** frees block and buffer memory structures */
SCIP_RETCODE SCIPmemFree(
   SCIP_MEM**            mem                 /**< pointer to block and buffer memory structure */
   )
{
   assert(mem != NULL);

   /* free memory buffers */
   BMSdestroyBufferMemory(&(*mem)->cleanbuffer);
   BMSdestroyBufferMemory(&(*mem)->buffer);

   /* free block memory */
   BMSdestroyBlockMemory(&(*mem)->probmem);
   BMSdestroyBlockMemory(&(*mem)->setmem);

   BMSfreeMemory(mem);

   return SCIP_OKAY;
}
示例#21
0
文件: buffer.c 项目: hhexiy/scip
/** frees memory buffer */
void SCIPbufferFree(
   SCIP_BUFFER**         buffer              /**< pointer to memory buffer storage */
   )
{
   int i;

   assert(buffer != NULL);

   for( i = 0; i < (*buffer)->ndata; ++i )
   {
      assert(!(*buffer)->used[i]);
      BMSfreeMemoryArrayNull(&(*buffer)->data[i]);
   }
   BMSfreeMemoryArrayNull(&(*buffer)->data);
   BMSfreeMemoryArrayNull(&(*buffer)->size);
   BMSfreeMemoryArrayNull(&(*buffer)->used);
   BMSfreeMemory(buffer);
}
示例#22
0
/* reset the variable name to the given one */
static
void resetVarname(
   SCIP_VAR*             var,                /**< variable */
   const char*           name                /**< variable name */
   )
{
   const char * oldname;

   assert( var != NULL );
   assert( name != NULL );

   /* get pointer to temporary generic name and free the memory */
   oldname = SCIPvarGetName(var);
   BMSfreeMemory(&oldname);

   /* reset name */
   SCIPvarSetNamePointer(var, name);
}
示例#23
0
/** frees pricing storage */
SCIP_RETCODE SCIPpricestoreFree(
   SCIP_PRICESTORE**     pricestore          /**< pointer to store pricing storage */
   )
{
   assert(pricestore != NULL);
   assert(*pricestore != NULL);
   assert((*pricestore)->nvars == 0);
   assert((*pricestore)->nbdviolvars == 0);

   SCIPclockFree(&(*pricestore)->probpricingtime);
   BMSfreeMemoryArrayNull(&(*pricestore)->vars);
   BMSfreeMemoryArrayNull(&(*pricestore)->scores);
   BMSfreeMemoryArrayNull(&(*pricestore)->bdviolvars);
   BMSfreeMemoryArrayNull(&(*pricestore)->bdviolvarslb);
   BMSfreeMemoryArrayNull(&(*pricestore)->bdviolvarsub);
   BMSfreeMemory(pricestore);

   return SCIP_OKAY;
}
示例#24
0
文件: message.c 项目: hhexiy/scip
/** prints a dialog message that requests user interaction into a file, acting like the vfprintf() command */
void SCIPmessageVFPrintDialog(
   SCIP_MESSAGEHDLR*     messagehdlr,        /**< message handler */
   FILE*                 file,               /**< file stream to print into, or NULL for stdout */
   const char*           formatstr,          /**< format string like in printf() function */
   va_list               ap                  /**< variable argument list */
   )
{
   char msg[SCIP_MAXSTRLEN];
   int n;
   va_list aq;

   va_copy(aq, ap);

   n = vsnprintf(msg, SCIP_MAXSTRLEN, formatstr, ap);
   if( n < 0 )
      msg[SCIP_MAXSTRLEN-1] = '\0';
   else if( n >= SCIP_MAXSTRLEN )
   {
      char* bigmsg;
#ifndef NDEBUG
      int m;
#endif

      if( BMSallocMemorySize(&bigmsg, n+1) == NULL )
      {
         va_end(aq);
         return;
      }

#ifndef NDEBUG
      m = vsnprintf(bigmsg, (size_t) n+1, formatstr, aq);
#else
      vsnprintf(bigmsg, (size_t) n+1, formatstr, aq);
#endif
      assert(m == n);
      va_end(aq);
      messagePrintDialog(messagehdlr, file, bigmsg);
      BMSfreeMemory(&bigmsg);
      return;
   }
   messagePrintDialog(messagehdlr, file, msg);
   va_end(aq);
}
示例#25
0
/** prints a error message, acting like the printf() command */
void SCIPmessagePrintError(
   const char*           formatstr,          /**< format string like in printf() function */
   ...                                       /**< format arguments line in printf() function */
   )
{
   char msg[SCIP_MAXSTRLEN];
   int n;
   va_list ap;

   va_start(ap, formatstr);  /*lint !e826*/

   n = vsnprintf(msg, SCIP_MAXSTRLEN, formatstr, ap);
   if( n < 0 )
      msg[SCIP_MAXSTRLEN-1] = '\0';
   else if( n >= SCIP_MAXSTRLEN )
   {
      char* bigmsg;
#ifndef NDEBUG
      int m;
#endif

      if( BMSallocMemorySize(&bigmsg, n+1) == NULL )
      {
         va_end(ap);
         return;
      }

#ifndef NDEBUG
      m = vsnprintf(bigmsg, (size_t) n+1, formatstr, ap);
#else
      vsnprintf(bigmsg, (size_t) n+1, formatstr, ap);
#endif
      assert(m == n);
      va_end(ap);
      messagePrintError(bigmsg, n);
      BMSfreeMemory(&bigmsg);
      return;
   }

   messagePrintError(msg, SCIP_MAXSTRLEN);
   va_end(ap);
}
示例#26
0
文件: message.c 项目: hhexiy/scip
/** prints an error message, acting like the vprintf() command using the static message handler */
void SCIPmessageVPrintError(
   const char*           formatstr,          /**< format string like in printf() function */
   va_list               ap                  /**< variable argument list */
   )
{
   char msg[SCIP_MAXSTRLEN];
   int n;
   va_list aq;

   va_copy(aq, ap);

   n = vsnprintf(msg, SCIP_MAXSTRLEN, formatstr, ap);
   if( n < 0 )
      msg[SCIP_MAXSTRLEN-1] = '\0';
   else if( n >= SCIP_MAXSTRLEN )
   {
      char* bigmsg;
#ifndef NDEBUG
      int m;
#endif

      if( BMSallocMemorySize(&bigmsg, n+1) == NULL )
      {
         va_end(aq);
         return;
      }

#ifndef NDEBUG
      m = vsnprintf(bigmsg, (size_t) n+1, formatstr, aq);
#else
      vsnprintf(bigmsg, (size_t) n+1, formatstr, aq);
#endif
      assert(m == n);
      va_end(aq);
      messagePrintError(bigmsg);
      BMSfreeMemory(&bigmsg);
      return;
   }

   messagePrintError(msg);
   va_end(aq);
}
示例#27
0
文件: buffer.c 项目: hhexiy/scip
/** frees a buffer */
void SCIPbufferFreeMem(
   SCIP_BUFFER*          buffer,             /**< memory buffer storage */
   void**                ptr,                /**< pointer to the allocated memory buffer */
   int                   dummysize           /**< used to get a safer define for SCIPsetFreeBufferSize/Array */
   )
{  /*lint --e{715}*/
#ifndef SCIP_NOBUFFERMEM
   int bufnum;

   assert(buffer != NULL);
   assert(buffer->firstfree <= buffer->ndata);
   assert(buffer->firstfree >= 1);
   assert(dummysize == 0);

   /* Search the pointer in the buffer list
    * Usually, buffers are allocated and freed like a stack, such that the freed pointer is
    * most likely at the end of the buffer list.
    */
   for( bufnum = buffer->firstfree-1; bufnum >= 0 && buffer->data[bufnum] != *ptr; --bufnum )
   {
   }
   assert(bufnum >= 0);
   assert(buffer->data[bufnum] == *ptr);
   assert(buffer->used[bufnum]);

   *ptr = NULL;
   buffer->used[bufnum] = FALSE;

   while( buffer->firstfree > 0 && !buffer->used[buffer->firstfree-1] )
      buffer->firstfree--;

   SCIPdebugMessage("freed buffer %d/%d at %p of size %d for pointer %p, first free is %d\n", 
      bufnum, buffer->ndata, buffer->data[bufnum], buffer->size[bufnum], (void*)ptr, buffer->firstfree);

#else
   BMSfreeMemory(ptr);
#endif
}
示例#28
0
/** frees memory of display column */
SCIP_RETCODE SCIPdispFree(
   SCIP_DISP**           disp,               /**< pointer to display column data structure */
   SCIP_SET*             set                 /**< global SCIP settings */
   )
{
   assert(disp != NULL);
   assert(*disp != NULL);
   assert(!(*disp)->initialized);
   assert(set != NULL);

   /* call destructor of display column */
   if( (*disp)->dispfree != NULL )
   {
      SCIP_CALL( (*disp)->dispfree(set->scip, *disp) );
   }

   BMSfreeMemoryArray(&(*disp)->name);
   BMSfreeMemoryArray(&(*disp)->desc);
   BMSfreeMemoryArray(&(*disp)->header);
   BMSfreeMemory(disp);

   return SCIP_OKAY;
}
示例#29
0
/** calls destructor and frees memory of variable pricer */
SCIP_RETCODE SCIPpricerFree(
   SCIP_PRICER**         pricer,             /**< pointer to variable pricer data structure */
   SCIP_SET*             set                 /**< global SCIP settings */
   )
{
   assert(pricer != NULL);
   assert(*pricer != NULL);
   assert(!(*pricer)->initialized);
   assert(set != NULL);

   /* call destructor of variable pricer */
   if( (*pricer)->pricerfree != NULL )
   {
      SCIP_CALL( (*pricer)->pricerfree(set->scip, *pricer) );
   }

   SCIPclockFree(&(*pricer)->pricerclock);
   BMSfreeMemoryArray(&(*pricer)->name);
   BMSfreeMemoryArray(&(*pricer)->desc);
   BMSfreeMemory(pricer);

   return SCIP_OKAY;
}
示例#30
0
/** frees memory of presolver */
SCIP_RETCODE SCIPpresolFree(
   SCIP_PRESOL**         presol,             /**< pointer to presolver data structure */
   SCIP_SET*             set                 /**< global SCIP settings */
   )
{
   assert(presol != NULL);
   assert(*presol != NULL);
   assert(!(*presol)->initialized);
   assert(set != NULL);

   /* call destructor of presolver */
   if( (*presol)->presolfree != NULL )
   {
      SCIP_CALL( (*presol)->presolfree(set->scip, *presol) );
   }

   SCIPclockFree(&(*presol)->presolclock);
   SCIPclockFree(&(*presol)->setuptime);
   BMSfreeMemoryArray(&(*presol)->name);
   BMSfreeMemoryArray(&(*presol)->desc);
   BMSfreeMemory(presol);

   return SCIP_OKAY;
}