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(); } 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(); #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 void cloneTest() { - + MIP* mip = new MIP(); MIP* mipnew = mip->newSolver(); MIP* mipclone = mip->cloneSolver(); @@ -133,6 +133,7 @@ try { CplexMip mip2; aTest(mip2); + cloneTest(); } 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(); #endif return 0;