lemon/lp_cplex.cc
changeset 1950 a1a6f5b788bd
parent 1895 5b01801efbc0
child 1956 a055123339d5
equal deleted inserted replaced
12:3dfec106b3c1 13:aa0ac9958eb9
    81     CPXdelrows(env, lp, i, i);
    81     CPXdelrows(env, lp, i, i);
    82   }
    82   }
    83   
    83   
    84   void LpCplex::_getColName(int col, std::string &name)
    84   void LpCplex::_getColName(int col, std::string &name)
    85   {
    85   {
    86     ///\bug Unimplemented
    86     ///\bug Untested
       
    87     int storespace;
       
    88     CPXgetcolname(env, lp, 0, 0, 0, &storespace, col, col);
       
    89 
       
    90     storespace *= -1;
       
    91     char buf[storespace];
       
    92     char *names[1];
       
    93     int dontcare;
       
    94     ///\bug return code unchecked for error
       
    95     CPXgetcolname(env, lp, names, buf, storespace, &dontcare, col, col);
       
    96     name = names[0];
    87   }
    97   }
    88   
    98   
    89   void LpCplex::_setColName(int col, const std::string &name)
    99   void LpCplex::_setColName(int col, const std::string &name)
    90   {
   100   {
    91     ///\bug Untested
   101     ///\bug Untested
    92     CPXchgcolname(env, lp, 1, &col, const_cast<char*>(name.c_str()));
   102     char *names[1];
       
   103     names[0] = const_cast<char*>(name.c_str());
       
   104     ///\bug return code unchecked for error
       
   105     CPXchgcolname(env, lp, 1, &col, names);    
    93   }
   106   }
    94   
   107   
    95   ///\warning Data at index 0 is ignored in the arrays.
   108   ///\warning Data at index 0 is ignored in the arrays.
    96   void LpCplex::_setRowCoeffs(int i, 
   109   void LpCplex::_setRowCoeffs(int i, 
    97 			      int length,
   110 			      int length,