0
11
0
57
57
6
6
39
39
14
14
40
40
10
10
10
10
53
53
| ... | ... |
@@ -23,3 +23,3 @@ |
| 23 | 23 |
|
| 24 |
|
|
| 24 |
ClpLp::ClpLp() {
|
|
| 25 | 25 |
_prob = new ClpSimplex(); |
| ... | ... |
@@ -29,3 +29,3 @@ |
| 29 | 29 |
|
| 30 |
|
|
| 30 |
ClpLp::ClpLp(const ClpLp& other) {
|
|
| 31 | 31 |
_prob = new ClpSimplex(*other._prob); |
| ... | ... |
@@ -37,3 +37,3 @@ |
| 37 | 37 |
|
| 38 |
|
|
| 38 |
ClpLp::~ClpLp() {
|
|
| 39 | 39 |
delete _prob; |
| ... | ... |
@@ -42,3 +42,3 @@ |
| 42 | 42 |
|
| 43 |
void |
|
| 43 |
void ClpLp::_init_temporals() {
|
|
| 44 | 44 |
_primal_ray = 0; |
| ... | ... |
@@ -47,3 +47,3 @@ |
| 47 | 47 |
|
| 48 |
void |
|
| 48 |
void ClpLp::_clear_temporals() {
|
|
| 49 | 49 |
if (_primal_ray) {
|
| ... | ... |
@@ -58,4 +58,4 @@ |
| 58 | 58 |
|
| 59 |
LpClp* LpClp::_newSolver() const {
|
|
| 60 |
LpClp* newlp = new LpClp; |
|
| 59 |
ClpLp* ClpLp::_newSolver() const {
|
|
| 60 |
ClpLp* newlp = new ClpLp; |
|
| 61 | 61 |
return newlp; |
| ... | ... |
@@ -63,4 +63,4 @@ |
| 63 | 63 |
|
| 64 |
LpClp* LpClp::_cloneSolver() const {
|
|
| 65 |
LpClp* copylp = new LpClp(*this); |
|
| 64 |
ClpLp* ClpLp::_cloneSolver() const {
|
|
| 65 |
ClpLp* copylp = new ClpLp(*this); |
|
| 66 | 66 |
return copylp; |
| ... | ... |
@@ -68,5 +68,5 @@ |
| 68 | 68 |
|
| 69 |
const char* |
|
| 69 |
const char* ClpLp::_solverName() const { return "ClpLp"; }
|
|
| 70 | 70 |
|
| 71 |
int |
|
| 71 |
int ClpLp::_addCol() {
|
|
| 72 | 72 |
_prob->addColumn(0, 0, 0, -COIN_DBL_MAX, COIN_DBL_MAX, 0.0); |
| ... | ... |
@@ -75,3 +75,3 @@ |
| 75 | 75 |
|
| 76 |
int |
|
| 76 |
int ClpLp::_addRow() {
|
|
| 77 | 77 |
_prob->addRow(0, 0, 0, -COIN_DBL_MAX, COIN_DBL_MAX); |
| ... | ... |
@@ -81,3 +81,3 @@ |
| 81 | 81 |
|
| 82 |
void |
|
| 82 |
void ClpLp::_eraseCol(int c) {
|
|
| 83 | 83 |
_col_names_ref.erase(_prob->getColumnName(c)); |
| ... | ... |
@@ -86,3 +86,3 @@ |
| 86 | 86 |
|
| 87 |
void |
|
| 87 |
void ClpLp::_eraseRow(int r) {
|
|
| 88 | 88 |
_row_names_ref.erase(_prob->getRowName(r)); |
| ... | ... |
@@ -91,3 +91,3 @@ |
| 91 | 91 |
|
| 92 |
void |
|
| 92 |
void ClpLp::_eraseColId(int i) {
|
|
| 93 | 93 |
cols.eraseIndex(i); |
| ... | ... |
@@ -96,3 +96,3 @@ |
| 96 | 96 |
|
| 97 |
void |
|
| 97 |
void ClpLp::_eraseRowId(int i) {
|
|
| 98 | 98 |
rows.eraseIndex(i); |
| ... | ... |
@@ -101,3 +101,3 @@ |
| 101 | 101 |
|
| 102 |
void |
|
| 102 |
void ClpLp::_getColName(int c, std::string& name) const {
|
|
| 103 | 103 |
name = _prob->getColumnName(c); |
| ... | ... |
@@ -105,3 +105,3 @@ |
| 105 | 105 |
|
| 106 |
void |
|
| 106 |
void ClpLp::_setColName(int c, const std::string& name) {
|
|
| 107 | 107 |
_prob->setColumnName(c, const_cast<std::string&>(name)); |
| ... | ... |
@@ -110,3 +110,3 @@ |
| 110 | 110 |
|
| 111 |
int |
|
| 111 |
int ClpLp::_colByName(const std::string& name) const {
|
|
| 112 | 112 |
std::map<std::string, int>::const_iterator it = _col_names_ref.find(name); |
| ... | ... |
@@ -115,3 +115,3 @@ |
| 115 | 115 |
|
| 116 |
void |
|
| 116 |
void ClpLp::_getRowName(int r, std::string& name) const {
|
|
| 117 | 117 |
name = _prob->getRowName(r); |
| ... | ... |
@@ -119,3 +119,3 @@ |
| 119 | 119 |
|
| 120 |
void |
|
| 120 |
void ClpLp::_setRowName(int r, const std::string& name) {
|
|
| 121 | 121 |
_prob->setRowName(r, const_cast<std::string&>(name)); |
| ... | ... |
@@ -124,3 +124,3 @@ |
| 124 | 124 |
|
| 125 |
int |
|
| 125 |
int ClpLp::_rowByName(const std::string& name) const {
|
|
| 126 | 126 |
std::map<std::string, int>::const_iterator it = _row_names_ref.find(name); |
| ... | ... |
@@ -130,3 +130,3 @@ |
| 130 | 130 |
|
| 131 |
void |
|
| 131 |
void ClpLp::_setRowCoeffs(int ix, ExprIterator b, ExprIterator e) {
|
|
| 132 | 132 |
std::map<int, Value> coeffs; |
| ... | ... |
@@ -158,3 +158,3 @@ |
| 158 | 158 |
|
| 159 |
void |
|
| 159 |
void ClpLp::_getRowCoeffs(int ix, InsertIterator b) const {
|
|
| 160 | 160 |
int n = _prob->clpMatrix()->getNumCols(); |
| ... | ... |
@@ -175,3 +175,3 @@ |
| 175 | 175 |
|
| 176 |
void |
|
| 176 |
void ClpLp::_setColCoeffs(int ix, ExprIterator b, ExprIterator e) {
|
|
| 177 | 177 |
std::map<int, Value> coeffs; |
| ... | ... |
@@ -198,3 +198,3 @@ |
| 198 | 198 |
|
| 199 |
void |
|
| 199 |
void ClpLp::_getColCoeffs(int ix, InsertIterator b) const {
|
|
| 200 | 200 |
CoinBigIndex begin = _prob->clpMatrix()->getVectorStarts()[ix]; |
| ... | ... |
@@ -211,3 +211,3 @@ |
| 211 | 211 |
|
| 212 |
void |
|
| 212 |
void ClpLp::_setCoeff(int ix, int jx, Value value) {
|
|
| 213 | 213 |
_prob->modifyCoefficient(ix, jx, value); |
| ... | ... |
@@ -215,3 +215,3 @@ |
| 215 | 215 |
|
| 216 |
|
|
| 216 |
ClpLp::Value ClpLp::_getCoeff(int ix, int jx) const {
|
|
| 217 | 217 |
CoinBigIndex begin = _prob->clpMatrix()->getVectorStarts()[ix]; |
| ... | ... |
@@ -230,3 +230,3 @@ |
| 230 | 230 |
|
| 231 |
void |
|
| 231 |
void ClpLp::_setColLowerBound(int i, Value lo) {
|
|
| 232 | 232 |
_prob->setColumnLower(i, lo == - INF ? - COIN_DBL_MAX : lo); |
| ... | ... |
@@ -234,3 +234,3 @@ |
| 234 | 234 |
|
| 235 |
|
|
| 235 |
ClpLp::Value ClpLp::_getColLowerBound(int i) const {
|
|
| 236 | 236 |
double val = _prob->getColLower()[i]; |
| ... | ... |
@@ -239,3 +239,3 @@ |
| 239 | 239 |
|
| 240 |
void |
|
| 240 |
void ClpLp::_setColUpperBound(int i, Value up) {
|
|
| 241 | 241 |
_prob->setColumnUpper(i, up == INF ? COIN_DBL_MAX : up); |
| ... | ... |
@@ -243,3 +243,3 @@ |
| 243 | 243 |
|
| 244 |
|
|
| 244 |
ClpLp::Value ClpLp::_getColUpperBound(int i) const {
|
|
| 245 | 245 |
double val = _prob->getColUpper()[i]; |
| ... | ... |
@@ -248,3 +248,3 @@ |
| 248 | 248 |
|
| 249 |
void |
|
| 249 |
void ClpLp::_setRowLowerBound(int i, Value lo) {
|
|
| 250 | 250 |
_prob->setRowLower(i, lo == - INF ? - COIN_DBL_MAX : lo); |
| ... | ... |
@@ -252,3 +252,3 @@ |
| 252 | 252 |
|
| 253 |
|
|
| 253 |
ClpLp::Value ClpLp::_getRowLowerBound(int i) const {
|
|
| 254 | 254 |
double val = _prob->getRowLower()[i]; |
| ... | ... |
@@ -257,3 +257,3 @@ |
| 257 | 257 |
|
| 258 |
void |
|
| 258 |
void ClpLp::_setRowUpperBound(int i, Value up) {
|
|
| 259 | 259 |
_prob->setRowUpper(i, up == INF ? COIN_DBL_MAX : up); |
| ... | ... |
@@ -261,3 +261,3 @@ |
| 261 | 261 |
|
| 262 |
|
|
| 262 |
ClpLp::Value ClpLp::_getRowUpperBound(int i) const {
|
|
| 263 | 263 |
double val = _prob->getRowUpper()[i]; |
| ... | ... |
@@ -266,3 +266,3 @@ |
| 266 | 266 |
|
| 267 |
void |
|
| 267 |
void ClpLp::_setObjCoeffs(ExprIterator b, ExprIterator e) {
|
|
| 268 | 268 |
int num = _prob->clpMatrix()->getNumCols(); |
| ... | ... |
@@ -276,3 +276,3 @@ |
| 276 | 276 |
|
| 277 |
void |
|
| 277 |
void ClpLp::_getObjCoeffs(InsertIterator b) const {
|
|
| 278 | 278 |
int num = _prob->clpMatrix()->getNumCols(); |
| ... | ... |
@@ -287,3 +287,3 @@ |
| 287 | 287 |
|
| 288 |
void |
|
| 288 |
void ClpLp::_setObjCoeff(int i, Value obj_coef) {
|
|
| 289 | 289 |
_prob->setObjectiveCoefficient(i, obj_coef); |
| ... | ... |
@@ -291,3 +291,3 @@ |
| 291 | 291 |
|
| 292 |
|
|
| 292 |
ClpLp::Value ClpLp::_getObjCoeff(int i) const {
|
|
| 293 | 293 |
return _prob->getObjCoefficients()[i]; |
| ... | ... |
@@ -295,3 +295,3 @@ |
| 295 | 295 |
|
| 296 |
|
|
| 296 |
ClpLp::SolveExitStatus ClpLp::_solve() {
|
|
| 297 | 297 |
return _prob->primal() >= 0 ? SOLVED : UNSOLVED; |
| ... | ... |
@@ -299,3 +299,3 @@ |
| 299 | 299 |
|
| 300 |
|
|
| 300 |
ClpLp::SolveExitStatus ClpLp::solvePrimal() {
|
|
| 301 | 301 |
return _prob->primal() >= 0 ? SOLVED : UNSOLVED; |
| ... | ... |
@@ -303,3 +303,3 @@ |
| 303 | 303 |
|
| 304 |
|
|
| 304 |
ClpLp::SolveExitStatus ClpLp::solveDual() {
|
|
| 305 | 305 |
return _prob->dual() >= 0 ? SOLVED : UNSOLVED; |
| ... | ... |
@@ -307,3 +307,3 @@ |
| 307 | 307 |
|
| 308 |
|
|
| 308 |
ClpLp::SolveExitStatus ClpLp::solveBarrier() {
|
|
| 309 | 309 |
return _prob->barrier() >= 0 ? SOLVED : UNSOLVED; |
| ... | ... |
@@ -311,6 +311,6 @@ |
| 311 | 311 |
|
| 312 |
|
|
| 312 |
ClpLp::Value ClpLp::_getPrimal(int i) const {
|
|
| 313 | 313 |
return _prob->primalColumnSolution()[i]; |
| 314 | 314 |
} |
| 315 |
|
|
| 315 |
ClpLp::Value ClpLp::_getPrimalValue() const {
|
|
| 316 | 316 |
return _prob->objectiveValue(); |
| ... | ... |
@@ -318,3 +318,3 @@ |
| 318 | 318 |
|
| 319 |
|
|
| 319 |
ClpLp::Value ClpLp::_getDual(int i) const {
|
|
| 320 | 320 |
return _prob->dualRowSolution()[i]; |
| ... | ... |
@@ -322,3 +322,3 @@ |
| 322 | 322 |
|
| 323 |
|
|
| 323 |
ClpLp::Value ClpLp::_getPrimalRay(int i) const {
|
|
| 324 | 324 |
if (!_primal_ray) {
|
| ... | ... |
@@ -330,3 +330,3 @@ |
| 330 | 330 |
|
| 331 |
|
|
| 331 |
ClpLp::Value ClpLp::_getDualRay(int i) const {
|
|
| 332 | 332 |
if (!_dual_ray) {
|
| ... | ... |
@@ -338,3 +338,3 @@ |
| 338 | 338 |
|
| 339 |
|
|
| 339 |
ClpLp::VarStatus ClpLp::_getColStatus(int i) const {
|
|
| 340 | 340 |
switch (_prob->getColumnStatus(i)) {
|
| ... | ... |
@@ -358,3 +358,3 @@ |
| 358 | 358 |
|
| 359 |
|
|
| 359 |
ClpLp::VarStatus ClpLp::_getRowStatus(int i) const {
|
|
| 360 | 360 |
switch (_prob->getColumnStatus(i)) {
|
| ... | ... |
@@ -379,3 +379,3 @@ |
| 379 | 379 |
|
| 380 |
|
|
| 380 |
ClpLp::ProblemType ClpLp::_getPrimalType() const {
|
|
| 381 | 381 |
if (_prob->isProvenOptimal()) {
|
| ... | ... |
@@ -391,3 +391,3 @@ |
| 391 | 391 |
|
| 392 |
|
|
| 392 |
ClpLp::ProblemType ClpLp::_getDualType() const {
|
|
| 393 | 393 |
if (_prob->isProvenOptimal()) {
|
| ... | ... |
@@ -403,3 +403,3 @@ |
| 403 | 403 |
|
| 404 |
void |
|
| 404 |
void ClpLp::_setSense(ClpLp::Sense sense) {
|
|
| 405 | 405 |
switch (sense) {
|
| ... | ... |
@@ -414,3 +414,3 @@ |
| 414 | 414 |
|
| 415 |
|
|
| 415 |
ClpLp::Sense ClpLp::_getSense() const {
|
|
| 416 | 416 |
double dir = _prob->optimizationDirection(); |
| ... | ... |
@@ -423,3 +423,3 @@ |
| 423 | 423 |
|
| 424 |
void |
|
| 424 |
void ClpLp::_clear() {
|
|
| 425 | 425 |
delete _prob; |
| ... | ... |
@@ -432,3 +432,3 @@ |
| 432 | 432 |
|
| 433 |
void |
|
| 433 |
void ClpLp::messageLevel(MessageLevel m) {
|
|
| 434 | 434 |
_prob->setLogLevel(static_cast<int>(m)); |
| ... | ... |
@@ -41,3 +41,3 @@ |
| 41 | 41 |
/// used with Common Public License. |
| 42 |
class |
|
| 42 |
class ClpLp : public LpSolver {
|
|
| 43 | 43 |
protected: |
| ... | ... |
@@ -52,7 +52,7 @@ |
| 52 | 52 |
/// \e |
| 53 |
|
|
| 53 |
ClpLp(); |
|
| 54 | 54 |
/// \e |
| 55 |
|
|
| 55 |
ClpLp(const ClpLp&); |
|
| 56 | 56 |
/// \e |
| 57 |
~ |
|
| 57 |
~ClpLp(); |
|
| 58 | 58 |
|
| ... | ... |
@@ -68,4 +68,4 @@ |
| 68 | 68 |
|
| 69 |
virtual LpClp* _newSolver() const; |
|
| 70 |
virtual LpClp* _cloneSolver() const; |
|
| 69 |
virtual ClpLp* _newSolver() const; |
|
| 70 |
virtual ClpLp* _cloneSolver() const; |
|
| 71 | 71 |
| ... | ... |
@@ -440,21 +440,21 @@ |
| 440 | 440 |
|
| 441 |
// |
|
| 441 |
// CplexLp members |
|
| 442 | 442 |
|
| 443 |
|
|
| 443 |
CplexLp::CplexLp() |
|
| 444 | 444 |
: LpBase(), CplexBase(), LpSolver() {}
|
| 445 | 445 |
|
| 446 |
|
|
| 446 |
CplexLp::CplexLp(const CplexEnv& env) |
|
| 447 | 447 |
: LpBase(), CplexBase(env), LpSolver() {}
|
| 448 | 448 |
|
| 449 |
|
|
| 449 |
CplexLp::CplexLp(const CplexLp& other) |
|
| 450 | 450 |
: LpBase(), CplexBase(other), LpSolver() {}
|
| 451 | 451 |
|
| 452 |
|
|
| 452 |
CplexLp::~CplexLp() {}
|
|
| 453 | 453 |
|
| 454 |
LpCplex* LpCplex::_newSolver() const { return new LpCplex; }
|
|
| 455 |
LpCplex* LpCplex::_cloneSolver() const {return new LpCplex(*this); }
|
|
| 454 |
CplexLp* CplexLp::_newSolver() const { return new CplexLp; }
|
|
| 455 |
CplexLp* CplexLp::_cloneSolver() const {return new CplexLp(*this); }
|
|
| 456 | 456 |
|
| 457 |
const char* |
|
| 457 |
const char* CplexLp::_solverName() const { return "CplexLp"; }
|
|
| 458 | 458 |
|
| 459 |
void |
|
| 459 |
void CplexLp::_clear_temporals() {
|
|
| 460 | 460 |
_col_status.clear(); |
| ... | ... |
@@ -474,3 +474,3 @@ |
| 474 | 474 |
// further information about the status of the optimization. |
| 475 |
|
|
| 475 |
CplexLp::SolveExitStatus CplexLp::convertStatus(int status) {
|
|
| 476 | 476 |
#if CPX_VERSION >= 800 |
| ... | ... |
@@ -507,3 +507,3 @@ |
| 507 | 507 |
|
| 508 |
|
|
| 508 |
CplexLp::SolveExitStatus CplexLp::_solve() {
|
|
| 509 | 509 |
_clear_temporals(); |
| ... | ... |
@@ -512,3 +512,3 @@ |
| 512 | 512 |
|
| 513 |
|
|
| 513 |
CplexLp::SolveExitStatus CplexLp::solvePrimal() {
|
|
| 514 | 514 |
_clear_temporals(); |
| ... | ... |
@@ -517,3 +517,3 @@ |
| 517 | 517 |
|
| 518 |
|
|
| 518 |
CplexLp::SolveExitStatus CplexLp::solveDual() {
|
|
| 519 | 519 |
_clear_temporals(); |
| ... | ... |
@@ -522,3 +522,3 @@ |
| 522 | 522 |
|
| 523 |
|
|
| 523 |
CplexLp::SolveExitStatus CplexLp::solveBarrier() {
|
|
| 524 | 524 |
_clear_temporals(); |
| ... | ... |
@@ -527,3 +527,3 @@ |
| 527 | 527 |
|
| 528 |
|
|
| 528 |
CplexLp::Value CplexLp::_getPrimal(int i) const {
|
|
| 529 | 529 |
Value x; |
| ... | ... |
@@ -533,3 +533,3 @@ |
| 533 | 533 |
|
| 534 |
|
|
| 534 |
CplexLp::Value CplexLp::_getDual(int i) const {
|
|
| 535 | 535 |
Value y; |
| ... | ... |
@@ -539,3 +539,3 @@ |
| 539 | 539 |
|
| 540 |
|
|
| 540 |
CplexLp::Value CplexLp::_getPrimalValue() const {
|
|
| 541 | 541 |
Value objval; |
| ... | ... |
@@ -545,3 +545,3 @@ |
| 545 | 545 |
|
| 546 |
|
|
| 546 |
CplexLp::VarStatus CplexLp::_getColStatus(int i) const {
|
|
| 547 | 547 |
if (_col_status.empty()) {
|
| ... | ... |
@@ -561,3 +561,3 @@ |
| 561 | 561 |
LEMON_ASSERT(false, "Wrong column status"); |
| 562 |
return |
|
| 562 |
return CplexLp::VarStatus(); |
|
| 563 | 563 |
} |
| ... | ... |
@@ -565,3 +565,3 @@ |
| 565 | 565 |
|
| 566 |
|
|
| 566 |
CplexLp::VarStatus CplexLp::_getRowStatus(int i) const {
|
|
| 567 | 567 |
if (_row_status.empty()) {
|
| ... | ... |
@@ -583,3 +583,3 @@ |
| 583 | 583 |
LEMON_ASSERT(false, "Wrong row status"); |
| 584 |
return |
|
| 584 |
return CplexLp::VarStatus(); |
|
| 585 | 585 |
} |
| ... | ... |
@@ -587,3 +587,3 @@ |
| 587 | 587 |
|
| 588 |
|
|
| 588 |
CplexLp::Value CplexLp::_getPrimalRay(int i) const {
|
|
| 589 | 589 |
if (_primal_ray.empty()) {
|
| ... | ... |
@@ -595,3 +595,3 @@ |
| 595 | 595 |
|
| 596 |
|
|
| 596 |
CplexLp::Value CplexLp::_getDualRay(int i) const {
|
|
| 597 | 597 |
if (_dual_ray.empty()) {
|
| ... | ... |
@@ -688,3 +688,3 @@ |
| 688 | 688 |
|
| 689 |
|
|
| 689 |
CplexLp::ProblemType CplexLp::_getPrimalType() const {
|
|
| 690 | 690 |
// Unboundedness not treated well: the following is from cplex 9.0 doc |
| ... | ... |
@@ -770,3 +770,3 @@ |
| 770 | 770 |
|
| 771 |
|
|
| 771 |
CplexLp::ProblemType CplexLp::_getDualType() const {
|
|
| 772 | 772 |
int stat = CPXgetstat(cplexEnv(), _prob); |
| ... | ... |
@@ -797,5 +797,5 @@ |
| 797 | 797 |
|
| 798 |
// |
|
| 798 |
// CplexMip members |
|
| 799 | 799 |
|
| 800 |
|
|
| 800 |
CplexMip::CplexMip() |
|
| 801 | 801 |
: LpBase(), CplexBase(), MipSolver() {
|
| ... | ... |
@@ -809,3 +809,3 @@ |
| 809 | 809 |
|
| 810 |
|
|
| 810 |
CplexMip::CplexMip(const CplexEnv& env) |
|
| 811 | 811 |
: LpBase(), CplexBase(env), MipSolver() {
|
| ... | ... |
@@ -820,13 +820,13 @@ |
| 820 | 820 |
|
| 821 |
|
|
| 821 |
CplexMip::CplexMip(const CplexMip& other) |
|
| 822 | 822 |
: LpBase(), CplexBase(other), MipSolver() {}
|
| 823 | 823 |
|
| 824 |
|
|
| 824 |
CplexMip::~CplexMip() {}
|
|
| 825 | 825 |
|
| 826 |
MipCplex* MipCplex::_newSolver() const { return new MipCplex; }
|
|
| 827 |
MipCplex* MipCplex::_cloneSolver() const {return new MipCplex(*this); }
|
|
| 826 |
CplexMip* CplexMip::_newSolver() const { return new CplexMip; }
|
|
| 827 |
CplexMip* CplexMip::_cloneSolver() const {return new CplexMip(*this); }
|
|
| 828 | 828 |
|
| 829 |
const char* |
|
| 829 |
const char* CplexMip::_solverName() const { return "CplexMip"; }
|
|
| 830 | 830 |
|
| 831 |
void |
|
| 831 |
void CplexMip::_setColType(int i, CplexMip::ColTypes col_type) {
|
|
| 832 | 832 |
|
| ... | ... |
@@ -849,3 +849,3 @@ |
| 849 | 849 |
|
| 850 |
|
|
| 850 |
CplexMip::ColTypes CplexMip::_getColType(int i) const {
|
|
| 851 | 851 |
char t; |
| ... | ... |
@@ -864,3 +864,3 @@ |
| 864 | 864 |
|
| 865 |
|
|
| 865 |
CplexMip::SolveExitStatus CplexMip::_solve() {
|
|
| 866 | 866 |
int status; |
| ... | ... |
@@ -875,3 +875,3 @@ |
| 875 | 875 |
|
| 876 |
|
|
| 876 |
CplexMip::ProblemType CplexMip::_getType() const {
|
|
| 877 | 877 |
|
| ... | ... |
@@ -911,3 +911,3 @@ |
| 911 | 911 |
|
| 912 |
|
|
| 912 |
CplexMip::Value CplexMip::_getSol(int i) const {
|
|
| 913 | 913 |
Value x; |
| ... | ... |
@@ -917,3 +917,3 @@ |
| 917 | 917 |
|
| 918 |
|
|
| 918 |
CplexMip::Value CplexMip::_getSolValue() const {
|
|
| 919 | 919 |
Value objval; |
| ... | ... |
@@ -162,12 +162,12 @@ |
| 162 | 162 |
///\ingroup lp_group |
| 163 |
class |
|
| 163 |
class CplexLp : public CplexBase, public LpSolver {
|
|
| 164 | 164 |
public: |
| 165 | 165 |
/// \e |
| 166 |
|
|
| 166 |
CplexLp(); |
|
| 167 | 167 |
/// \e |
| 168 |
|
|
| 168 |
CplexLp(const CplexEnv&); |
|
| 169 | 169 |
/// \e |
| 170 |
|
|
| 170 |
CplexLp(const CplexLp&); |
|
| 171 | 171 |
/// \e |
| 172 |
virtual ~ |
|
| 172 |
virtual ~CplexLp(); |
|
| 173 | 173 |
|
| ... | ... |
@@ -188,4 +188,4 @@ |
| 188 | 188 |
|
| 189 |
virtual LpCplex* _cloneSolver() const; |
|
| 190 |
virtual LpCplex* _newSolver() const; |
|
| 189 |
virtual CplexLp* _cloneSolver() const; |
|
| 190 |
virtual CplexLp* _newSolver() const; |
|
| 191 | 191 |
|
| ... | ... |
@@ -224,12 +224,12 @@ |
| 224 | 224 |
///\ingroup lp_group |
| 225 |
class |
|
| 225 |
class CplexMip : public CplexBase, public MipSolver {
|
|
| 226 | 226 |
public: |
| 227 | 227 |
/// \e |
| 228 |
|
|
| 228 |
CplexMip(); |
|
| 229 | 229 |
/// \e |
| 230 |
|
|
| 230 |
CplexMip(const CplexEnv&); |
|
| 231 | 231 |
/// \e |
| 232 |
|
|
| 232 |
CplexMip(const CplexMip&); |
|
| 233 | 233 |
/// \e |
| 234 |
virtual ~ |
|
| 234 |
virtual ~CplexMip(); |
|
| 235 | 235 |
|
| ... | ... |
@@ -237,4 +237,4 @@ |
| 237 | 237 |
|
| 238 |
virtual MipCplex* _cloneSolver() const; |
|
| 239 |
virtual MipCplex* _newSolver() const; |
|
| 238 |
virtual CplexMip* _cloneSolver() const; |
|
| 239 |
virtual CplexMip* _newSolver() const; |
|
| 240 | 240 |
| ... | ... |
@@ -524,5 +524,5 @@ |
| 524 | 524 |
|
| 525 |
// |
|
| 525 |
// GlpkLp members |
|
| 526 | 526 |
|
| 527 |
|
|
| 527 |
GlpkLp::GlpkLp() |
|
| 528 | 528 |
: LpBase(), GlpkBase(), LpSolver() {
|
| ... | ... |
@@ -531,3 +531,3 @@ |
| 531 | 531 |
|
| 532 |
|
|
| 532 |
GlpkLp::GlpkLp(const GlpkLp& other) |
|
| 533 | 533 |
: LpBase(other), GlpkBase(other), LpSolver(other) {
|
| ... | ... |
@@ -536,8 +536,8 @@ |
| 536 | 536 |
|
| 537 |
LpGlpk* LpGlpk::_newSolver() const { return new LpGlpk; }
|
|
| 538 |
LpGlpk* LpGlpk::_cloneSolver() const { return new LpGlpk(*this); }
|
|
| 537 |
GlpkLp* GlpkLp::_newSolver() const { return new GlpkLp; }
|
|
| 538 |
GlpkLp* GlpkLp::_cloneSolver() const { return new GlpkLp(*this); }
|
|
| 539 | 539 |
|
| 540 |
const char* |
|
| 540 |
const char* GlpkLp::_solverName() const { return "GlpkLp"; }
|
|
| 541 | 541 |
|
| 542 |
void |
|
| 542 |
void GlpkLp::_clear_temporals() {
|
|
| 543 | 543 |
_primal_ray.clear(); |
| ... | ... |
@@ -546,3 +546,3 @@ |
| 546 | 546 |
|
| 547 |
|
|
| 547 |
GlpkLp::SolveExitStatus GlpkLp::_solve() {
|
|
| 548 | 548 |
return solvePrimal(); |
| ... | ... |
@@ -550,3 +550,3 @@ |
| 550 | 550 |
|
| 551 |
|
|
| 551 |
GlpkLp::SolveExitStatus GlpkLp::solvePrimal() {
|
|
| 552 | 552 |
_clear_temporals(); |
| ... | ... |
@@ -575,3 +575,3 @@ |
| 575 | 575 |
|
| 576 |
|
|
| 576 |
GlpkLp::SolveExitStatus GlpkLp::solveDual() {
|
|
| 577 | 577 |
_clear_temporals(); |
| ... | ... |
@@ -601,3 +601,3 @@ |
| 601 | 601 |
|
| 602 |
|
|
| 602 |
GlpkLp::Value GlpkLp::_getPrimal(int i) const {
|
|
| 603 | 603 |
return glp_get_col_prim(lp, i); |
| ... | ... |
@@ -605,3 +605,3 @@ |
| 605 | 605 |
|
| 606 |
|
|
| 606 |
GlpkLp::Value GlpkLp::_getDual(int i) const {
|
|
| 607 | 607 |
return glp_get_row_dual(lp, i); |
| ... | ... |
@@ -609,3 +609,3 @@ |
| 609 | 609 |
|
| 610 |
|
|
| 610 |
GlpkLp::Value GlpkLp::_getPrimalValue() const {
|
|
| 611 | 611 |
return glp_get_obj_val(lp); |
| ... | ... |
@@ -613,3 +613,3 @@ |
| 613 | 613 |
|
| 614 |
|
|
| 614 |
GlpkLp::VarStatus GlpkLp::_getColStatus(int i) const {
|
|
| 615 | 615 |
switch (glp_get_col_stat(lp, i)) {
|
| ... | ... |
@@ -627,3 +627,3 @@ |
| 627 | 627 |
LEMON_ASSERT(false, "Wrong column status"); |
| 628 |
return |
|
| 628 |
return GlpkLp::VarStatus(); |
|
| 629 | 629 |
} |
| ... | ... |
@@ -631,3 +631,3 @@ |
| 631 | 631 |
|
| 632 |
|
|
| 632 |
GlpkLp::VarStatus GlpkLp::_getRowStatus(int i) const {
|
|
| 633 | 633 |
switch (glp_get_row_stat(lp, i)) {
|
| ... | ... |
@@ -645,3 +645,3 @@ |
| 645 | 645 |
LEMON_ASSERT(false, "Wrong row status"); |
| 646 |
return |
|
| 646 |
return GlpkLp::VarStatus(); |
|
| 647 | 647 |
} |
| ... | ... |
@@ -649,3 +649,3 @@ |
| 649 | 649 |
|
| 650 |
|
|
| 650 |
GlpkLp::Value GlpkLp::_getPrimalRay(int i) const {
|
|
| 651 | 651 |
if (_primal_ray.empty()) {
|
| ... | ... |
@@ -701,3 +701,3 @@ |
| 701 | 701 |
|
| 702 |
|
|
| 702 |
GlpkLp::Value GlpkLp::_getDualRay(int i) const {
|
|
| 703 | 703 |
if (_dual_ray.empty()) {
|
| ... | ... |
@@ -773,3 +773,3 @@ |
| 773 | 773 |
|
| 774 |
|
|
| 774 |
GlpkLp::ProblemType GlpkLp::_getPrimalType() const {
|
|
| 775 | 775 |
if (glp_get_status(lp) == GLP_OPT) |
| ... | ... |
@@ -790,3 +790,3 @@ |
| 790 | 790 |
LEMON_ASSERT(false, "Wrong primal type"); |
| 791 |
return |
|
| 791 |
return GlpkLp::ProblemType(); |
|
| 792 | 792 |
} |
| ... | ... |
@@ -794,3 +794,3 @@ |
| 794 | 794 |
|
| 795 |
|
|
| 795 |
GlpkLp::ProblemType GlpkLp::_getDualType() const {
|
|
| 796 | 796 |
if (glp_get_status(lp) == GLP_OPT) |
| ... | ... |
@@ -811,3 +811,3 @@ |
| 811 | 811 |
LEMON_ASSERT(false, "Wrong primal type"); |
| 812 |
return |
|
| 812 |
return GlpkLp::ProblemType(); |
|
| 813 | 813 |
} |
| ... | ... |
@@ -815,3 +815,3 @@ |
| 815 | 815 |
|
| 816 |
void |
|
| 816 |
void GlpkLp::presolver(bool b) {
|
|
| 817 | 817 |
lpx_set_int_parm(lp, LPX_K_PRESOL, b ? 1 : 0); |
| ... | ... |
@@ -819,3 +819,3 @@ |
| 819 | 819 |
|
| 820 |
void |
|
| 820 |
void GlpkLp::messageLevel(MessageLevel m) {
|
|
| 821 | 821 |
_message_level = m; |
| ... | ... |
@@ -823,5 +823,5 @@ |
| 823 | 823 |
|
| 824 |
// |
|
| 824 |
// GlpkMip members |
|
| 825 | 825 |
|
| 826 |
|
|
| 826 |
GlpkMip::GlpkMip() |
|
| 827 | 827 |
: LpBase(), GlpkBase(), MipSolver() {
|
| ... | ... |
@@ -830,3 +830,3 @@ |
| 830 | 830 |
|
| 831 |
|
|
| 831 |
GlpkMip::GlpkMip(const GlpkMip& other) |
|
| 832 | 832 |
: LpBase(), GlpkBase(other), MipSolver() {
|
| ... | ... |
@@ -835,3 +835,3 @@ |
| 835 | 835 |
|
| 836 |
void |
|
| 836 |
void GlpkMip::_setColType(int i, GlpkMip::ColTypes col_type) {
|
|
| 837 | 837 |
switch (col_type) {
|
| ... | ... |
@@ -846,3 +846,3 @@ |
| 846 | 846 |
|
| 847 |
|
|
| 847 |
GlpkMip::ColTypes GlpkMip::_getColType(int i) const {
|
|
| 848 | 848 |
switch (glp_get_col_kind(lp, i)) {
|
| ... | ... |
@@ -857,3 +857,3 @@ |
| 857 | 857 |
|
| 858 |
|
|
| 858 |
GlpkMip::SolveExitStatus GlpkMip::_solve() {
|
|
| 859 | 859 |
glp_smcp smcp; |
| ... | ... |
@@ -903,3 +903,3 @@ |
| 903 | 903 |
|
| 904 |
|
|
| 904 |
GlpkMip::ProblemType GlpkMip::_getType() const {
|
|
| 905 | 905 |
switch (glp_get_status(lp)) {
|
| ... | ... |
@@ -917,3 +917,3 @@ |
| 917 | 917 |
LEMON_ASSERT(false, "Wrong problem type."); |
| 918 |
return |
|
| 918 |
return GlpkMip::ProblemType(); |
|
| 919 | 919 |
} |
| ... | ... |
@@ -930,3 +930,3 @@ |
| 930 | 930 |
LEMON_ASSERT(false, "Wrong problem type."); |
| 931 |
return |
|
| 931 |
return GlpkMip::ProblemType(); |
|
| 932 | 932 |
} |
| ... | ... |
@@ -934,3 +934,3 @@ |
| 934 | 934 |
|
| 935 |
|
|
| 935 |
GlpkMip::Value GlpkMip::_getSol(int i) const {
|
|
| 936 | 936 |
return glp_mip_col_val(lp, i); |
| ... | ... |
@@ -938,3 +938,3 @@ |
| 938 | 938 |
|
| 939 |
|
|
| 939 |
GlpkMip::Value GlpkMip::_getSolValue() const {
|
|
| 940 | 940 |
return glp_mip_obj_val(lp); |
| ... | ... |
@@ -942,8 +942,8 @@ |
| 942 | 942 |
|
| 943 |
MipGlpk* MipGlpk::_newSolver() const { return new MipGlpk; }
|
|
| 944 |
MipGlpk* MipGlpk::_cloneSolver() const {return new MipGlpk(*this); }
|
|
| 943 |
GlpkMip* GlpkMip::_newSolver() const { return new GlpkMip; }
|
|
| 944 |
GlpkMip* GlpkMip::_cloneSolver() const {return new GlpkMip(*this); }
|
|
| 945 | 945 |
|
| 946 |
const char* |
|
| 946 |
const char* GlpkMip::_solverName() const { return "GlpkMip"; }
|
|
| 947 | 947 |
|
| 948 |
void |
|
| 948 |
void GlpkMip::messageLevel(MessageLevel m) {
|
|
| 949 | 949 |
_message_level = m; |
| ... | ... |
@@ -121,3 +121,3 @@ |
| 121 | 121 |
///\ingroup lp_group |
| 122 |
class |
|
| 122 |
class GlpkLp : public GlpkBase, public LpSolver {
|
|
| 123 | 123 |
public: |
| ... | ... |
@@ -125,5 +125,5 @@ |
| 125 | 125 |
///\e |
| 126 |
|
|
| 126 |
GlpkLp(); |
|
| 127 | 127 |
///\e |
| 128 |
|
|
| 128 |
GlpkLp(const GlpkLp&); |
|
| 129 | 129 |
|
| ... | ... |
@@ -138,4 +138,4 @@ |
| 138 | 138 |
|
| 139 |
virtual LpGlpk* _cloneSolver() const; |
|
| 140 |
virtual LpGlpk* _newSolver() const; |
|
| 139 |
virtual GlpkLp* _cloneSolver() const; |
|
| 140 |
virtual GlpkLp* _newSolver() const; |
|
| 141 | 141 |
|
| ... | ... |
@@ -205,3 +205,3 @@ |
| 205 | 205 |
///\ingroup lp_group |
| 206 |
class |
|
| 206 |
class GlpkMip : public GlpkBase, public MipSolver {
|
|
| 207 | 207 |
public: |
| ... | ... |
@@ -209,5 +209,5 @@ |
| 209 | 209 |
///\e |
| 210 |
|
|
| 210 |
GlpkMip(); |
|
| 211 | 211 |
///\e |
| 212 |
|
|
| 212 |
GlpkMip(const GlpkMip&); |
|
| 213 | 213 |
|
| ... | ... |
@@ -215,4 +215,4 @@ |
| 215 | 215 |
|
| 216 |
virtual MipGlpk* _cloneSolver() const; |
|
| 217 |
virtual MipGlpk* _newSolver() const; |
|
| 216 |
virtual GlpkMip* _cloneSolver() const; |
|
| 217 |
virtual GlpkMip* _newSolver() const; |
|
| 218 | 218 |
| ... | ... |
@@ -53,4 +53,4 @@ |
| 53 | 53 |
/// |
| 54 |
///Currently, it is either \c LpGlpk, \c LpCplex, \c LpSoplex or \c LpClp |
|
| 55 |
typedef LpGlpk Lp; |
|
| 54 |
///Currently, it is either \c GlpkLp, \c CplexLp, \c SoplexLp or \c ClpLp |
|
| 55 |
typedef GlpkLp Lp; |
|
| 56 | 56 |
|
| ... | ... |
@@ -68,4 +68,4 @@ |
| 68 | 68 |
/// |
| 69 |
///Currently, it is either \c MipGlpk or \c MipCplex |
|
| 70 |
typedef MipGlpk Mip; |
|
| 69 |
///Currently, it is either \c GlpkMip or \c CplexMip |
|
| 70 |
typedef GlpkMip Mip; |
|
| 71 | 71 |
#else |
| ... | ... |
@@ -73,16 +73,16 @@ |
| 73 | 73 |
# define LEMON_DEFAULT_LP GLPK |
| 74 |
typedef |
|
| 74 |
typedef GlpkLp Lp; |
|
| 75 | 75 |
# define LEMON_DEFAULT_MIP GLPK |
| 76 |
typedef |
|
| 76 |
typedef GlpkMip Mip; |
|
| 77 | 77 |
#elif HAVE_CPLEX |
| 78 | 78 |
# define LEMON_DEFAULT_LP CPLEX |
| 79 |
typedef |
|
| 79 |
typedef CplexLp Lp; |
|
| 80 | 80 |
# define LEMON_DEFAULT_MIP CPLEX |
| 81 |
typedef |
|
| 81 |
typedef CplexMip Mip; |
|
| 82 | 82 |
#elif HAVE_SOPLEX |
| 83 | 83 |
# define DEFAULT_LP SOPLEX |
| 84 |
typedef |
|
| 84 |
typedef SoplexLp Lp; |
|
| 85 | 85 |
#elif HAVE_CLP |
| 86 | 86 |
# define DEFAULT_LP CLP |
| 87 |
typedef |
|
| 87 |
typedef ClpLp Lp; |
|
| 88 | 88 |
#endif |
| ... | ... |
@@ -28,3 +28,3 @@ |
| 28 | 28 |
|
| 29 |
|
|
| 29 |
SoplexLp::SoplexLp() {
|
|
| 30 | 30 |
soplex = new soplex::SoPlex; |
| ... | ... |
@@ -32,3 +32,3 @@ |
| 32 | 32 |
|
| 33 |
|
|
| 33 |
SoplexLp::~SoplexLp() {
|
|
| 34 | 34 |
delete soplex; |
| ... | ... |
@@ -36,3 +36,3 @@ |
| 36 | 36 |
|
| 37 |
|
|
| 37 |
SoplexLp::SoplexLp(const SoplexLp& lp) {
|
|
| 38 | 38 |
rows = lp.rows; |
| ... | ... |
@@ -51,3 +51,3 @@ |
| 51 | 51 |
|
| 52 |
void |
|
| 52 |
void SoplexLp::_clear_temporals() {
|
|
| 53 | 53 |
_primal_values.clear(); |
| ... | ... |
@@ -56,4 +56,4 @@ |
| 56 | 56 |
|
| 57 |
LpSoplex* LpSoplex::_newSolver() const {
|
|
| 58 |
LpSoplex* newlp = new LpSoplex(); |
|
| 57 |
SoplexLp* SoplexLp::_newSolver() const {
|
|
| 58 |
SoplexLp* newlp = new SoplexLp(); |
|
| 59 | 59 |
return newlp; |
| ... | ... |
@@ -61,4 +61,4 @@ |
| 61 | 61 |
|
| 62 |
LpSoplex* LpSoplex::_cloneSolver() const {
|
|
| 63 |
LpSoplex* newlp = new LpSoplex(*this); |
|
| 62 |
SoplexLp* SoplexLp::_cloneSolver() const {
|
|
| 63 |
SoplexLp* newlp = new SoplexLp(*this); |
|
| 64 | 64 |
return newlp; |
| ... | ... |
@@ -66,5 +66,5 @@ |
| 66 | 66 |
|
| 67 |
const char* |
|
| 67 |
const char* SoplexLp::_solverName() const { return "SoplexLp"; }
|
|
| 68 | 68 |
|
| 69 |
int |
|
| 69 |
int SoplexLp::_addCol() {
|
|
| 70 | 70 |
soplex::LPCol c; |
| ... | ... |
@@ -79,3 +79,3 @@ |
| 79 | 79 |
|
| 80 |
int |
|
| 80 |
int SoplexLp::_addRow() {
|
|
| 81 | 81 |
soplex::LPRow r; |
| ... | ... |
@@ -91,3 +91,3 @@ |
| 91 | 91 |
|
| 92 |
void |
|
| 92 |
void SoplexLp::_eraseCol(int i) {
|
|
| 93 | 93 |
soplex->removeCol(i); |
| ... | ... |
@@ -99,3 +99,3 @@ |
| 99 | 99 |
|
| 100 |
void |
|
| 100 |
void SoplexLp::_eraseRow(int i) {
|
|
| 101 | 101 |
soplex->removeRow(i); |
| ... | ... |
@@ -107,3 +107,3 @@ |
| 107 | 107 |
|
| 108 |
void |
|
| 108 |
void SoplexLp::_eraseColId(int i) {
|
|
| 109 | 109 |
cols.eraseIndex(i); |
| ... | ... |
@@ -111,3 +111,3 @@ |
| 111 | 111 |
} |
| 112 |
void |
|
| 112 |
void SoplexLp::_eraseRowId(int i) {
|
|
| 113 | 113 |
rows.eraseIndex(i); |
| ... | ... |
@@ -116,3 +116,3 @@ |
| 116 | 116 |
|
| 117 |
void |
|
| 117 |
void SoplexLp::_getColName(int c, std::string &name) const {
|
|
| 118 | 118 |
name = _col_names[c]; |
| ... | ... |
@@ -120,3 +120,3 @@ |
| 120 | 120 |
|
| 121 |
void |
|
| 121 |
void SoplexLp::_setColName(int c, const std::string &name) {
|
|
| 122 | 122 |
_col_names_ref.erase(_col_names[c]); |
| ... | ... |
@@ -128,3 +128,3 @@ |
| 128 | 128 |
|
| 129 |
int |
|
| 129 |
int SoplexLp::_colByName(const std::string& name) const {
|
|
| 130 | 130 |
std::map<std::string, int>::const_iterator it = |
| ... | ... |
@@ -138,3 +138,3 @@ |
| 138 | 138 |
|
| 139 |
void |
|
| 139 |
void SoplexLp::_getRowName(int r, std::string &name) const {
|
|
| 140 | 140 |
name = _row_names[r]; |
| ... | ... |
@@ -142,3 +142,3 @@ |
| 142 | 142 |
|
| 143 |
void |
|
| 143 |
void SoplexLp::_setRowName(int r, const std::string &name) {
|
|
| 144 | 144 |
_row_names_ref.erase(_row_names[r]); |
| ... | ... |
@@ -150,3 +150,3 @@ |
| 150 | 150 |
|
| 151 |
int |
|
| 151 |
int SoplexLp::_rowByName(const std::string& name) const {
|
|
| 152 | 152 |
std::map<std::string, int>::const_iterator it = |
| ... | ... |
@@ -161,3 +161,3 @@ |
| 161 | 161 |
|
| 162 |
void |
|
| 162 |
void SoplexLp::_setRowCoeffs(int i, ExprIterator b, ExprIterator e) {
|
|
| 163 | 163 |
for (int j = 0; j < soplex->nCols(); ++j) {
|
| ... | ... |
@@ -170,3 +170,3 @@ |
| 170 | 170 |
|
| 171 |
void |
|
| 171 |
void SoplexLp::_getRowCoeffs(int i, InsertIterator b) const {
|
|
| 172 | 172 |
const soplex::SVector& vec = soplex->rowVector(i); |
| ... | ... |
@@ -178,3 +178,3 @@ |
| 178 | 178 |
|
| 179 |
void |
|
| 179 |
void SoplexLp::_setColCoeffs(int j, ExprIterator b, ExprIterator e) {
|
|
| 180 | 180 |
for (int i = 0; i < soplex->nRows(); ++i) {
|
| ... | ... |
@@ -187,3 +187,3 @@ |
| 187 | 187 |
|
| 188 |
void |
|
| 188 |
void SoplexLp::_getColCoeffs(int i, InsertIterator b) const {
|
|
| 189 | 189 |
const soplex::SVector& vec = soplex->colVector(i); |
| ... | ... |
@@ -195,3 +195,3 @@ |
| 195 | 195 |
|
| 196 |
void |
|
| 196 |
void SoplexLp::_setCoeff(int i, int j, Value value) {
|
|
| 197 | 197 |
soplex->changeElement(i, j, value); |
| ... | ... |
@@ -199,3 +199,3 @@ |
| 199 | 199 |
|
| 200 |
|
|
| 200 |
SoplexLp::Value SoplexLp::_getCoeff(int i, int j) const {
|
|
| 201 | 201 |
return soplex->rowVector(i)[j]; |
| ... | ... |
@@ -203,3 +203,3 @@ |
| 203 | 203 |
|
| 204 |
void |
|
| 204 |
void SoplexLp::_setColLowerBound(int i, Value value) {
|
|
| 205 | 205 |
LEMON_ASSERT(value != INF, "Invalid bound"); |
| ... | ... |
@@ -208,3 +208,3 @@ |
| 208 | 208 |
|
| 209 |
|
|
| 209 |
SoplexLp::Value SoplexLp::_getColLowerBound(int i) const {
|
|
| 210 | 210 |
double value = soplex->lower(i); |
| ... | ... |
@@ -213,3 +213,3 @@ |
| 213 | 213 |
|
| 214 |
void |
|
| 214 |
void SoplexLp::_setColUpperBound(int i, Value value) {
|
|
| 215 | 215 |
LEMON_ASSERT(value != -INF, "Invalid bound"); |
| ... | ... |
@@ -218,3 +218,3 @@ |
| 218 | 218 |
|
| 219 |
|
|
| 219 |
SoplexLp::Value SoplexLp::_getColUpperBound(int i) const {
|
|
| 220 | 220 |
double value = soplex->upper(i); |
| ... | ... |
@@ -223,3 +223,3 @@ |
| 223 | 223 |
|
| 224 |
void |
|
| 224 |
void SoplexLp::_setRowLowerBound(int i, Value lb) {
|
|
| 225 | 225 |
LEMON_ASSERT(lb != INF, "Invalid bound"); |
| ... | ... |
@@ -228,3 +228,3 @@ |
| 228 | 228 |
|
| 229 |
|
|
| 229 |
SoplexLp::Value SoplexLp::_getRowLowerBound(int i) const {
|
|
| 230 | 230 |
double res = soplex->lhs(i); |
| ... | ... |
@@ -233,3 +233,3 @@ |
| 233 | 233 |
|
| 234 |
void |
|
| 234 |
void SoplexLp::_setRowUpperBound(int i, Value ub) {
|
|
| 235 | 235 |
LEMON_ASSERT(ub != -INF, "Invalid bound"); |
| ... | ... |
@@ -238,3 +238,3 @@ |
| 238 | 238 |
|
| 239 |
|
|
| 239 |
SoplexLp::Value SoplexLp::_getRowUpperBound(int i) const {
|
|
| 240 | 240 |
double res = soplex->rhs(i); |
| ... | ... |
@@ -243,3 +243,3 @@ |
| 243 | 243 |
|
| 244 |
void |
|
| 244 |
void SoplexLp::_setObjCoeffs(ExprIterator b, ExprIterator e) {
|
|
| 245 | 245 |
for (int j = 0; j < soplex->nCols(); ++j) {
|
| ... | ... |
@@ -252,3 +252,3 @@ |
| 252 | 252 |
|
| 253 |
void |
|
| 253 |
void SoplexLp::_getObjCoeffs(InsertIterator b) const {
|
|
| 254 | 254 |
for (int j = 0; j < soplex->nCols(); ++j) {
|
| ... | ... |
@@ -262,3 +262,3 @@ |
| 262 | 262 |
|
| 263 |
void |
|
| 263 |
void SoplexLp::_setObjCoeff(int i, Value obj_coef) {
|
|
| 264 | 264 |
soplex->changeObj(i, obj_coef); |
| ... | ... |
@@ -266,3 +266,3 @@ |
| 266 | 266 |
|
| 267 |
|
|
| 267 |
SoplexLp::Value SoplexLp::_getObjCoeff(int i) const {
|
|
| 268 | 268 |
return soplex->obj(i); |
| ... | ... |
@@ -270,3 +270,3 @@ |
| 270 | 270 |
|
| 271 |
|
|
| 271 |
SoplexLp::SolveExitStatus SoplexLp::_solve() {
|
|
| 272 | 272 |
|
| ... | ... |
@@ -286,3 +286,3 @@ |
| 286 | 286 |
|
| 287 |
|
|
| 287 |
SoplexLp::Value SoplexLp::_getPrimal(int i) const {
|
|
| 288 | 288 |
if (_primal_values.empty()) {
|
| ... | ... |
@@ -295,3 +295,3 @@ |
| 295 | 295 |
|
| 296 |
|
|
| 296 |
SoplexLp::Value SoplexLp::_getDual(int i) const {
|
|
| 297 | 297 |
if (_dual_values.empty()) {
|
| ... | ... |
@@ -304,3 +304,3 @@ |
| 304 | 304 |
|
| 305 |
|
|
| 305 |
SoplexLp::Value SoplexLp::_getPrimalValue() const {
|
|
| 306 | 306 |
return soplex->objValue(); |
| ... | ... |
@@ -308,3 +308,3 @@ |
| 308 | 308 |
|
| 309 |
|
|
| 309 |
SoplexLp::VarStatus SoplexLp::_getColStatus(int i) const {
|
|
| 310 | 310 |
switch (soplex->getBasisColStatus(i)) {
|
| ... | ... |
@@ -326,3 +326,3 @@ |
| 326 | 326 |
|
| 327 |
|
|
| 327 |
SoplexLp::VarStatus SoplexLp::_getRowStatus(int i) const {
|
|
| 328 | 328 |
switch (soplex->getBasisRowStatus(i)) {
|
| ... | ... |
@@ -344,3 +344,3 @@ |
| 344 | 344 |
|
| 345 |
|
|
| 345 |
SoplexLp::Value SoplexLp::_getPrimalRay(int i) const {
|
|
| 346 | 346 |
if (_primal_ray.empty()) {
|
| ... | ... |
@@ -353,3 +353,3 @@ |
| 353 | 353 |
|
| 354 |
|
|
| 354 |
SoplexLp::Value SoplexLp::_getDualRay(int i) const {
|
|
| 355 | 355 |
if (_dual_ray.empty()) {
|
| ... | ... |
@@ -362,3 +362,3 @@ |
| 362 | 362 |
|
| 363 |
|
|
| 363 |
SoplexLp::ProblemType SoplexLp::_getPrimalType() const {
|
|
| 364 | 364 |
switch (soplex->status()) {
|
| ... | ... |
@@ -375,3 +375,3 @@ |
| 375 | 375 |
|
| 376 |
|
|
| 376 |
SoplexLp::ProblemType SoplexLp::_getDualType() const {
|
|
| 377 | 377 |
switch (soplex->status()) {
|
| ... | ... |
@@ -388,3 +388,3 @@ |
| 388 | 388 |
|
| 389 |
void |
|
| 389 |
void SoplexLp::_setSense(Sense sense) {
|
|
| 390 | 390 |
switch (sense) {
|
| ... | ... |
@@ -398,3 +398,3 @@ |
| 398 | 398 |
|
| 399 |
|
|
| 399 |
SoplexLp::Sense SoplexLp::_getSense() const {
|
|
| 400 | 400 |
switch (soplex->spxSense()) {
|
| ... | ... |
@@ -406,3 +406,3 @@ |
| 406 | 406 |
LEMON_ASSERT(false, "Wrong sense."); |
| 407 |
return |
|
| 407 |
return SoplexLp::Sense(); |
|
| 408 | 408 |
} |
| ... | ... |
@@ -410,3 +410,3 @@ |
| 410 | 410 |
|
| 411 |
void |
|
| 411 |
void SoplexLp::_clear() {
|
|
| 412 | 412 |
soplex->clear(); |
| ... | ... |
@@ -45,3 +45,3 @@ |
| 45 | 45 |
/// <tt>http://soplex.zib.de</tt> address. |
| 46 |
class |
|
| 46 |
class SoplexLp : public LpSolver {
|
|
| 47 | 47 |
private: |
| ... | ... |
@@ -70,7 +70,7 @@ |
| 70 | 70 |
/// \e |
| 71 |
|
|
| 71 |
SoplexLp(); |
|
| 72 | 72 |
/// \e |
| 73 |
|
|
| 73 |
SoplexLp(const SoplexLp&); |
|
| 74 | 74 |
/// \e |
| 75 |
~ |
|
| 75 |
~SoplexLp(); |
|
| 76 | 76 |
|
| ... | ... |
@@ -78,4 +78,4 @@ |
| 78 | 78 |
|
| 79 |
virtual LpSoplex* _newSolver() const; |
|
| 80 |
virtual LpSoplex* _cloneSolver() const; |
|
| 79 |
virtual SoplexLp* _newSolver() const; |
|
| 80 |
virtual SoplexLp* _cloneSolver() const; |
|
| 81 | 81 |
| ... | ... |
@@ -364,3 +364,3 @@ |
| 364 | 364 |
{
|
| 365 |
|
|
| 365 |
GlpkLp lp_glpk1,lp_glpk2; |
|
| 366 | 366 |
lpTest(lp_glpk1); |
| ... | ... |
@@ -372,3 +372,3 @@ |
| 372 | 372 |
try {
|
| 373 |
|
|
| 373 |
CplexLp lp_cplex1,lp_cplex2; |
|
| 374 | 374 |
lpTest(lp_cplex1); |
| ... | ... |
@@ -387,3 +387,3 @@ |
| 387 | 387 |
{
|
| 388 |
|
|
| 388 |
SoplexLp lp_soplex1,lp_soplex2; |
|
| 389 | 389 |
lpTest(lp_soplex1); |
| ... | ... |
@@ -395,3 +395,3 @@ |
| 395 | 395 |
{
|
| 396 |
|
|
| 396 |
ClpLp lp_clp1,lp_clp2; |
|
| 397 | 397 |
lpTest(lp_clp1); |
0 comments (0 inline)