2 * lemon/lp_skeleton.h - Part of LEMON, a generic C++ optimization library
4 * Copyright (C) 2006 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
5 * (Egervary Research Group on Combinatorial Optimization, EGRES).
7 * Permission to use, modify and distribute this software is granted
8 * provided that this copyright notice appears in all copies. For
9 * precise terms see the accompanying LICENSE file.
11 * This software is provided "AS IS" with no warranty of any kind,
12 * express or implied, and with no claim as to its suitability for any
17 #ifndef LEMON_LP_SKELETON
18 #define LEMON_LP_SKELETON
20 #include <lemon/lp_base.h>
23 ///\brief A skeleton file to implement LP solver interfaces
26 ///A skeleton class to implement LP solver interfaces
27 class LpSkeleton :public LpSolverBase {
32 virtual LpSolverBase &_newLp();
34 virtual LpSolverBase &_copyLp();
36 virtual int _addCol();
38 virtual int _addRow();
40 virtual void _eraseCol(int i);
42 virtual void _eraseRow(int i);
44 virtual void _getColName(int col, std::string & name);
46 virtual void _setColName(int col, const std::string & name);
50 /// \warning Arrays are indexed from 1 (datum at index 0 is ignored)
52 virtual void _setRowCoeffs(int i,
55 Value const * values );
58 /// \warning Arrays are indexed from 1 (datum at index 0 is ignored)
60 virtual void _setColCoeffs(int i,
63 Value const * values );
65 /// Set one element of the coefficient matrix
66 virtual void _setCoeff(int row, int col, Value value);
68 /// The lower bound of a variable (column) have to be given by an
69 /// extended number of type Value, i.e. a finite number of type
70 /// Value or -\ref INF.
71 virtual void _setColLowerBound(int i, Value value);
74 /// The upper bound of a variable (column) have to be given by an
75 /// extended number of type Value, i.e. a finite number of type
76 /// Value or \ref INF.
77 virtual void _setColUpperBound(int i, Value value);
80 // /// The lower bound of a linear expression (row) have to be given by an
81 // /// extended number of type Value, i.e. a finite number of type
82 // /// Value or -\ref INF.
83 // virtual void _setRowLowerBound(int i, Value value);
86 // /// The upper bound of a linear expression (row) have to be given by an
87 // /// extended number of type Value, i.e. a finite number of type
88 // /// Value or \ref INF.
89 // virtual void _setRowUpperBound(int i, Value value);
91 /// The lower and upper bound of a linear expression (row) have to be
93 /// extended number of type Value, i.e. a finite number of type
94 /// Value or +/-\ref INF.
95 virtual void _setRowBounds(int i, Value lb, Value ub);
100 virtual void _clearObj();
102 virtual void _setObjCoeff(int i, Value obj_coef);
106 ///\bug Wrong interface
108 virtual SolveExitStatus _solve();
112 ///\bug Wrong interface
114 virtual Value _getPrimal(int i);
118 ///\bug Wrong interface
120 virtual Value _getDual(int i);
124 ///\bug Wrong interface
126 virtual Value _getPrimalValue();
130 ///\bug Wrong interface
132 virtual SolutionStatus _getPrimalStatus();
135 virtual SolutionStatus _getDualStatus();
139 virtual ProblemTypes _getProblemType();
142 virtual void _setMax();
144 virtual void _setMin();
147 virtual bool _isBasicCol(int i);
152 LpSkeleton() : LpSolverBase(), col_num(0), row_num(0) {}
157 #endif // LEMON_LP_SKELETON