1.1 --- a/lemon/cplex.h Mon Jan 12 23:11:39 2009 +0100
1.2 +++ b/lemon/cplex.h Thu Nov 05 15:48:01 2009 +0100
1.3 @@ -2,7 +2,7 @@
1.4 *
1.5 * This file is a part of LEMON, a generic C++ optimization library.
1.6 *
1.7 - * Copyright (C) 2003-2008
1.8 + * Copyright (C) 2003-2009
1.9 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
1.10 * (Egervary Research Group on Combinatorial Optimization, EGRES).
1.11 *
1.12 @@ -78,7 +78,7 @@
1.13 /// \brief Base interface for the CPLEX LP and MIP solver
1.14 ///
1.15 /// This class implements the common interface of the CPLEX LP and
1.16 - /// MIP solvers.
1.17 + /// MIP solvers.
1.18 /// \ingroup lp_group
1.19 class CplexBase : virtual public LpBase {
1.20 protected:
1.21 @@ -93,6 +93,7 @@
1.22
1.23 virtual int _addCol();
1.24 virtual int _addRow();
1.25 + virtual int _addRow(Value l, ExprIterator b, ExprIterator e, Value u);
1.26
1.27 virtual void _eraseCol(int i);
1.28 virtual void _eraseRow(int i);
1.29 @@ -144,14 +145,29 @@
1.30
1.31 virtual void _clear();
1.32
1.33 + virtual void _messageLevel(MessageLevel level);
1.34 + void _applyMessageLevel();
1.35 +
1.36 + bool _message_enabled;
1.37 +
1.38 public:
1.39
1.40 /// Returns the used \c CplexEnv instance
1.41 const CplexEnv& env() const { return _env; }
1.42 +
1.43 + /// \brief Returns the const cpxenv pointer
1.44 ///
1.45 + /// \note The cpxenv might be destructed with the solver.
1.46 const cpxenv* cplexEnv() const { return _env.cplexEnv(); }
1.47
1.48 + /// \brief Returns the const cpxenv pointer
1.49 + ///
1.50 + /// \note The cpxenv might be destructed with the solver.
1.51 + cpxenv* cplexEnv() { return _env.cplexEnv(); }
1.52 +
1.53 + /// Returns the cplex problem object
1.54 cpxlp* cplexLp() { return _prob; }
1.55 + /// Returns the cplex problem object
1.56 const cpxlp* cplexLp() const { return _prob; }
1.57
1.58 };
1.59 @@ -160,7 +176,7 @@
1.60 ///
1.61 /// This class implements an interface for the CPLEX LP solver.
1.62 ///\ingroup lp_group
1.63 - class CplexLp : public CplexBase, public LpSolver {
1.64 + class CplexLp : public LpSolver, public CplexBase {
1.65 public:
1.66 /// \e
1.67 CplexLp();
1.68 @@ -171,6 +187,11 @@
1.69 /// \e
1.70 virtual ~CplexLp();
1.71
1.72 + /// \e
1.73 + virtual CplexLp* cloneSolver() const;
1.74 + /// \e
1.75 + virtual CplexLp* newSolver() const;
1.76 +
1.77 private:
1.78
1.79 // these values cannot retrieved element by element
1.80 @@ -186,9 +207,6 @@
1.81
1.82 protected:
1.83
1.84 - virtual CplexLp* _cloneSolver() const;
1.85 - virtual CplexLp* _newSolver() const;
1.86 -
1.87 virtual const char* _solverName() const;
1.88
1.89 virtual SolveExitStatus _solve();
1.90 @@ -222,7 +240,7 @@
1.91 ///
1.92 /// This class implements an interface for the CPLEX MIP solver.
1.93 ///\ingroup lp_group
1.94 - class CplexMip : public CplexBase, public MipSolver {
1.95 + class CplexMip : public MipSolver, public CplexBase {
1.96 public:
1.97 /// \e
1.98 CplexMip();
1.99 @@ -233,10 +251,13 @@
1.100 /// \e
1.101 virtual ~CplexMip();
1.102
1.103 + /// \e
1.104 + virtual CplexMip* cloneSolver() const;
1.105 + /// \e
1.106 + virtual CplexMip* newSolver() const;
1.107 +
1.108 protected:
1.109
1.110 - virtual CplexMip* _cloneSolver() const;
1.111 - virtual CplexMip* _newSolver() const;
1.112
1.113 virtual const char* _solverName() const;
1.114