COIN-OR::LEMON - Graph Library

Changeset 576:745e182d0139 in lemon-1.2 for lemon/cbc.cc


Ignore:
Timestamp:
04/08/09 22:49:28 (11 years ago)
Author:
Balazs Dezso <deba@…>
Branch:
default
Phase:
public
Message:

Unified message handling for LP and MIP solvers (#9)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/cbc.cc

    r567 r576  
    5656    _osi_solver = 0;
    5757    _cbc_model = 0;
     58    messageLevel(MESSAGE_NOTHING);
    5859  }
    5960
    6061  CbcMip::CbcMip(const CbcMip& other) {
    6162    _prob = new CoinModel(*other._prob);
     63    _prob->setProblemName("LEMON");
    6264    _osi_solver = 0;
    6365    _cbc_model = 0;
     66    messageLevel(MESSAGE_NOTHING);
    6467  }
    6568
     
    271274    _cbc_model= new CbcModel(*_osi_solver);
    272275
    273     switch (_message_level) {
    274     case MESSAGE_NO_OUTPUT:
    275       _osi_solver->messageHandler()->setLogLevel(0);
    276       _cbc_model->setLogLevel(0);
    277       break;
    278     case MESSAGE_ERROR_MESSAGE:
    279       _osi_solver->messageHandler()->setLogLevel(1);
    280       _cbc_model->setLogLevel(1);
    281       break;
    282     case MESSAGE_NORMAL_OUTPUT:
    283       _osi_solver->messageHandler()->setLogLevel(2);
    284       _cbc_model->setLogLevel(2);
    285       break;
    286     case MESSAGE_FULL_OUTPUT:
    287       _osi_solver->messageHandler()->setLogLevel(3);
    288       _cbc_model->setLogLevel(3);
    289       break;
    290     }
     276    _osi_solver->messageHandler()->setLogLevel(_message_level);
     277    _cbc_model->setLogLevel(_message_level);
    291278
    292279    _cbc_model->initialSolve();
     
    454441  }
    455442
    456   void CbcMip::messageLevel(MessageLevel m) {
    457     _message_level = m;
     443  void CbcMip::_messageLevel(MessageLevel level) {
     444    switch (level) {
     445    case MESSAGE_NOTHING:
     446      _message_level = 0;
     447      break;
     448    case MESSAGE_ERROR:
     449      _message_level = 1;
     450      break;
     451    case MESSAGE_WARNING:
     452      _message_level = 1;
     453      break;
     454    case MESSAGE_NORMAL:
     455      _message_level = 2;
     456      break;
     457    case MESSAGE_VERBOSE:
     458      _message_level = 3;
     459      break;
     460    }
    458461  }
    459462
Note: See TracChangeset for help on using the changeset viewer.