- Increased max. number of iteration
- Better tests.
3 * This file is a part of LEMON, a generic C++ optimization library
5 * Copyright (C) 2003-2006
6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
7 * (Egervary Research Group on Combinatorial Optimization, EGRES).
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.
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
19 #ifndef LEMON_LP_SKELETON
20 #define LEMON_LP_SKELETON
22 #include <lemon/lp_base.h>
25 ///\brief A skeleton file to implement LP solver interfaces
28 ///A skeleton class to implement LP solver interfaces
29 class LpSkeleton :public LpSolverBase {
34 virtual LpSolverBase &_newLp();
36 virtual LpSolverBase &_copyLp();
38 virtual int _addCol();
40 virtual int _addRow();
42 virtual void _eraseCol(int i);
44 virtual void _eraseRow(int i);
46 virtual void _getColName(int col, std::string & name);
48 virtual void _setColName(int col, const std::string & name);
52 /// \warning Arrays are indexed from 1 (datum at index 0 is ignored)
54 virtual void _setRowCoeffs(int i,
57 Value const * values );
60 /// \warning Arrays are indexed from 1 (datum at index 0 is ignored)
62 virtual void _setColCoeffs(int i,
65 Value const * values );
67 /// Set one element of the coefficient matrix
68 virtual void _setCoeff(int row, int col, Value value);
70 /// The lower bound of a variable (column) have to be given by an
71 /// extended number of type Value, i.e. a finite number of type
72 /// Value or -\ref INF.
73 virtual void _setColLowerBound(int i, Value value);
76 /// The upper bound of a variable (column) have to be given by an
77 /// extended number of type Value, i.e. a finite number of type
78 /// Value or \ref INF.
79 virtual void _setColUpperBound(int i, Value value);
82 // /// The lower bound of a linear expression (row) have to be given by an
83 // /// extended number of type Value, i.e. a finite number of type
84 // /// Value or -\ref INF.
85 // virtual void _setRowLowerBound(int i, Value value);
88 // /// The upper bound of a linear expression (row) have to be given by an
89 // /// extended number of type Value, i.e. a finite number of type
90 // /// Value or \ref INF.
91 // virtual void _setRowUpperBound(int i, Value value);
93 /// The lower and upper bound of a linear expression (row) have to be
95 /// extended number of type Value, i.e. a finite number of type
96 /// Value or +/-\ref INF.
97 virtual void _setRowBounds(int i, Value lb, Value ub);
102 virtual void _clearObj();
104 virtual void _setObjCoeff(int i, Value obj_coef);
108 ///\bug Wrong interface
110 virtual SolveExitStatus _solve();
114 ///\bug Wrong interface
116 virtual Value _getPrimal(int i);
120 ///\bug Wrong interface
122 virtual Value _getDual(int i);
126 ///\bug Wrong interface
128 virtual Value _getPrimalValue();
132 ///\bug Wrong interface
134 virtual SolutionStatus _getPrimalStatus();
137 virtual SolutionStatus _getDualStatus();
141 virtual ProblemTypes _getProblemType();
144 virtual void _setMax();
146 virtual void _setMin();
149 virtual bool _isBasicCol(int i);
154 LpSkeleton() : LpSolverBase(), col_num(0), row_num(0) {}
159 #endif // LEMON_LP_SKELETON