Changeset 1112:b258584569f2 in lemon-0.x for src/work/marci/lp
- Timestamp:
- 02/01/05 16:26:47 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1511
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/marci/lp/lp_solver_base.h
r1111 r1112 178 178 solvers, i.e. it makes possible to write algorithms using LP's, 179 179 in which the solver can be changed to an other one easily. 180 \nosubgrouping 180 181 */ 181 182 template <typename _Value> 182 183 class LPSolverBase { 183 public: 184 185 /*! @name Unchategorized functions and types (public members) 186 */ 187 //@{ 188 public: 189 190 //UNCATEGORIZED 191 184 192 /// \e 185 193 typedef _Value Value; … … 206 214 /// \e 207 215 virtual ~LPSolverBase() { } 208 209 //MATRIX INDEPEDENT MANIPULATING FUNCTIONS 210 211 public: 216 //@} 217 218 /*! @name Medium level interface (public members) 219 These functions appear in the low level and also in the high level 220 interfaces thus these each of these functions have to be implemented 221 only once in the different interfaces. 222 This means that these functions have to be reimplemented for all of the 223 different lp solvers. These are basic functions, and have the same 224 parameter lists in the low and high level interfaces. 225 */ 226 //@{ 227 public: 228 229 //UNCATEGORIZED FUNCTIONS 230 212 231 /// \e 213 232 virtual void setMinimize() = 0; … … 215 234 virtual void setMaximize() = 0; 216 235 217 //LOW LEVEL INTERFACE, MATRIX MANIPULATING FUNCTIONS 218 236 //SOLVER FUNCTIONS 237 238 /// \e 239 virtual void solveSimplex() = 0; 240 /// \e 241 virtual void solvePrimalSimplex() = 0; 242 /// \e 243 virtual void solveDualSimplex() = 0; 244 /// \e 245 246 //SOLUTION RETRIEVING 247 248 /// \e 249 virtual _Value getObjVal() = 0; 250 251 //OTHER FUNCTIONS 252 253 /// \e 254 virtual int rowNum() const = 0; 255 /// \e 256 virtual int colNum() const = 0; 257 /// \e 258 virtual int warmUp() = 0; 259 /// \e 260 virtual void printWarmUpStatus(int i) = 0; 261 /// \e 262 virtual int getPrimalStatus() = 0; 263 /// \e 264 virtual void printPrimalStatus(int i) = 0; 265 /// \e 266 virtual int getDualStatus() = 0; 267 /// \e 268 virtual void printDualStatus(int i) = 0; 269 /// Returns the status of the slack variable assigned to row \c row_it. 270 virtual int getRowStat(const RowIt& row_it) = 0; 271 /// \e 272 virtual void printRowStatus(int i) = 0; 273 /// Returns the status of the variable assigned to column \c col_it. 274 virtual int getColStat(const ColIt& col_it) = 0; 275 /// \e 276 virtual void printColStatus(int i) = 0; 277 278 //@} 279 280 /*! @name Low level interface (protected members) 281 Problem manipulating functions in the low level interface 282 */ 283 //@{ 219 284 protected: 285 286 //MATRIX MANIPULATING FUNCTIONS 287 220 288 /// \e 221 289 virtual int _addCol() = 0; … … 280 348 /// \e 281 349 virtual _Value _getObjCoef(int i) = 0; 282 283 //LOW LEVEL, SOLUTION RETRIEVING FUNCTIONS 284 285 protected: 350 351 //SOLUTION RETRIEVING 352 286 353 /// \e 287 354 virtual _Value _getPrimal(int i) = 0; 288 289 //HIGH LEVEL INTERFACE, MATRIX MANIPULATING FUNTIONS 290 291 public: 355 //@} 356 357 /*! @name High level interface (public members) 358 Problem manipulating functions in the high level interface 359 */ 360 //@{ 361 public: 362 363 //MATRIX MANIPULATING FUNCTIONS 364 292 365 /// \e 293 366 ColIt addCol() { … … 403 476 } 404 477 405 //MOST HIGH LEVEL, USER FRIEND FUNCTIONS 478 //SOLUTION RETRIEVING FUNCTIONS 479 480 /// \e 481 _Value getPrimal(const ColIt& col_it) { 482 return _getPrimal(col_iter_map[col_it]); 483 } 484 485 //@} 486 487 /*! @name User friend interface 488 Problem manipulating functions in the user friend interface 489 */ 490 //@{ 491 492 //EXPRESSION TYPES 406 493 407 494 /// \e … … 409 496 /// \e 410 497 typedef Expr<RowIt, _Value> DualExpression; 498 499 //MATRIX MANIPULATING FUNCTIONS 500 411 501 /// \e 412 502 void setRowCoeffs(RowIt row_it, const Expression& expr) { … … 436 526 } 437 527 } 438 439 //SOLVER FUNCTIONS 440 441 /// \e 442 virtual void solveSimplex() = 0; 443 /// \e 444 virtual void solvePrimalSimplex() = 0; 445 /// \e 446 virtual void solveDualSimplex() = 0; 447 /// \e 448 449 //HIGH LEVEL, SOLUTION RETRIEVING FUNCTIONS 450 451 public: 452 453 /// \e 454 _Value getPrimal(const ColIt& col_it) { 455 return _getPrimal(col_iter_map[col_it]); 456 } 457 /// \e 458 virtual _Value getObjVal() = 0; 459 460 //OTHER FUNCTIONS 461 462 /// \e 463 virtual int rowNum() const = 0; 464 /// \e 465 virtual int colNum() const = 0; 466 /// \e 467 virtual int warmUp() = 0; 468 /// \e 469 virtual void printWarmUpStatus(int i) = 0; 470 /// \e 471 virtual int getPrimalStatus() = 0; 472 /// \e 473 virtual void printPrimalStatus(int i) = 0; 474 /// \e 475 virtual int getDualStatus() = 0; 476 /// \e 477 virtual void printDualStatus(int i) = 0; 478 /// Returns the status of the slack variable assigned to row \c row_it. 479 virtual int getRowStat(const RowIt& row_it) = 0; 480 /// \e 481 virtual void printRowStatus(int i) = 0; 482 /// Returns the status of the variable assigned to column \c col_it. 483 virtual int getColStat(const ColIt& col_it) = 0; 484 /// \e 485 virtual void printColStatus(int i) = 0; 528 //@} 486 529 }; 487 530
Note: See TracChangeset
for help on using the changeset viewer.