COIN-OR::LEMON - Graph Library

Changeset 1258:88dff8bb4bf2 in lemon-0.x for src


Ignore:
Timestamp:
03/25/05 12:03:49 (19 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1685
Message:
  • setRow() added
  • more docs
File:
1 edited

Legend:

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

    r1256 r1258  
    260260#endif
    261261    ///Add a new empty row (i.e a new constaint) to the LP
     262
     263    ///This function adds a new empty row (i.e a new constaint) to the LP.
     264    ///\return The created row
    262265    Row addRow() { Row r; r.id=rows.insert(_addRow()); return r;}
    263266
    264     ///Add a new row (i.e a new constaint) to the LP
    265 
    266     ///\param l lower bound (-INF means no bound)
    267     ///\param e a linear expression (see \ref Expr)
    268     ///\param u upper bound (INF means no bound)
     267    ///Set a row (i.e a constaint) of the LP
     268
     269    ///\param r is the row to be modified
     270    ///\param l is lower bound (-INF means no bound)
     271    ///\param e is a linear expression (see \ref Expr)
     272    ///\param u is the upper bound (INF means no bound)
    269273    ///\bug This is a temportary function. The interface will change to
    270274    ///a better one.
    271     Row addRow(Value l,Expr e, Value u) {
    272       Row r=addRow();
     275    void setRow(Row r, Value l,const Expr &e, Value u) {
    273276      std::vector<int> indices;
    274277      std::vector<Value> values;
    275278      indices.push_back(0);
    276279      values.push_back(0);
    277       for(Expr::iterator i=e.begin(); i!=e.end(); ++i)
     280      for(Expr::const_iterator i=e.begin(); i!=e.end(); ++i)
    278281        if((*i).second!=0) { ///\bug EPSILON would be necessary here!!!
    279282          indices.push_back(cols.floatingId((*i).first.id));
     
    284287      _setRowLowerBound(rows.floatingId(r.id),l-e.constComp());
    285288      _setRowUpperBound(rows.floatingId(r.id),u-e.constComp());
     289    }
     290
     291    ///Add a new row (i.e a new constaint) to the LP
     292
     293    ///\param l is the lower bound (-INF means no bound)
     294    ///\param e is a linear expression (see \ref Expr)
     295    ///\param u is the upper bound (INF means no bound)
     296    ///\return The created row.
     297    ///\bug This is a temportary function. The interface will change to
     298    ///a better one.
     299    Row addRow(Value l,const Expr &e, Value u) {
     300      Row r=addRow();
     301      setRow(r,l,e,u);
    286302      return r;
    287303    }
Note: See TracChangeset for help on using the changeset viewer.