COIN-OR::LEMON - Graph Library

Ignore:
Files:
4 deleted
39 edited

Legend:

Unmodified
Added
Removed
  • CMakeLists.txt

    r574 r565  
    4040ADD_SUBDIRECTORY(lemon)
    4141ADD_SUBDIRECTORY(demo)
    42 ADD_SUBDIRECTORY(tools)
    4342ADD_SUBDIRECTORY(doc)
    4443ADD_SUBDIRECTORY(test)
     
    5857    "${PROJECT_NAME} ${PROJECT_VERSION}")
    5958
    60   SET(CPACK_COMPONENTS_ALL headers library html_documentation bin)
     59  SET(CPACK_COMPONENTS_ALL headers library html_documentation)
    6160
    6261  SET(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C++ headers")
    6362  SET(CPACK_COMPONENT_LIBRARY_DISPLAY_NAME "Dynamic-link library")
    64   SET(CPACK_COMPONENT_BIN_DISPLAY_NAME "Command line utilities")
    6563  SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DISPLAY_NAME "HTML documentation")
    6664
     
    6967  SET(CPACK_COMPONENT_LIBRARY_DESCRIPTION
    7068    "DLL and import library")
    71   SET(CPACK_COMPONENT_BIN_DESCRIPTION
    72     "Command line utilities")
    7369  SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DESCRIPTION
    7470    "Doxygen generated documentation")
  • INSTALL

    r526 r318  
    55tarballs and successfully extracted it. The latest version of LEMON is
    66available at our web page (http://lemon.cs.elte.hu/).
    7 
    8 LEMON provides two different build environments, one is based on "autotool",
    9 while the other is based on "cmake". This file contains instructions only for
    10 the former one, which is the recommended build environment on Linux, Mac OSX
    11 and other unices or if you use Cygwin on Windows. For cmake installation
    12 instructions visit http://lemon.cs.elte.hu.
    137
    148In order to install LEMON from the extracted source tarball you have to
  • lemon/Makefile.am

    r575 r569  
    8484        lemon/math.h \
    8585        lemon/max_matching.h \
    86         lemon/min_cost_arborescence.h \
    8786        lemon/nauty_reader.h \
    8887        lemon/path.h \
  • lemon/bfs.h

    r525 r463  
    5050    ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
    5151    typedef typename Digraph::template NodeMap<typename Digraph::Arc> PredMap;
    52     ///Instantiates a \c PredMap.
    53 
    54     ///This function instantiates a \ref PredMap.
     52    ///Instantiates a PredMap.
     53
     54    ///This function instantiates a PredMap.
    5555    ///\param g is the digraph, to which we would like to define the
    56     ///\ref PredMap.
     56    ///PredMap.
    5757    static PredMap *createPredMap(const Digraph &g)
    5858    {
     
    6565    ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
    6666    typedef NullMap<typename Digraph::Node,bool> ProcessedMap;
    67     ///Instantiates a \c ProcessedMap.
    68 
    69     ///This function instantiates a \ref ProcessedMap.
     67    ///Instantiates a ProcessedMap.
     68
     69    ///This function instantiates a ProcessedMap.
    7070    ///\param g is the digraph, to which
    71     ///we would like to define the \ref ProcessedMap
     71    ///we would like to define the ProcessedMap
    7272#ifdef DOXYGEN
    7373    static ProcessedMap *createProcessedMap(const Digraph &g)
     
    8484    ///It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
    8585    typedef typename Digraph::template NodeMap<bool> ReachedMap;
    86     ///Instantiates a \c ReachedMap.
    87 
    88     ///This function instantiates a \ref ReachedMap.
     86    ///Instantiates a ReachedMap.
     87
     88    ///This function instantiates a ReachedMap.
    8989    ///\param g is the digraph, to which
    90     ///we would like to define the \ref ReachedMap.
     90    ///we would like to define the ReachedMap.
    9191    static ReachedMap *createReachedMap(const Digraph &g)
    9292    {
     
    9999    ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
    100100    typedef typename Digraph::template NodeMap<int> DistMap;
    101     ///Instantiates a \c DistMap.
    102 
    103     ///This function instantiates a \ref DistMap.
     101    ///Instantiates a DistMap.
     102
     103    ///This function instantiates a DistMap.
    104104    ///\param g is the digraph, to which we would like to define the
    105     ///\ref DistMap.
     105    ///DistMap.
    106106    static DistMap *createDistMap(const Digraph &g)
    107107    {
     
    222222    };
    223223    ///\brief \ref named-templ-param "Named parameter" for setting
    224     ///\c PredMap type.
     224    ///PredMap type.
    225225    ///
    226226    ///\ref named-templ-param "Named parameter" for setting
    227     ///\c PredMap type.
     227    ///PredMap type.
    228228    ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
    229229    template <class T>
     
    242242    };
    243243    ///\brief \ref named-templ-param "Named parameter" for setting
    244     ///\c DistMap type.
     244    ///DistMap type.
    245245    ///
    246246    ///\ref named-templ-param "Named parameter" for setting
    247     ///\c DistMap type.
     247    ///DistMap type.
    248248    ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
    249249    template <class T>
     
    262262    };
    263263    ///\brief \ref named-templ-param "Named parameter" for setting
    264     ///\c ReachedMap type.
     264    ///ReachedMap type.
    265265    ///
    266266    ///\ref named-templ-param "Named parameter" for setting
    267     ///\c ReachedMap type.
     267    ///ReachedMap type.
    268268    ///It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
    269269    template <class T>
     
    282282    };
    283283    ///\brief \ref named-templ-param "Named parameter" for setting
    284     ///\c ProcessedMap type.
     284    ///ProcessedMap type.
    285285    ///
    286286    ///\ref named-templ-param "Named parameter" for setting
    287     ///\c ProcessedMap type.
     287    ///ProcessedMap type.
    288288    ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
    289289    template <class T>
     
    301301    };
    302302    ///\brief \ref named-templ-param "Named parameter" for setting
    303     ///\c ProcessedMap type to be <tt>Digraph::NodeMap<bool></tt>.
     303    ///ProcessedMap type to be <tt>Digraph::NodeMap<bool></tt>.
    304304    ///
    305305    ///\ref named-templ-param "Named parameter" for setting
    306     ///\c ProcessedMap type to be <tt>Digraph::NodeMap<bool></tt>.
     306    ///ProcessedMap type to be <tt>Digraph::NodeMap<bool></tt>.
    307307    ///If you don't set it explicitly, it will be automatically allocated.
    308308    struct SetStandardProcessedMap :
     
    11951195  /// This class defines the interface of the BfsVisit events, and
    11961196  /// it could be the base of a real visitor class.
    1197   template <typename GR>
     1197  template <typename _Digraph>
    11981198  struct BfsVisitor {
    1199     typedef GR Digraph;
     1199    typedef _Digraph Digraph;
    12001200    typedef typename Digraph::Arc Arc;
    12011201    typedef typename Digraph::Node Node;
     
    12251225  };
    12261226#else
    1227   template <typename GR>
     1227  template <typename _Digraph>
    12281228  struct BfsVisitor {
    1229     typedef GR Digraph;
     1229    typedef _Digraph Digraph;
    12301230    typedef typename Digraph::Arc Arc;
    12311231    typedef typename Digraph::Node Node;
     
    12551255  ///
    12561256  /// Default traits class of BfsVisit class.
    1257   /// \tparam GR The type of the digraph the algorithm runs on.
    1258   template<class GR>
     1257  /// \tparam _Digraph The type of the digraph the algorithm runs on.
     1258  template<class _Digraph>
    12591259  struct BfsVisitDefaultTraits {
    12601260
    12611261    /// \brief The type of the digraph the algorithm runs on.
    1262     typedef GR Digraph;
     1262    typedef _Digraph Digraph;
    12631263
    12641264    /// \brief The type of the map that indicates which nodes are reached.
     
    12811281  /// \ingroup search
    12821282  ///
    1283   /// \brief BFS algorithm class with visitor interface.
     1283  /// \brief %BFS algorithm class with visitor interface.
    12841284  ///
    1285   /// This class provides an efficient implementation of the BFS algorithm
     1285  /// This class provides an efficient implementation of the %BFS algorithm
    12861286  /// with visitor interface.
    12871287  ///
    1288   /// The BfsVisit class provides an alternative interface to the Bfs
     1288  /// The %BfsVisit class provides an alternative interface to the Bfs
    12891289  /// class. It works with callback mechanism, the BfsVisit object calls
    12901290  /// the member functions of the \c Visitor class on every BFS event.
     
    12951295  /// instead.
    12961296  ///
    1297   /// \tparam GR The type of the digraph the algorithm runs on.
    1298   /// The default type is \ref ListDigraph.
    1299   /// The value of GR is not used directly by \ref BfsVisit,
    1300   /// it is only passed to \ref BfsVisitDefaultTraits.
    1301   /// \tparam VS The Visitor type that is used by the algorithm.
    1302   /// \ref BfsVisitor "BfsVisitor<GR>" is an empty visitor, which
     1297  /// \tparam _Digraph The type of the digraph the algorithm runs on.
     1298  /// The default value is
     1299  /// \ref ListDigraph. The value of _Digraph is not used directly by
     1300  /// \ref BfsVisit, it is only passed to \ref BfsVisitDefaultTraits.
     1301  /// \tparam _Visitor The Visitor type that is used by the algorithm.
     1302  /// \ref BfsVisitor "BfsVisitor<_Digraph>" is an empty visitor, which
    13031303  /// does not observe the BFS events. If you want to observe the BFS
    13041304  /// events, you should implement your own visitor class.
    1305   /// \tparam TR Traits class to set various data types used by the
     1305  /// \tparam _Traits Traits class to set various data types used by the
    13061306  /// algorithm. The default traits class is
    1307   /// \ref BfsVisitDefaultTraits "BfsVisitDefaultTraits<GR>".
     1307  /// \ref BfsVisitDefaultTraits "BfsVisitDefaultTraits<_Digraph>".
    13081308  /// See \ref BfsVisitDefaultTraits for the documentation of
    13091309  /// a BFS visit traits class.
    13101310#ifdef DOXYGEN
    1311   template <typename GR, typename VS, typename TR>
     1311  template <typename _Digraph, typename _Visitor, typename _Traits>
    13121312#else
    1313   template <typename GR = ListDigraph,
    1314             typename VS = BfsVisitor<GR>,
    1315             typename TR = BfsVisitDefaultTraits<GR> >
     1313  template <typename _Digraph = ListDigraph,
     1314            typename _Visitor = BfsVisitor<_Digraph>,
     1315            typename _Traits = BfsVisitDefaultTraits<_Digraph> >
    13161316#endif
    13171317  class BfsVisit {
     
    13191319
    13201320    ///The traits class.
    1321     typedef TR Traits;
     1321    typedef _Traits Traits;
    13221322
    13231323    ///The type of the digraph the algorithm runs on.
     
    13251325
    13261326    ///The visitor type used by the algorithm.
    1327     typedef VS Visitor;
     1327    typedef _Visitor Visitor;
    13281328
    13291329    ///The type of the map that indicates which nodes are reached.
  • lemon/bits/array_map.h

    r525 r463  
    136136    // \brief Template assign operator.
    137137    //
    138     // The given parameter should conform to the ReadMap
     138    // The given parameter should be conform to the ReadMap
    139139    // concecpt and could be indiced by the current item set of
    140140    // the NodeMap. In this case the value for each item
  • lemon/bits/default_map.h

    r582 r564  
    2020#define LEMON_BITS_DEFAULT_MAP_H
    2121
    22 #include <lemon/config.h>
    2322#include <lemon/bits/array_map.h>
    2423#include <lemon/bits/vector_map.h>
  • lemon/bits/path_dump.h

    r576 r566  
    1717 */
    1818
    19 #ifndef LEMON_BITS_PATH_DUMP_H
    20 #define LEMON_BITS_PATH_DUMP_H
     19#ifndef LEMON_BITS_PRED_MAP_PATH_H
     20#define LEMON_BITS_PRED_MAP_PATH_H
    2121
    2222#include <lemon/core.h>
  • lemon/bits/vector_map.h

    r525 r463  
    125125    // \brief Template assign operator.
    126126    //
    127     // The given parameter should conform to the ReadMap
     127    // The given parameter should be conform to the ReadMap
    128128    // concecpt and could be indiced by the current item set of
    129129    // the NodeMap. In this case the value for each item
  • lemon/bits/windows.h

    r576 r511  
    1717 */
    1818
    19 #ifndef LEMON_BITS_WINDOWS_H
    20 #define LEMON_BITS_WINDOWS_H
     19#ifndef LEMON_WINDOWS_H
     20#define LEMON_WINDOWS_H
    2121
    2222#include <string>
  • lemon/circulation.h

    r525 r463  
    3232  ///
    3333  /// Default traits class of Circulation class.
    34   /// \tparam GR Digraph type.
    35   /// \tparam LM Lower bound capacity map type.
    36   /// \tparam UM Upper bound capacity map type.
    37   /// \tparam DM Delta map type.
    38   template <typename GR, typename LM,
    39             typename UM, typename DM>
     34  /// \tparam _Diraph Digraph type.
     35  /// \tparam _LCapMap Lower bound capacity map type.
     36  /// \tparam _UCapMap Upper bound capacity map type.
     37  /// \tparam _DeltaMap Delta map type.
     38  template <typename _Diraph, typename _LCapMap,
     39            typename _UCapMap, typename _DeltaMap>
    4040  struct CirculationDefaultTraits {
    4141
    4242    /// \brief The type of the digraph the algorithm runs on.
    43     typedef GR Digraph;
     43    typedef _Diraph Digraph;
    4444
    4545    /// \brief The type of the map that stores the circulation lower
     
    4848    /// The type of the map that stores the circulation lower bound.
    4949    /// It must meet the \ref concepts::ReadMap "ReadMap" concept.
    50     typedef LM LCapMap;
     50    typedef _LCapMap LCapMap;
    5151
    5252    /// \brief The type of the map that stores the circulation upper
     
    5555    /// The type of the map that stores the circulation upper bound.
    5656    /// It must meet the \ref concepts::ReadMap "ReadMap" concept.
    57     typedef UM UCapMap;
     57    typedef _UCapMap UCapMap;
    5858
    5959    /// \brief The type of the map that stores the lower bound for
     
    6363    /// of the nodes. It must meet the \ref concepts::ReadMap "ReadMap"
    6464    /// concept.
    65     typedef DM DeltaMap;
     65    typedef _DeltaMap DeltaMap;
    6666
    6767    /// \brief The type of the flow values.
     
    138138     in this way.
    139139
    140      \tparam GR The type of the digraph the algorithm runs on.
    141      \tparam LM The type of the lower bound capacity map. The default
    142      map type is \ref concepts::Digraph::ArcMap "GR::ArcMap<int>".
    143      \tparam UM The type of the upper bound capacity map. The default
    144      map type is \c LM.
    145      \tparam DM The type of the map that stores the lower bound
     140     \tparam _Digraph The type of the digraph the algorithm runs on.
     141     \tparam _LCapMap The type of the lower bound capacity map. The default
     142     map type is \ref concepts::Digraph::ArcMap "_Digraph::ArcMap<int>".
     143     \tparam _UCapMap The type of the upper bound capacity map. The default
     144     map type is \c _LCapMap.
     145     \tparam _DeltaMap The type of the map that stores the lower bound
    146146     for the supply of the nodes. The default map type is
    147      \ref concepts::Digraph::NodeMap "GR::NodeMap<UM::Value>".
     147     \c _Digraph::ArcMap<_UCapMap::Value>.
    148148  */
    149149#ifdef DOXYGEN
    150 template< typename GR,
    151           typename LM,
    152           typename UM,
    153           typename DM,
    154           typename TR >
     150template< typename _Digraph,
     151          typename _LCapMap,
     152          typename _UCapMap,
     153          typename _DeltaMap,
     154          typename _Traits >
    155155#else
    156 template< typename GR,
    157           typename LM = typename GR::template ArcMap<int>,
    158           typename UM = LM,
    159           typename DM = typename GR::template NodeMap<typename UM::Value>,
    160           typename TR = CirculationDefaultTraits<GR, LM, UM, DM> >
     156template< typename _Digraph,
     157          typename _LCapMap = typename _Digraph::template ArcMap<int>,
     158          typename _UCapMap = _LCapMap,
     159          typename _DeltaMap = typename _Digraph::
     160                               template NodeMap<typename _UCapMap::Value>,
     161          typename _Traits=CirculationDefaultTraits<_Digraph, _LCapMap,
     162                                                    _UCapMap, _DeltaMap> >
    161163#endif
    162164  class Circulation {
     
    164166
    165167    ///The \ref CirculationDefaultTraits "traits class" of the algorithm.
    166     typedef TR Traits;
     168    typedef _Traits Traits;
    167169    ///The type of the digraph the algorithm runs on.
    168170    typedef typename Traits::Digraph Digraph;
  • lemon/clp.cc

    r587 r485  
    5757  }
    5858
    59   ClpLp* ClpLp::newSolver() const {
     59  ClpLp* ClpLp::_newSolver() const {
    6060    ClpLp* newlp = new ClpLp;
    6161    return newlp;
    6262  }
    6363
    64   ClpLp* ClpLp::cloneSolver() const {
     64  ClpLp* ClpLp::_cloneSolver() const {
    6565    ClpLp* copylp = new ClpLp(*this);
    6666    return copylp;
  • lemon/clp.h

    r587 r485  
    5757    ~ClpLp();
    5858
    59     /// \e
    60     virtual ClpLp* newSolver() const;
    61     /// \e
    62     virtual ClpLp* cloneSolver() const;
    63 
    6459  protected:
    6560
     
    7166
    7267  protected:
     68
     69    virtual ClpLp* _newSolver() const;
     70    virtual ClpLp* _cloneSolver() const;
    7371
    7472    virtual const char* _solverName() const;
  • lemon/concepts/digraph.h

    r576 r463  
    1717 */
    1818
    19 #ifndef LEMON_CONCEPTS_DIGRAPH_H
    20 #define LEMON_CONCEPTS_DIGRAPH_H
     19#ifndef LEMON_CONCEPT_DIGRAPH_H
     20#define LEMON_CONCEPT_DIGRAPH_H
    2121
    2222///\ingroup graph_concepts
     
    485485
    486486
    487 #endif
     487#endif // LEMON_CONCEPT_DIGRAPH_H
  • lemon/concepts/graph.h

    r576 r463  
    2121///\brief The concept of Undirected Graphs.
    2222
    23 #ifndef LEMON_CONCEPTS_GRAPH_H
    24 #define LEMON_CONCEPTS_GRAPH_H
     23#ifndef LEMON_CONCEPT_GRAPH_H
     24#define LEMON_CONCEPT_GRAPH_H
    2525
    2626#include <lemon/concepts/graph_components.h>
     27#include <lemon/concepts/graph.h>
    2728#include <lemon/core.h>
    2829
  • lemon/concepts/graph_components.h

    r581 r463  
    2222
    2323
    24 #ifndef LEMON_CONCEPTS_GRAPH_COMPONENTS_H
    25 #define LEMON_CONCEPTS_GRAPH_COMPONENTS_H
     24#ifndef LEMON_CONCEPT_GRAPH_COMPONENTS_H
     25#define LEMON_CONCEPT_GRAPH_COMPONENTS_H
    2626
    2727#include <lemon/core.h>
     
    115115    ///
    116116    /// This class provides the minimal set of features needed for a
    117     /// directed graph structure. All digraph concepts have to
     117    /// directed graph structure. All digraph concepts have to be
    118118    /// conform to this base directed graph. It just provides types
    119119    /// for nodes and arcs and functions to get the source and the
     
    180180    /// This class provides the minimal set of features needed for an
    181181    /// undirected graph structure. All undirected graph concepts have
    182     /// to conform to this base graph. It just provides types for
     182    /// to be conform to this base graph. It just provides types for
    183183    /// nodes, arcs and edges and functions to get the
    184184    /// source and the target of the arcs and edges,
     
    295295    /// This class provides beside the core digraph features
    296296    /// core id functions for the digraph structure.
    297     /// The most of the base digraphs should conform to this concept.
     297    /// The most of the base digraphs should be conform to this concept.
    298298    /// The id's are unique and immutable.
    299299    template <typename _Base = BaseDigraphComponent>
     
    373373    /// This class provides beside the core undirected graph features
    374374    /// core id functions for the undirected graph structure.  The
    375     /// most of the base undirected graphs should conform to this
     375    /// most of the base undirected graphs should be conform to this
    376376    /// concept.  The id's are unique and immutable.
    377377    template <typename _Base = BaseGraphComponent>
  • lemon/concepts/heap.h

    r576 r566  
    2121///\brief The concept of heaps.
    2222
    23 #ifndef LEMON_CONCEPTS_HEAP_H
    24 #define LEMON_CONCEPTS_HEAP_H
     23#ifndef LEMON_CONCEPT_HEAP_H
     24#define LEMON_CONCEPT_HEAP_H
    2525
    2626#include <lemon/core.h>
     
    244244  } // namespace lemon
    245245}
    246 #endif
     246#endif // LEMON_CONCEPT_PATH_H
  • lemon/concepts/maps.h

    r576 r463  
    1717 */
    1818
    19 #ifndef LEMON_CONCEPTS_MAPS_H
    20 #define LEMON_CONCEPTS_MAPS_H
     19#ifndef LEMON_CONCEPT_MAPS_H
     20#define LEMON_CONCEPT_MAPS_H
    2121
    2222#include <lemon/core.h>
     
    214214} //namespace lemon
    215215
    216 #endif
     216#endif // LEMON_CONCEPT_MAPS_H
  • lemon/concepts/path.h

    r576 r463  
    2222///
    2323
    24 #ifndef LEMON_CONCEPTS_PATH_H
    25 #define LEMON_CONCEPTS_PATH_H
     24#ifndef LEMON_CONCEPT_PATH_H
     25#define LEMON_CONCEPT_PATH_H
    2626
    2727#include <lemon/core.h>
     
    306306} // namespace lemon
    307307
    308 #endif
     308#endif // LEMON_CONCEPT_PATH_H
  • lemon/core.h

    r582 r463  
    2323#include <algorithm>
    2424
    25 #include <lemon/core.h>
    2625#include <lemon/bits/enable_if.h>
    2726#include <lemon/bits/traits.h>
  • lemon/cplex.cc

    r587 r485  
    452452  CplexLp::~CplexLp() {}
    453453
    454   CplexLp* CplexLp::newSolver() const { return new CplexLp; }
    455   CplexLp* CplexLp::cloneSolver() const {return new CplexLp(*this); }
     454  CplexLp* CplexLp::_newSolver() const { return new CplexLp; }
     455  CplexLp* CplexLp::_cloneSolver() const {return new CplexLp(*this); }
    456456
    457457  const char* CplexLp::_solverName() const { return "CplexLp"; }
     
    824824  CplexMip::~CplexMip() {}
    825825
    826   CplexMip* CplexMip::newSolver() const { return new CplexMip; }
    827   CplexMip* CplexMip::cloneSolver() const {return new CplexMip(*this); }
     826  CplexMip* CplexMip::_newSolver() const { return new CplexMip; }
     827  CplexMip* CplexMip::_cloneSolver() const {return new CplexMip(*this); }
    828828
    829829  const char* CplexMip::_solverName() const { return "CplexMip"; }
  • lemon/cplex.h

    r587 r485  
    161161  /// This class implements an interface for the CPLEX LP solver.
    162162  ///\ingroup lp_group
    163   class CplexLp : public LpSolver, public CplexBase {
     163  class CplexLp : public CplexBase, public LpSolver {
    164164  public:
    165165    /// \e
     
    171171    /// \e
    172172    virtual ~CplexLp();
    173 
    174     /// \e
    175     virtual CplexLp* cloneSolver() const;
    176     /// \e
    177     virtual CplexLp* newSolver() const;
    178173
    179174  private:
     
    191186
    192187  protected:
     188
     189    virtual CplexLp* _cloneSolver() const;
     190    virtual CplexLp* _newSolver() const;
    193191
    194192    virtual const char* _solverName() const;
     
    225223  /// This class implements an interface for the CPLEX MIP solver.
    226224  ///\ingroup lp_group
    227   class CplexMip : public MipSolver, public CplexBase {
     225  class CplexMip : public CplexBase, public MipSolver {
    228226  public:
    229227    /// \e
  • lemon/dfs.h

    r525 r463  
    5050    ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
    5151    typedef typename Digraph::template NodeMap<typename Digraph::Arc> PredMap;
    52     ///Instantiates a \c PredMap.
    53 
    54     ///This function instantiates a \ref PredMap.
     52    ///Instantiates a PredMap.
     53
     54    ///This function instantiates a PredMap.
    5555    ///\param g is the digraph, to which we would like to define the
    56     ///\ref PredMap.
     56    ///PredMap.
    5757    static PredMap *createPredMap(const Digraph &g)
    5858    {
     
    6565    ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
    6666    typedef NullMap<typename Digraph::Node,bool> ProcessedMap;
    67     ///Instantiates a \c ProcessedMap.
    68 
    69     ///This function instantiates a \ref ProcessedMap.
     67    ///Instantiates a ProcessedMap.
     68
     69    ///This function instantiates a ProcessedMap.
    7070    ///\param g is the digraph, to which
    71     ///we would like to define the \ref ProcessedMap.
     71    ///we would like to define the ProcessedMap
    7272#ifdef DOXYGEN
    7373    static ProcessedMap *createProcessedMap(const Digraph &g)
     
    8484    ///It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
    8585    typedef typename Digraph::template NodeMap<bool> ReachedMap;
    86     ///Instantiates a \c ReachedMap.
    87 
    88     ///This function instantiates a \ref ReachedMap.
     86    ///Instantiates a ReachedMap.
     87
     88    ///This function instantiates a ReachedMap.
    8989    ///\param g is the digraph, to which
    90     ///we would like to define the \ref ReachedMap.
     90    ///we would like to define the ReachedMap.
    9191    static ReachedMap *createReachedMap(const Digraph &g)
    9292    {
     
    9999    ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
    100100    typedef typename Digraph::template NodeMap<int> DistMap;
    101     ///Instantiates a \c DistMap.
    102 
    103     ///This function instantiates a \ref DistMap.
     101    ///Instantiates a DistMap.
     102
     103    ///This function instantiates a DistMap.
    104104    ///\param g is the digraph, to which we would like to define the
    105     ///\ref DistMap.
     105    ///DistMap.
    106106    static DistMap *createDistMap(const Digraph &g)
    107107    {
     
    221221    };
    222222    ///\brief \ref named-templ-param "Named parameter" for setting
    223     ///\c PredMap type.
     223    ///PredMap type.
    224224    ///
    225225    ///\ref named-templ-param "Named parameter" for setting
    226     ///\c PredMap type.
     226    ///PredMap type.
    227227    ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
    228228    template <class T>
     
    241241    };
    242242    ///\brief \ref named-templ-param "Named parameter" for setting
    243     ///\c DistMap type.
     243    ///DistMap type.
    244244    ///
    245245    ///\ref named-templ-param "Named parameter" for setting
    246     ///\c DistMap type.
     246    ///DistMap type.
    247247    ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
    248248    template <class T>
     
    261261    };
    262262    ///\brief \ref named-templ-param "Named parameter" for setting
    263     ///\c ReachedMap type.
     263    ///ReachedMap type.
    264264    ///
    265265    ///\ref named-templ-param "Named parameter" for setting
    266     ///\c ReachedMap type.
     266    ///ReachedMap type.
    267267    ///It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
    268268    template <class T>
     
    281281    };
    282282    ///\brief \ref named-templ-param "Named parameter" for setting
    283     ///\c ProcessedMap type.
     283    ///ProcessedMap type.
    284284    ///
    285285    ///\ref named-templ-param "Named parameter" for setting
    286     ///\c ProcessedMap type.
     286    ///ProcessedMap type.
    287287    ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
    288288    template <class T>
     
    299299    };
    300300    ///\brief \ref named-templ-param "Named parameter" for setting
    301     ///\c ProcessedMap type to be <tt>Digraph::NodeMap<bool></tt>.
     301    ///ProcessedMap type to be <tt>Digraph::NodeMap<bool></tt>.
    302302    ///
    303303    ///\ref named-templ-param "Named parameter" for setting
    304     ///\c ProcessedMap type to be <tt>Digraph::NodeMap<bool></tt>.
     304    ///ProcessedMap type to be <tt>Digraph::NodeMap<bool></tt>.
    305305    ///If you don't set it explicitly, it will be automatically allocated.
    306306    struct SetStandardProcessedMap :
     
    11271127  /// This class defines the interface of the DfsVisit events, and
    11281128  /// it could be the base of a real visitor class.
    1129   template <typename GR>
     1129  template <typename _Digraph>
    11301130  struct DfsVisitor {
    1131     typedef GR Digraph;
     1131    typedef _Digraph Digraph;
    11321132    typedef typename Digraph::Arc Arc;
    11331133    typedef typename Digraph::Node Node;
     
    11651165  };
    11661166#else
    1167   template <typename GR>
     1167  template <typename _Digraph>
    11681168  struct DfsVisitor {
    1169     typedef GR Digraph;
     1169    typedef _Digraph Digraph;
    11701170    typedef typename Digraph::Arc Arc;
    11711171    typedef typename Digraph::Node Node;
     
    12001200  /// Default traits class of DfsVisit class.
    12011201  /// \tparam _Digraph The type of the digraph the algorithm runs on.
    1202   template<class GR>
     1202  template<class _Digraph>
    12031203  struct DfsVisitDefaultTraits {
    12041204
    12051205    /// \brief The type of the digraph the algorithm runs on.
    1206     typedef GR Digraph;
     1206    typedef _Digraph Digraph;
    12071207
    12081208    /// \brief The type of the map that indicates which nodes are reached.
     
    12251225  /// \ingroup search
    12261226  ///
    1227   /// \brief DFS algorithm class with visitor interface.
     1227  /// \brief %DFS algorithm class with visitor interface.
    12281228  ///
    1229   /// This class provides an efficient implementation of the DFS algorithm
     1229  /// This class provides an efficient implementation of the %DFS algorithm
    12301230  /// with visitor interface.
    12311231  ///
    1232   /// The DfsVisit class provides an alternative interface to the Dfs
     1232  /// The %DfsVisit class provides an alternative interface to the Dfs
    12331233  /// class. It works with callback mechanism, the DfsVisit object calls
    12341234  /// the member functions of the \c Visitor class on every DFS event.
     
    12391239  /// instead.
    12401240  ///
    1241   /// \tparam GR The type of the digraph the algorithm runs on.
    1242   /// The default type is \ref ListDigraph.
    1243   /// The value of GR is not used directly by \ref DfsVisit,
    1244   /// it is only passed to \ref DfsVisitDefaultTraits.
    1245   /// \tparam VS The Visitor type that is used by the algorithm.
    1246   /// \ref DfsVisitor "DfsVisitor<GR>" is an empty visitor, which
     1241  /// \tparam _Digraph The type of the digraph the algorithm runs on.
     1242  /// The default value is
     1243  /// \ref ListDigraph. The value of _Digraph is not used directly by
     1244  /// \ref DfsVisit, it is only passed to \ref DfsVisitDefaultTraits.
     1245  /// \tparam _Visitor The Visitor type that is used by the algorithm.
     1246  /// \ref DfsVisitor "DfsVisitor<_Digraph>" is an empty visitor, which
    12471247  /// does not observe the DFS events. If you want to observe the DFS
    12481248  /// events, you should implement your own visitor class.
    1249   /// \tparam TR Traits class to set various data types used by the
     1249  /// \tparam _Traits Traits class to set various data types used by the
    12501250  /// algorithm. The default traits class is
    1251   /// \ref DfsVisitDefaultTraits "DfsVisitDefaultTraits<GR>".
     1251  /// \ref DfsVisitDefaultTraits "DfsVisitDefaultTraits<_Digraph>".
    12521252  /// See \ref DfsVisitDefaultTraits for the documentation of
    12531253  /// a DFS visit traits class.
    12541254#ifdef DOXYGEN
    1255   template <typename GR, typename VS, typename TR>
     1255  template <typename _Digraph, typename _Visitor, typename _Traits>
    12561256#else
    1257   template <typename GR = ListDigraph,
    1258             typename VS = DfsVisitor<GR>,
    1259             typename TR = DfsVisitDefaultTraits<GR> >
     1257  template <typename _Digraph = ListDigraph,
     1258            typename _Visitor = DfsVisitor<_Digraph>,
     1259            typename _Traits = DfsVisitDefaultTraits<_Digraph> >
    12601260#endif
    12611261  class DfsVisit {
     
    12631263
    12641264    ///The traits class.
    1265     typedef TR Traits;
     1265    typedef _Traits Traits;
    12661266
    12671267    ///The type of the digraph the algorithm runs on.
     
    12691269
    12701270    ///The visitor type used by the algorithm.
    1271     typedef VS Visitor;
     1271    typedef _Visitor Visitor;
    12721272
    12731273    ///The type of the map that indicates which nodes are reached.
  • lemon/dijkstra.h

    r525 r463  
    7474    typedef typename LM::Value Value;
    7575
    76     /// Operation traits for %Dijkstra algorithm.
     76    /// Operation traits for Dijkstra algorithm.
    7777
    7878    /// This class defines the operations that are used in the algorithm.
     
    8585    /// Usually it is \c Digraph::NodeMap<int>.
    8686    typedef typename Digraph::template NodeMap<int> HeapCrossRef;
    87     ///Instantiates a \c HeapCrossRef.
     87    ///Instantiates a \ref HeapCrossRef.
    8888
    8989    ///This function instantiates a \ref HeapCrossRef.
     
    9595    }
    9696
    97     ///The heap type used by the %Dijkstra algorithm.
     97    ///The heap type used by the Dijkstra algorithm.
    9898
    9999    ///The heap type used by the Dijkstra algorithm.
     
    102102    ///\sa Dijkstra
    103103    typedef BinHeap<typename LM::Value, HeapCrossRef, std::less<Value> > Heap;
    104     ///Instantiates a \c Heap.
     104    ///Instantiates a \ref Heap.
    105105
    106106    ///This function instantiates a \ref Heap.
     
    117117    ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
    118118    typedef typename Digraph::template NodeMap<typename Digraph::Arc> PredMap;
    119     ///Instantiates a \c PredMap.
    120 
    121     ///This function instantiates a \ref PredMap.
     119    ///Instantiates a PredMap.
     120
     121    ///This function instantiates a PredMap.
    122122    ///\param g is the digraph, to which we would like to define the
    123     ///\ref PredMap.
     123    ///PredMap.
    124124    static PredMap *createPredMap(const Digraph &g)
    125125    {
     
    133133    ///By default it is a NullMap.
    134134    typedef NullMap<typename Digraph::Node,bool> ProcessedMap;
    135     ///Instantiates a \c ProcessedMap.
    136 
    137     ///This function instantiates a \ref ProcessedMap.
     135    ///Instantiates a ProcessedMap.
     136
     137    ///This function instantiates a ProcessedMap.
    138138    ///\param g is the digraph, to which
    139     ///we would like to define the \ref ProcessedMap.
     139    ///we would like to define the ProcessedMap
    140140#ifdef DOXYGEN
    141141    static ProcessedMap *createProcessedMap(const Digraph &g)
     
    152152    ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
    153153    typedef typename Digraph::template NodeMap<typename LM::Value> DistMap;
    154     ///Instantiates a \c DistMap.
    155 
    156     ///This function instantiates a \ref DistMap.
     154    ///Instantiates a DistMap.
     155
     156    ///This function instantiates a DistMap.
    157157    ///\param g is the digraph, to which we would like to define
    158     ///the \ref DistMap.
     158    ///the DistMap
    159159    static DistMap *createDistMap(const Digraph &g)
    160160    {
     
    217217    ///The heap type used by the algorithm.
    218218    typedef typename TR::Heap Heap;
    219     ///\brief The \ref DijkstraDefaultOperationTraits "operation traits class"
    220     ///of the algorithm.
     219    ///The operation traits class.
    221220    typedef typename TR::OperationTraits OperationTraits;
    222221
     
    234233    const Digraph *G;
    235234    //Pointer to the length map.
    236     const LengthMap *_length;
     235    const LengthMap *length;
    237236    //Pointer to the map of predecessors arcs.
    238237    PredMap *_pred;
     
    299298    };
    300299    ///\brief \ref named-templ-param "Named parameter" for setting
    301     ///\c PredMap type.
     300    ///PredMap type.
    302301    ///
    303302    ///\ref named-templ-param "Named parameter" for setting
    304     ///\c PredMap type.
     303    ///PredMap type.
    305304    ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
    306305    template <class T>
     
    320319    };
    321320    ///\brief \ref named-templ-param "Named parameter" for setting
    322     ///\c DistMap type.
     321    ///DistMap type.
    323322    ///
    324323    ///\ref named-templ-param "Named parameter" for setting
    325     ///\c DistMap type.
     324    ///DistMap type.
    326325    ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
    327326    template <class T>
     
    341340    };
    342341    ///\brief \ref named-templ-param "Named parameter" for setting
    343     ///\c ProcessedMap type.
     342    ///ProcessedMap type.
    344343    ///
    345344    ///\ref named-templ-param "Named parameter" for setting
    346     ///\c ProcessedMap type.
     345    ///ProcessedMap type.
    347346    ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
    348347    template <class T>
     
    360359    };
    361360    ///\brief \ref named-templ-param "Named parameter" for setting
    362     ///\c ProcessedMap type to be <tt>Digraph::NodeMap<bool></tt>.
     361    ///ProcessedMap type to be <tt>Digraph::NodeMap<bool></tt>.
    363362    ///
    364363    ///\ref named-templ-param "Named parameter" for setting
    365     ///\c ProcessedMap type to be <tt>Digraph::NodeMap<bool></tt>.
     364    ///ProcessedMap type to be <tt>Digraph::NodeMap<bool></tt>.
    366365    ///If you don't set it explicitly, it will be automatically allocated.
    367366    struct SetStandardProcessedMap
     
    441440    ///
    442441    ///\ref named-templ-param "Named parameter" for setting
    443     ///\c OperationTraits type.
     442    ///\ref OperationTraits type.
    444443    template <class T>
    445444    struct SetOperationTraits
     
    460459
    461460    ///Constructor.
    462     ///\param g The digraph the algorithm runs on.
    463     ///\param length The length map used by the algorithm.
    464     Dijkstra(const Digraph& g, const LengthMap& length) :
    465       G(&g), _length(&length),
     461    ///\param _g The digraph the algorithm runs on.
     462    ///\param _length The length map used by the algorithm.
     463    Dijkstra(const Digraph& _g, const LengthMap& _length) :
     464      G(&_g), length(&_length),
    466465      _pred(NULL), local_pred(false),
    467466      _dist(NULL), local_dist(false),
     
    487486    Dijkstra &lengthMap(const LengthMap &m)
    488487    {
    489       _length = &m;
     488      length = &m;
    490489      return *this;
    491490    }
     
    640639        switch(_heap->state(w)) {
    641640        case Heap::PRE_HEAP:
    642           _heap->push(w,OperationTraits::plus(oldvalue, (*_length)[e]));
     641          _heap->push(w,OperationTraits::plus(oldvalue, (*length)[e]));
    643642          _pred->set(w,e);
    644643          break;
    645644        case Heap::IN_HEAP:
    646645          {
    647             Value newvalue = OperationTraits::plus(oldvalue, (*_length)[e]);
     646            Value newvalue = OperationTraits::plus(oldvalue, (*length)[e]);
    648647            if ( OperationTraits::less(newvalue, (*_heap)[w]) ) {
    649648              _heap->decrease(w, newvalue);
  • lemon/dimacs.h

    r572 r463  
    296296  }
    297297
    298   template<typename Graph>
    299   typename enable_if<lemon::UndirectedTagIndicator<Graph>,void>::type
    300   _addArcEdge(Graph &g, typename Graph::Node s, typename Graph::Node t,
    301               dummy<0> = 0)
    302   {
    303     g.addEdge(s,t);
    304   }
    305   template<typename Graph>
    306   typename disable_if<lemon::UndirectedTagIndicator<Graph>,void>::type
    307   _addArcEdge(Graph &g, typename Graph::Node s, typename Graph::Node t,
    308               dummy<1> = 1)
    309   {
    310     g.addArc(s,t);
    311   }
    312  
    313   /// DIMACS plain (di)graph reader function.
    314   ///
    315   /// This function reads a (di)graph without any designated nodes and
     298  /// DIMACS plain digraph reader function.
     299  ///
     300  /// This function reads a digraph without any designated nodes and
    316301  /// maps from DIMACS format, i.e. from DIMACS files having a line
    317302  /// starting with
     
    323308  /// If the file type was previously evaluated by dimacsType(), then
    324309  /// the descriptor struct should be given by the \c dest parameter.
    325   template<typename Graph>
    326   void readDimacsMat(std::istream& is, Graph &g,
    327                      DimacsDescriptor desc=DimacsDescriptor())
    328   {
     310  template<typename Digraph>
     311  void readDimacsMat(std::istream& is, Digraph &g,
     312                     DimacsDescriptor desc=DimacsDescriptor()) {
     313    typename Digraph::Node u,v;
     314    NullMap<typename Digraph::Arc, int> n;
    329315    if(desc.type==DimacsDescriptor::NONE) desc=dimacsType(is);
    330316    if(desc.type!=DimacsDescriptor::MAT)
    331317      throw FormatError("Problem type mismatch");
    332 
    333     g.clear();
    334     std::vector<typename Graph::Node> nodes;
    335     char c;
    336     int i, j;
    337     std::string str;
    338     nodes.resize(desc.nodeNum + 1);
    339     for (int k = 1; k <= desc.nodeNum; ++k) {
    340       nodes[k] = g.addNode();
    341     }
    342    
    343     while (is >> c) {
    344       switch (c) {
    345       case 'c': // comment line
    346         getline(is, str);
    347         break;
    348       case 'n': // node definition line
    349         break;
    350       case 'a': // arc (arc) definition line
    351         is >> i >> j;
    352         getline(is, str);
    353         _addArcEdge(g,nodes[i], nodes[j]);
    354         break;
    355       }
    356     }
     318    _readDimacs(is, g, n, u, v, desc);
    357319  }
    358320
  • lemon/glpk.cc

    r589 r585  
    541541  }
    542542
    543   GlpkLp* GlpkLp::newSolver() const { return new GlpkLp; }
    544   GlpkLp* GlpkLp::cloneSolver() const { return new GlpkLp(*this); }
     543  GlpkLp* GlpkLp::_newSolver() const { return new GlpkLp; }
     544  GlpkLp* GlpkLp::_cloneSolver() const { return new GlpkLp(*this); }
    545545
    546546  const char* GlpkLp::_solverName() const { return "GlpkLp"; }
     
    947947  }
    948948
    949   GlpkMip* GlpkMip::newSolver() const { return new GlpkMip; }
    950   GlpkMip* GlpkMip::cloneSolver() const {return new GlpkMip(*this); }
     949  GlpkMip* GlpkMip::_newSolver() const { return new GlpkMip; }
     950  GlpkMip* GlpkMip::_cloneSolver() const {return new GlpkMip(*this); }
    951951
    952952  const char* GlpkMip::_solverName() const { return "GlpkMip"; }
  • lemon/glpk.h

    r589 r585  
    132132  /// This class implements an interface for the GLPK LP solver.
    133133  ///\ingroup lp_group
    134   class GlpkLp : public LpSolver, public GlpkBase {
     134  class GlpkLp : public GlpkBase, public LpSolver {
    135135  public:
    136136
     
    139139    ///\e
    140140    GlpkLp(const GlpkLp&);
    141 
    142     ///\e
    143     virtual GlpkLp* cloneSolver() const;
    144     ///\e
    145     virtual GlpkLp* newSolver() const;
    146141
    147142  private:
     
    153148
    154149  protected:
     150
     151    virtual GlpkLp* _cloneSolver() const;
     152    virtual GlpkLp* _newSolver() const;
    155153
    156154    virtual const char* _solverName() const;
     
    168166    virtual Value _getDualRay(int i) const;
    169167
     168    ///\todo It should be clarified
     169    ///
    170170    virtual ProblemType _getPrimalType() const;
    171171    virtual ProblemType _getDualType() const;
     
    216216  /// This class implements an interface for the GLPK MIP solver.
    217217  ///\ingroup lp_group
    218   class GlpkMip : public MipSolver, public GlpkBase {
     218  class GlpkMip : public GlpkBase, public MipSolver {
    219219  public:
    220220
     
    224224    GlpkMip(const GlpkMip&);
    225225
    226     virtual GlpkMip* cloneSolver() const;
    227     virtual GlpkMip* newSolver() const;
    228 
    229   protected:
     226  protected:
     227
     228    virtual GlpkMip* _cloneSolver() const;
     229    virtual GlpkMip* _newSolver() const;
    230230
    231231    virtual const char* _solverName() const;
  • lemon/lp_base.h

    r587 r561  
    919919
    920920    //Abstract virtual functions
     921    virtual LpBase* _newSolver() const = 0;
     922    virtual LpBase* _cloneSolver() const = 0;
    921923
    922924    virtual int _addColId(int col) { return cols.addIndex(col); }
     
    985987    /// Virtual destructor
    986988    virtual ~LpBase() {}
     989
     990    ///Creates a new LP problem
     991    LpBase* newSolver() {return _newSolver();}
     992    ///Makes a copy of the LP problem
     993    LpBase* cloneSolver() {return _cloneSolver();}
    987994
    988995    ///Gives back the name of the solver.
     
    18151822  public:
    18161823
    1817     ///Allocate a new LP problem instance
    1818     virtual LpSolver* newSolver() const = 0;
    1819     ///Make a copy of the LP problem
    1820     virtual LpSolver* cloneSolver() const = 0;
    1821 
    18221824    ///\name Solve the LP
    18231825
     
    19341936    ///@}
    19351937
     1938    LpSolver* newSolver() {return _newSolver();}
     1939    LpSolver* cloneSolver() {return _cloneSolver();}
     1940
    19361941  protected:
    19371942
     1943    virtual LpSolver* _newSolver() const = 0;
     1944    virtual LpSolver* _cloneSolver() const = 0;
    19381945  };
    19391946
     
    19691976    };
    19701977
    1971     ///Allocate a new MIP problem instance
    1972     virtual MipSolver* newSolver() const = 0;
    1973     ///Make a copy of the MIP problem
    1974     virtual MipSolver* cloneSolver() const = 0;
    1975 
    19761978    ///\name Solve the MIP
    19771979
     
    20612063    virtual Value _getSolValue() const = 0;
    20622064
     2065  public:
     2066
     2067    MipSolver* newSolver() {return _newSolver();}
     2068    MipSolver* cloneSolver() {return _cloneSolver();}
     2069
     2070  protected:
     2071
     2072    virtual MipSolver* _newSolver() const = 0;
     2073    virtual MipSolver* _cloneSolver() const = 0;
    20632074  };
    20642075
  • lemon/lp_skeleton.cc

    r587 r482  
    106106  { return BASIC; }
    107107
    108   LpSkeleton* LpSkeleton::newSolver() const
     108  LpSkeleton* LpSkeleton::_newSolver() const
    109109  { return static_cast<LpSkeleton*>(0); }
    110110
    111   LpSkeleton* LpSkeleton::cloneSolver() const
     111  LpSkeleton* LpSkeleton::_cloneSolver() const
    112112  { return static_cast<LpSkeleton*>(0); }
    113113
     
    123123  { return UNDEFINED; }
    124124
    125   MipSkeleton* MipSkeleton::newSolver() const
     125  MipSkeleton* MipSkeleton::_newSolver() const
    126126  { return static_cast<MipSkeleton*>(0); }
    127127
    128   MipSkeleton* MipSkeleton::cloneSolver() const
     128  MipSkeleton* MipSkeleton::_cloneSolver() const
    129129  { return static_cast<MipSkeleton*>(0); }
    130130
  • lemon/lp_skeleton.h

    r588 r482  
    1717 */
    1818
    19 #ifndef LEMON_LP_SKELETON_H
    20 #define LEMON_LP_SKELETON_H
     19#ifndef LEMON_LP_SKELETON
     20#define LEMON_LP_SKELETON
    2121
    2222#include <lemon/lp_base.h>
    2323
    2424///\file
    25 ///\brief Skeleton file to implement LP/MIP solver interfaces
    26 /// 
    27 ///The classes in this file do nothing, but they can serve as skeletons when
    28 ///implementing an interface to new solvers.
     25///\brief A skeleton file to implement LP solver interfaces
    2926namespace lemon {
    3027
    31   ///A skeleton class to implement LP/MIP solver base interface
    32  
    33   ///This class does nothing, but it can serve as a skeleton when
    34   ///implementing an interface to new solvers.
     28  ///A skeleton class to implement LP solver interfaces
    3529  class SkeletonSolverBase : public virtual LpBase {
    3630    int col_num,row_num;
     
    143137  };
    144138
    145   /// \brief Skeleton class for an LP solver interface
     139  /// \brief Interface for a skeleton LP solver
    146140  ///
    147   ///This class does nothing, but it can serve as a skeleton when
    148   ///implementing an interface to new solvers.
    149 
     141  /// This class implements an interface for a skeleton LP solver.
    150142  ///\ingroup lp_group
    151   class LpSkeleton : public LpSolver, public SkeletonSolverBase {
     143  class LpSkeleton : public SkeletonSolverBase, public LpSolver {
    152144  public:
    153     ///\e
    154     LpSkeleton() : LpSolver(), SkeletonSolverBase() {}
    155     ///\e
    156     virtual LpSkeleton* newSolver() const;
    157     ///\e
    158     virtual LpSkeleton* cloneSolver() const;
     145    LpSkeleton() : SkeletonSolverBase(), LpSolver() {}
     146
    159147  protected:
    160148
     
    186174
    187175    ///\e
     176    virtual LpSkeleton* _newSolver() const;
     177    ///\e
     178    virtual LpSkeleton* _cloneSolver() const;
     179    ///\e
    188180    virtual const char* _solverName() const;
    189181
    190182  };
    191183
    192   /// \brief Skeleton class for a MIP solver interface
     184  /// \brief Interface for a skeleton MIP solver
    193185  ///
    194   ///This class does nothing, but it can serve as a skeleton when
    195   ///implementing an interface to new solvers.
     186  /// This class implements an interface for a skeleton MIP solver.
    196187  ///\ingroup lp_group
    197   class MipSkeleton : public MipSolver, public SkeletonSolverBase {
     188  class MipSkeleton : public SkeletonSolverBase, public MipSolver {
    198189  public:
    199     ///\e
    200     MipSkeleton() : MipSolver(), SkeletonSolverBase() {}
    201     ///\e
    202     virtual MipSkeleton* newSolver() const;
    203     ///\e
    204     virtual MipSkeleton* cloneSolver() const;
     190    MipSkeleton() : SkeletonSolverBase(), MipSolver() {}
    205191
    206192  protected:
    207193    ///\e
     194
     195    ///\bug Wrong interface
     196    ///
    208197    virtual SolveExitStatus _solve();
    209198
    210199    ///\e
     200
     201    ///\bug Wrong interface
     202    ///
    211203    virtual Value _getSol(int i) const;
    212204
    213205    ///\e
     206
     207    ///\bug Wrong interface
     208    ///
    214209    virtual Value _getSolValue() const;
    215210
    216211    ///\e
     212
     213    ///\bug Wrong interface
     214    ///
    217215    virtual ProblemType _getType() const;
    218216
    219217    ///\e
     218    virtual MipSkeleton* _newSolver() const;
     219
     220    ///\e
     221    virtual MipSkeleton* _cloneSolver() const;
     222    ///\e
    220223    virtual const char* _solverName() const;
     224
    221225  };
    222226
    223227} //namespace lemon
    224228
    225 #endif
     229#endif // LEMON_LP_SKELETON
  • lemon/preflow.h

    r525 r463  
    3232  ///
    3333  /// Default traits class of Preflow class.
    34   /// \tparam GR Digraph type.
    35   /// \tparam CM Capacity map type.
    36   template <typename GR, typename CM>
     34  /// \tparam _Digraph Digraph type.
     35  /// \tparam _CapacityMap Capacity map type.
     36  template <typename _Digraph, typename _CapacityMap>
    3737  struct PreflowDefaultTraits {
    3838
    3939    /// \brief The type of the digraph the algorithm runs on.
    40     typedef GR Digraph;
     40    typedef _Digraph Digraph;
    4141
    4242    /// \brief The type of the map that stores the arc capacities.
     
    4444    /// The type of the map that stores the arc capacities.
    4545    /// It must meet the \ref concepts::ReadMap "ReadMap" concept.
    46     typedef CM CapacityMap;
     46    typedef _CapacityMap CapacityMap;
    4747
    4848    /// \brief The type of the flow values.
     
    105105  /// second phase constructs a feasible maximum flow on each arc.
    106106  ///
    107   /// \tparam GR The type of the digraph the algorithm runs on.
    108   /// \tparam CM The type of the capacity map. The default map
    109   /// type is \ref concepts::Digraph::ArcMap "GR::ArcMap<int>".
     107  /// \tparam _Digraph The type of the digraph the algorithm runs on.
     108  /// \tparam _CapacityMap The type of the capacity map. The default map
     109  /// type is \ref concepts::Digraph::ArcMap "_Digraph::ArcMap<int>".
    110110#ifdef DOXYGEN
    111   template <typename GR, typename CM, typename TR>
     111  template <typename _Digraph, typename _CapacityMap, typename _Traits>
    112112#else
    113   template <typename GR,
    114             typename CM = typename GR::template ArcMap<int>,
    115             typename TR = PreflowDefaultTraits<GR, CM> >
     113  template <typename _Digraph,
     114            typename _CapacityMap = typename _Digraph::template ArcMap<int>,
     115            typename _Traits = PreflowDefaultTraits<_Digraph, _CapacityMap> >
    116116#endif
    117117  class Preflow {
     
    119119
    120120    ///The \ref PreflowDefaultTraits "traits class" of the algorithm.
    121     typedef TR Traits;
     121    typedef _Traits Traits;
    122122    ///The type of the digraph the algorithm runs on.
    123123    typedef typename Traits::Digraph Digraph;
  • lemon/soplex.cc

    r587 r485  
    2020#include <lemon/soplex.h>
    2121
    22 #include <soplex.h>
     22#include <soplex/soplex.h>
    2323
    2424
     
    5555  }
    5656
    57   SoplexLp* SoplexLp::newSolver() const {
     57  SoplexLp* SoplexLp::_newSolver() const {
    5858    SoplexLp* newlp = new SoplexLp();
    5959    return newlp;
    6060  }
    6161
    62   SoplexLp* SoplexLp::cloneSolver() const {
     62  SoplexLp* SoplexLp::_cloneSolver() const {
    6363    SoplexLp* newlp = new SoplexLp(*this);
    6464    return newlp;
  • lemon/soplex.h

    r587 r485  
    7474    /// \e
    7575    ~SoplexLp();
    76     /// \e
    77     virtual SoplexLp* newSolver() const;
    78     /// \e
    79     virtual SoplexLp* cloneSolver() const;
    8076
    8177  protected:
     78
     79    virtual SoplexLp* _newSolver() const;
     80    virtual SoplexLp* _cloneSolver() const;
    8281
    8382    virtual const char* _solverName() const;
  • m4/lx_check_soplex.m4

    r586 r480  
    2121      SOPLEX_CXXFLAGS="-I$with_soplex_includedir"
    2222    elif test x"$with_soplex" != x"yes"; then
    23       SOPLEX_CXXFLAGS="-I$with_soplex/src"
     23      SOPLEX_CXXFLAGS="-I$with_soplex/include"
    2424    fi
    2525
     
    3939
    4040    lx_soplex_test_prog='
    41       #include <soplex.h>
     41      #include <soplex/soplex.h>
    4242
    4343      int main(int argc, char** argv)
  • test/CMakeLists.txt

    r575 r569  
    3030  maps_test
    3131  max_matching_test
    32   min_cost_arborescence_test
    3332  path_test
    3433  preflow_test
  • test/Makefile.am

    r575 r569  
    2626        test/maps_test \
    2727        test/max_matching_test \
    28         test/min_cost_arborescence_test \
    2928        test/path_test \
    3029        test/preflow_test \
     
    6867test_mip_test_SOURCES = test/mip_test.cc
    6968test_max_matching_test_SOURCES = test/max_matching_test.cc
    70 test_min_cost_arborescence_test_SOURCES = test/min_cost_arborescence_test.cc
    7169test_path_test_SOURCES = test/path_test.cc
    7270test_preflow_test_SOURCES = test/preflow_test.cc
  • test/euler_test.cc

    r578 r569  
    2626void checkDiEulerIt(const Digraph& g)
    2727{
    28   typename Digraph::template ArcMap<int> visitationNumber(g, 0);
     28  typename Digraph::template ArcMap<int> visitationNumber(g);
    2929
    3030  DiEulerIt<Digraph> e(g);
    3131  typename Digraph::Node firstNode = g.source(e);
    32   typename Digraph::Node lastNode = g.target(e);
     32  typename Digraph::Node lastNode;
    3333
    3434  for (; e != INVALID; ++e)
     
    5454void checkEulerIt(const Graph& g)
    5555{
    56   typename Graph::template EdgeMap<int> visitationNumber(g, 0);
     56  typename Graph::template EdgeMap<int> visitationNumber(g);
    5757
    5858  EulerIt<Graph> e(g);
    5959  typename Graph::Node firstNode = g.u(e);
    60   typename Graph::Node lastNode = g.v(e);
     60  typename Graph::Node lastNode;
    6161
    6262  for (; e != INVALID; ++e)
  • test/lp_test.cc

    r589 r585  
    198198    check(const_cast<const LpSolver::Expr&>(e)[p2]==0, buf.str());
    199199
    200     //Test for clone/new
    201     LP* lpnew = lp.newSolver();
    202     LP* lpclone = lp.cloneSolver();
    203     delete lpnew;
    204     delete lpclone;
    205200
    206201  }
     
    253248  if (stat ==  LpSolver::OPTIMAL) {
    254249    std::ostringstream sbuf;
    255     sbuf << "Wrong optimal value (" << lp.primal() <<") with "
    256          << lp.solverName() <<"\n     the right optimum is " << exp_opt;
     250    sbuf << "Wrong optimal value: the right optimum is " << exp_opt;
    257251    check(std::abs(lp.primal()-exp_opt) < 1e-3, sbuf.str());
    258252  }
     
    362356}
    363357
    364 template<class LP>
    365 void cloneTest()
    366 {
    367   //Test for clone/new
    368  
    369   LP* lp = new LP();
    370   LP* lpnew = lp->newSolver();
    371   LP* lpclone = lp->cloneSolver();
    372   delete lp;
    373   delete lpnew;
    374   delete lpclone;
    375 }
    376 
    377358int main()
    378359{
     
    385366    lpTest(lp_glpk1);
    386367    aTest(lp_glpk2);
    387     cloneTest<GlpkLp>();
    388368  }
    389369#endif
     
    402382#endif
    403383  }
    404     cloneTest<CplexLp>();
    405384#endif
    406385
     
    410389    lpTest(lp_soplex1);
    411390    aTest(lp_soplex2);
    412     cloneTest<SoplexLp>();
    413391  }
    414392#endif
     
    419397    lpTest(lp_clp1);
    420398    aTest(lp_clp2);
    421     cloneTest<ClpLp>();
    422399  }
    423400#endif
  • test/mip_test.cc

    r589 r585  
    107107}
    108108
    109 template<class MIP>
    110 void cloneTest()
    111 {
    112  
    113   MIP* mip = new MIP();
    114   MIP* mipnew = mip->newSolver();
    115   MIP* mipclone = mip->cloneSolver();
    116   delete mip;
    117   delete mipnew;
    118   delete mipclone;
    119 }
    120109
    121110int main()
     
    126115    GlpkMip mip1;
    127116    aTest(mip1);
    128     cloneTest<GlpkMip>();
    129117  }
    130118#endif
     
    142130#endif
    143131  }
    144   cloneTest<CplexMip>();
    145132#endif
    146133
  • tools/Makefile.am

    r573 r570  
    22
    33bin_PROGRAMS += \
    4         tools/dimacs-solver \
    54        tools/dimacs-to-lgf \
    65        tools/lgf-gen
     
    109endif WANT_TOOLS
    1110
    12 tools_dimacs_solver_SOURCES = tools/dimacs-solver.cc
    1311tools_dimacs_to_lgf_SOURCES = tools/dimacs-to-lgf.cc
    1412tools_lgf_gen_SOURCES = tools/lgf-gen.cc
Note: See TracChangeset for help on using the changeset viewer.