COIN-OR::LEMON - Graph Library

source: lemon-0.x/lemon/lp_skeleton.h @ 2363:2aabce558574

Last change on this file since 2363:2aabce558574 was 2363:2aabce558574, checked in by Balazs Dezso, 13 years ago

Changes on the LP interface

_FixId => LpId?

  • handling of not common ids soplex

LpGlpk? row and col erase bug fix

  • calling lpx_std_basis before simplex

LpSoplex?

  • added getter functions
  • better m4 file
  • integration to the tests
  • better handling of unsolved lps
File size: 4.5 KB
Line 
1/* -*- C++ -*-
2 *
3 * This file is a part of LEMON, a generic C++ optimization library
4 *
5 * Copyright (C) 2003-2006
6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
7 * (Egervary Research Group on Combinatorial Optimization, EGRES).
8 *
9 * Permission to use, modify and distribute this software is granted
10 * provided that this copyright notice appears in all copies. For
11 * precise terms see the accompanying LICENSE file.
12 *
13 * This software is provided "AS IS" with no warranty of any kind,
14 * express or implied, and with no claim as to its suitability for any
15 * purpose.
16 *
17 */
18
19#ifndef LEMON_LP_SKELETON
20#define LEMON_LP_SKELETON
21
22#include <lemon/lp_base.h>
23
24///\file
25///\brief A skeleton file to implement LP solver interfaces
26namespace lemon {
27
28  ///A skeleton class to implement LP solver interfaces
29  class LpSkeleton :public LpSolverBase {
30    int col_num,row_num;
31   
32  protected:
33
34    ///\e
35    virtual LpSolverBase &_newLp();
36    ///\e
37    virtual LpSolverBase &_copyLp();
38    /// \e
39    virtual int _addCol();
40    /// \e
41    virtual int _addRow();
42    /// \e
43    virtual void _eraseCol(int i);
44    /// \e
45    virtual void _eraseRow(int i);
46    /// \e
47    virtual void _getColName(int col, std::string & name);
48    /// \e
49    virtual void _setColName(int col, const std::string & name);
50
51    /// \e
52    virtual void _setRowCoeffs(int i, LpRowIterator b, LpRowIterator e);
53    /// \e
54    virtual void _setColCoeffs(int i, LpColIterator b, LpColIterator e);
55   
56    /// Set one element of the coefficient matrix
57    virtual void _setCoeff(int row, int col, Value value);
58
59    /// Get one element of the coefficient matrix
60    virtual Value _getCoeff(int row, int col);
61
62    /// The lower bound of a variable (column) have to be given by an
63    /// extended number of type Value, i.e. a finite number of type
64    /// Value or -\ref INF.
65    virtual void _setColLowerBound(int i, Value value);
66    /// \e
67
68    /// The lower bound of a variable (column) is an
69    /// extended number of type Value, i.e. a finite number of type
70    /// Value or -\ref INF.
71    virtual Value _getColLowerBound(int i);
72
73    /// The upper bound of a variable (column) have to be given by an
74    /// extended number of type Value, i.e. a finite number of type
75    /// Value or \ref INF.
76    virtual void _setColUpperBound(int i, Value value);
77    /// \e
78
79    /// The upper bound of a variable (column) is an
80    /// extended number of type Value, i.e. a finite number of type
81    /// Value or \ref INF.
82    virtual Value _getColUpperBound(int i);
83
84//     /// The lower bound of a linear expression (row) have to be given by an
85//     /// extended number of type Value, i.e. a finite number of type
86//     /// Value or -\ref INF.
87//     virtual void _setRowLowerBound(int i, Value value);
88//     /// \e
89
90//     /// The upper bound of a linear expression (row) have to be given by an
91//     /// extended number of type Value, i.e. a finite number of type
92//     /// Value or \ref INF.
93//     virtual void _setRowUpperBound(int i, Value value);
94
95    /// The lower and upper bound of a linear expression (row) have to be
96    /// given by an
97    /// extended number of type Value, i.e. a finite number of type
98    /// Value or +/-\ref INF.
99    virtual void _setRowBounds(int i, Value lb, Value ub);
100    /// \e
101
102
103    /// The lower and the upper bound of
104    /// a constraint (row) are 
105    /// extended numbers of type Value, i.e.  finite numbers of type
106    /// Value, -\ref INF or \ref INF.
107    virtual void _getRowBounds(int i, Value &lb, Value &ub);
108    /// \e
109
110
111    /// \e
112    virtual void _clearObj();
113    /// \e
114    virtual void _setObjCoeff(int i, Value obj_coef);
115
116    /// \e
117    virtual Value _getObjCoeff(int i);
118
119    ///\e
120   
121    ///\bug Wrong interface
122    ///
123    virtual SolveExitStatus _solve();
124
125    ///\e
126
127    ///\bug Wrong interface
128    ///
129    virtual Value _getPrimal(int i);
130
131    ///\e
132
133    ///\bug Wrong interface
134    ///
135    virtual Value _getDual(int i);
136
137    ///\e
138
139    ///\bug Wrong interface
140    ///
141    virtual Value _getPrimalValue();
142
143    ///\e
144
145    ///\bug Wrong interface
146    ///
147    virtual SolutionStatus _getPrimalStatus();
148
149    ////e
150    virtual SolutionStatus _getDualStatus();
151
152
153    ///\e
154    virtual ProblemTypes _getProblemType();
155
156    ///\e
157    virtual void _setMax();
158    ///\e
159    virtual void _setMin();
160
161    ///\e
162    virtual bool _isMax();
163
164
165
166    ///\e
167    virtual bool _isBasicCol(int i);
168
169   
170
171  public:
172    LpSkeleton() : LpSolverBase(), col_num(0), row_num(0) {}
173  }; 
174
175} //namespace lemon
176
177#endif // LEMON_LP_SKELETON
Note: See TracBrowser for help on using the repository browser.