COIN-OR::LEMON - Graph Library

Changeset 793:e4554cd6b2bf in lemon for lemon/clp.cc


Ignore:
Timestamp:
10/04/09 00:28:42 (10 years ago)
Author:
Balazs Dezso <deba@…>
Branch:
default
Phase:
public
Message:

Faster add row operation (#203)

One virtual function call instead of more

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/clp.cc

    r623 r793  
    7979  }
    8080
     81  int ClpLp::_addRow(Value l, ExprIterator b, ExprIterator e, Value u) {
     82    std::vector<int> indexes;
     83    std::vector<Value> values;
     84
     85    for(ExprIterator it = b; it != e; ++it) {
     86      indexes.push_back(it->first);
     87      values.push_back(it->second);
     88    }
     89
     90    _prob->addRow(values.size(), &indexes.front(), &values.front(), l, u);
     91    return _prob->numberRows() - 1;
     92  }
     93
    8194
    8295  void ClpLp::_eraseCol(int c) {
Note: See TracChangeset for help on using the changeset viewer.