# HG changeset patch # User klao # Date 1138969210 0 # Node ID a1a6f5b788bd50c9861ea35443e1c85a2351efa5 # Parent 5db4ff8d69dec08f4030b7e49c5d32fda52080f0 lp_cplex.cc: bugfix in _setColName, _getColName implemented diff -r 5db4ff8d69de -r a1a6f5b788bd lemon/lp_cplex.cc --- a/lemon/lp_cplex.cc Fri Feb 03 09:18:17 2006 +0000 +++ b/lemon/lp_cplex.cc Fri Feb 03 12:20:10 2006 +0000 @@ -83,13 +83,26 @@ void LpCplex::_getColName(int col, std::string &name) { - ///\bug Unimplemented + ///\bug Untested + int storespace; + CPXgetcolname(env, lp, 0, 0, 0, &storespace, col, col); + + storespace *= -1; + char buf[storespace]; + char *names[1]; + int dontcare; + ///\bug return code unchecked for error + CPXgetcolname(env, lp, names, buf, storespace, &dontcare, col, col); + name = names[0]; } void LpCplex::_setColName(int col, const std::string &name) { ///\bug Untested - CPXchgcolname(env, lp, 1, &col, const_cast(name.c_str())); + char *names[1]; + names[0] = const_cast(name.c_str()); + ///\bug return code unchecked for error + CPXchgcolname(env, lp, 1, &col, names); } ///\warning Data at index 0 is ignored in the arrays.