Changeset 1048:38a49245a701 in lemon-0.x for src/work/marci
- Timestamp:
- 01/04/05 18:54:41 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1442
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/marci/lp/lp_solver_wrapper_2.h
r1031 r1048 160 160 /*! \e 161 161 */ 162 template <typename _Value> 162 163 class LPSolverBase { 163 164 public: 165 /// \e 166 typedef _Value Value; 164 167 /// \e 165 168 typedef IterablePartition<int>::ClassIt RowIt; … … 192 195 /// temporally, glpk style indexing 193 196 virtual void setRowCoeffs(RowIt row_it, int num, 194 int* indices, double* doubles) = 0;195 //pair<RowIt, double>-bol kell megadni egy std range-et197 int* indices, _Value* doubles) = 0; 198 //pair<RowIt, _Value>-bol kell megadni egy std range-et 196 199 /// \e 197 200 template <typename Begin, typename End> … … 199 202 int mem_length=1+colNum(); 200 203 int* indices = new int[mem_length]; 201 double* doubles = new double[mem_length];204 _Value* doubles = new _Value[mem_length]; 202 205 int length=0; 203 206 for ( ; begin!=end; ++begin) { … … 212 215 /// temporally, glpk style indexing 213 216 virtual void setColCoeffs(ColIt col_it, int num, 214 int* indices, double* doubles) = 0;215 //pair<ColIt, double>-bol kell megadni egy std range-et217 int* indices, _Value* doubles) = 0; 218 //pair<ColIt, _Value>-bol kell megadni egy std range-et 216 219 /// \e 217 220 template <typename Begin, typename End> … … 219 222 int mem_length=1+rowNum(); 220 223 int* indices = new int[mem_length]; 221 double* doubles = new double[mem_length];224 _Value* doubles = new _Value[mem_length]; 222 225 int length=0; 223 226 for ( ; begin!=end; ++begin) { … … 236 239 /// \e 237 240 virtual void setColBounds(const ColIt& col_it, int bound_type, 238 double lo, double up) =0;239 /// \e 240 virtual double getObjCoef(const ColIt& col_it) = 0;241 _Value lo, _Value up) =0; 242 /// \e 243 virtual _Value getObjCoef(const ColIt& col_it) = 0; 241 244 /// \e 242 245 virtual void setRowBounds(const RowIt& row_it, int bound_type, 243 double lo, double up) = 0;244 /// \e 245 virtual void setObjCoef(const ColIt& col_it, double obj_coef) = 0;246 _Value lo, _Value up) = 0; 247 /// \e 248 virtual void setObjCoef(const ColIt& col_it, _Value obj_coef) = 0; 246 249 /// \e 247 250 virtual void solveSimplex() = 0; … … 251 254 virtual void solveDualSimplex() = 0; 252 255 /// \e 253 virtual double getPrimal(const ColIt& col_it) = 0;254 /// \e 255 virtual double getObjVal() = 0;256 virtual _Value getPrimal(const ColIt& col_it) = 0; 257 /// \e 258 virtual _Value getObjVal() = 0; 256 259 /// \e 257 260 virtual int rowNum() const = 0; … … 280 283 }; 281 284 285 282 286 /// \brief Wrappers for LP solvers 283 287 /// … … 287 291 /// solvers, i.e. it makes possible to write algorithms using LP's, 288 292 /// in which the solver can be changed to an other one easily. 289 class LPSolverWrapper : public LPSolverBase {290 public: 291 typedef LPSolverBase Parent;293 class LPSolverWrapper : public LPSolverBase<double> { 294 public: 295 typedef LPSolverBase<double> Parent; 292 296 293 297 // class Row { … … 324 328 public: 325 329 /// \e 326 LPSolverWrapper() : LPSolverBase(),330 LPSolverWrapper() : Parent(), 327 331 lp(lpx_create_prob()) { 328 332 lpx_set_int_parm(lp, LPX_K_DUAL, 1);
Note: See TracChangeset
for help on using the changeset viewer.