diff --git a/lemon/soplex.cc b/lemon/soplex.cc --- a/lemon/soplex.cc +++ b/lemon/soplex.cc @@ -20,6 +20,7 @@ #include #include +#include ///\file @@ -28,6 +29,7 @@ SoplexLp::SoplexLp() { soplex = new soplex::SoPlex; + messageLevel(MESSAGE_NOTHING); } SoplexLp::~SoplexLp() { @@ -47,6 +49,7 @@ _row_names = lp._row_names; _row_names_ref = lp._row_names_ref; + messageLevel(MESSAGE_NOTHING); } void SoplexLp::_clear_temporals() { @@ -271,6 +274,8 @@ SoplexLp::SolveExitStatus SoplexLp::_solve() { _clear_temporals(); + + _applyMessageLevel(); soplex::SPxSolver::Status status = soplex->solve(); @@ -419,5 +424,29 @@ _clear_temporals(); } + void SoplexLp::_messageLevel(MessageLevel level) { + switch (level) { + case MESSAGE_NOTHING: + _message_level = -1; + break; + case MESSAGE_ERROR: + _message_level = soplex::SPxOut::ERROR; + break; + case MESSAGE_WARNING: + _message_level = soplex::SPxOut::WARNING; + break; + case MESSAGE_NORMAL: + _message_level = soplex::SPxOut::INFO2; + break; + case MESSAGE_VERBOSE: + _message_level = soplex::SPxOut::DEBUG; + break; + } + } + + void SoplexLp::_applyMessageLevel() { + soplex::Param::setVerbose(_message_level); + } + } //namespace lemon