lemon/cbc.cc
changeset 623 745e182d0139
parent 614 3314f58e7b25
child 793 e4554cd6b2bf
child 1120 ee581a0ecfbf
     1.1 --- a/lemon/cbc.cc	Tue Apr 07 14:50:20 2009 +0100
     1.2 +++ b/lemon/cbc.cc	Wed Apr 08 22:49:28 2009 +0200
     1.3 @@ -55,12 +55,15 @@
     1.4      _prob->setProblemName("LEMON");
     1.5      _osi_solver = 0;
     1.6      _cbc_model = 0;
     1.7 +    messageLevel(MESSAGE_NOTHING);
     1.8    }
     1.9  
    1.10    CbcMip::CbcMip(const CbcMip& other) {
    1.11      _prob = new CoinModel(*other._prob);
    1.12 +    _prob->setProblemName("LEMON");
    1.13      _osi_solver = 0;
    1.14      _cbc_model = 0;
    1.15 +    messageLevel(MESSAGE_NOTHING);
    1.16    }
    1.17  
    1.18    CbcMip::~CbcMip() {
    1.19 @@ -270,24 +273,8 @@
    1.20      }
    1.21      _cbc_model= new CbcModel(*_osi_solver);
    1.22  
    1.23 -    switch (_message_level) {
    1.24 -    case MESSAGE_NO_OUTPUT:
    1.25 -      _osi_solver->messageHandler()->setLogLevel(0);
    1.26 -      _cbc_model->setLogLevel(0);
    1.27 -      break;
    1.28 -    case MESSAGE_ERROR_MESSAGE:
    1.29 -      _osi_solver->messageHandler()->setLogLevel(1);
    1.30 -      _cbc_model->setLogLevel(1);
    1.31 -      break;
    1.32 -    case MESSAGE_NORMAL_OUTPUT:
    1.33 -      _osi_solver->messageHandler()->setLogLevel(2);
    1.34 -      _cbc_model->setLogLevel(2);
    1.35 -      break;
    1.36 -    case MESSAGE_FULL_OUTPUT:
    1.37 -      _osi_solver->messageHandler()->setLogLevel(3);
    1.38 -      _cbc_model->setLogLevel(3);
    1.39 -      break;
    1.40 -    }
    1.41 +    _osi_solver->messageHandler()->setLogLevel(_message_level);
    1.42 +    _cbc_model->setLogLevel(_message_level);
    1.43  
    1.44      _cbc_model->initialSolve();
    1.45      _cbc_model->solver()->setHintParam(OsiDoReducePrint, true, OsiHintTry);
    1.46 @@ -453,8 +440,24 @@
    1.47      cols.clear();
    1.48    }
    1.49  
    1.50 -  void CbcMip::messageLevel(MessageLevel m) {
    1.51 -    _message_level = m;
    1.52 +  void CbcMip::_messageLevel(MessageLevel level) {
    1.53 +    switch (level) {
    1.54 +    case MESSAGE_NOTHING:
    1.55 +      _message_level = 0;
    1.56 +      break;
    1.57 +    case MESSAGE_ERROR:
    1.58 +      _message_level = 1;
    1.59 +      break;
    1.60 +    case MESSAGE_WARNING:
    1.61 +      _message_level = 1;
    1.62 +      break;
    1.63 +    case MESSAGE_NORMAL:
    1.64 +      _message_level = 2;
    1.65 +      break;
    1.66 +    case MESSAGE_VERBOSE:
    1.67 +      _message_level = 3;
    1.68 +      break;
    1.69 +    }
    1.70    }
    1.71  
    1.72  } //END OF NAMESPACE LEMON