COIN-OR::LEMON - Graph Library

Ignore:
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • lemon/bits/solver_bits.h

    r1141 r1081  
    4545      void clear() {
    4646        first_item = -1;
    47         last_item = -1;
    4847        first_free_item = -1;
    4948        items.clear();
  • lemon/cbc.cc

    r1140 r1120  
    424424
    425425    _prob = new CoinModel();
     426    rows.clear();
     427    cols.clear();
    426428  }
    427429
  • lemon/clp.cc

    r1141 r1081  
    425425    delete _prob;
    426426    _prob = new ClpSimplex();
     427    rows.clear();
     428    cols.clear();
    427429    _col_names_ref.clear();
    428430    _clear_temporals();
  • lemon/cplex.cc

    r1141 r1081  
    438438    int status;
    439439    _prob = CPXcreateprob(cplexEnv(), &status, "Cplex problem");
     440    rows.clear();
     441    cols.clear();
    440442  }
    441443
  • lemon/glpk.cc

    r1140 r623  
    521521  void GlpkBase::_clear() {
    522522    glp_erase_prob(lp);
     523    rows.clear();
     524    cols.clear();
    523525  }
    524526
  • lemon/lp_base.h

    r1141 r1093  
    15431543
    15441544    ///Clears the problem
    1545     void clear() { _clear(); rows.clear(); cols.clear(); }
     1545    void clear() { _clear(); }
    15461546
    15471547    /// Sets the message level of the solver
  • test/lp_test.cc

    r1141 r1097  
    4242using namespace lemon;
    4343
    44 int countCols(LpBase & lp) {
    45   int count=0;
    46   for (LpBase::ColIt c(lp); c!=INVALID; ++c) ++count;
    47   return count;
    48 }
    49 
    50 int countRows(LpBase & lp) {
    51   int count=0;
    52   for (LpBase::RowIt r(lp); r!=INVALID; ++r) ++count;
    53   return count;
    54 }
    55 
    56 
    5744void lpTest(LpSolver& lp)
    5845{
    5946
    6047  typedef LpSolver LP;
    61 
    62   // Test LpBase::clear()
    63   check(countRows(lp)==0, "Wrong number of rows");
    64   check(countCols(lp)==0, "Wrong number of cols");
    65   lp.addCol(); lp.addRow(); lp.addRow();
    66   check(countRows(lp)==2, "Wrong number of rows");
    67   check(countCols(lp)==1, "Wrong number of cols");
    68   lp.clear();
    69   check(countRows(lp)==0, "Wrong number of rows");
    70   check(countCols(lp)==0, "Wrong number of cols");
    71   lp.addCol(); lp.addCol(); lp.addCol(); lp.addRow();
    72   check(countRows(lp)==1, "Wrong number of rows");
    73   check(countCols(lp)==3, "Wrong number of cols");
    74   lp.clear();
    7548
    7649  std::vector<LP::Col> x(10);
Note: See TracChangeset for help on using the changeset viewer.