1.1 --- a/lemon/clp.cc Mon Jan 12 12:26:01 2009 +0000
1.2 +++ b/lemon/clp.cc Mon Jan 12 12:26:02 2009 +0000
1.3 @@ -21,13 +21,13 @@
1.4
1.5 namespace lemon {
1.6
1.7 - LpClp::LpClp() {
1.8 + ClpLp::ClpLp() {
1.9 _prob = new ClpSimplex();
1.10 _init_temporals();
1.11 messageLevel(MESSAGE_NO_OUTPUT);
1.12 }
1.13
1.14 - LpClp::LpClp(const LpClp& other) {
1.15 + ClpLp::ClpLp(const ClpLp& other) {
1.16 _prob = new ClpSimplex(*other._prob);
1.17 rows = other.rows;
1.18 cols = other.cols;
1.19 @@ -35,17 +35,17 @@
1.20 messageLevel(MESSAGE_NO_OUTPUT);
1.21 }
1.22
1.23 - LpClp::~LpClp() {
1.24 + ClpLp::~ClpLp() {
1.25 delete _prob;
1.26 _clear_temporals();
1.27 }
1.28
1.29 - void LpClp::_init_temporals() {
1.30 + void ClpLp::_init_temporals() {
1.31 _primal_ray = 0;
1.32 _dual_ray = 0;
1.33 }
1.34
1.35 - void LpClp::_clear_temporals() {
1.36 + void ClpLp::_clear_temporals() {
1.37 if (_primal_ray) {
1.38 delete[] _primal_ray;
1.39 _primal_ray = 0;
1.40 @@ -56,79 +56,79 @@
1.41 }
1.42 }
1.43
1.44 - LpClp* LpClp::_newSolver() const {
1.45 - LpClp* newlp = new LpClp;
1.46 + ClpLp* ClpLp::_newSolver() const {
1.47 + ClpLp* newlp = new ClpLp;
1.48 return newlp;
1.49 }
1.50
1.51 - LpClp* LpClp::_cloneSolver() const {
1.52 - LpClp* copylp = new LpClp(*this);
1.53 + ClpLp* ClpLp::_cloneSolver() const {
1.54 + ClpLp* copylp = new ClpLp(*this);
1.55 return copylp;
1.56 }
1.57
1.58 - const char* LpClp::_solverName() const { return "LpClp"; }
1.59 + const char* ClpLp::_solverName() const { return "ClpLp"; }
1.60
1.61 - int LpClp::_addCol() {
1.62 + int ClpLp::_addCol() {
1.63 _prob->addColumn(0, 0, 0, -COIN_DBL_MAX, COIN_DBL_MAX, 0.0);
1.64 return _prob->numberColumns() - 1;
1.65 }
1.66
1.67 - int LpClp::_addRow() {
1.68 + int ClpLp::_addRow() {
1.69 _prob->addRow(0, 0, 0, -COIN_DBL_MAX, COIN_DBL_MAX);
1.70 return _prob->numberRows() - 1;
1.71 }
1.72
1.73
1.74 - void LpClp::_eraseCol(int c) {
1.75 + void ClpLp::_eraseCol(int c) {
1.76 _col_names_ref.erase(_prob->getColumnName(c));
1.77 _prob->deleteColumns(1, &c);
1.78 }
1.79
1.80 - void LpClp::_eraseRow(int r) {
1.81 + void ClpLp::_eraseRow(int r) {
1.82 _row_names_ref.erase(_prob->getRowName(r));
1.83 _prob->deleteRows(1, &r);
1.84 }
1.85
1.86 - void LpClp::_eraseColId(int i) {
1.87 + void ClpLp::_eraseColId(int i) {
1.88 cols.eraseIndex(i);
1.89 cols.shiftIndices(i);
1.90 }
1.91
1.92 - void LpClp::_eraseRowId(int i) {
1.93 + void ClpLp::_eraseRowId(int i) {
1.94 rows.eraseIndex(i);
1.95 rows.shiftIndices(i);
1.96 }
1.97
1.98 - void LpClp::_getColName(int c, std::string& name) const {
1.99 + void ClpLp::_getColName(int c, std::string& name) const {
1.100 name = _prob->getColumnName(c);
1.101 }
1.102
1.103 - void LpClp::_setColName(int c, const std::string& name) {
1.104 + void ClpLp::_setColName(int c, const std::string& name) {
1.105 _prob->setColumnName(c, const_cast<std::string&>(name));
1.106 _col_names_ref[name] = c;
1.107 }
1.108
1.109 - int LpClp::_colByName(const std::string& name) const {
1.110 + int ClpLp::_colByName(const std::string& name) const {
1.111 std::map<std::string, int>::const_iterator it = _col_names_ref.find(name);
1.112 return it != _col_names_ref.end() ? it->second : -1;
1.113 }
1.114
1.115 - void LpClp::_getRowName(int r, std::string& name) const {
1.116 + void ClpLp::_getRowName(int r, std::string& name) const {
1.117 name = _prob->getRowName(r);
1.118 }
1.119
1.120 - void LpClp::_setRowName(int r, const std::string& name) {
1.121 + void ClpLp::_setRowName(int r, const std::string& name) {
1.122 _prob->setRowName(r, const_cast<std::string&>(name));
1.123 _row_names_ref[name] = r;
1.124 }
1.125
1.126 - int LpClp::_rowByName(const std::string& name) const {
1.127 + int ClpLp::_rowByName(const std::string& name) const {
1.128 std::map<std::string, int>::const_iterator it = _row_names_ref.find(name);
1.129 return it != _row_names_ref.end() ? it->second : -1;
1.130 }
1.131
1.132
1.133 - void LpClp::_setRowCoeffs(int ix, ExprIterator b, ExprIterator e) {
1.134 + void ClpLp::_setRowCoeffs(int ix, ExprIterator b, ExprIterator e) {
1.135 std::map<int, Value> coeffs;
1.136
1.137 int n = _prob->clpMatrix()->getNumCols();
1.138 @@ -156,7 +156,7 @@
1.139 }
1.140 }
1.141
1.142 - void LpClp::_getRowCoeffs(int ix, InsertIterator b) const {
1.143 + void ClpLp::_getRowCoeffs(int ix, InsertIterator b) const {
1.144 int n = _prob->clpMatrix()->getNumCols();
1.145
1.146 const int* indices = _prob->clpMatrix()->getIndices();
1.147 @@ -173,7 +173,7 @@
1.148 }
1.149 }
1.150
1.151 - void LpClp::_setColCoeffs(int ix, ExprIterator b, ExprIterator e) {
1.152 + void ClpLp::_setColCoeffs(int ix, ExprIterator b, ExprIterator e) {
1.153 std::map<int, Value> coeffs;
1.154
1.155 CoinBigIndex begin = _prob->clpMatrix()->getVectorStarts()[ix];
1.156 @@ -196,7 +196,7 @@
1.157 }
1.158 }
1.159
1.160 - void LpClp::_getColCoeffs(int ix, InsertIterator b) const {
1.161 + void ClpLp::_getColCoeffs(int ix, InsertIterator b) const {
1.162 CoinBigIndex begin = _prob->clpMatrix()->getVectorStarts()[ix];
1.163 CoinBigIndex end = begin + _prob->clpMatrix()->getVectorLengths()[ix];
1.164
1.165 @@ -209,11 +209,11 @@
1.166 }
1.167 }
1.168
1.169 - void LpClp::_setCoeff(int ix, int jx, Value value) {
1.170 + void ClpLp::_setCoeff(int ix, int jx, Value value) {
1.171 _prob->modifyCoefficient(ix, jx, value);
1.172 }
1.173
1.174 - LpClp::Value LpClp::_getCoeff(int ix, int jx) const {
1.175 + ClpLp::Value ClpLp::_getCoeff(int ix, int jx) const {
1.176 CoinBigIndex begin = _prob->clpMatrix()->getVectorStarts()[ix];
1.177 CoinBigIndex end = begin + _prob->clpMatrix()->getVectorLengths()[ix];
1.178
1.179 @@ -228,43 +228,43 @@
1.180 }
1.181 }
1.182
1.183 - void LpClp::_setColLowerBound(int i, Value lo) {
1.184 + void ClpLp::_setColLowerBound(int i, Value lo) {
1.185 _prob->setColumnLower(i, lo == - INF ? - COIN_DBL_MAX : lo);
1.186 }
1.187
1.188 - LpClp::Value LpClp::_getColLowerBound(int i) const {
1.189 + ClpLp::Value ClpLp::_getColLowerBound(int i) const {
1.190 double val = _prob->getColLower()[i];
1.191 return val == - COIN_DBL_MAX ? - INF : val;
1.192 }
1.193
1.194 - void LpClp::_setColUpperBound(int i, Value up) {
1.195 + void ClpLp::_setColUpperBound(int i, Value up) {
1.196 _prob->setColumnUpper(i, up == INF ? COIN_DBL_MAX : up);
1.197 }
1.198
1.199 - LpClp::Value LpClp::_getColUpperBound(int i) const {
1.200 + ClpLp::Value ClpLp::_getColUpperBound(int i) const {
1.201 double val = _prob->getColUpper()[i];
1.202 return val == COIN_DBL_MAX ? INF : val;
1.203 }
1.204
1.205 - void LpClp::_setRowLowerBound(int i, Value lo) {
1.206 + void ClpLp::_setRowLowerBound(int i, Value lo) {
1.207 _prob->setRowLower(i, lo == - INF ? - COIN_DBL_MAX : lo);
1.208 }
1.209
1.210 - LpClp::Value LpClp::_getRowLowerBound(int i) const {
1.211 + ClpLp::Value ClpLp::_getRowLowerBound(int i) const {
1.212 double val = _prob->getRowLower()[i];
1.213 return val == - COIN_DBL_MAX ? - INF : val;
1.214 }
1.215
1.216 - void LpClp::_setRowUpperBound(int i, Value up) {
1.217 + void ClpLp::_setRowUpperBound(int i, Value up) {
1.218 _prob->setRowUpper(i, up == INF ? COIN_DBL_MAX : up);
1.219 }
1.220
1.221 - LpClp::Value LpClp::_getRowUpperBound(int i) const {
1.222 + ClpLp::Value ClpLp::_getRowUpperBound(int i) const {
1.223 double val = _prob->getRowUpper()[i];
1.224 return val == COIN_DBL_MAX ? INF : val;
1.225 }
1.226
1.227 - void LpClp::_setObjCoeffs(ExprIterator b, ExprIterator e) {
1.228 + void ClpLp::_setObjCoeffs(ExprIterator b, ExprIterator e) {
1.229 int num = _prob->clpMatrix()->getNumCols();
1.230 for (int i = 0; i < num; ++i) {
1.231 _prob->setObjectiveCoefficient(i, 0.0);
1.232 @@ -274,7 +274,7 @@
1.233 }
1.234 }
1.235
1.236 - void LpClp::_getObjCoeffs(InsertIterator b) const {
1.237 + void ClpLp::_getObjCoeffs(InsertIterator b) const {
1.238 int num = _prob->clpMatrix()->getNumCols();
1.239 for (int i = 0; i < num; ++i) {
1.240 Value coef = _prob->getObjCoefficients()[i];
1.241 @@ -285,42 +285,42 @@
1.242 }
1.243 }
1.244
1.245 - void LpClp::_setObjCoeff(int i, Value obj_coef) {
1.246 + void ClpLp::_setObjCoeff(int i, Value obj_coef) {
1.247 _prob->setObjectiveCoefficient(i, obj_coef);
1.248 }
1.249
1.250 - LpClp::Value LpClp::_getObjCoeff(int i) const {
1.251 + ClpLp::Value ClpLp::_getObjCoeff(int i) const {
1.252 return _prob->getObjCoefficients()[i];
1.253 }
1.254
1.255 - LpClp::SolveExitStatus LpClp::_solve() {
1.256 + ClpLp::SolveExitStatus ClpLp::_solve() {
1.257 return _prob->primal() >= 0 ? SOLVED : UNSOLVED;
1.258 }
1.259
1.260 - LpClp::SolveExitStatus LpClp::solvePrimal() {
1.261 + ClpLp::SolveExitStatus ClpLp::solvePrimal() {
1.262 return _prob->primal() >= 0 ? SOLVED : UNSOLVED;
1.263 }
1.264
1.265 - LpClp::SolveExitStatus LpClp::solveDual() {
1.266 + ClpLp::SolveExitStatus ClpLp::solveDual() {
1.267 return _prob->dual() >= 0 ? SOLVED : UNSOLVED;
1.268 }
1.269
1.270 - LpClp::SolveExitStatus LpClp::solveBarrier() {
1.271 + ClpLp::SolveExitStatus ClpLp::solveBarrier() {
1.272 return _prob->barrier() >= 0 ? SOLVED : UNSOLVED;
1.273 }
1.274
1.275 - LpClp::Value LpClp::_getPrimal(int i) const {
1.276 + ClpLp::Value ClpLp::_getPrimal(int i) const {
1.277 return _prob->primalColumnSolution()[i];
1.278 }
1.279 - LpClp::Value LpClp::_getPrimalValue() const {
1.280 + ClpLp::Value ClpLp::_getPrimalValue() const {
1.281 return _prob->objectiveValue();
1.282 }
1.283
1.284 - LpClp::Value LpClp::_getDual(int i) const {
1.285 + ClpLp::Value ClpLp::_getDual(int i) const {
1.286 return _prob->dualRowSolution()[i];
1.287 }
1.288
1.289 - LpClp::Value LpClp::_getPrimalRay(int i) const {
1.290 + ClpLp::Value ClpLp::_getPrimalRay(int i) const {
1.291 if (!_primal_ray) {
1.292 _primal_ray = _prob->unboundedRay();
1.293 LEMON_ASSERT(_primal_ray != 0, "Primal ray is not provided");
1.294 @@ -328,7 +328,7 @@
1.295 return _primal_ray[i];
1.296 }
1.297
1.298 - LpClp::Value LpClp::_getDualRay(int i) const {
1.299 + ClpLp::Value ClpLp::_getDualRay(int i) const {
1.300 if (!_dual_ray) {
1.301 _dual_ray = _prob->infeasibilityRay();
1.302 LEMON_ASSERT(_dual_ray != 0, "Dual ray is not provided");
1.303 @@ -336,7 +336,7 @@
1.304 return _dual_ray[i];
1.305 }
1.306
1.307 - LpClp::VarStatus LpClp::_getColStatus(int i) const {
1.308 + ClpLp::VarStatus ClpLp::_getColStatus(int i) const {
1.309 switch (_prob->getColumnStatus(i)) {
1.310 case ClpSimplex::basic:
1.311 return BASIC;
1.312 @@ -356,7 +356,7 @@
1.313 }
1.314 }
1.315
1.316 - LpClp::VarStatus LpClp::_getRowStatus(int i) const {
1.317 + ClpLp::VarStatus ClpLp::_getRowStatus(int i) const {
1.318 switch (_prob->getColumnStatus(i)) {
1.319 case ClpSimplex::basic:
1.320 return BASIC;
1.321 @@ -377,7 +377,7 @@
1.322 }
1.323
1.324
1.325 - LpClp::ProblemType LpClp::_getPrimalType() const {
1.326 + ClpLp::ProblemType ClpLp::_getPrimalType() const {
1.327 if (_prob->isProvenOptimal()) {
1.328 return OPTIMAL;
1.329 } else if (_prob->isProvenPrimalInfeasible()) {
1.330 @@ -389,7 +389,7 @@
1.331 }
1.332 }
1.333
1.334 - LpClp::ProblemType LpClp::_getDualType() const {
1.335 + ClpLp::ProblemType ClpLp::_getDualType() const {
1.336 if (_prob->isProvenOptimal()) {
1.337 return OPTIMAL;
1.338 } else if (_prob->isProvenDualInfeasible()) {
1.339 @@ -401,7 +401,7 @@
1.340 }
1.341 }
1.342
1.343 - void LpClp::_setSense(LpClp::Sense sense) {
1.344 + void ClpLp::_setSense(ClpLp::Sense sense) {
1.345 switch (sense) {
1.346 case MIN:
1.347 _prob->setOptimizationDirection(1);
1.348 @@ -412,7 +412,7 @@
1.349 }
1.350 }
1.351
1.352 - LpClp::Sense LpClp::_getSense() const {
1.353 + ClpLp::Sense ClpLp::_getSense() const {
1.354 double dir = _prob->optimizationDirection();
1.355 if (dir > 0.0) {
1.356 return MIN;
1.357 @@ -421,7 +421,7 @@
1.358 }
1.359 }
1.360
1.361 - void LpClp::_clear() {
1.362 + void ClpLp::_clear() {
1.363 delete _prob;
1.364 _prob = new ClpSimplex();
1.365 rows.clear();
1.366 @@ -430,7 +430,7 @@
1.367 _clear_temporals();
1.368 }
1.369
1.370 - void LpClp::messageLevel(MessageLevel m) {
1.371 + void ClpLp::messageLevel(MessageLevel m) {
1.372 _prob->setLogLevel(static_cast<int>(m));
1.373 }
1.374
2.1 --- a/lemon/clp.h Mon Jan 12 12:26:01 2009 +0000
2.2 +++ b/lemon/clp.h Mon Jan 12 12:26:02 2009 +0000
2.3 @@ -39,7 +39,7 @@
2.4 /// Clp library is an object oriented lp solver library developed at
2.5 /// the IBM. The CLP is part of the COIN-OR package and it can be
2.6 /// used with Common Public License.
2.7 - class LpClp : public LpSolver {
2.8 + class ClpLp : public LpSolver {
2.9 protected:
2.10
2.11 ClpSimplex* _prob;
2.12 @@ -50,11 +50,11 @@
2.13 public:
2.14
2.15 /// \e
2.16 - LpClp();
2.17 + ClpLp();
2.18 /// \e
2.19 - LpClp(const LpClp&);
2.20 + ClpLp(const ClpLp&);
2.21 /// \e
2.22 - ~LpClp();
2.23 + ~ClpLp();
2.24
2.25 protected:
2.26
2.27 @@ -66,8 +66,8 @@
2.28
2.29 protected:
2.30
2.31 - virtual LpClp* _newSolver() const;
2.32 - virtual LpClp* _cloneSolver() const;
2.33 + virtual ClpLp* _newSolver() const;
2.34 + virtual ClpLp* _cloneSolver() const;
2.35
2.36 virtual const char* _solverName() const;
2.37
3.1 --- a/lemon/cplex.cc Mon Jan 12 12:26:01 2009 +0000
3.2 +++ b/lemon/cplex.cc Mon Jan 12 12:26:02 2009 +0000
3.3 @@ -438,25 +438,25 @@
3.4 cols.clear();
3.5 }
3.6
3.7 - // LpCplex members
3.8 + // CplexLp members
3.9
3.10 - LpCplex::LpCplex()
3.11 + CplexLp::CplexLp()
3.12 : LpBase(), CplexBase(), LpSolver() {}
3.13
3.14 - LpCplex::LpCplex(const CplexEnv& env)
3.15 + CplexLp::CplexLp(const CplexEnv& env)
3.16 : LpBase(), CplexBase(env), LpSolver() {}
3.17
3.18 - LpCplex::LpCplex(const LpCplex& other)
3.19 + CplexLp::CplexLp(const CplexLp& other)
3.20 : LpBase(), CplexBase(other), LpSolver() {}
3.21
3.22 - LpCplex::~LpCplex() {}
3.23 + CplexLp::~CplexLp() {}
3.24
3.25 - LpCplex* LpCplex::_newSolver() const { return new LpCplex; }
3.26 - LpCplex* LpCplex::_cloneSolver() const {return new LpCplex(*this); }
3.27 + CplexLp* CplexLp::_newSolver() const { return new CplexLp; }
3.28 + CplexLp* CplexLp::_cloneSolver() const {return new CplexLp(*this); }
3.29
3.30 - const char* LpCplex::_solverName() const { return "LpCplex"; }
3.31 + const char* CplexLp::_solverName() const { return "CplexLp"; }
3.32
3.33 - void LpCplex::_clear_temporals() {
3.34 + void CplexLp::_clear_temporals() {
3.35 _col_status.clear();
3.36 _row_status.clear();
3.37 _primal_ray.clear();
3.38 @@ -472,7 +472,7 @@
3.39 // value does not necessarily mean that a solution exists. Use query
3.40 // routines CPXsolninfo, CPXgetstat, and CPXsolution to obtain
3.41 // further information about the status of the optimization.
3.42 - LpCplex::SolveExitStatus LpCplex::convertStatus(int status) {
3.43 + CplexLp::SolveExitStatus CplexLp::convertStatus(int status) {
3.44 #if CPX_VERSION >= 800
3.45 if (status == 0) {
3.46 switch (CPXgetstat(cplexEnv(), _prob)) {
3.47 @@ -505,45 +505,45 @@
3.48 #endif
3.49 }
3.50
3.51 - LpCplex::SolveExitStatus LpCplex::_solve() {
3.52 + CplexLp::SolveExitStatus CplexLp::_solve() {
3.53 _clear_temporals();
3.54 return convertStatus(CPXlpopt(cplexEnv(), _prob));
3.55 }
3.56
3.57 - LpCplex::SolveExitStatus LpCplex::solvePrimal() {
3.58 + CplexLp::SolveExitStatus CplexLp::solvePrimal() {
3.59 _clear_temporals();
3.60 return convertStatus(CPXprimopt(cplexEnv(), _prob));
3.61 }
3.62
3.63 - LpCplex::SolveExitStatus LpCplex::solveDual() {
3.64 + CplexLp::SolveExitStatus CplexLp::solveDual() {
3.65 _clear_temporals();
3.66 return convertStatus(CPXdualopt(cplexEnv(), _prob));
3.67 }
3.68
3.69 - LpCplex::SolveExitStatus LpCplex::solveBarrier() {
3.70 + CplexLp::SolveExitStatus CplexLp::solveBarrier() {
3.71 _clear_temporals();
3.72 return convertStatus(CPXbaropt(cplexEnv(), _prob));
3.73 }
3.74
3.75 - LpCplex::Value LpCplex::_getPrimal(int i) const {
3.76 + CplexLp::Value CplexLp::_getPrimal(int i) const {
3.77 Value x;
3.78 CPXgetx(cplexEnv(), _prob, &x, i, i);
3.79 return x;
3.80 }
3.81
3.82 - LpCplex::Value LpCplex::_getDual(int i) const {
3.83 + CplexLp::Value CplexLp::_getDual(int i) const {
3.84 Value y;
3.85 CPXgetpi(cplexEnv(), _prob, &y, i, i);
3.86 return y;
3.87 }
3.88
3.89 - LpCplex::Value LpCplex::_getPrimalValue() const {
3.90 + CplexLp::Value CplexLp::_getPrimalValue() const {
3.91 Value objval;
3.92 CPXgetobjval(cplexEnv(), _prob, &objval);
3.93 return objval;
3.94 }
3.95
3.96 - LpCplex::VarStatus LpCplex::_getColStatus(int i) const {
3.97 + CplexLp::VarStatus CplexLp::_getColStatus(int i) const {
3.98 if (_col_status.empty()) {
3.99 _col_status.resize(CPXgetnumcols(cplexEnv(), _prob));
3.100 CPXgetbase(cplexEnv(), _prob, &_col_status.front(), 0);
3.101 @@ -559,11 +559,11 @@
3.102 return UPPER;
3.103 default:
3.104 LEMON_ASSERT(false, "Wrong column status");
3.105 - return LpCplex::VarStatus();
3.106 + return CplexLp::VarStatus();
3.107 }
3.108 }
3.109
3.110 - LpCplex::VarStatus LpCplex::_getRowStatus(int i) const {
3.111 + CplexLp::VarStatus CplexLp::_getRowStatus(int i) const {
3.112 if (_row_status.empty()) {
3.113 _row_status.resize(CPXgetnumrows(cplexEnv(), _prob));
3.114 CPXgetbase(cplexEnv(), _prob, 0, &_row_status.front());
3.115 @@ -581,11 +581,11 @@
3.116 return UPPER;
3.117 default:
3.118 LEMON_ASSERT(false, "Wrong row status");
3.119 - return LpCplex::VarStatus();
3.120 + return CplexLp::VarStatus();
3.121 }
3.122 }
3.123
3.124 - LpCplex::Value LpCplex::_getPrimalRay(int i) const {
3.125 + CplexLp::Value CplexLp::_getPrimalRay(int i) const {
3.126 if (_primal_ray.empty()) {
3.127 _primal_ray.resize(CPXgetnumcols(cplexEnv(), _prob));
3.128 CPXgetray(cplexEnv(), _prob, &_primal_ray.front());
3.129 @@ -593,7 +593,7 @@
3.130 return _primal_ray[i];
3.131 }
3.132
3.133 - LpCplex::Value LpCplex::_getDualRay(int i) const {
3.134 + CplexLp::Value CplexLp::_getDualRay(int i) const {
3.135 if (_dual_ray.empty()) {
3.136
3.137 }
3.138 @@ -686,7 +686,7 @@
3.139 void statusSwitch(CPXENVptr,int&){}
3.140 #endif
3.141
3.142 - LpCplex::ProblemType LpCplex::_getPrimalType() const {
3.143 + CplexLp::ProblemType CplexLp::_getPrimalType() const {
3.144 // Unboundedness not treated well: the following is from cplex 9.0 doc
3.145 // About Unboundedness
3.146
3.147 @@ -768,7 +768,7 @@
3.148 // CPX_STAT_OPTIMAL_RELAXED
3.149 // CPX_STAT_UNBOUNDED
3.150
3.151 - LpCplex::ProblemType LpCplex::_getDualType() const {
3.152 + CplexLp::ProblemType CplexLp::_getDualType() const {
3.153 int stat = CPXgetstat(cplexEnv(), _prob);
3.154 #if CPX_VERSION >= 800
3.155 switch (stat) {
3.156 @@ -795,9 +795,9 @@
3.157 #endif
3.158 }
3.159
3.160 - // MipCplex members
3.161 + // CplexMip members
3.162
3.163 - MipCplex::MipCplex()
3.164 + CplexMip::CplexMip()
3.165 : LpBase(), CplexBase(), MipSolver() {
3.166
3.167 #if CPX_VERSION < 800
3.168 @@ -807,7 +807,7 @@
3.169 #endif
3.170 }
3.171
3.172 - MipCplex::MipCplex(const CplexEnv& env)
3.173 + CplexMip::CplexMip(const CplexEnv& env)
3.174 : LpBase(), CplexBase(env), MipSolver() {
3.175
3.176 #if CPX_VERSION < 800
3.177 @@ -818,17 +818,17 @@
3.178
3.179 }
3.180
3.181 - MipCplex::MipCplex(const MipCplex& other)
3.182 + CplexMip::CplexMip(const CplexMip& other)
3.183 : LpBase(), CplexBase(other), MipSolver() {}
3.184
3.185 - MipCplex::~MipCplex() {}
3.186 + CplexMip::~CplexMip() {}
3.187
3.188 - MipCplex* MipCplex::_newSolver() const { return new MipCplex; }
3.189 - MipCplex* MipCplex::_cloneSolver() const {return new MipCplex(*this); }
3.190 + CplexMip* CplexMip::_newSolver() const { return new CplexMip; }
3.191 + CplexMip* CplexMip::_cloneSolver() const {return new CplexMip(*this); }
3.192
3.193 - const char* MipCplex::_solverName() const { return "MipCplex"; }
3.194 + const char* CplexMip::_solverName() const { return "CplexMip"; }
3.195
3.196 - void MipCplex::_setColType(int i, MipCplex::ColTypes col_type) {
3.197 + void CplexMip::_setColType(int i, CplexMip::ColTypes col_type) {
3.198
3.199 // Note If a variable is to be changed to binary, a call to CPXchgbds
3.200 // should also be made to change the bounds to 0 and 1.
3.201 @@ -847,7 +847,7 @@
3.202 }
3.203 }
3.204
3.205 - MipCplex::ColTypes MipCplex::_getColType(int i) const {
3.206 + CplexMip::ColTypes CplexMip::_getColType(int i) const {
3.207 char t;
3.208 CPXgetctype (cplexEnv(), _prob, &t, i, i);
3.209 switch (t) {
3.210 @@ -862,7 +862,7 @@
3.211
3.212 }
3.213
3.214 - MipCplex::SolveExitStatus MipCplex::_solve() {
3.215 + CplexMip::SolveExitStatus CplexMip::_solve() {
3.216 int status;
3.217 status = CPXmipopt (cplexEnv(), _prob);
3.218 if (status==0)
3.219 @@ -873,7 +873,7 @@
3.220 }
3.221
3.222
3.223 - MipCplex::ProblemType MipCplex::_getType() const {
3.224 + CplexMip::ProblemType CplexMip::_getType() const {
3.225
3.226 int stat = CPXgetstat(cplexEnv(), _prob);
3.227
3.228 @@ -909,13 +909,13 @@
3.229 // has a feasible solution.
3.230 }
3.231
3.232 - MipCplex::Value MipCplex::_getSol(int i) const {
3.233 + CplexMip::Value CplexMip::_getSol(int i) const {
3.234 Value x;
3.235 CPXgetmipx(cplexEnv(), _prob, &x, i, i);
3.236 return x;
3.237 }
3.238
3.239 - MipCplex::Value MipCplex::_getSolValue() const {
3.240 + CplexMip::Value CplexMip::_getSolValue() const {
3.241 Value objval;
3.242 CPXgetmipobjval(cplexEnv(), _prob, &objval);
3.243 return objval;
4.1 --- a/lemon/cplex.h Mon Jan 12 12:26:01 2009 +0000
4.2 +++ b/lemon/cplex.h Mon Jan 12 12:26:02 2009 +0000
4.3 @@ -160,16 +160,16 @@
4.4 ///
4.5 /// This class implements an interface for the CPLEX LP solver.
4.6 ///\ingroup lp_group
4.7 - class LpCplex : public CplexBase, public LpSolver {
4.8 + class CplexLp : public CplexBase, public LpSolver {
4.9 public:
4.10 /// \e
4.11 - LpCplex();
4.12 + CplexLp();
4.13 /// \e
4.14 - LpCplex(const CplexEnv&);
4.15 + CplexLp(const CplexEnv&);
4.16 /// \e
4.17 - LpCplex(const LpCplex&);
4.18 + CplexLp(const CplexLp&);
4.19 /// \e
4.20 - virtual ~LpCplex();
4.21 + virtual ~CplexLp();
4.22
4.23 private:
4.24
4.25 @@ -186,8 +186,8 @@
4.26
4.27 protected:
4.28
4.29 - virtual LpCplex* _cloneSolver() const;
4.30 - virtual LpCplex* _newSolver() const;
4.31 + virtual CplexLp* _cloneSolver() const;
4.32 + virtual CplexLp* _newSolver() const;
4.33
4.34 virtual const char* _solverName() const;
4.35
4.36 @@ -222,21 +222,21 @@
4.37 ///
4.38 /// This class implements an interface for the CPLEX MIP solver.
4.39 ///\ingroup lp_group
4.40 - class MipCplex : public CplexBase, public MipSolver {
4.41 + class CplexMip : public CplexBase, public MipSolver {
4.42 public:
4.43 /// \e
4.44 - MipCplex();
4.45 + CplexMip();
4.46 /// \e
4.47 - MipCplex(const CplexEnv&);
4.48 + CplexMip(const CplexEnv&);
4.49 /// \e
4.50 - MipCplex(const MipCplex&);
4.51 + CplexMip(const CplexMip&);
4.52 /// \e
4.53 - virtual ~MipCplex();
4.54 + virtual ~CplexMip();
4.55
4.56 protected:
4.57
4.58 - virtual MipCplex* _cloneSolver() const;
4.59 - virtual MipCplex* _newSolver() const;
4.60 + virtual CplexMip* _cloneSolver() const;
4.61 + virtual CplexMip* _newSolver() const;
4.62
4.63 virtual const char* _solverName() const;
4.64
5.1 --- a/lemon/glpk.cc Mon Jan 12 12:26:01 2009 +0000
5.2 +++ b/lemon/glpk.cc Mon Jan 12 12:26:02 2009 +0000
5.3 @@ -522,33 +522,33 @@
5.4 cols.clear();
5.5 }
5.6
5.7 - // LpGlpk members
5.8 + // GlpkLp members
5.9
5.10 - LpGlpk::LpGlpk()
5.11 + GlpkLp::GlpkLp()
5.12 : LpBase(), GlpkBase(), LpSolver() {
5.13 messageLevel(MESSAGE_NO_OUTPUT);
5.14 }
5.15
5.16 - LpGlpk::LpGlpk(const LpGlpk& other)
5.17 + GlpkLp::GlpkLp(const GlpkLp& other)
5.18 : LpBase(other), GlpkBase(other), LpSolver(other) {
5.19 messageLevel(MESSAGE_NO_OUTPUT);
5.20 }
5.21
5.22 - LpGlpk* LpGlpk::_newSolver() const { return new LpGlpk; }
5.23 - LpGlpk* LpGlpk::_cloneSolver() const { return new LpGlpk(*this); }
5.24 + GlpkLp* GlpkLp::_newSolver() const { return new GlpkLp; }
5.25 + GlpkLp* GlpkLp::_cloneSolver() const { return new GlpkLp(*this); }
5.26
5.27 - const char* LpGlpk::_solverName() const { return "LpGlpk"; }
5.28 + const char* GlpkLp::_solverName() const { return "GlpkLp"; }
5.29
5.30 - void LpGlpk::_clear_temporals() {
5.31 + void GlpkLp::_clear_temporals() {
5.32 _primal_ray.clear();
5.33 _dual_ray.clear();
5.34 }
5.35
5.36 - LpGlpk::SolveExitStatus LpGlpk::_solve() {
5.37 + GlpkLp::SolveExitStatus GlpkLp::_solve() {
5.38 return solvePrimal();
5.39 }
5.40
5.41 - LpGlpk::SolveExitStatus LpGlpk::solvePrimal() {
5.42 + GlpkLp::SolveExitStatus GlpkLp::solvePrimal() {
5.43 _clear_temporals();
5.44
5.45 glp_smcp smcp;
5.46 @@ -573,7 +573,7 @@
5.47 return SOLVED;
5.48 }
5.49
5.50 - LpGlpk::SolveExitStatus LpGlpk::solveDual() {
5.51 + GlpkLp::SolveExitStatus GlpkLp::solveDual() {
5.52 _clear_temporals();
5.53
5.54 glp_smcp smcp;
5.55 @@ -599,19 +599,19 @@
5.56 return SOLVED;
5.57 }
5.58
5.59 - LpGlpk::Value LpGlpk::_getPrimal(int i) const {
5.60 + GlpkLp::Value GlpkLp::_getPrimal(int i) const {
5.61 return glp_get_col_prim(lp, i);
5.62 }
5.63
5.64 - LpGlpk::Value LpGlpk::_getDual(int i) const {
5.65 + GlpkLp::Value GlpkLp::_getDual(int i) const {
5.66 return glp_get_row_dual(lp, i);
5.67 }
5.68
5.69 - LpGlpk::Value LpGlpk::_getPrimalValue() const {
5.70 + GlpkLp::Value GlpkLp::_getPrimalValue() const {
5.71 return glp_get_obj_val(lp);
5.72 }
5.73
5.74 - LpGlpk::VarStatus LpGlpk::_getColStatus(int i) const {
5.75 + GlpkLp::VarStatus GlpkLp::_getColStatus(int i) const {
5.76 switch (glp_get_col_stat(lp, i)) {
5.77 case GLP_BS:
5.78 return BASIC;
5.79 @@ -625,11 +625,11 @@
5.80 return FIXED;
5.81 default:
5.82 LEMON_ASSERT(false, "Wrong column status");
5.83 - return LpGlpk::VarStatus();
5.84 + return GlpkLp::VarStatus();
5.85 }
5.86 }
5.87
5.88 - LpGlpk::VarStatus LpGlpk::_getRowStatus(int i) const {
5.89 + GlpkLp::VarStatus GlpkLp::_getRowStatus(int i) const {
5.90 switch (glp_get_row_stat(lp, i)) {
5.91 case GLP_BS:
5.92 return BASIC;
5.93 @@ -643,11 +643,11 @@
5.94 return FIXED;
5.95 default:
5.96 LEMON_ASSERT(false, "Wrong row status");
5.97 - return LpGlpk::VarStatus();
5.98 + return GlpkLp::VarStatus();
5.99 }
5.100 }
5.101
5.102 - LpGlpk::Value LpGlpk::_getPrimalRay(int i) const {
5.103 + GlpkLp::Value GlpkLp::_getPrimalRay(int i) const {
5.104 if (_primal_ray.empty()) {
5.105 int row_num = glp_get_num_rows(lp);
5.106 int col_num = glp_get_num_cols(lp);
5.107 @@ -699,7 +699,7 @@
5.108 return _primal_ray[i];
5.109 }
5.110
5.111 - LpGlpk::Value LpGlpk::_getDualRay(int i) const {
5.112 + GlpkLp::Value GlpkLp::_getDualRay(int i) const {
5.113 if (_dual_ray.empty()) {
5.114 int row_num = glp_get_num_rows(lp);
5.115
5.116 @@ -771,7 +771,7 @@
5.117 return _dual_ray[i];
5.118 }
5.119
5.120 - LpGlpk::ProblemType LpGlpk::_getPrimalType() const {
5.121 + GlpkLp::ProblemType GlpkLp::_getPrimalType() const {
5.122 if (glp_get_status(lp) == GLP_OPT)
5.123 return OPTIMAL;
5.124 switch (glp_get_prim_stat(lp)) {
5.125 @@ -788,11 +788,11 @@
5.126 return INFEASIBLE;
5.127 default:
5.128 LEMON_ASSERT(false, "Wrong primal type");
5.129 - return LpGlpk::ProblemType();
5.130 + return GlpkLp::ProblemType();
5.131 }
5.132 }
5.133
5.134 - LpGlpk::ProblemType LpGlpk::_getDualType() const {
5.135 + GlpkLp::ProblemType GlpkLp::_getDualType() const {
5.136 if (glp_get_status(lp) == GLP_OPT)
5.137 return OPTIMAL;
5.138 switch (glp_get_dual_stat(lp)) {
5.139 @@ -809,31 +809,31 @@
5.140 return INFEASIBLE;
5.141 default:
5.142 LEMON_ASSERT(false, "Wrong primal type");
5.143 - return LpGlpk::ProblemType();
5.144 + return GlpkLp::ProblemType();
5.145 }
5.146 }
5.147
5.148 - void LpGlpk::presolver(bool b) {
5.149 + void GlpkLp::presolver(bool b) {
5.150 lpx_set_int_parm(lp, LPX_K_PRESOL, b ? 1 : 0);
5.151 }
5.152
5.153 - void LpGlpk::messageLevel(MessageLevel m) {
5.154 + void GlpkLp::messageLevel(MessageLevel m) {
5.155 _message_level = m;
5.156 }
5.157
5.158 - // MipGlpk members
5.159 + // GlpkMip members
5.160
5.161 - MipGlpk::MipGlpk()
5.162 + GlpkMip::GlpkMip()
5.163 : LpBase(), GlpkBase(), MipSolver() {
5.164 messageLevel(MESSAGE_NO_OUTPUT);
5.165 }
5.166
5.167 - MipGlpk::MipGlpk(const MipGlpk& other)
5.168 + GlpkMip::GlpkMip(const GlpkMip& other)
5.169 : LpBase(), GlpkBase(other), MipSolver() {
5.170 messageLevel(MESSAGE_NO_OUTPUT);
5.171 }
5.172
5.173 - void MipGlpk::_setColType(int i, MipGlpk::ColTypes col_type) {
5.174 + void GlpkMip::_setColType(int i, GlpkMip::ColTypes col_type) {
5.175 switch (col_type) {
5.176 case INTEGER:
5.177 glp_set_col_kind(lp, i, GLP_IV);
5.178 @@ -844,7 +844,7 @@
5.179 }
5.180 }
5.181
5.182 - MipGlpk::ColTypes MipGlpk::_getColType(int i) const {
5.183 + GlpkMip::ColTypes GlpkMip::_getColType(int i) const {
5.184 switch (glp_get_col_kind(lp, i)) {
5.185 case GLP_IV:
5.186 case GLP_BV:
5.187 @@ -855,7 +855,7 @@
5.188
5.189 }
5.190
5.191 - MipGlpk::SolveExitStatus MipGlpk::_solve() {
5.192 + GlpkMip::SolveExitStatus GlpkMip::_solve() {
5.193 glp_smcp smcp;
5.194 glp_init_smcp(&smcp);
5.195
5.196 @@ -901,7 +901,7 @@
5.197 }
5.198
5.199
5.200 - MipGlpk::ProblemType MipGlpk::_getType() const {
5.201 + GlpkMip::ProblemType GlpkMip::_getType() const {
5.202 switch (glp_get_status(lp)) {
5.203 case GLP_OPT:
5.204 switch (glp_mip_status(lp)) {
5.205 @@ -915,7 +915,7 @@
5.206 return OPTIMAL;
5.207 default:
5.208 LEMON_ASSERT(false, "Wrong problem type.");
5.209 - return MipGlpk::ProblemType();
5.210 + return GlpkMip::ProblemType();
5.211 }
5.212 case GLP_NOFEAS:
5.213 return INFEASIBLE;
5.214 @@ -928,24 +928,24 @@
5.215 }
5.216 default:
5.217 LEMON_ASSERT(false, "Wrong problem type.");
5.218 - return MipGlpk::ProblemType();
5.219 + return GlpkMip::ProblemType();
5.220 }
5.221 }
5.222
5.223 - MipGlpk::Value MipGlpk::_getSol(int i) const {
5.224 + GlpkMip::Value GlpkMip::_getSol(int i) const {
5.225 return glp_mip_col_val(lp, i);
5.226 }
5.227
5.228 - MipGlpk::Value MipGlpk::_getSolValue() const {
5.229 + GlpkMip::Value GlpkMip::_getSolValue() const {
5.230 return glp_mip_obj_val(lp);
5.231 }
5.232
5.233 - MipGlpk* MipGlpk::_newSolver() const { return new MipGlpk; }
5.234 - MipGlpk* MipGlpk::_cloneSolver() const {return new MipGlpk(*this); }
5.235 + GlpkMip* GlpkMip::_newSolver() const { return new GlpkMip; }
5.236 + GlpkMip* GlpkMip::_cloneSolver() const {return new GlpkMip(*this); }
5.237
5.238 - const char* MipGlpk::_solverName() const { return "MipGlpk"; }
5.239 + const char* GlpkMip::_solverName() const { return "GlpkMip"; }
5.240
5.241 - void MipGlpk::messageLevel(MessageLevel m) {
5.242 + void GlpkMip::messageLevel(MessageLevel m) {
5.243 _message_level = m;
5.244 }
5.245
6.1 --- a/lemon/glpk.h Mon Jan 12 12:26:01 2009 +0000
6.2 +++ b/lemon/glpk.h Mon Jan 12 12:26:02 2009 +0000
6.3 @@ -119,13 +119,13 @@
6.4 ///
6.5 /// This class implements an interface for the GLPK LP solver.
6.6 ///\ingroup lp_group
6.7 - class LpGlpk : public GlpkBase, public LpSolver {
6.8 + class GlpkLp : public GlpkBase, public LpSolver {
6.9 public:
6.10
6.11 ///\e
6.12 - LpGlpk();
6.13 + GlpkLp();
6.14 ///\e
6.15 - LpGlpk(const LpGlpk&);
6.16 + GlpkLp(const GlpkLp&);
6.17
6.18 private:
6.19
6.20 @@ -136,8 +136,8 @@
6.21
6.22 protected:
6.23
6.24 - virtual LpGlpk* _cloneSolver() const;
6.25 - virtual LpGlpk* _newSolver() const;
6.26 + virtual GlpkLp* _cloneSolver() const;
6.27 + virtual GlpkLp* _newSolver() const;
6.28
6.29 virtual const char* _solverName() const;
6.30
6.31 @@ -203,18 +203,18 @@
6.32 ///
6.33 /// This class implements an interface for the GLPK MIP solver.
6.34 ///\ingroup lp_group
6.35 - class MipGlpk : public GlpkBase, public MipSolver {
6.36 + class GlpkMip : public GlpkBase, public MipSolver {
6.37 public:
6.38
6.39 ///\e
6.40 - MipGlpk();
6.41 + GlpkMip();
6.42 ///\e
6.43 - MipGlpk(const MipGlpk&);
6.44 + GlpkMip(const GlpkMip&);
6.45
6.46 protected:
6.47
6.48 - virtual MipGlpk* _cloneSolver() const;
6.49 - virtual MipGlpk* _newSolver() const;
6.50 + virtual GlpkMip* _cloneSolver() const;
6.51 + virtual GlpkMip* _newSolver() const;
6.52
6.53 virtual const char* _solverName() const;
6.54
7.1 --- a/lemon/lp.h Mon Jan 12 12:26:01 2009 +0000
7.2 +++ b/lemon/lp.h Mon Jan 12 12:26:02 2009 +0000
7.3 @@ -51,8 +51,8 @@
7.4 ///The default LP solver.
7.5 ///\ingroup lp_group
7.6 ///
7.7 - ///Currently, it is either \c LpGlpk, \c LpCplex, \c LpSoplex or \c LpClp
7.8 - typedef LpGlpk Lp;
7.9 + ///Currently, it is either \c GlpkLp, \c CplexLp, \c SoplexLp or \c ClpLp
7.10 + typedef GlpkLp Lp;
7.11
7.12 ///The default MIP solver identifier
7.13
7.14 @@ -66,25 +66,25 @@
7.15 ///The default MIP solver.
7.16 ///\ingroup lp_group
7.17 ///
7.18 - ///Currently, it is either \c MipGlpk or \c MipCplex
7.19 - typedef MipGlpk Mip;
7.20 + ///Currently, it is either \c GlpkMip or \c CplexMip
7.21 + typedef GlpkMip Mip;
7.22 #else
7.23 #ifdef HAVE_GLPK
7.24 # define LEMON_DEFAULT_LP GLPK
7.25 - typedef LpGlpk Lp;
7.26 + typedef GlpkLp Lp;
7.27 # define LEMON_DEFAULT_MIP GLPK
7.28 - typedef MipGlpk Mip;
7.29 + typedef GlpkMip Mip;
7.30 #elif HAVE_CPLEX
7.31 # define LEMON_DEFAULT_LP CPLEX
7.32 - typedef LpCplex Lp;
7.33 + typedef CplexLp Lp;
7.34 # define LEMON_DEFAULT_MIP CPLEX
7.35 - typedef MipCplex Mip;
7.36 + typedef CplexMip Mip;
7.37 #elif HAVE_SOPLEX
7.38 # define DEFAULT_LP SOPLEX
7.39 - typedef LpSoplex Lp;
7.40 + typedef SoplexLp Lp;
7.41 #elif HAVE_CLP
7.42 # define DEFAULT_LP CLP
7.43 - typedef LpClp Lp;
7.44 + typedef ClpLp Lp;
7.45 #endif
7.46 #endif
7.47
8.1 --- a/lemon/soplex.cc Mon Jan 12 12:26:01 2009 +0000
8.2 +++ b/lemon/soplex.cc Mon Jan 12 12:26:02 2009 +0000
8.3 @@ -26,15 +26,15 @@
8.4 ///\brief Implementation of the LEMON-SOPLEX lp solver interface.
8.5 namespace lemon {
8.6
8.7 - LpSoplex::LpSoplex() {
8.8 + SoplexLp::SoplexLp() {
8.9 soplex = new soplex::SoPlex;
8.10 }
8.11
8.12 - LpSoplex::~LpSoplex() {
8.13 + SoplexLp::~SoplexLp() {
8.14 delete soplex;
8.15 }
8.16
8.17 - LpSoplex::LpSoplex(const LpSoplex& lp) {
8.18 + SoplexLp::SoplexLp(const SoplexLp& lp) {
8.19 rows = lp.rows;
8.20 cols = lp.cols;
8.21
8.22 @@ -49,24 +49,24 @@
8.23
8.24 }
8.25
8.26 - void LpSoplex::_clear_temporals() {
8.27 + void SoplexLp::_clear_temporals() {
8.28 _primal_values.clear();
8.29 _dual_values.clear();
8.30 }
8.31
8.32 - LpSoplex* LpSoplex::_newSolver() const {
8.33 - LpSoplex* newlp = new LpSoplex();
8.34 + SoplexLp* SoplexLp::_newSolver() const {
8.35 + SoplexLp* newlp = new SoplexLp();
8.36 return newlp;
8.37 }
8.38
8.39 - LpSoplex* LpSoplex::_cloneSolver() const {
8.40 - LpSoplex* newlp = new LpSoplex(*this);
8.41 + SoplexLp* SoplexLp::_cloneSolver() const {
8.42 + SoplexLp* newlp = new SoplexLp(*this);
8.43 return newlp;
8.44 }
8.45
8.46 - const char* LpSoplex::_solverName() const { return "LpSoplex"; }
8.47 + const char* SoplexLp::_solverName() const { return "SoplexLp"; }
8.48
8.49 - int LpSoplex::_addCol() {
8.50 + int SoplexLp::_addCol() {
8.51 soplex::LPCol c;
8.52 c.setLower(-soplex::infinity);
8.53 c.setUpper(soplex::infinity);
8.54 @@ -77,7 +77,7 @@
8.55 return soplex->nCols() - 1;
8.56 }
8.57
8.58 - int LpSoplex::_addRow() {
8.59 + int SoplexLp::_addRow() {
8.60 soplex::LPRow r;
8.61 r.setLhs(-soplex::infinity);
8.62 r.setRhs(soplex::infinity);
8.63 @@ -89,7 +89,7 @@
8.64 }
8.65
8.66
8.67 - void LpSoplex::_eraseCol(int i) {
8.68 + void SoplexLp::_eraseCol(int i) {
8.69 soplex->removeCol(i);
8.70 _col_names_ref.erase(_col_names[i]);
8.71 _col_names[i] = _col_names.back();
8.72 @@ -97,7 +97,7 @@
8.73 _col_names.pop_back();
8.74 }
8.75
8.76 - void LpSoplex::_eraseRow(int i) {
8.77 + void SoplexLp::_eraseRow(int i) {
8.78 soplex->removeRow(i);
8.79 _row_names_ref.erase(_row_names[i]);
8.80 _row_names[i] = _row_names.back();
8.81 @@ -105,20 +105,20 @@
8.82 _row_names.pop_back();
8.83 }
8.84
8.85 - void LpSoplex::_eraseColId(int i) {
8.86 + void SoplexLp::_eraseColId(int i) {
8.87 cols.eraseIndex(i);
8.88 cols.relocateIndex(i, cols.maxIndex());
8.89 }
8.90 - void LpSoplex::_eraseRowId(int i) {
8.91 + void SoplexLp::_eraseRowId(int i) {
8.92 rows.eraseIndex(i);
8.93 rows.relocateIndex(i, rows.maxIndex());
8.94 }
8.95
8.96 - void LpSoplex::_getColName(int c, std::string &name) const {
8.97 + void SoplexLp::_getColName(int c, std::string &name) const {
8.98 name = _col_names[c];
8.99 }
8.100
8.101 - void LpSoplex::_setColName(int c, const std::string &name) {
8.102 + void SoplexLp::_setColName(int c, const std::string &name) {
8.103 _col_names_ref.erase(_col_names[c]);
8.104 _col_names[c] = name;
8.105 if (!name.empty()) {
8.106 @@ -126,7 +126,7 @@
8.107 }
8.108 }
8.109
8.110 - int LpSoplex::_colByName(const std::string& name) const {
8.111 + int SoplexLp::_colByName(const std::string& name) const {
8.112 std::map<std::string, int>::const_iterator it =
8.113 _col_names_ref.find(name);
8.114 if (it != _col_names_ref.end()) {
8.115 @@ -136,11 +136,11 @@
8.116 }
8.117 }
8.118
8.119 - void LpSoplex::_getRowName(int r, std::string &name) const {
8.120 + void SoplexLp::_getRowName(int r, std::string &name) const {
8.121 name = _row_names[r];
8.122 }
8.123
8.124 - void LpSoplex::_setRowName(int r, const std::string &name) {
8.125 + void SoplexLp::_setRowName(int r, const std::string &name) {
8.126 _row_names_ref.erase(_row_names[r]);
8.127 _row_names[r] = name;
8.128 if (!name.empty()) {
8.129 @@ -148,7 +148,7 @@
8.130 }
8.131 }
8.132
8.133 - int LpSoplex::_rowByName(const std::string& name) const {
8.134 + int SoplexLp::_rowByName(const std::string& name) const {
8.135 std::map<std::string, int>::const_iterator it =
8.136 _row_names_ref.find(name);
8.137 if (it != _row_names_ref.end()) {
8.138 @@ -159,7 +159,7 @@
8.139 }
8.140
8.141
8.142 - void LpSoplex::_setRowCoeffs(int i, ExprIterator b, ExprIterator e) {
8.143 + void SoplexLp::_setRowCoeffs(int i, ExprIterator b, ExprIterator e) {
8.144 for (int j = 0; j < soplex->nCols(); ++j) {
8.145 soplex->changeElement(i, j, 0.0);
8.146 }
8.147 @@ -168,7 +168,7 @@
8.148 }
8.149 }
8.150
8.151 - void LpSoplex::_getRowCoeffs(int i, InsertIterator b) const {
8.152 + void SoplexLp::_getRowCoeffs(int i, InsertIterator b) const {
8.153 const soplex::SVector& vec = soplex->rowVector(i);
8.154 for (int k = 0; k < vec.size(); ++k) {
8.155 *b = std::make_pair(vec.index(k), vec.value(k));
8.156 @@ -176,7 +176,7 @@
8.157 }
8.158 }
8.159
8.160 - void LpSoplex::_setColCoeffs(int j, ExprIterator b, ExprIterator e) {
8.161 + void SoplexLp::_setColCoeffs(int j, ExprIterator b, ExprIterator e) {
8.162 for (int i = 0; i < soplex->nRows(); ++i) {
8.163 soplex->changeElement(i, j, 0.0);
8.164 }
8.165 @@ -185,7 +185,7 @@
8.166 }
8.167 }
8.168
8.169 - void LpSoplex::_getColCoeffs(int i, InsertIterator b) const {
8.170 + void SoplexLp::_getColCoeffs(int i, InsertIterator b) const {
8.171 const soplex::SVector& vec = soplex->colVector(i);
8.172 for (int k = 0; k < vec.size(); ++k) {
8.173 *b = std::make_pair(vec.index(k), vec.value(k));
8.174 @@ -193,55 +193,55 @@
8.175 }
8.176 }
8.177
8.178 - void LpSoplex::_setCoeff(int i, int j, Value value) {
8.179 + void SoplexLp::_setCoeff(int i, int j, Value value) {
8.180 soplex->changeElement(i, j, value);
8.181 }
8.182
8.183 - LpSoplex::Value LpSoplex::_getCoeff(int i, int j) const {
8.184 + SoplexLp::Value SoplexLp::_getCoeff(int i, int j) const {
8.185 return soplex->rowVector(i)[j];
8.186 }
8.187
8.188 - void LpSoplex::_setColLowerBound(int i, Value value) {
8.189 + void SoplexLp::_setColLowerBound(int i, Value value) {
8.190 LEMON_ASSERT(value != INF, "Invalid bound");
8.191 soplex->changeLower(i, value != -INF ? value : -soplex::infinity);
8.192 }
8.193
8.194 - LpSoplex::Value LpSoplex::_getColLowerBound(int i) const {
8.195 + SoplexLp::Value SoplexLp::_getColLowerBound(int i) const {
8.196 double value = soplex->lower(i);
8.197 return value != -soplex::infinity ? value : -INF;
8.198 }
8.199
8.200 - void LpSoplex::_setColUpperBound(int i, Value value) {
8.201 + void SoplexLp::_setColUpperBound(int i, Value value) {
8.202 LEMON_ASSERT(value != -INF, "Invalid bound");
8.203 soplex->changeUpper(i, value != INF ? value : soplex::infinity);
8.204 }
8.205
8.206 - LpSoplex::Value LpSoplex::_getColUpperBound(int i) const {
8.207 + SoplexLp::Value SoplexLp::_getColUpperBound(int i) const {
8.208 double value = soplex->upper(i);
8.209 return value != soplex::infinity ? value : INF;
8.210 }
8.211
8.212 - void LpSoplex::_setRowLowerBound(int i, Value lb) {
8.213 + void SoplexLp::_setRowLowerBound(int i, Value lb) {
8.214 LEMON_ASSERT(lb != INF, "Invalid bound");
8.215 soplex->changeRange(i, lb != -INF ? lb : -soplex::infinity, soplex->rhs(i));
8.216 }
8.217
8.218 - LpSoplex::Value LpSoplex::_getRowLowerBound(int i) const {
8.219 + SoplexLp::Value SoplexLp::_getRowLowerBound(int i) const {
8.220 double res = soplex->lhs(i);
8.221 return res == -soplex::infinity ? -INF : res;
8.222 }
8.223
8.224 - void LpSoplex::_setRowUpperBound(int i, Value ub) {
8.225 + void SoplexLp::_setRowUpperBound(int i, Value ub) {
8.226 LEMON_ASSERT(ub != -INF, "Invalid bound");
8.227 soplex->changeRange(i, soplex->lhs(i), ub != INF ? ub : soplex::infinity);
8.228 }
8.229
8.230 - LpSoplex::Value LpSoplex::_getRowUpperBound(int i) const {
8.231 + SoplexLp::Value SoplexLp::_getRowUpperBound(int i) const {
8.232 double res = soplex->rhs(i);
8.233 return res == soplex::infinity ? INF : res;
8.234 }
8.235
8.236 - void LpSoplex::_setObjCoeffs(ExprIterator b, ExprIterator e) {
8.237 + void SoplexLp::_setObjCoeffs(ExprIterator b, ExprIterator e) {
8.238 for (int j = 0; j < soplex->nCols(); ++j) {
8.239 soplex->changeObj(j, 0.0);
8.240 }
8.241 @@ -250,7 +250,7 @@
8.242 }
8.243 }
8.244
8.245 - void LpSoplex::_getObjCoeffs(InsertIterator b) const {
8.246 + void SoplexLp::_getObjCoeffs(InsertIterator b) const {
8.247 for (int j = 0; j < soplex->nCols(); ++j) {
8.248 Value coef = soplex->obj(j);
8.249 if (coef != 0.0) {
8.250 @@ -260,15 +260,15 @@
8.251 }
8.252 }
8.253
8.254 - void LpSoplex::_setObjCoeff(int i, Value obj_coef) {
8.255 + void SoplexLp::_setObjCoeff(int i, Value obj_coef) {
8.256 soplex->changeObj(i, obj_coef);
8.257 }
8.258
8.259 - LpSoplex::Value LpSoplex::_getObjCoeff(int i) const {
8.260 + SoplexLp::Value SoplexLp::_getObjCoeff(int i) const {
8.261 return soplex->obj(i);
8.262 }
8.263
8.264 - LpSoplex::SolveExitStatus LpSoplex::_solve() {
8.265 + SoplexLp::SolveExitStatus SoplexLp::_solve() {
8.266
8.267 _clear_temporals();
8.268
8.269 @@ -284,7 +284,7 @@
8.270 }
8.271 }
8.272
8.273 - LpSoplex::Value LpSoplex::_getPrimal(int i) const {
8.274 + SoplexLp::Value SoplexLp::_getPrimal(int i) const {
8.275 if (_primal_values.empty()) {
8.276 _primal_values.resize(soplex->nCols());
8.277 soplex::Vector pv(_primal_values.size(), &_primal_values.front());
8.278 @@ -293,7 +293,7 @@
8.279 return _primal_values[i];
8.280 }
8.281
8.282 - LpSoplex::Value LpSoplex::_getDual(int i) const {
8.283 + SoplexLp::Value SoplexLp::_getDual(int i) const {
8.284 if (_dual_values.empty()) {
8.285 _dual_values.resize(soplex->nRows());
8.286 soplex::Vector dv(_dual_values.size(), &_dual_values.front());
8.287 @@ -302,11 +302,11 @@
8.288 return _dual_values[i];
8.289 }
8.290
8.291 - LpSoplex::Value LpSoplex::_getPrimalValue() const {
8.292 + SoplexLp::Value SoplexLp::_getPrimalValue() const {
8.293 return soplex->objValue();
8.294 }
8.295
8.296 - LpSoplex::VarStatus LpSoplex::_getColStatus(int i) const {
8.297 + SoplexLp::VarStatus SoplexLp::_getColStatus(int i) const {
8.298 switch (soplex->getBasisColStatus(i)) {
8.299 case soplex::SPxSolver::BASIC:
8.300 return BASIC;
8.301 @@ -324,7 +324,7 @@
8.302 }
8.303 }
8.304
8.305 - LpSoplex::VarStatus LpSoplex::_getRowStatus(int i) const {
8.306 + SoplexLp::VarStatus SoplexLp::_getRowStatus(int i) const {
8.307 switch (soplex->getBasisRowStatus(i)) {
8.308 case soplex::SPxSolver::BASIC:
8.309 return BASIC;
8.310 @@ -342,7 +342,7 @@
8.311 }
8.312 }
8.313
8.314 - LpSoplex::Value LpSoplex::_getPrimalRay(int i) const {
8.315 + SoplexLp::Value SoplexLp::_getPrimalRay(int i) const {
8.316 if (_primal_ray.empty()) {
8.317 _primal_ray.resize(soplex->nCols());
8.318 soplex::Vector pv(_primal_ray.size(), &_primal_ray.front());
8.319 @@ -351,7 +351,7 @@
8.320 return _primal_ray[i];
8.321 }
8.322
8.323 - LpSoplex::Value LpSoplex::_getDualRay(int i) const {
8.324 + SoplexLp::Value SoplexLp::_getDualRay(int i) const {
8.325 if (_dual_ray.empty()) {
8.326 _dual_ray.resize(soplex->nRows());
8.327 soplex::Vector dv(_dual_ray.size(), &_dual_ray.front());
8.328 @@ -360,7 +360,7 @@
8.329 return _dual_ray[i];
8.330 }
8.331
8.332 - LpSoplex::ProblemType LpSoplex::_getPrimalType() const {
8.333 + SoplexLp::ProblemType SoplexLp::_getPrimalType() const {
8.334 switch (soplex->status()) {
8.335 case soplex::SPxSolver::OPTIMAL:
8.336 return OPTIMAL;
8.337 @@ -373,7 +373,7 @@
8.338 }
8.339 }
8.340
8.341 - LpSoplex::ProblemType LpSoplex::_getDualType() const {
8.342 + SoplexLp::ProblemType SoplexLp::_getDualType() const {
8.343 switch (soplex->status()) {
8.344 case soplex::SPxSolver::OPTIMAL:
8.345 return OPTIMAL;
8.346 @@ -386,7 +386,7 @@
8.347 }
8.348 }
8.349
8.350 - void LpSoplex::_setSense(Sense sense) {
8.351 + void SoplexLp::_setSense(Sense sense) {
8.352 switch (sense) {
8.353 case MIN:
8.354 soplex->changeSense(soplex::SPxSolver::MINIMIZE);
8.355 @@ -396,7 +396,7 @@
8.356 }
8.357 }
8.358
8.359 - LpSoplex::Sense LpSoplex::_getSense() const {
8.360 + SoplexLp::Sense SoplexLp::_getSense() const {
8.361 switch (soplex->spxSense()) {
8.362 case soplex::SPxSolver::MAXIMIZE:
8.363 return MAX;
8.364 @@ -404,11 +404,11 @@
8.365 return MIN;
8.366 default:
8.367 LEMON_ASSERT(false, "Wrong sense.");
8.368 - return LpSoplex::Sense();
8.369 + return SoplexLp::Sense();
8.370 }
8.371 }
8.372
8.373 - void LpSoplex::_clear() {
8.374 + void SoplexLp::_clear() {
8.375 soplex->clear();
8.376 _col_names.clear();
8.377 _col_names_ref.clear();
9.1 --- a/lemon/soplex.h Mon Jan 12 12:26:01 2009 +0000
9.2 +++ b/lemon/soplex.h Mon Jan 12 12:26:02 2009 +0000
9.3 @@ -43,7 +43,7 @@
9.4 /// developed at the Konrad-Zuse-Zentrum für Informationstechnik
9.5 /// Berlin (ZIB). You can find detailed information about it at the
9.6 /// <tt>http://soplex.zib.de</tt> address.
9.7 - class LpSoplex : public LpSolver {
9.8 + class SoplexLp : public LpSolver {
9.9 private:
9.10
9.11 soplex::SoPlex* soplex;
9.12 @@ -68,16 +68,16 @@
9.13 public:
9.14
9.15 /// \e
9.16 - LpSoplex();
9.17 + SoplexLp();
9.18 /// \e
9.19 - LpSoplex(const LpSoplex&);
9.20 + SoplexLp(const SoplexLp&);
9.21 /// \e
9.22 - ~LpSoplex();
9.23 + ~SoplexLp();
9.24
9.25 protected:
9.26
9.27 - virtual LpSoplex* _newSolver() const;
9.28 - virtual LpSoplex* _cloneSolver() const;
9.29 + virtual SoplexLp* _newSolver() const;
9.30 + virtual SoplexLp* _cloneSolver() const;
9.31
9.32 virtual const char* _solverName() const;
9.33
10.1 --- a/test/lp_test.cc Mon Jan 12 12:26:01 2009 +0000
10.2 +++ b/test/lp_test.cc Mon Jan 12 12:26:02 2009 +0000
10.3 @@ -362,7 +362,7 @@
10.4
10.5 #ifdef HAVE_GLPK
10.6 {
10.7 - LpGlpk lp_glpk1,lp_glpk2;
10.8 + GlpkLp lp_glpk1,lp_glpk2;
10.9 lpTest(lp_glpk1);
10.10 aTest(lp_glpk2);
10.11 }
10.12 @@ -370,7 +370,7 @@
10.13
10.14 #ifdef HAVE_CPLEX
10.15 try {
10.16 - LpCplex lp_cplex1,lp_cplex2;
10.17 + CplexLp lp_cplex1,lp_cplex2;
10.18 lpTest(lp_cplex1);
10.19 aTest(lp_cplex2);
10.20 } catch (CplexEnv::LicenseError& error) {
10.21 @@ -385,7 +385,7 @@
10.22
10.23 #ifdef HAVE_SOPLEX
10.24 {
10.25 - LpSoplex lp_soplex1,lp_soplex2;
10.26 + SoplexLp lp_soplex1,lp_soplex2;
10.27 lpTest(lp_soplex1);
10.28 aTest(lp_soplex2);
10.29 }
10.30 @@ -393,7 +393,7 @@
10.31
10.32 #ifdef HAVE_CLP
10.33 {
10.34 - LpClp lp_clp1,lp_clp2;
10.35 + ClpLp lp_clp1,lp_clp2;
10.36 lpTest(lp_clp1);
10.37 aTest(lp_clp2);
10.38 }
11.1 --- a/test/mip_test.cc Mon Jan 12 12:26:01 2009 +0000
11.2 +++ b/test/mip_test.cc Mon Jan 12 12:26:02 2009 +0000
11.3 @@ -112,14 +112,14 @@
11.4
11.5 #ifdef HAVE_GLPK
11.6 {
11.7 - MipGlpk mip1;
11.8 + GlpkMip mip1;
11.9 aTest(mip1);
11.10 }
11.11 #endif
11.12
11.13 #ifdef HAVE_CPLEX
11.14 try {
11.15 - MipCplex mip2;
11.16 + CplexMip mip2;
11.17 aTest(mip2);
11.18 } catch (CplexEnv::LicenseError& error) {
11.19 #ifdef LEMON_FORCE_CPLEX_CHECK