Changeset 1004 for stable/2.1/Cbc


Ignore:
Timestamp:
Jul 15, 2008 12:02:38 PM (11 years ago)
Author:
forrest
Message:

for threadsafe messages

Location:
stable/2.1/Cbc/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • stable/2.1/Cbc/src/CbcModel.cpp

    r1002 r1004  
    18421842      threadId[i].status =0;
    18431843      threadInfo[i].baseModel=this;
    1844       threadModel[i]=new CbcModel(*this);
     1844      threadModel[i]=new CbcModel(*this,true);
    18451845#ifdef COIN_HAS_CLP
    18461846      // Solver may need to know about model
     
    29942994    // delete models (here in case some point to others)
    29952995    for (i=0;i<numberThreads_;i++) {
     2996      // make sure handler will be deleted
     2997      threadModel[i]->defaultHandler_=true;
    29962998      delete threadModel[i];
    29972999    }
     
    38523854// Copy constructor.
    38533855
    3854 CbcModel::CbcModel(const CbcModel & rhs, bool noTree)
     3856CbcModel::CbcModel(const CbcModel & rhs, bool cloneHandler)
    38553857:
    38563858  continuousSolver_(NULL),
     
    39293931  solverCharacteristics_ = NULL;
    39303932  if (rhs.emptyWarmStart_) emptyWarmStart_ = rhs.emptyWarmStart_->clone() ;
    3931   if (defaultHandler_) {
     3933  bool noTree=false;
     3934  if (defaultHandler_||cloneHandler) {
    39323935    handler_ = new CoinMessageHandler();
    39333936    handler_->setLogLevel(2);
     
    41134116    walkback_ = NULL;
    41144117  synchronizeModel();
     4118  if (cloneHandler) {
     4119    delete handler_;
     4120    CoinMessageHandler * handler = rhs.handler_->clone();
     4121    passInMessageHandler(handler);
     4122  }
    41154123}
    41164124 
     
    96839691  defaultHandler_=false;
    96849692  handler_=handler;
     9693  if (solver_)
     9694    solver_->passInMessageHandler(handler);
     9695  if (continuousSolver_)
     9696    continuousSolver_->passInMessageHandler(handler);
     9697  if (referenceSolver_)
     9698    referenceSolver_->passInMessageHandler(handler);
    96859699}
    96869700void
  • stable/2.1/Cbc/src/CbcModel.hpp

    r941 r1004  
    15261526 
    15271527    /** Copy constructor .
    1528       If noTree is true then tree and cuts are not copied
     1528      If cloneHandler true - non-default handler cloned
    15291529    */ 
    1530     CbcModel(const CbcModel & rhs, bool noTree=false);
     1530    CbcModel(const CbcModel & rhs, bool cloneHandler=false);
    15311531 
    15321532    /// Assignment operator
Note: See TracChangeset for help on using the changeset viewer.