COIN-OR::LEMON - Graph Library

Changes in / [961:4bb9e72e1a41:962:2da3de1c0ebe] in lemon-1.2


Ignore:
Files:
2 added
36 edited

Legend:

Unmodified
Added
Removed
  • CMakeLists.txt

    r942 r954  
    6767    # C4996: 'function': was declared deprecated
    6868  ELSE()
    69     SET(CXX_WARNING "-Wall -W")
     69    SET(CXX_WARNING "-Wall")
    7070  ENDIF()
    7171ENDIF()
     
    7474SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LEMON_CXX_WARNING_FLAGS}")
    7575
    76 SET( CMAKE_CXX_FLAGS_MAINTAINER "-Werror -ggdb" CACHE STRING
     76SET( CMAKE_CXX_FLAGS_MAINTAINER "-Werror -ggdb -O0" CACHE STRING
    7777    "Flags used by the C++ compiler during maintainer builds."
    7878    FORCE )
    79 SET( CMAKE_C_FLAGS_MAINTAINER "-Werror" CACHE STRING
     79SET( CMAKE_C_FLAGS_MAINTAINER "-Werror -O0" CACHE STRING
    8080    "Flags used by the C compiler during maintainer builds."
    8181    FORCE )
  • NEWS

    r883 r934  
     12011-11-09 Version 1.2.3 released
     2
     3        Bugfix release.
     4
     5        #428: Add missing lemon/lemon.pc.cmake to the release tarball
     6        #429: Fix VS warnings
     7        #430: Fix LpBase::Constr two-side limit bug
     8
     92011-08-08 Version 1.2.2 released
     10
     11        Bugfix release.
     12
     13        #392: Bug fix in Dfs::start(s,t)
     14        #414: Fix wrong initialization in Preflow
     15        #404: Update Doxygen configuration
     16        #416: Support tests with valgrind
     17        #418: Better Win CodeBlock/MinGW support
     18        #419: Backport build environment improvements from the main branch
     19              - Build of mip_test and lp_test precede the running of the tests
     20              - Also search for coin libs under ${COIN_ROOT_DIR}/lib/coin
     21              - Do not look for COIN_VOL libraries
     22        #382: Allow lgf file without Arc maps
     23        #417: Bug fix in CostScaling
     24
     252010-10-21 Version 1.2.1 released
     26
     27        Bugfix release.
     28
     29        #366: Fix Pred[Matrix]MapPath::empty()
     30        #371: Bug fix in (di)graphCopy()
     31              The target graph is cleared before adding nodes and arcs/edges.
     32
     33        #364: Add missing UndirectedTags
     34        #368: Fix the usage of std::numeric_limits<>::min() in Network Simplex
     35        #372: Fix a critical bug in preflow
     36
    1372010-03-19 Version 1.2 released
    238
  • cmake/FindCOIN.cmake

    r920 r951  
    5555)
    5656
     57FIND_LIBRARY(COIN_ZLIB_LIBRARY
     58  NAMES z libz
     59  HINTS ${COIN_ROOT_DIR}/lib/coin
     60  HINTS ${COIN_ROOT_DIR}/lib
     61)
     62FIND_LIBRARY(COIN_BZ2_LIBRARY
     63  NAMES bz2 libbz2
     64  HINTS ${COIN_ROOT_DIR}/lib/coin
     65  HINTS ${COIN_ROOT_DIR}/lib
     66)
     67
    5768INCLUDE(FindPackageHandleStandardArgs)
    5869FIND_PACKAGE_HANDLE_STANDARD_ARGS(COIN DEFAULT_MSG
     
    7283IF(COIN_FOUND)
    7384  SET(COIN_INCLUDE_DIRS ${COIN_INCLUDE_DIR})
    74   SET(COIN_LIBRARIES "${COIN_CBC_LIBRARY};${COIN_CBC_SOLVER_LIBRARY};${COIN_CGL_LIBRARY};${COIN_CLP_LIBRARY};${COIN_COIN_UTILS_LIBRARY};${COIN_OSI_LIBRARY};${COIN_OSI_CBC_LIBRARY};${COIN_OSI_CLP_LIBRARY}")
    75   SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARY};${COIN_COIN_UTILS_LIBRARY}")
    76   SET(COIN_CBC_LIBRARIES ${COIN_LIBRARIES})
     85  SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARY};${COIN_COIN_UTILS_LIBRARY};${COIN_ZLIB_LIBRARY};${COIN_BZ2_LIBRARY}")
     86  IF(COIN_ZLIB_LIBRARY)
     87    SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARIES};${COIN_ZLIB_LIBRARY}")
     88  ENDIF(COIN_ZLIB_LIBRARY)
     89   IF(COIN_BZ2_LIBRARY)
     90    SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARIES};${COIN_BZ2_LIBRARY}")
     91  ENDIF(COIN_BZ2_LIBRARY)
     92  SET(COIN_CBC_LIBRARIES "${COIN_CBC_LIBRARY};${COIN_CBC_SOLVER_LIBRARY};${COIN_CGL_LIBRARY};${COIN_OSI_LIBRARY};${COIN_OSI_CBC_LIBRARY};${COIN_OSI_CLP_LIBRARY};${COIN_ZLIB_LIBRARY};${COIN_BZ2_LIBRARY};${COIN_CLP_LIBRARIES}")
     93  SET(COIN_LIBRARIES ${COIN_CBC_LIBRARIES})
    7794ENDIF(COIN_FOUND)
    7895
     
    89106  COIN_OSI_VOL_LIBRARY
    90107  COIN_VOL_LIBRARY
     108  COIN_ZLIB_LIBRARY
     109  COIN_BZ2_LIBRARY
    91110)
    92111
  • cmake/FindCPLEX.cmake

    r636 r950  
    33FIND_PATH(CPLEX_INCLUDE_DIR
    44  ilcplex/cplex.h
    5   PATHS "C:/ILOG/CPLEX91/include"
    6   PATHS "/opt/ilog/cplex91/include"
     5  PATHS "C:/ILOG/CPLEX/include"
     6  PATHS "/opt/ilog/cplex/include"
    77  HINTS ${CPLEX_ROOT_DIR}/include
    88)
    99FIND_LIBRARY(CPLEX_LIBRARY
    10   cplex91
    11   PATHS "C:/ILOG/CPLEX91/lib/msvc7/stat_mda"
    12   PATHS "/opt/ilog/cplex91/bin"
     10  cplex
     11  PATHS "C:/ILOG/CPLEX/lib/msvc7/stat_mda"
     12  PATHS "/opt/ilog/cplex/bin"
    1313  HINTS ${CPLEX_ROOT_DIR}/bin
     14  HINTS ${CPLEX_ROOT_DIR}/lib
    1415)
    1516
     
    1819
    1920FIND_PATH(CPLEX_BIN_DIR
    20   cplex91.dll
    21   PATHS "C:/ILOG/CPLEX91/bin/x86_win32"
     21  cplex.dll
     22  PATHS "C:/ILOG/CPLEX/bin/x86_win32"
     23  HINTS ${CPLEX_ROOT_DIR}/bin
    2224)
    2325
  • doc/groups.dox

    r880 r884  
    287287
    288288/**
    289 @defgroup matrices Matrices
    290 @ingroup auxdat
    291 \brief Two dimensional data storages implemented in LEMON.
    292 
    293 This group contains two dimensional data storages implemented in LEMON.
    294 */
    295 
    296 /**
    297289@defgroup algs Algorithms
    298290\brief This group contains the several algorithms
     
    327319   but the digraph should not contain directed cycles with negative total
    328320   length.
    329  - \ref FloydWarshall "Floyd-Warshall" and \ref Johnson "Johnson" algorithms
    330    for solving the \e all-pairs \e shortest \e paths \e problem when arc
    331    lenghts can be either positive or negative, but the digraph should
    332    not contain directed cycles with negative total length.
    333321 - \ref Suurballe A successive shortest path algorithm for finding
    334322   arc-disjoint paths between two nodes having minimum total length.
     
    364352\f[ 0 \leq f(uv) \leq cap(uv) \quad \forall uv\in A \f]
    365353
    366 LEMON contains several algorithms for solving maximum flow problems:
    367 - \ref EdmondsKarp Edmonds-Karp algorithm
    368   \ref edmondskarp72theoretical.
    369 - \ref Preflow Goldberg-Tarjan's preflow push-relabel algorithm
    370   \ref goldberg88newapproach.
    371 - \ref DinitzSleatorTarjan Dinitz's blocking flow algorithm with dynamic trees
    372   \ref dinic70algorithm, \ref sleator83dynamic.
    373 - \ref GoldbergTarjan !Preflow push-relabel algorithm with dynamic trees
    374   \ref goldberg88newapproach, \ref sleator83dynamic.
    375 
    376 In most cases the \ref Preflow algorithm provides the
    377 fastest method for computing a maximum flow. All implementations
    378 also provide functions to query the minimum cut, which is the dual
    379 problem of maximum flow.
     354\ref Preflow is an efficient implementation of Goldberg-Tarjan's
     355preflow push-relabel algorithm \ref goldberg88newapproach for finding
     356maximum flows. It also provides functions to query the minimum cut,
     357which is the dual problem of maximum flow.
    380358
    381359\ref Circulation is a preflow push-relabel algorithm implemented directly
     
    434412- \ref HaoOrlin "Hao-Orlin algorithm" for calculating minimum cut
    435413  in directed graphs.
    436 - \ref NagamochiIbaraki "Nagamochi-Ibaraki algorithm" for
    437   calculating minimum cut in undirected graphs.
    438414- \ref GomoryHu "Gomory-Hu tree computation" for calculating
    439415  all-pairs minimum cut in undirected graphs.
     
    498474
    499475The matching algorithms implemented in LEMON:
    500 - \ref MaxBipartiteMatching Hopcroft-Karp augmenting path algorithm
    501   for calculating maximum cardinality matching in bipartite graphs.
    502 - \ref PrBipartiteMatching Push-relabel algorithm
    503   for calculating maximum cardinality matching in bipartite graphs.
    504 - \ref MaxWeightedBipartiteMatching
    505   Successive shortest path algorithm for calculating maximum weighted
    506   matching and maximum weighted bipartite matching in bipartite graphs.
    507 - \ref MinCostMaxBipartiteMatching
    508   Successive shortest path algorithm for calculating minimum cost maximum
    509   matching in bipartite graphs.
    510476- \ref MaxMatching Edmond's blossom shrinking algorithm for calculating
    511477  maximum cardinality matching in general graphs.
     
    552518
    553519/**
    554 @defgroup approx Approximation Algorithms
    555 @ingroup algs
    556 \brief Approximation algorithms.
    557 
    558 This group contains the approximation and heuristic algorithms
    559 implemented in LEMON.
    560 */
    561 
    562 /**
    563520@defgroup auxalg Auxiliary Algorithms
    564521@ingroup algs
     
    589546The currently supported solvers are \ref glpk, \ref clp, \ref cbc,
    590547\ref cplex, \ref soplex.
    591 */
    592 
    593 /**
    594 @defgroup lp_utils Tools for Lp and Mip Solvers
    595 @ingroup lp_group
    596 \brief Helper tools to the Lp and Mip solvers.
    597 
    598 This group adds some helper tools to general optimization framework
    599 implemented in LEMON.
    600 */
    601 
    602 /**
    603 @defgroup metah Metaheuristics
    604 @ingroup gen_opt_group
    605 \brief Metaheuristics for LEMON library.
    606 
    607 This group contains some metaheuristic optimization tools.
    608548*/
    609549
  • doc/lgf.dox

    r923 r927  
    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).
  • lemon/bfs.h

    r877 r954  
    12521252      }
    12531253      _Visitor& visitor;
     1254      Constraints() {}
    12541255    };
    12551256  };
  • lemon/bits/graph_adaptor_extender.h

    r886 r927  
    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).
  • lemon/bits/path_dump.h

    r890 r927  
    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).
  • lemon/bits/solver_bits.h

    r877 r956  
    4545      void clear() {
    4646        first_item = -1;
     47        last_item = -1;
    4748        first_free_item = -1;
    4849        items.clear();
  • lemon/bits/windows.cc

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

    r746 r956  
    2626#include <coin/OsiSolverInterface.hpp>
    2727
    28 #ifdef COIN_HAS_CLP
    2928#include "coin/OsiClpSolverInterface.hpp"
    30 #endif
    31 #ifdef COIN_HAS_OSL
    32 #include "coin/OsiOslSolverInterface.hpp"
    33 #endif
    3429
    3530#include "coin/CbcCutGenerator.hpp"
     
    271266      delete _osi_solver;
    272267    }
    273 #ifdef COIN_HAS_CLP
    274268    _osi_solver = new OsiClpSolverInterface();
    275 #elif COIN_HAS_OSL
    276     _osi_solver = new OsiOslSolverInterface();
    277 #else
    278 #error Cannot instantiate Osi solver
    279 #endif
    280269
    281270    _osi_solver->loadFromCoinModel(*_prob);
     
    329318      _cbc_model->addCutGenerator(&flowGen, -1, "FlowCover");
    330319
    331 #ifdef COIN_HAS_CLP
    332320      OsiClpSolverInterface* osiclp =
    333321        dynamic_cast<OsiClpSolverInterface*>(_cbc_model->solver());
     
    335323        osiclp->setupForRepeatedUse(2, 0);
    336324      }
    337 #endif
    338325
    339326      CbcRounding heuristic1(*_cbc_model);
     
    449436
    450437    _prob = new CoinModel();
    451     rows.clear();
    452     cols.clear();
    453438  }
    454439
  • lemon/clp.cc

    r877 r956  
    438438    delete _prob;
    439439    _prob = new ClpSimplex();
    440     rows.clear();
    441     cols.clear();
    442440    _col_names_ref.clear();
    443441    _clear_temporals();
  • lemon/concepts/graph_components.h

    r877 r954  
    116116        const _GraphItem &ia;
    117117        const _GraphItem &ib;
     118        Constraints() {}
    118119      };
    119120    };
     
    175176
    176177        const _Digraph& digraph;
     178        Constraints() {}
    177179      };
    178180    };
     
    291293
    292294        const _Graph& graph;
     295      Constraints() {}
    293296      };
    294297
     
    370373
    371374        const _Digraph& digraph;
     375        Constraints() {}
    372376      };
    373377    };
     
    422426
    423427        const _Graph& graph;
     428        Constraints() {}
    424429      };
    425430    };
     
    499504        }
    500505        const GR& g;
     506        Constraints() {}
    501507      };
    502508    };
     
    587593        const Base& node;
    588594        const GR& graph;
     595        Constraints() {}
    589596      };
    590597    };
     
    763770
    764771        const _Digraph& digraph;
     772        Constraints() {}
    765773      };
    766774    };
     
    887895
    888896        const _Graph& graph;
     897        Constraints() {}
    889898      };
    890899    };
     
    944953
    945954        const _Digraph& digraph;
     955        Constraints() {}
    946956      };
    947957    };
     
    985995
    986996        const _Graph& graph;
     997        Constraints() {}
    987998      };
    988999    };
     
    10621073        const GR &g;
    10631074        const typename GraphMap::Value &t;
     1075        Constraints() {}
    10641076      };
    10651077
     
    12001212
    12011213        const _Digraph& digraph;
     1214        Constraints() {}
    12021215      };
    12031216    };
     
    12851298
    12861299        const _Graph& graph;
     1300        Constraints() {}
    12871301      };
    12881302    };
     
    13291343
    13301344        _Digraph& digraph;
     1345        Constraints() {}
    13311346      };
    13321347    };
     
    13731388
    13741389        _Graph& graph;
     1390        Constraints() {}
    13751391      };
    13761392    };
     
    14121428
    14131429        _Digraph& digraph;
     1430        Constraints() {}
    14141431      };
    14151432    };
     
    14511468
    14521469        _Graph& graph;
     1470        Constraints() {}
    14531471      };
    14541472    };
     
    14791497
    14801498        _Digraph& digraph;
     1499        Constraints() {}
    14811500      };
    14821501    };
     
    15071526
    15081527        _Graph& graph;
     1528        Constraints() {}
    15091529      };
    15101530    };
  • lemon/concepts/heap.h

    r877 r954  
    315315        _Heap& heap;
    316316        ItemIntMap& map;
     317        Constraints() {}
    317318      };
    318319    };
  • lemon/concepts/maps.h

    r718 r953  
    6969        const typename _ReadMap::Key& own_key;
    7070        const _ReadMap& m;
     71        Constraints() {}
    7172      };
    7273
     
    110111        const typename _WriteMap::Value& own_val;
    111112        _WriteMap& m;
     113        Constraints() {}
    112114      };
    113115    };
     
    130132      /// Returns the value associated with the given key.
    131133      Value operator[](const Key &) const {
    132         return *static_cast<Value *>(0);
     134        Value *r = 0;
     135        return *r;
    133136      }
    134137
     
    170173      /// Returns a reference to the value associated with the given key.
    171174      Reference operator[](const Key &) {
    172         return *static_cast<Value *>(0);
     175        Value *r = 0;
     176        return *r;
    173177      }
    174178
    175179      /// Returns a const reference to the value associated with the given key.
    176180      ConstReference operator[](const Key &) const {
    177         return *static_cast<Value *>(0);
     181        Value *r = 0;
     182        return *r;
    178183      }
    179184
     
    206211        typename _ReferenceMap::ConstReference own_cref;
    207212        _ReferenceMap& m;
     213        Constraints() {}
    208214      };
    209215    };
  • lemon/concepts/path.h

    r785 r954  
    169169        }
    170170        _Path& p;
     171        PathDumperConstraints() {}
    171172      };
    172173
     
    194195        }
    195196        _Path& p;
     197        PathDumperConstraints() {}
    196198      };
    197199
  • lemon/core.h

    r942 r960  
    18501850    ///a single node \c n, then \ref refresh(Node) "refresh(n)" is enough.
    18511851    ///
    1852 #ifdef DOXYGEN
    1853     Arc operator()(Node s, Node t, Arc prev=INVALID) const {}
    1854 #else
    1855     using ArcLookUp<GR>::operator() ;
    1856     Arc operator()(Node s, Node t, Arc prev) const
     1852    Arc operator()(Node s, Node t, Arc prev=INVALID) const
    18571853    {
    1858       return prev==INVALID?(*this)(s,t):_next[prev];
    1859     }
     1854      if(prev==INVALID)
     1855        {
     1856          Arc f=INVALID;
     1857          Arc e;
     1858          for(e=_head[s];
     1859              e!=INVALID&&_g.target(e)!=t;
     1860              e = t < _g.target(e)?_left[e]:_right[e]) ;
     1861          while(e!=INVALID)
     1862            if(_g.target(e)==t)
     1863              {
     1864                f = e;
     1865                e = _left[e];
     1866              }
     1867            else e = _right[e];
     1868          return f;
     1869        }
     1870      else return _next[prev];
     1871    }
     1872
     1873  };
     1874
     1875  /// @}
     1876
     1877} //namespace lemon
     1878
    18601879#endif
    1861 
    1862   };
    1863 
    1864   /// @}
    1865 
    1866 } //namespace lemon
    1867 
    1868 #endif
  • lemon/cost_scaling.h

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

    r877 r956  
    471471    int status;
    472472    _prob = CPXcreateprob(cplexEnv(), &status, "Cplex problem");
    473     rows.clear();
    474     cols.clear();
    475473  }
    476474
  • lemon/dfs.h

    r942 r954  
    11941194      }
    11951195      _Visitor& visitor;
     1196      Constraints() {}
    11961197    };
    11971198  };
  • lemon/glpk.cc

    r877 r956  
    557557  void GlpkBase::_clear() {
    558558    glp_erase_prob(lp);
    559     rows.clear();
    560     cols.clear();
    561559  }
    562560
  • lemon/lp_base.h

    r933 r956  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2011
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    15571557
    15581558    ///Clears the problem
    1559     void clear() { _clear(); }
     1559    void clear() { _clear(); rows.clear(); cols.clear(); }
    15601560
    15611561    /// Sets the message level of the solver
  • lemon/maps.h

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

    r877 r958  
    6565    Path() {}
    6666
     67    /// \brief Copy constructor
     68    ///
     69    Path(const Path& cpath) {
     70      pathCopy(cpath, *this);
     71    }
     72
    6773    /// \brief Template copy constructor
    6874    ///
     
    7278    Path(const CPath& cpath) {
    7379      pathCopy(cpath, *this);
     80    }
     81
     82    /// \brief Copy assignment
     83    ///
     84    Path& operator=(const Path& cpath) {
     85      pathCopy(cpath, *this);
     86      return *this;
    7487    }
    7588
     
    253266    SimplePath() {}
    254267
     268    /// \brief Copy constructor
     269    ///
     270    SimplePath(const SimplePath& cpath) {
     271      pathCopy(cpath, *this);
     272    }
     273
    255274    /// \brief Template copy constructor
    256275    ///
     
    260279    SimplePath(const CPath& cpath) {
    261280      pathCopy(cpath, *this);
     281    }
     282
     283    /// \brief Copy assignment
     284    ///
     285    SimplePath& operator=(const SimplePath& cpath) {
     286      pathCopy(cpath, *this);
     287      return *this;
    262288    }
    263289
     
    432458    ListPath() : first(0), last(0) {}
    433459
     460    /// \brief Copy constructor
     461    ///
     462    ListPath(const ListPath& cpath) : first(0), last(0) {
     463      pathCopy(cpath, *this);
     464    }
     465
    434466    /// \brief Template copy constructor
    435467    ///
     
    446478    ~ListPath() {
    447479      clear();
     480    }
     481
     482    /// \brief Copy assignment
     483    ///
     484    ListPath& operator=(const ListPath& cpath) {
     485      pathCopy(cpath, *this);
     486      return *this;
    448487    }
    449488
     
    759798    StaticPath() : len(0), arcs(0) {}
    760799
     800    /// \brief Copy constructor
     801    ///
     802    StaticPath(const StaticPath& cpath) : arcs(0) {
     803      pathCopy(cpath, *this);
     804    }
     805
    761806    /// \brief Template copy constructor
    762807    ///
     
    772817    ~StaticPath() {
    773818      if (arcs) delete[] arcs;
     819    }
     820
     821    /// \brief Copy assignment
     822    ///
     823    StaticPath& operator=(const StaticPath& cpath) {
     824      pathCopy(cpath, *this);
     825      return *this;
    774826    }
    775827
  • lemon/preflow.h

    r942 r944  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2011
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    555555        }
    556556      }
    557       for (NodeIt n(_graph); n != INVALID; ++n) 
     557      for (NodeIt n(_graph); n != INVALID; ++n)
    558558        if(n!=_source && n!=_target && _tolerance.positive((*_excess)[n]))
    559559          _level->activate(n);
    560          
     560
    561561      return true;
    562562    }
     
    586586          level = _level->highestActiveLevel();
    587587          --num;
    588          
     588
    589589          Value excess = (*_excess)[n];
    590590          int new_level = _level->maxLevel();
  • test/CMakeLists.txt

    r942 r960  
    1414SET(TESTS
    1515  adaptors_test
     16  arc_look_up_test
    1617  bellman_ford_test
    1718  bfs_test
     
    8788    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
    8889    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
    89       COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
     90      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex.dll ${TARGET_PATH}
    9091    )
    9192  ENDIF()
     
    129130    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
    130131    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
    131       COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
     132      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex.dll ${TARGET_PATH}
    132133    )
    133134  ENDIF()
  • test/Makefile.am

    r942 r944  
    7979test_graph_test_SOURCES = test/graph_test.cc
    8080test_graph_utils_test_SOURCES = test/graph_utils_test.cc
     81test_hao_orlin_test_SOURCES = test/hao_orlin_test.cc
    8182test_heap_test_SOURCES = test/heap_test.cc
    8283test_kruskal_test_SOURCES = test/kruskal_test.cc
    83 test_hao_orlin_test_SOURCES = test/hao_orlin_test.cc
    8484test_lgf_test_SOURCES = test/lgf_test.cc
    8585test_lp_test_SOURCES = test/lp_test.cc
  • test/dfs_test.cc

    r942 r944  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2011
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    220220  check(dfs.run(s1,t1) && dfs.reached(t1),"Node 3 is reachable from Node 6.");
    221221  }
    222  
     222
    223223  {
    224224    NullMap<Node,Arc> myPredMap;
  • test/graph_copy_test.cc

    r896 r927  
    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).
     
    7171    nodeCrossRef(ncr).arcCrossRef(ecr).
    7272    node(fn, tn).arc(fa, ta).run();
    73  
     73
    7474  check(countNodes(from) == countNodes(to), "Wrong copy.");
    7575  check(countArcs(from) == countArcs(to), "Wrong copy.");
     
    9999  // Test repeated copy
    100100  digraphCopy(from, to).run();
    101  
     101
    102102  check(countNodes(from) == countNodes(to), "Wrong copy.");
    103103  check(countArcs(from) == countArcs(to), "Wrong copy.");
     
    201201  // Test repeated copy
    202202  graphCopy(from, to).run();
    203  
     203
    204204  check(countNodes(from) == countNodes(to), "Wrong copy.");
    205205  check(countEdges(from) == countEdges(to), "Wrong copy.");
  • test/heap_test.cc

    r921 r927  
    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).
  • test/lgf_test.cc

    r930 r935  
    6464
    6565
    66 int main() 
     66int main()
    6767{
    6868  {
    69     ListDigraph d; 
     69    ListDigraph d;
    7070    ListDigraph::Node s,t;
    7171    ListDigraph::ArcMap<int> label(d);
     
    9494
    9595  {
    96     ListDigraph d; 
     96    ListDigraph d;
    9797    std::istringstream input(test_lgf_nomap);
    9898    digraphReader(d, input).
     
    111111
    112112  {
    113     ListDigraph d; 
     113    ListDigraph d;
    114114    std::istringstream input(test_lgf_bad1);
    115115    bool ok=false;
     
    118118        run();
    119119    }
    120     catch (FormatError&) 
     120    catch (FormatError&)
    121121      {
    122122        ok = true;
     
    140140
    141141  {
    142     ListDigraph d; 
     142    ListDigraph d;
    143143    std::istringstream input(test_lgf_bad2);
    144144    bool ok=false;
  • test/lp_test.cc

    r932 r956  
    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).
     
    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/maps_test.cc

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

    r440 r957  
    3939}
    4040
     41// Check if proper copy consructor is called (use valgrind for testing)
     42template<class _Path>
     43void checkCopy()
     44{
     45  ListDigraph g;
     46  ListDigraph::Arc a  = g.addArc(g.addNode(), g.addNode());
     47 
     48  _Path p,q;
     49  p.addBack(a);
     50  q=p;
     51  _Path r(p);
     52  StaticPath<ListDigraph> s(r);
     53}
     54 
    4155int main() {
    4256  check_concepts();
     57
     58  checkCopy<Path<ListDigraph> >();
     59  checkCopy<SimplePath<ListDigraph> >();
     60  checkCopy<ListPath<ListDigraph> >();
     61
     62  ListDigraph g;
     63  ListDigraph::Arc a  = g.addArc(g.addNode(), g.addNode());
     64 
     65  Path<ListDigraph> p;
     66  StaticPath<ListDigraph> q,r;
     67  p.addBack(a);
     68  q=p;
     69  r=q;
     70  StaticPath<ListDigraph> s(q);
     71
    4372  return 0;
    4473}
  • test/preflow_test.cc

    r902 r927  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2011
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    160160{
    161161  DIGRAPH_TYPEDEFS(SmartDigraph);
    162  
     162
    163163  SmartDigraph g;
    164164  SmartDigraph::ArcMap<int> cap(g),iflow(g);
     
    272272
    273273  initFlowTest();
    274  
     274
    275275  return 0;
    276276}
Note: See TracChangeset for help on using the changeset viewer.