deba@2313
|
1 |
/* -*- C++ -*-
|
deba@2313
|
2 |
*
|
deba@2313
|
3 |
* This file is a part of LEMON, a generic C++ optimization library
|
deba@2313
|
4 |
*
|
deba@2313
|
5 |
* Copyright (C) 2003-2006
|
deba@2313
|
6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
|
deba@2313
|
7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES).
|
deba@2313
|
8 |
*
|
deba@2313
|
9 |
* Permission to use, modify and distribute this software is granted
|
deba@2313
|
10 |
* provided that this copyright notice appears in all copies. For
|
deba@2313
|
11 |
* precise terms see the accompanying LICENSE file.
|
deba@2313
|
12 |
*
|
deba@2313
|
13 |
* This software is provided "AS IS" with no warranty of any kind,
|
deba@2313
|
14 |
* express or implied, and with no claim as to its suitability for any
|
deba@2313
|
15 |
* purpose.
|
deba@2313
|
16 |
*
|
deba@2313
|
17 |
*/
|
deba@2313
|
18 |
|
deba@2313
|
19 |
#ifndef LEMON_LP_SOPLEX_H
|
deba@2313
|
20 |
#define LEMON_LP_SOPLEX_H
|
deba@2313
|
21 |
|
deba@2313
|
22 |
///\file
|
deba@2313
|
23 |
///\brief Header of the LEMON-SOPLEX lp solver interface.
|
deba@2313
|
24 |
|
deba@2313
|
25 |
#include <vector>
|
deba@2313
|
26 |
#include <string>
|
deba@2313
|
27 |
|
deba@2313
|
28 |
#include <lemon/lp_base.h>
|
deba@2313
|
29 |
|
deba@2313
|
30 |
// Forward declaration
|
deba@2313
|
31 |
namespace soplex {
|
deba@2313
|
32 |
class SoPlex;
|
deba@2313
|
33 |
}
|
deba@2313
|
34 |
|
deba@2313
|
35 |
namespace lemon {
|
deba@2313
|
36 |
|
deba@2313
|
37 |
/// \brief Interface for the SOPLEX solver
|
deba@2313
|
38 |
///
|
deba@2313
|
39 |
/// This class implements an interface for the SOPLEX LP solver.
|
deba@2313
|
40 |
class LpSoplex :virtual public LpSolverBase {
|
deba@2313
|
41 |
protected:
|
deba@2313
|
42 |
|
deba@2313
|
43 |
soplex::SoPlex* soplex;
|
deba@2313
|
44 |
|
deba@2313
|
45 |
std::vector<std::string> colNames;
|
deba@2313
|
46 |
|
deba@2313
|
47 |
std::vector<Value> primal;
|
deba@2313
|
48 |
std::vector<Value> dual;
|
deba@2313
|
49 |
|
deba@2313
|
50 |
|
deba@2313
|
51 |
public:
|
deba@2313
|
52 |
|
deba@2313
|
53 |
typedef LpSolverBase Parent;
|
deba@2313
|
54 |
|
deba@2313
|
55 |
|
deba@2313
|
56 |
/// \e
|
deba@2313
|
57 |
LpSoplex();
|
deba@2313
|
58 |
/// \e
|
deba@2313
|
59 |
~LpSoplex();
|
deba@2313
|
60 |
|
deba@2313
|
61 |
protected:
|
deba@2313
|
62 |
|
deba@2313
|
63 |
virtual LpSolverBase &_newLp();
|
deba@2313
|
64 |
virtual LpSolverBase &_copyLp();
|
deba@2313
|
65 |
|
deba@2313
|
66 |
virtual int _addCol();
|
deba@2313
|
67 |
virtual int _addRow();
|
deba@2313
|
68 |
virtual void _eraseCol(int i);
|
deba@2313
|
69 |
virtual void _eraseRow(int i);
|
deba@2313
|
70 |
virtual void _getColName(int col, std::string & name);
|
deba@2313
|
71 |
virtual void _setColName(int col, const std::string & name);
|
deba@2313
|
72 |
virtual void _setRowCoeffs(int i, LpRowIterator b, LpRowIterator e);
|
deba@2313
|
73 |
virtual void _setColCoeffs(int i, LpColIterator b, LpColIterator e);
|
deba@2313
|
74 |
virtual void _setCoeff(int row, int col, Value value);
|
deba@2313
|
75 |
virtual void _setColLowerBound(int i, Value value);
|
deba@2313
|
76 |
virtual void _setColUpperBound(int i, Value value);
|
deba@2313
|
77 |
virtual void _setRowBounds(int i, Value lower, Value upper);
|
deba@2313
|
78 |
virtual void _setObjCoeff(int i, Value obj_coef);
|
deba@2313
|
79 |
virtual void _clearObj();
|
deba@2313
|
80 |
|
deba@2313
|
81 |
virtual SolveExitStatus _solve();
|
deba@2313
|
82 |
virtual Value _getPrimal(int i);
|
deba@2313
|
83 |
virtual Value _getDual(int i);
|
deba@2313
|
84 |
virtual Value _getPrimalValue();
|
deba@2313
|
85 |
virtual bool _isBasicCol(int i);
|
deba@2313
|
86 |
|
deba@2313
|
87 |
virtual SolutionStatus _getPrimalStatus();
|
deba@2313
|
88 |
virtual SolutionStatus _getDualStatus();
|
deba@2313
|
89 |
virtual ProblemTypes _getProblemType();
|
deba@2313
|
90 |
|
deba@2313
|
91 |
|
deba@2313
|
92 |
virtual void _setMax();
|
deba@2313
|
93 |
virtual void _setMin();
|
deba@2313
|
94 |
|
deba@2313
|
95 |
};
|
deba@2313
|
96 |
} //END OF NAMESPACE LEMON
|
deba@2313
|
97 |
|
deba@2313
|
98 |
#endif //LEMON_LP_SOPLEX_H
|
deba@2313
|
99 |
|