COIN-OR::LEMON - Graph Library

Changeset 1293:8ede2a6b2594 in lemon-0.x for src/work/athos/lp


Ignore:
Timestamp:
04/01/05 21:50:29 (20 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1726
Message:
  • Make lp stuff compilable
  • Some 'set's removed
Location:
src/work/athos/lp
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • src/work/athos/lp/lp_base.h

    r1291 r1293  
    106106
    107107    ///\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
    117113    };
    118114     
     
    120116    enum SolutionType {
    121117      ///\e
    122       INFEASIBLE = 0,
    123       ///\e
    124       UNDEFINED = 1,
    125       ///\e
    126       OPTIMAL = 2,
    127       ///\e
    128       FEASIBLE = 3
     118      UNDEFINED = 0,
     119      ///\e
     120      INFEASIBLE = 1,
     121      ///\e
     122      FEASIBLE = 2,
     123      ///\e
     124      OPTIMAL = 3
    129125    };
    130126     
     
    419415    ///\bug Wrong interface
    420416    ///
    421     virtual SolutionXXXType _solve() = 0;
     417    virtual SolutionStatus _solve() = 0;
    422418
    423419    ///\e
     
    425421    ///\bug Wrong interface
    426422    ///
    427     virtual Value _getSolution(int i) = 0;
     423    virtual Value _getPrimal(int i) = 0;
    428424    ///\e
    429425
     
    576572    /// Set the lower bound of a column (i.e a variable)
    577573
    578     /// The upper bound of a variable (column) have to be given by an
     574    /// The upper bound of a variable (column) has to be given by an
    579575    /// extended number of type Value, i.e. a finite number of type
    580576    /// Value or -\ref INF.
    581     void setColLowerBound(Col c, Value value) {
     577    void colLowerBound(Col c, Value value) {
    582578      _setColLowerBound(cols.floatingId(c.id),value);
    583579    }
    584580    /// Set the upper bound of a column (i.e a variable)
    585581
    586     /// The upper bound of a variable (column) have to be given by an
     582    /// The upper bound of a variable (column) has to be given by an
    587583    /// extended number of type Value, i.e. a finite number of type
    588584    /// Value or \ref INF.
    589     void setColUpperBound(Col c, Value value) {
     585    void colUpperBound(Col c, Value value) {
    590586      _setColUpperBound(cols.floatingId(c.id),value);
    591587    };
     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   
    592599    /// Set the lower bound of a row (i.e a constraint)
    593600
    594     /// The lower bound of a linear expression (row) have to be given by an
     601    /// The lower bound of a linear expression (row) has to be given by an
    595602    /// extended number of type Value, i.e. a finite number of type
    596603    /// Value or -\ref INF.
    597     void setRowLowerBound(Row r, Value value) {
     604    void rowLowerBound(Row r, Value value) {
    598605      _setRowLowerBound(rows.floatingId(r.id),value);
    599606    };
    600607    /// Set the upper bound of a row (i.e a constraint)
    601608
    602     /// The upper bound of a linear expression (row) have to be given by an
     609    /// The upper bound of a linear expression (row) has to be given by an
    603610    /// extended number of type Value, i.e. a finite number of type
    604611    /// Value or \ref INF.
    605     void setRowUpperBound(Row r, Value value) {
     612    void rowUpperBound(Row r, Value value) {
    606613      _setRowUpperBound(rows.floatingId(r.id),value);
    607614    };
     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   
    608626    ///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); };
    610628    ///Set the objective function
    611629   
     
    615633      clearObj();
    616634      for (Expr::iterator i=e.begin(); i!=e.end(); ++i)
    617         setObjCoeff((*i).first,(*i).second);
     635        objCoeff((*i).first,(*i).second);
    618636    }
    619637
     
    626644
    627645    ///\e
    628     SolutionType solve() { return _solve(); }
     646    SolutionStatus solve() { return _solve(); }
    629647   
    630648    ///@}
     
    635653
    636654    ///\e
    637     Value solution(Col c) { return _getSolution(cols.floatingId(c.id)); }
     655    Value primal(Col c) { return _getPrimal(cols.floatingId(c.id)); }
    638656
    639657    ///@}
  • src/work/athos/lp/lp_glpk.cc

    r1263 r1293  
    239239
    240240
    241   LpGlpk::SolutionType LpGlpk::_solve()
     241  LpGlpk::SolutionStatus LpGlpk::_solve()
    242242  {
    243     return OPTIMAL;
     243    return SOLVED;
    244244  }
    245245
    246   LpGlpk::Value LpGlpk::_getSolution(int i)
     246  LpGlpk::Value LpGlpk::_getPrimal(int i)
    247247  {
    248248    return 0;
  • src/work/athos/lp/lp_glpk.h

    r1263 r1293  
    7171    ///\bug Unimplemented
    7272    ///
    73     virtual SolutionType _solve();
     73    virtual SolutionStatus _solve();
    7474    ///\e
    7575   
    7676    ///\bug Unimplemented
    7777    ///
    78     virtual Value _getSolution(int i);
     78    virtual Value _getPrimal(int i);
    7979
    8080  };
  • src/work/athos/lp/lp_solver_skeleton.cc

    r1273 r1293  
    6666  }
    6767
    68   LpSolverSkeleton::SolutionType LpSolverSkeleton::_solve()
     68  LpSolverSkeleton::SolutionStatus LpSolverSkeleton::_solve()
    6969  {
    70     return OPTIMAL;
     70    return SOLVED;
    7171  }
    7272
    73   LpSolverSkeleton::Value LpSolverSkeleton::_getSolution(int i)
     73  LpSolverSkeleton::Value LpSolverSkeleton::_getPrimal(int i)
    7474  {
    7575    return 0;
  • src/work/athos/lp/lp_solver_skeleton.h

    r1273 r1293  
    4545    virtual void _setRowUpperBound(int i, Value value);
    4646    virtual void _setObjCoeff(int i, Value obj_coef);
    47     virtual SolutionType _solve();
    48     virtual Value _getSolution(int i);
     47    virtual SolutionStatus _solve();
     48    virtual Value _getPrimal(int i);
    4949  public:
    5050    LpSolverSkeleton() : LpSolverBase(), col_num(0), row_num(0) {}
  • src/work/athos/lp/lp_test.cc

    r1273 r1293  
    144144 
    145145  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);
    148148  }
    149149
Note: See TracChangeset for help on using the changeset viewer.