[Osi-tickets] [COIN-OR Open Solver Interface] #105: Double line breaks in MOSEK Osi interface

COIN-OR Open Solver Interface coin-trac at coin-or.org
Tue Aug 6 12:11:01 EDT 2013


#105: Double line breaks in MOSEK Osi interface
---------------------+-------------------
 Reporter:  PetterS  |      Owner:  mjs
     Type:  defect   |     Status:  new
 Priority:  minor    |  Milestone:
Component:  OsiMsk   |    Version:  0.104
 Keywords:           |
---------------------+-------------------
 On my computer (Windows 8, 64-bit), OsiMskSolverInterface prints two line
 breaks after each line.

 The following modification to OsiMskStreamFuncLog fixes the problem:


 {{{
 static
 void MSKAPI OsiMskStreamFuncLog(MSKuserhandle_t handle, MSKCONST char*
 str) {
         if (handle) {
                 if (((CoinMessageHandler*)handle)->logLevel() >= 1) {
                         std::string str_cpy(str);
                         std::string::size_type len = str_cpy.length();
                         if (len > 0 && str_cpy[len - 1] == '\n') {
                                 str_cpy[len - 1] = ' ';
                         }
                         ((CoinMessageHandler*)handle)->message(0, "MSK",
 str_cpy.c_str(), ' ') << CoinMessageEol;
                 }
         } else {
                 printf(str);
                 printf("\n");
         }
 }
 }}}

-- 
Ticket URL: <https://projects.coin-or.org/Osi/ticket/105>
COIN-OR Open Solver Interface <http://projects.coin-or.org/Osi>
An API for a variety of LP and MIP solvers (and more).



More information about the Osi-tickets mailing list