Changes in / [987:cfbabca1b4e9:989:38e1d4383262] in lemon-main
- Files:
- 
          - 7 edited
 
 - 
          lemon/bits/solver_bits.h (modified) (1 diff)
- 
          lemon/cbc.cc (modified) (1 diff)
- 
          lemon/clp.cc (modified) (1 diff)
- 
          lemon/cplex.cc (modified) (1 diff)
- 
          lemon/glpk.cc (modified) (1 diff)
- 
          lemon/lp_base.h (modified) (1 diff)
- 
          test/lp_test.cc (modified) (1 diff)
 
Legend:
- Unmodified
- Added
- Removed
- 
        lemon/bits/solver_bits.hr877 r989 45 45 void clear() { 46 46 first_item = -1; 47 last_item = -1; 47 48 first_free_item = -1; 48 49 items.clear(); 
- 
        lemon/cbc.ccr974 r989 436 436 437 437 _prob = new CoinModel(); 438 rows.clear();439 cols.clear();440 438 } 441 439 
- 
        lemon/clp.ccr877 r989 438 438 delete _prob; 439 439 _prob = new ClpSimplex(); 440 rows.clear();441 cols.clear();442 440 _col_names_ref.clear(); 443 441 _clear_temporals(); 
- 
        lemon/cplex.ccr877 r989 471 471 int status; 472 472 _prob = CPXcreateprob(cplexEnv(), &status, "Cplex problem"); 473 rows.clear();474 cols.clear();475 473 } 476 474 
- 
        lemon/glpk.ccr877 r989 557 557 void GlpkBase::_clear() { 558 558 glp_erase_prob(lp); 559 rows.clear();560 cols.clear();561 559 } 562 560 
- 
        lemon/lp_base.hr958 r989 1557 1557 1558 1558 ///Clears the problem 1559 void clear() { _clear(); }1559 void clear() { _clear(); rows.clear(); cols.clear(); } 1560 1560 1561 1561 /// Sets the message level of the solver 
- 
        test/lp_test.ccr957 r988 42 42 using namespace lemon; 43 43 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 44 57 void lpTest(LpSolver& lp) 45 58 { 46 59 47 60 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(); 48 75 49 76 std::vector<LP::Col> x(10); 
Note: See TracChangeset
          for help on using the changeset viewer.
      

