[Lemon-commits] Balazs Dezso: Fix lp related errors and warnings...
Lemon HG
hg at lemon.cs.elte.hu
Thu Mar 19 13:30:01 CET 2009
details: http://lemon.cs.elte.hu/hg/lemon/rev/9d0d7e20f76d
changeset: 575:9d0d7e20f76d
user: Balazs Dezso <deba [at] inf.elte.hu>
date: Thu Mar 19 08:40:34 2009 +0100
description:
Fix lp related errors and warnings (#241 and #242)
diffstat:
lemon/cplex.cc | 14 +++++++-------
lemon/cplex.h | 11 +++++++----
lemon/glpk.cc | 10 +++++-----
test/lp_test.cc | 6 +++---
test/mip_test.cc | 6 +++---
5 files changed, 25 insertions(+), 22 deletions(-)
diffs (209 lines):
diff --git a/lemon/cplex.cc b/lemon/cplex.cc
--- a/lemon/cplex.cc
+++ b/lemon/cplex.cc
@@ -2,7 +2,7 @@
*
* This file is a part of LEMON, a generic C++ optimization library.
*
- * Copyright (C) 2003-2008
+ * Copyright (C) 2003-2009
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
*
@@ -441,13 +441,13 @@
// CplexLp members
CplexLp::CplexLp()
- : LpBase(), CplexBase(), LpSolver() {}
+ : LpBase(), LpSolver(), CplexBase() {}
CplexLp::CplexLp(const CplexEnv& env)
- : LpBase(), CplexBase(env), LpSolver() {}
+ : LpBase(), LpSolver(), CplexBase(env) {}
CplexLp::CplexLp(const CplexLp& other)
- : LpBase(), CplexBase(other), LpSolver() {}
+ : LpBase(), LpSolver(), CplexBase(other) {}
CplexLp::~CplexLp() {}
@@ -798,7 +798,7 @@
// CplexMip members
CplexMip::CplexMip()
- : LpBase(), CplexBase(), MipSolver() {
+ : LpBase(), MipSolver(), CplexBase() {
#if CPX_VERSION < 800
CPXchgprobtype(cplexEnv(), _prob, CPXPROB_MIP);
@@ -808,7 +808,7 @@
}
CplexMip::CplexMip(const CplexEnv& env)
- : LpBase(), CplexBase(env), MipSolver() {
+ : LpBase(), MipSolver(), CplexBase(env) {
#if CPX_VERSION < 800
CPXchgprobtype(cplexEnv(), _prob, CPXPROB_MIP);
@@ -819,7 +819,7 @@
}
CplexMip::CplexMip(const CplexMip& other)
- : LpBase(), CplexBase(other), MipSolver() {}
+ : LpBase(), MipSolver(), CplexBase(other) {}
CplexMip::~CplexMip() {}
diff --git a/lemon/cplex.h b/lemon/cplex.h
--- a/lemon/cplex.h
+++ b/lemon/cplex.h
@@ -2,7 +2,7 @@
*
* This file is a part of LEMON, a generic C++ optimization library.
*
- * Copyright (C) 2003-2008
+ * Copyright (C) 2003-2009
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
*
@@ -78,7 +78,7 @@
/// \brief Base interface for the CPLEX LP and MIP solver
///
/// This class implements the common interface of the CPLEX LP and
- /// MIP solvers.
+ /// MIP solvers.
/// \ingroup lp_group
class CplexBase : virtual public LpBase {
protected:
@@ -235,10 +235,13 @@
/// \e
virtual ~CplexMip();
+ /// \e
+ virtual CplexMip* cloneSolver() const;
+ /// \e
+ virtual CplexMip* newSolver() const;
+
protected:
- virtual CplexMip* _cloneSolver() const;
- virtual CplexMip* _newSolver() const;
virtual const char* _solverName() const;
diff --git a/lemon/glpk.cc b/lemon/glpk.cc
--- a/lemon/glpk.cc
+++ b/lemon/glpk.cc
@@ -2,7 +2,7 @@
*
* This file is a part of LEMON, a generic C++ optimization library.
*
- * Copyright (C) 2003-2008
+ * Copyright (C) 2003-2009
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
*
@@ -531,12 +531,12 @@
// GlpkLp members
GlpkLp::GlpkLp()
- : LpBase(), GlpkBase(), LpSolver() {
+ : LpBase(), LpSolver(), GlpkBase() {
messageLevel(MESSAGE_NO_OUTPUT);
}
GlpkLp::GlpkLp(const GlpkLp& other)
- : LpBase(other), GlpkBase(other), LpSolver(other) {
+ : LpBase(other), LpSolver(other), GlpkBase(other) {
messageLevel(MESSAGE_NO_OUTPUT);
}
@@ -830,12 +830,12 @@
// GlpkMip members
GlpkMip::GlpkMip()
- : LpBase(), GlpkBase(), MipSolver() {
+ : LpBase(), MipSolver(), GlpkBase() {
messageLevel(MESSAGE_NO_OUTPUT);
}
GlpkMip::GlpkMip(const GlpkMip& other)
- : LpBase(), GlpkBase(other), MipSolver() {
+ : LpBase(), MipSolver(), GlpkBase(other) {
messageLevel(MESSAGE_NO_OUTPUT);
}
diff --git a/test/lp_test.cc b/test/lp_test.cc
--- a/test/lp_test.cc
+++ b/test/lp_test.cc
@@ -2,7 +2,7 @@
*
* This file is a part of LEMON, a generic C++ optimization library.
*
- * Copyright (C) 2003-2008
+ * Copyright (C) 2003-2009
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
*
@@ -365,7 +365,7 @@
void cloneTest()
{
//Test for clone/new
-
+
LP* lp = new LP();
LP* lpnew = lp->newSolver();
LP* lpclone = lp->cloneSolver();
@@ -393,6 +393,7 @@
CplexLp lp_cplex1,lp_cplex2;
lpTest(lp_cplex1);
aTest(lp_cplex2);
+ cloneTest<CplexLp>();
} catch (CplexEnv::LicenseError& error) {
#ifdef LEMON_FORCE_CPLEX_CHECK
check(false, error.what());
@@ -401,7 +402,6 @@
std::cerr << "Cplex license check failed, lp check skipped" << std::endl;
#endif
}
- cloneTest<CplexLp>();
#endif
#ifdef HAVE_SOPLEX
diff --git a/test/mip_test.cc b/test/mip_test.cc
--- a/test/mip_test.cc
+++ b/test/mip_test.cc
@@ -2,7 +2,7 @@
*
* This file is a part of LEMON, a generic C++ optimization library.
*
- * Copyright (C) 2003-2008
+ * Copyright (C) 2003-2009
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
* (Egervary Research Group on Combinatorial Optimization, EGRES).
*
@@ -109,7 +109,7 @@
template<class MIP>
void cloneTest()
{
-
+
MIP* mip = new MIP();
MIP* mipnew = mip->newSolver();
MIP* mipclone = mip->cloneSolver();
@@ -133,6 +133,7 @@
try {
CplexMip mip2;
aTest(mip2);
+ cloneTest<CplexMip>();
} catch (CplexEnv::LicenseError& error) {
#ifdef LEMON_FORCE_CPLEX_CHECK
check(false, error.what());
@@ -141,7 +142,6 @@
std::cerr << "Cplex license check failed, lp check skipped" << std::endl;
#endif
}
- cloneTest<CplexMip>();
#endif
return 0;
More information about the Lemon-commits
mailing list