Changeset 1293:8ede2a6b2594 in lemon-0.x for src/work/athos/lp
- Timestamp:
- 04/01/05 21:50:29 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1726
- Location:
- src/work/athos/lp
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/athos/lp/lp_base.h
r1291 r1293 106 106 107 107 ///\e 108 enum SolutionXXXType { 109 ///\e 110 INFEASIBLE = 0, 111 ///\e 112 UNBOUNDED = 1, 113 ///\e 114 OPTIMAL = 2, 115 ///\e 116 FEASIBLE = 3 108 enum SolutionStatus { 109 ///\e 110 SOLVED = 0, 111 ///\e 112 UNSOLVED = 1 117 113 }; 118 114 … … 120 116 enum SolutionType { 121 117 ///\e 122 INFEASIBLE= 0,123 ///\e 124 UNDEFINED= 1,125 ///\e 126 OPTIMAL= 2,127 ///\e 128 FEASIBLE= 3118 UNDEFINED = 0, 119 ///\e 120 INFEASIBLE = 1, 121 ///\e 122 FEASIBLE = 2, 123 ///\e 124 OPTIMAL = 3 129 125 }; 130 126 … … 419 415 ///\bug Wrong interface 420 416 /// 421 virtual Solution XXXType_solve() = 0;417 virtual SolutionStatus _solve() = 0; 422 418 423 419 ///\e … … 425 421 ///\bug Wrong interface 426 422 /// 427 virtual Value _get Solution(int i) = 0;423 virtual Value _getPrimal(int i) = 0; 428 424 ///\e 429 425 … … 576 572 /// Set the lower bound of a column (i.e a variable) 577 573 578 /// The upper bound of a variable (column) ha veto be given by an574 /// The upper bound of a variable (column) has to be given by an 579 575 /// extended number of type Value, i.e. a finite number of type 580 576 /// Value or -\ref INF. 581 void setColLowerBound(Col c, Value value) {577 void colLowerBound(Col c, Value value) { 582 578 _setColLowerBound(cols.floatingId(c.id),value); 583 579 } 584 580 /// Set the upper bound of a column (i.e a variable) 585 581 586 /// The upper bound of a variable (column) ha veto be given by an582 /// The upper bound of a variable (column) has to be given by an 587 583 /// extended number of type Value, i.e. a finite number of type 588 584 /// Value or \ref INF. 589 void setColUpperBound(Col c, Value value) {585 void colUpperBound(Col c, Value value) { 590 586 _setColUpperBound(cols.floatingId(c.id),value); 591 587 }; 588 /// Set the lower and the upper bounds of a column (i.e a variable) 589 590 /// The lower and the upper bounds of 591 /// a variable (column) have to be given by an 592 /// extended number of type Value, i.e. a finite number of type 593 /// Value, -\ref INF or \ref INF. 594 void colBounds(Col c, Value lower, Value upper) { 595 _setColLowerBound(cols.floatingId(c.id),lower); 596 _setColUpperBound(cols.floatingId(c.id),upper); 597 } 598 592 599 /// Set the lower bound of a row (i.e a constraint) 593 600 594 /// The lower bound of a linear expression (row) ha veto be given by an601 /// The lower bound of a linear expression (row) has to be given by an 595 602 /// extended number of type Value, i.e. a finite number of type 596 603 /// Value or -\ref INF. 597 void setRowLowerBound(Row r, Value value) {604 void rowLowerBound(Row r, Value value) { 598 605 _setRowLowerBound(rows.floatingId(r.id),value); 599 606 }; 600 607 /// Set the upper bound of a row (i.e a constraint) 601 608 602 /// The upper bound of a linear expression (row) ha veto be given by an609 /// The upper bound of a linear expression (row) has to be given by an 603 610 /// extended number of type Value, i.e. a finite number of type 604 611 /// Value or \ref INF. 605 void setRowUpperBound(Row r, Value value) {612 void rowUpperBound(Row r, Value value) { 606 613 _setRowUpperBound(rows.floatingId(r.id),value); 607 614 }; 615 /// Set the lower and the upper bounds of a row (i.e a variable) 616 617 /// The lower and the upper bounds of 618 /// a constraint (row) have to be given by an 619 /// extended number of type Value, i.e. a finite number of type 620 /// Value, -\ref INF or \ref INF. 621 void rowBounds(Row c, Value lower, Value upper) { 622 _setRowLowerBound(rows.floatingId(c.id),lower); 623 _setRowUpperBound(rows.floatingId(c.id),upper); 624 } 625 608 626 ///Set an element of the objective function 609 void setObjCoeff(Col c, Value v) {_setObjCoeff(cols.floatingId(c.id),v); };627 void objCoeff(Col c, Value v) {_setObjCoeff(cols.floatingId(c.id),v); }; 610 628 ///Set the objective function 611 629 … … 615 633 clearObj(); 616 634 for (Expr::iterator i=e.begin(); i!=e.end(); ++i) 617 setObjCoeff((*i).first,(*i).second);635 objCoeff((*i).first,(*i).second); 618 636 } 619 637 … … 626 644 627 645 ///\e 628 Solution Typesolve() { return _solve(); }646 SolutionStatus solve() { return _solve(); } 629 647 630 648 ///@} … … 635 653 636 654 ///\e 637 Value solution(Col c) { return _getSolution(cols.floatingId(c.id)); }655 Value primal(Col c) { return _getPrimal(cols.floatingId(c.id)); } 638 656 639 657 ///@} -
src/work/athos/lp/lp_glpk.cc
r1263 r1293 239 239 240 240 241 LpGlpk::Solution TypeLpGlpk::_solve()241 LpGlpk::SolutionStatus LpGlpk::_solve() 242 242 { 243 return OPTIMAL;243 return SOLVED; 244 244 } 245 245 246 LpGlpk::Value LpGlpk::_get Solution(int i)246 LpGlpk::Value LpGlpk::_getPrimal(int i) 247 247 { 248 248 return 0; -
src/work/athos/lp/lp_glpk.h
r1263 r1293 71 71 ///\bug Unimplemented 72 72 /// 73 virtual Solution Type_solve();73 virtual SolutionStatus _solve(); 74 74 ///\e 75 75 76 76 ///\bug Unimplemented 77 77 /// 78 virtual Value _get Solution(int i);78 virtual Value _getPrimal(int i); 79 79 80 80 }; -
src/work/athos/lp/lp_solver_skeleton.cc
r1273 r1293 66 66 } 67 67 68 LpSolverSkeleton::Solution TypeLpSolverSkeleton::_solve()68 LpSolverSkeleton::SolutionStatus LpSolverSkeleton::_solve() 69 69 { 70 return OPTIMAL;70 return SOLVED; 71 71 } 72 72 73 LpSolverSkeleton::Value LpSolverSkeleton::_get Solution(int i)73 LpSolverSkeleton::Value LpSolverSkeleton::_getPrimal(int i) 74 74 { 75 75 return 0; -
src/work/athos/lp/lp_solver_skeleton.h
r1273 r1293 45 45 virtual void _setRowUpperBound(int i, Value value); 46 46 virtual void _setObjCoeff(int i, Value obj_coef); 47 virtual Solution Type_solve();48 virtual Value _get Solution(int i);47 virtual SolutionStatus _solve(); 48 virtual Value _getPrimal(int i); 49 49 public: 50 50 LpSolverSkeleton() : LpSolverBase(), col_num(0), row_num(0) {} -
src/work/athos/lp/lp_test.cc
r1273 r1293 144 144 145 145 for(EdgeIt e(g);e!=INVALID;++e) { 146 lp. setColUpperBound(x[e],cap[e]);147 lp. setColLowerBound(x[e],0);146 lp.colUpperBound(x[e],cap[e]); 147 lp.colLowerBound(x[e],0); 148 148 } 149 149
Note: See TracChangeset
for help on using the changeset viewer.