COIN-OR::LEMON - Graph Library

Changeset 1141:c3a7ca108705 in lemon


Ignore:
Timestamp:
05/06/12 16:46:14 (12 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
1.1
Parents:
1126:a30455cd0107 (diff), 1140:8d281761dea4 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Phase:
public
Message:

Merge bugfix #441 to branch 1.1

Files:
10 edited

Legend:

Unmodified
Added
Removed
  • lemon/bits/solver_bits.h

    r1081 r1141  
    4545      void clear() {
    4646        first_item = -1;
     47        last_item = -1;
    4748        first_free_item = -1;
    4849        items.clear();
  • lemon/bits/solver_bits.h

    r1140 r1141  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2011
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/clp.cc

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

    r1140 r1141  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2011
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
  • lemon/cplex.cc

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

    r1140 r1141  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2011
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    455455
    456456  void CplexBase::_applyMessageLevel() {
    457     CPXsetintparam(cplexEnv(), CPX_PARAM_SCRIND, 
     457    CPXsetintparam(cplexEnv(), CPX_PARAM_SCRIND,
    458458                   _message_enabled ? CPX_ON : CPX_OFF);
    459459  }
  • lemon/lp_base.h

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

    r1140 r1141  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2008
     5 * Copyright (C) 2003-2011
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    8383      MESSAGE_VERBOSE
    8484    };
    85    
     85
    8686
    8787    ///The floating point type used by the solver
     
    115115      typedef True LpCol;
    116116      /// Default constructor
    117      
     117
    118118      /// \warning The default constructor sets the Col to an
    119119      /// undefined value.
    120120      Col() {}
    121121      /// Invalid constructor \& conversion.
    122      
     122
    123123      /// This constructor initializes the Col to be invalid.
    124       /// \sa Invalid for more details.     
     124      /// \sa Invalid for more details.
    125125      Col(const Invalid&) : _id(-1) {}
    126126      /// Equality operator
     
    157157    public:
    158158      /// Default constructor
    159      
     159
    160160      /// \warning The default constructor sets the iterator
    161161      /// to an undefined value.
    162162      ColIt() {}
    163163      /// Sets the iterator to the first Col
    164      
     164
    165165      /// Sets the iterator to the first Col.
    166166      ///
     
    170170      }
    171171      /// Invalid constructor \& conversion
    172      
     172
    173173      /// Initialize the iterator to be invalid.
    174174      /// \sa Invalid for more details.
    175175      ColIt(const Invalid&) : Col(INVALID) {}
    176176      /// Next column
    177      
     177
    178178      /// Assign the iterator to the next column.
    179179      ///
     
    210210      typedef True LpRow;
    211211      /// Default constructor
    212      
     212
    213213      /// \warning The default constructor sets the Row to an
    214214      /// undefined value.
    215215      Row() {}
    216216      /// Invalid constructor \& conversion.
    217      
     217
    218218      /// This constructor initializes the Row to be invalid.
    219       /// \sa Invalid for more details.     
     219      /// \sa Invalid for more details.
    220220      Row(const Invalid&) : _id(-1) {}
    221221      /// Equality operator
     
    225225      bool operator==(Row r) const  {return _id == r._id;}
    226226      /// Inequality operator
    227      
     227
    228228      /// \sa operator==(Row r)
    229229      ///
     
    252252    public:
    253253      /// Default constructor
    254      
     254
    255255      /// \warning The default constructor sets the iterator
    256256      /// to an undefined value.
    257257      RowIt() {}
    258258      /// Sets the iterator to the first Row
    259      
     259
    260260      /// Sets the iterator to the first Row.
    261261      ///
     
    265265      }
    266266      /// Invalid constructor \& conversion
    267      
     267
    268268      /// Initialize the iterator to be invalid.
    269269      /// \sa Invalid for more details.
    270270      RowIt(const Invalid&) : Row(INVALID) {}
    271271      /// Next row
    272      
     272
    273273      /// Assign the iterator to the next row.
    274274      ///
     
    348348      typedef True SolverExpr;
    349349      /// Default constructor
    350      
     350
    351351      /// Construct an empty expression, the coefficients and
    352352      /// the constant component are initialized to zero.
     
    449449
    450450      ///Iterator over the expression
    451      
    452       ///The iterator iterates over the terms of the expression. 
    453       /// 
     451
     452      ///The iterator iterates over the terms of the expression.
     453      ///
    454454      ///\code
    455455      ///double s=0;
     
    465465
    466466        /// Sets the iterator to the first term
    467        
     467
    468468        /// Sets the iterator to the first term of the expression.
    469469        ///
     
    482482        const Value& operator*() const { return _it->second; }
    483483        /// Next term
    484        
     484
    485485        /// Assign the iterator to the next term.
    486486        ///
     
    494494
    495495      /// Const iterator over the expression
    496      
    497       ///The iterator iterates over the terms of the expression. 
    498       /// 
     496
     497      ///The iterator iterates over the terms of the expression.
     498      ///
    499499      ///\code
    500500      ///double s=0;
     
    510510
    511511        /// Sets the iterator to the first term
    512        
     512
    513513        /// Sets the iterator to the first term of the expression.
    514514        ///
     
    525525
    526526        /// Next term
    527        
     527
    528528        /// Assign the iterator to the next term.
    529529        ///
     
    674674      typedef True SolverExpr;
    675675      /// Default constructor
    676      
     676
    677677      /// Construct an empty expression, the coefficients are
    678678      /// initialized to zero.
     
    709709      }
    710710      /// \brief Removes the coefficients which's absolute value does
    711       /// not exceed \c epsilon. 
     711      /// not exceed \c epsilon.
    712712      void simplify(Value epsilon = 0.0) {
    713713        std::map<int, Value>::iterator it=comps.begin();
     
    758758
    759759      ///Iterator over the expression
    760      
    761       ///The iterator iterates over the terms of the expression. 
    762       /// 
     760
     761      ///The iterator iterates over the terms of the expression.
     762      ///
    763763      ///\code
    764764      ///double s=0;
     
    774774
    775775        /// Sets the iterator to the first term
    776        
     776
    777777        /// Sets the iterator to the first term of the expression.
    778778        ///
     
    792792
    793793        /// Next term
    794        
     794
    795795        /// Assign the iterator to the next term.
    796796        ///
     
    804804
    805805      ///Iterator over the expression
    806      
    807       ///The iterator iterates over the terms of the expression. 
    808       /// 
     806
     807      ///The iterator iterates over the terms of the expression.
     808      ///
    809809      ///\code
    810810      ///double s=0;
     
    820820
    821821        /// Sets the iterator to the first term
    822        
     822
    823823        /// Sets the iterator to the first term of the expression.
    824824        ///
     
    835835
    836836        /// Next term
    837        
     837
    838838        /// Assign the iterator to the next term.
    839839        ///
     
    18041804    enum VarStatus {
    18051805      /// The variable is in the basis
    1806       BASIC, 
     1806      BASIC,
    18071807      /// The variable is free, but not basic
    18081808      FREE,
    1809       /// The variable has active lower bound 
     1809      /// The variable has active lower bound
    18101810      LOWER,
    18111811      /// The variable has active upper bound
     
    18861886    }
    18871887    /// Returns a component of the primal ray
    1888    
     1888
    18891889    /// The primal ray is solution of the modified primal problem,
    18901890    /// where we change each finite bound to 0, and we looking for a
     
    19201920
    19211921    /// Returns a component of the dual ray
    1922    
     1922
    19231923    /// The dual ray is solution of the modified primal problem, where
    19241924    /// we change each finite bound to 0 (i.e. the objective function
     
    20622062    }
    20632063    ///The value of the objective function
    2064    
     2064
    20652065    ///\return
    20662066    ///- \ref INF or -\ref INF means either infeasibility or unboundedness
  • test/lp_test.cc

    r1097 r1141  
    4242using namespace lemon;
    4343
     44int countCols(LpBase & lp) {
     45  int count=0;
     46  for (LpBase::ColIt c(lp); c!=INVALID; ++c) ++count;
     47  return count;
     48}
     49
     50int countRows(LpBase & lp) {
     51  int count=0;
     52  for (LpBase::RowIt r(lp); r!=INVALID; ++r) ++count;
     53  return count;
     54}
     55
     56
    4457void lpTest(LpSolver& lp)
    4558{
    4659
    4760  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();
    4875
    4976  std::vector<LP::Col> x(10);
  • test/lp_test.cc

    r1140 r1141  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2011
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
Note: See TracChangeset for help on using the changeset viewer.