Changeset 482:ed54c0d13df0 in lemon for lemon/lp_skeleton.h
 Timestamp:
 12/02/08 22:48:28 (11 years ago)
 Branch:
 default
 Children:
 483:76ec7bd57026, 547:17cabb114d52
 Phase:
 public
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

lemon/lp_skeleton.h
r481 r482 27 27 28 28 ///A skeleton class to implement LP solver interfaces 29 class LpSkeleton :public LpSolverBase {29 class SkeletonSolverBase : public virtual LpBase { 30 30 int col_num,row_num; 31 31 32 32 protected: 33 33 34 ///\e 35 virtual LpSolverBase* _newLp(); 36 ///\e 37 virtual LpSolverBase* _copyLp(); 34 SkeletonSolverBase() 35 : col_num(1), row_num(1) {} 36 38 37 /// \e 39 38 virtual int _addCol(); … … 44 43 /// \e 45 44 virtual void _eraseRow(int i); 46 /// \e 47 virtual void _getColName(int col, std::string & name) const; 48 /// \e 49 virtual void _setColName(int col, const std::string & name); 45 46 /// \e 47 virtual void _getColName(int col, std::string& name) const; 48 /// \e 49 virtual void _setColName(int col, const std::string& name); 50 50 /// \e 51 51 virtual int _colByName(const std::string& name) const; 52 52 53 53 /// \e 54 virtual void _setRowCoeffs(int i, ConstRowIterator b, ConstRowIterator e); 55 /// \e 56 virtual void _getRowCoeffs(int i, RowIterator b) const; 57 /// \e 58 virtual void _setColCoeffs(int i, ConstColIterator b, ConstColIterator e); 59 /// \e 60 virtual void _getColCoeffs(int i, ColIterator b) const; 54 virtual void _getRowName(int row, std::string& name) const; 55 /// \e 56 virtual void _setRowName(int row, const std::string& name); 57 /// \e 58 virtual int _rowByName(const std::string& name) const; 59 60 /// \e 61 virtual void _setRowCoeffs(int i, ExprIterator b, ExprIterator e); 62 /// \e 63 virtual void _getRowCoeffs(int i, InsertIterator b) const; 64 /// \e 65 virtual void _setColCoeffs(int i, ExprIterator b, ExprIterator e); 66 /// \e 67 virtual void _getColCoeffs(int i, InsertIterator b) const; 61 68 62 69 /// Set one element of the coefficient matrix … … 88 95 virtual Value _getColUpperBound(int i) const; 89 96 90 // /// The lower 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 _setRowLowerBound(int i, Value value); 94 // /// \e 95 96 // /// The upper bound of a linear expression (row) have to be given by an 97 // /// extended number of type Value, i.e. a finite number of type 98 // /// Value or \ref INF. 99 // virtual void _setRowUpperBound(int i, Value value); 100 101 /// The lower and upper bound of a linear expression (row) have to be 102 /// given by an 103 /// extended number of type Value, i.e. a finite number of type 104 /// Value or +/\ref INF. 105 virtual void _setRowBounds(int i, Value lb, Value ub); 106 /// \e 107 108 109 /// The lower and the upper bound of 110 /// a constraint (row) are 111 /// extended numbers of type Value, i.e. finite numbers of type 112 /// Value, \ref INF or \ref INF. 113 virtual void _getRowBounds(int i, Value &lb, Value &ub) const; 114 /// \e 115 116 117 /// \e 118 virtual void _clearObj(); 97 /// The lower bound of a constraint (row) have to be given by an 98 /// extended number of type Value, i.e. a finite number of type 99 /// Value or \ref INF. 100 virtual void _setRowLowerBound(int i, Value value); 101 /// \e 102 103 /// The lower bound of a constraint (row) is an 104 /// extended number of type Value, i.e. a finite number of type 105 /// Value or \ref INF. 106 virtual Value _getRowLowerBound(int i) const; 107 108 /// The upper bound of a constraint (row) have to be given by an 109 /// extended number of type Value, i.e. a finite number of type 110 /// Value or \ref INF. 111 virtual void _setRowUpperBound(int i, Value value); 112 /// \e 113 114 /// The upper bound of a constraint (row) is an 115 /// extended number of type Value, i.e. a finite number of type 116 /// Value or \ref INF. 117 virtual Value _getRowUpperBound(int i) const; 118 119 /// \e 120 virtual void _setObjCoeffs(ExprIterator b, ExprIterator e); 121 /// \e 122 virtual void _getObjCoeffs(InsertIterator b) const; 123 119 124 /// \e 120 125 virtual void _setObjCoeff(int i, Value obj_coef); 121 122 126 /// \e 123 127 virtual Value _getObjCoeff(int i) const; 124 128 125 129 ///\e 126 127 ///\bug Wrong interface 128 /// 130 virtual void _setSense(Sense); 131 ///\e 132 virtual Sense _getSense() const; 133 134 ///\e 135 virtual void _clear(); 136 137 }; 138 139 /// \brief Interface for a skeleton LP solver 140 /// 141 /// This class implements an interface for a skeleton LP solver. 142 ///\ingroup lp_group 143 class LpSkeleton : public SkeletonSolverBase, public LpSolver { 144 public: 145 LpSkeleton() : SkeletonSolverBase(), LpSolver() {} 146 147 protected: 148 149 ///\e 129 150 virtual SolveExitStatus _solve(); 130 151 131 152 ///\e 132 133 ///\bug Wrong interface134 ///135 153 virtual Value _getPrimal(int i) const; 136 137 ///\e 138 139 ///\bug Wrong interface 140 /// 154 ///\e 141 155 virtual Value _getDual(int i) const; 142 156 143 157 ///\e 144 145 ///\bug Wrong interface146 ///147 158 virtual Value _getPrimalValue() const; 148 159 149 160 ///\e 150 151 ///\bug Wrong interface 152 /// 153 virtual SolutionStatus _getPrimalStatus() const; 154 155 ////e 156 virtual SolutionStatus _getDualStatus() const; 157 158 159 ///\e 160 virtual ProblemTypes _getProblemType() const; 161 162 ///\e 163 virtual void _setMax(); 164 ///\e 165 virtual void _setMin(); 166 167 ///\e 168 virtual bool _isMax() const; 169 170 171 172 ///\e 173 virtual bool _isBasicCol(int i) const; 174 175 176 161 virtual Value _getPrimalRay(int i) const; 162 ///\e 163 virtual Value _getDualRay(int i) const; 164 165 ///\e 166 virtual ProblemType _getPrimalType() const; 167 ///\e 168 virtual ProblemType _getDualType() const; 169 170 ///\e 171 virtual VarStatus _getColStatus(int i) const; 172 ///\e 173 virtual VarStatus _getRowStatus(int i) const; 174 175 ///\e 176 virtual LpSkeleton* _newSolver() const; 177 ///\e 178 virtual LpSkeleton* _cloneSolver() const; 179 ///\e 180 virtual const char* _solverName() const; 181 182 }; 183 184 /// \brief Interface for a skeleton MIP solver 185 /// 186 /// This class implements an interface for a skeleton MIP solver. 187 ///\ingroup lp_group 188 class MipSkeleton : public SkeletonSolverBase, public MipSolver { 177 189 public: 178 LpSkeleton() : LpSolverBase(), col_num(0), row_num(0) {} 190 MipSkeleton() : SkeletonSolverBase(), MipSolver() {} 191 192 protected: 193 ///\e 194 195 ///\bug Wrong interface 196 /// 197 virtual SolveExitStatus _solve(); 198 199 ///\e 200 201 ///\bug Wrong interface 202 /// 203 virtual Value _getSol(int i) const; 204 205 ///\e 206 207 ///\bug Wrong interface 208 /// 209 virtual Value _getSolValue() const; 210 211 ///\e 212 213 ///\bug Wrong interface 214 /// 215 virtual ProblemType _getType() const; 216 217 ///\e 218 virtual MipSkeleton* _newSolver() const; 219 220 ///\e 221 virtual MipSkeleton* _cloneSolver() const; 222 ///\e 223 virtual const char* _solverName() const; 224 179 225 }; 180 226
Note: See TracChangeset
for help on using the changeset viewer.