COIN-OR::LEMON - Graph Library

Changeset 793:e4554cd6b2bf in lemon for lemon/cbc.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/cbc.cc

    r623 r793  
    9595  }
    9696
     97  int CbcMip::_addRow(Value l, ExprIterator b, ExprIterator e, Value u) {
     98    std::vector<int> indexes;
     99    std::vector<Value> values;
     100
     101    for(ExprIterator it = b; it != e; ++it) {
     102      indexes.push_back(it->first);
     103      values.push_back(it->second);
     104    }
     105
     106    _prob->addRow(values.size(), &indexes.front(), &values.front(), l, u);
     107    return _prob->numberRows() - 1;
     108  }
    97109
    98110  void CbcMip::_eraseCol(int i) {
Note: See TracChangeset for help on using the changeset viewer.