# HG changeset patch
# User Balazs Dezso <deba@inf.elte.hu>
# Date 1237448434 -3600
# Node ID 9d0d7e20f76d71a7129ffbc9beb7092114587677
# Parent 20e3acc1a757bc90dd280136e524c2f56a0f42c2
Fix lp related errors and warnings (#241 and #242)
diff -r 20e3acc1a757 -r 9d0d7e20f76d lemon/cplex.cc
|
a
|
b
|
|
| 2 | 2 | * |
| 3 | 3 | * This file is a part of LEMON, a generic C++ optimization library. |
| 4 | 4 | * |
| 5 | | * Copyright (C) 2003-2008 |
| | 5 | * Copyright (C) 2003-2009 |
| 6 | 6 | * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 | * (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 | * |
| … |
… |
|
| 441 | 441 | // CplexLp members |
| 442 | 442 | |
| 443 | 443 | CplexLp::CplexLp() |
| 444 | | : LpBase(), CplexBase(), LpSolver() {} |
| | 444 | : LpBase(), LpSolver(), CplexBase() {} |
| 445 | 445 | |
| 446 | 446 | CplexLp::CplexLp(const CplexEnv& env) |
| 447 | | : LpBase(), CplexBase(env), LpSolver() {} |
| | 447 | : LpBase(), LpSolver(), CplexBase(env) {} |
| 448 | 448 | |
| 449 | 449 | CplexLp::CplexLp(const CplexLp& other) |
| 450 | | : LpBase(), CplexBase(other), LpSolver() {} |
| | 450 | : LpBase(), LpSolver(), CplexBase(other) {} |
| 451 | 451 | |
| 452 | 452 | CplexLp::~CplexLp() {} |
| 453 | 453 | |
| … |
… |
|
| 798 | 798 | // CplexMip members |
| 799 | 799 | |
| 800 | 800 | CplexMip::CplexMip() |
| 801 | | : LpBase(), CplexBase(), MipSolver() { |
| | 801 | : LpBase(), MipSolver(), CplexBase() { |
| 802 | 802 | |
| 803 | 803 | #if CPX_VERSION < 800 |
| 804 | 804 | CPXchgprobtype(cplexEnv(), _prob, CPXPROB_MIP); |
| … |
… |
|
| 808 | 808 | } |
| 809 | 809 | |
| 810 | 810 | CplexMip::CplexMip(const CplexEnv& env) |
| 811 | | : LpBase(), CplexBase(env), MipSolver() { |
| | 811 | : LpBase(), MipSolver(), CplexBase(env) { |
| 812 | 812 | |
| 813 | 813 | #if CPX_VERSION < 800 |
| 814 | 814 | CPXchgprobtype(cplexEnv(), _prob, CPXPROB_MIP); |
| … |
… |
|
| 819 | 819 | } |
| 820 | 820 | |
| 821 | 821 | CplexMip::CplexMip(const CplexMip& other) |
| 822 | | : LpBase(), CplexBase(other), MipSolver() {} |
| | 822 | : LpBase(), MipSolver(), CplexBase(other) {} |
| 823 | 823 | |
| 824 | 824 | CplexMip::~CplexMip() {} |
| 825 | 825 | |
diff -r 20e3acc1a757 -r 9d0d7e20f76d lemon/cplex.h
|
a
|
b
|
|
| 2 | 2 | * |
| 3 | 3 | * This file is a part of LEMON, a generic C++ optimization library. |
| 4 | 4 | * |
| 5 | | * Copyright (C) 2003-2008 |
| | 5 | * Copyright (C) 2003-2009 |
| 6 | 6 | * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 | * (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 | * |
| … |
… |
|
| 78 | 78 | /// \brief Base interface for the CPLEX LP and MIP solver |
| 79 | 79 | /// |
| 80 | 80 | /// This class implements the common interface of the CPLEX LP and |
| 81 | | /// MIP solvers. |
| | 81 | /// MIP solvers. |
| 82 | 82 | /// \ingroup lp_group |
| 83 | 83 | class CplexBase : virtual public LpBase { |
| 84 | 84 | protected: |
| … |
… |
|
| 235 | 235 | /// \e |
| 236 | 236 | virtual ~CplexMip(); |
| 237 | 237 | |
| | 238 | /// \e |
| | 239 | virtual CplexMip* cloneSolver() const; |
| | 240 | /// \e |
| | 241 | virtual CplexMip* newSolver() const; |
| | 242 | |
| 238 | 243 | protected: |
| 239 | 244 | |
| 240 | | virtual CplexMip* _cloneSolver() const; |
| 241 | | virtual CplexMip* _newSolver() const; |
| 242 | 245 | |
| 243 | 246 | virtual const char* _solverName() const; |
| 244 | 247 | |
diff -r 20e3acc1a757 -r 9d0d7e20f76d lemon/glpk.cc
|
a
|
b
|
|
| 2 | 2 | * |
| 3 | 3 | * This file is a part of LEMON, a generic C++ optimization library. |
| 4 | 4 | * |
| 5 | | * Copyright (C) 2003-2008 |
| | 5 | * Copyright (C) 2003-2009 |
| 6 | 6 | * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 | * (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 | * |
| … |
… |
|
| 531 | 531 | // GlpkLp members |
| 532 | 532 | |
| 533 | 533 | GlpkLp::GlpkLp() |
| 534 | | : LpBase(), GlpkBase(), LpSolver() { |
| | 534 | : LpBase(), LpSolver(), GlpkBase() { |
| 535 | 535 | messageLevel(MESSAGE_NO_OUTPUT); |
| 536 | 536 | } |
| 537 | 537 | |
| 538 | 538 | GlpkLp::GlpkLp(const GlpkLp& other) |
| 539 | | : LpBase(other), GlpkBase(other), LpSolver(other) { |
| | 539 | : LpBase(other), LpSolver(other), GlpkBase(other) { |
| 540 | 540 | messageLevel(MESSAGE_NO_OUTPUT); |
| 541 | 541 | } |
| 542 | 542 | |
| … |
… |
|
| 830 | 830 | // GlpkMip members |
| 831 | 831 | |
| 832 | 832 | GlpkMip::GlpkMip() |
| 833 | | : LpBase(), GlpkBase(), MipSolver() { |
| | 833 | : LpBase(), MipSolver(), GlpkBase() { |
| 834 | 834 | messageLevel(MESSAGE_NO_OUTPUT); |
| 835 | 835 | } |
| 836 | 836 | |
| 837 | 837 | GlpkMip::GlpkMip(const GlpkMip& other) |
| 838 | | : LpBase(), GlpkBase(other), MipSolver() { |
| | 838 | : LpBase(), MipSolver(), GlpkBase(other) { |
| 839 | 839 | messageLevel(MESSAGE_NO_OUTPUT); |
| 840 | 840 | } |
| 841 | 841 | |
diff -r 20e3acc1a757 -r 9d0d7e20f76d test/lp_test.cc
|
a
|
b
|
|
| 2 | 2 | * |
| 3 | 3 | * This file is a part of LEMON, a generic C++ optimization library. |
| 4 | 4 | * |
| 5 | | * Copyright (C) 2003-2008 |
| | 5 | * Copyright (C) 2003-2009 |
| 6 | 6 | * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 | * (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 | * |
| … |
… |
|
| 365 | 365 | void cloneTest() |
| 366 | 366 | { |
| 367 | 367 | //Test for clone/new |
| 368 | | |
| | 368 | |
| 369 | 369 | LP* lp = new LP(); |
| 370 | 370 | LP* lpnew = lp->newSolver(); |
| 371 | 371 | LP* lpclone = lp->cloneSolver(); |
| … |
… |
|
| 393 | 393 | CplexLp lp_cplex1,lp_cplex2; |
| 394 | 394 | lpTest(lp_cplex1); |
| 395 | 395 | aTest(lp_cplex2); |
| | 396 | cloneTest<CplexLp>(); |
| 396 | 397 | } catch (CplexEnv::LicenseError& error) { |
| 397 | 398 | #ifdef LEMON_FORCE_CPLEX_CHECK |
| 398 | 399 | check(false, error.what()); |
| … |
… |
|
| 401 | 402 | std::cerr << "Cplex license check failed, lp check skipped" << std::endl; |
| 402 | 403 | #endif |
| 403 | 404 | } |
| 404 | | cloneTest<CplexLp>(); |
| 405 | 405 | #endif |
| 406 | 406 | |
| 407 | 407 | #ifdef HAVE_SOPLEX |
diff -r 20e3acc1a757 -r 9d0d7e20f76d test/mip_test.cc
|
a
|
b
|
|
| 2 | 2 | * |
| 3 | 3 | * This file is a part of LEMON, a generic C++ optimization library. |
| 4 | 4 | * |
| 5 | | * Copyright (C) 2003-2008 |
| | 5 | * Copyright (C) 2003-2009 |
| 6 | 6 | * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| 7 | 7 | * (Egervary Research Group on Combinatorial Optimization, EGRES). |
| 8 | 8 | * |
| … |
… |
|
| 109 | 109 | template<class MIP> |
| 110 | 110 | void cloneTest() |
| 111 | 111 | { |
| 112 | | |
| | 112 | |
| 113 | 113 | MIP* mip = new MIP(); |
| 114 | 114 | MIP* mipnew = mip->newSolver(); |
| 115 | 115 | MIP* mipclone = mip->cloneSolver(); |
| … |
… |
|
| 133 | 133 | try { |
| 134 | 134 | CplexMip mip2; |
| 135 | 135 | aTest(mip2); |
| | 136 | cloneTest<CplexMip>(); |
| 136 | 137 | } catch (CplexEnv::LicenseError& error) { |
| 137 | 138 | #ifdef LEMON_FORCE_CPLEX_CHECK |
| 138 | 139 | check(false, error.what()); |
| … |
… |
|
| 141 | 142 | std::cerr << "Cplex license check failed, lp check skipped" << std::endl; |
| 142 | 143 | #endif |
| 143 | 144 | } |
| 144 | | cloneTest<CplexMip>(); |
| 145 | 145 | #endif |
| 146 | 146 | |
| 147 | 147 | return 0; |