Changes in / [585:ba124394367a:589:fc6c7aab4b8d] in lemon
- Files:
-
- 4 added
- 39 edited
Legend:
- Unmodified
- Added
- Removed
-
CMakeLists.txt
r565 r574 40 40 ADD_SUBDIRECTORY(lemon) 41 41 ADD_SUBDIRECTORY(demo) 42 ADD_SUBDIRECTORY(tools) 42 43 ADD_SUBDIRECTORY(doc) 43 44 ADD_SUBDIRECTORY(test) … … 57 58 "${PROJECT_NAME} ${PROJECT_VERSION}") 58 59 59 SET(CPACK_COMPONENTS_ALL headers library html_documentation )60 SET(CPACK_COMPONENTS_ALL headers library html_documentation bin) 60 61 61 62 SET(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C++ headers") 62 63 SET(CPACK_COMPONENT_LIBRARY_DISPLAY_NAME "Dynamic-link library") 64 SET(CPACK_COMPONENT_BIN_DISPLAY_NAME "Command line utilities") 63 65 SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DISPLAY_NAME "HTML documentation") 64 66 … … 67 69 SET(CPACK_COMPONENT_LIBRARY_DESCRIPTION 68 70 "DLL and import library") 71 SET(CPACK_COMPONENT_BIN_DESCRIPTION 72 "Command line utilities") 69 73 SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DESCRIPTION 70 74 "Doxygen generated documentation") -
INSTALL
r318 r526 5 5 tarballs and successfully extracted it. The latest version of LEMON is 6 6 available 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. 7 13 8 14 In order to install LEMON from the extracted source tarball you have to -
lemon/Makefile.am
r569 r575 84 84 lemon/math.h \ 85 85 lemon/max_matching.h \ 86 lemon/min_cost_arborescence.h \ 86 87 lemon/nauty_reader.h \ 87 88 lemon/path.h \ -
lemon/bfs.h
r463 r525 50 50 ///It must meet the \ref concepts::WriteMap "WriteMap" concept. 51 51 typedef typename Digraph::template NodeMap<typename Digraph::Arc> PredMap; 52 ///Instantiates a PredMap.53 54 ///This function instantiates a PredMap.52 ///Instantiates a \c PredMap. 53 54 ///This function instantiates a \ref PredMap. 55 55 ///\param g is the digraph, to which we would like to define the 56 /// PredMap.56 ///\ref PredMap. 57 57 static PredMap *createPredMap(const Digraph &g) 58 58 { … … 65 65 ///It must meet the \ref concepts::WriteMap "WriteMap" concept. 66 66 typedef NullMap<typename Digraph::Node,bool> ProcessedMap; 67 ///Instantiates a ProcessedMap.68 69 ///This function instantiates a ProcessedMap.67 ///Instantiates a \c ProcessedMap. 68 69 ///This function instantiates a \ref ProcessedMap. 70 70 ///\param g is the digraph, to which 71 ///we would like to define the ProcessedMap71 ///we would like to define the \ref ProcessedMap 72 72 #ifdef DOXYGEN 73 73 static ProcessedMap *createProcessedMap(const Digraph &g) … … 84 84 ///It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept. 85 85 typedef typename Digraph::template NodeMap<bool> ReachedMap; 86 ///Instantiates a ReachedMap.87 88 ///This function instantiates a ReachedMap.86 ///Instantiates a \c ReachedMap. 87 88 ///This function instantiates a \ref ReachedMap. 89 89 ///\param g is the digraph, to which 90 ///we would like to define the ReachedMap.90 ///we would like to define the \ref ReachedMap. 91 91 static ReachedMap *createReachedMap(const Digraph &g) 92 92 { … … 99 99 ///It must meet the \ref concepts::WriteMap "WriteMap" concept. 100 100 typedef typename Digraph::template NodeMap<int> DistMap; 101 ///Instantiates a DistMap.102 103 ///This function instantiates a DistMap.101 ///Instantiates a \c DistMap. 102 103 ///This function instantiates a \ref DistMap. 104 104 ///\param g is the digraph, to which we would like to define the 105 /// DistMap.105 ///\ref DistMap. 106 106 static DistMap *createDistMap(const Digraph &g) 107 107 { … … 222 222 }; 223 223 ///\brief \ref named-templ-param "Named parameter" for setting 224 /// PredMap type.224 ///\c PredMap type. 225 225 /// 226 226 ///\ref named-templ-param "Named parameter" for setting 227 /// PredMap type.227 ///\c PredMap type. 228 228 ///It must meet the \ref concepts::WriteMap "WriteMap" concept. 229 229 template <class T> … … 242 242 }; 243 243 ///\brief \ref named-templ-param "Named parameter" for setting 244 /// DistMap type.244 ///\c DistMap type. 245 245 /// 246 246 ///\ref named-templ-param "Named parameter" for setting 247 /// DistMap type.247 ///\c DistMap type. 248 248 ///It must meet the \ref concepts::WriteMap "WriteMap" concept. 249 249 template <class T> … … 262 262 }; 263 263 ///\brief \ref named-templ-param "Named parameter" for setting 264 /// ReachedMap type.264 ///\c ReachedMap type. 265 265 /// 266 266 ///\ref named-templ-param "Named parameter" for setting 267 /// ReachedMap type.267 ///\c ReachedMap type. 268 268 ///It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept. 269 269 template <class T> … … 282 282 }; 283 283 ///\brief \ref named-templ-param "Named parameter" for setting 284 /// ProcessedMap type.284 ///\c ProcessedMap type. 285 285 /// 286 286 ///\ref named-templ-param "Named parameter" for setting 287 /// ProcessedMap type.287 ///\c ProcessedMap type. 288 288 ///It must meet the \ref concepts::WriteMap "WriteMap" concept. 289 289 template <class T> … … 301 301 }; 302 302 ///\brief \ref named-templ-param "Named parameter" for setting 303 /// ProcessedMap type to be <tt>Digraph::NodeMap<bool></tt>.303 ///\c ProcessedMap type to be <tt>Digraph::NodeMap<bool></tt>. 304 304 /// 305 305 ///\ref named-templ-param "Named parameter" for setting 306 /// ProcessedMap type to be <tt>Digraph::NodeMap<bool></tt>.306 ///\c ProcessedMap type to be <tt>Digraph::NodeMap<bool></tt>. 307 307 ///If you don't set it explicitly, it will be automatically allocated. 308 308 struct SetStandardProcessedMap : … … 1195 1195 /// This class defines the interface of the BfsVisit events, and 1196 1196 /// it could be the base of a real visitor class. 1197 template <typename _Digraph>1197 template <typename GR> 1198 1198 struct BfsVisitor { 1199 typedef _DigraphDigraph;1199 typedef GR Digraph; 1200 1200 typedef typename Digraph::Arc Arc; 1201 1201 typedef typename Digraph::Node Node; … … 1225 1225 }; 1226 1226 #else 1227 template <typename _Digraph>1227 template <typename GR> 1228 1228 struct BfsVisitor { 1229 typedef _DigraphDigraph;1229 typedef GR Digraph; 1230 1230 typedef typename Digraph::Arc Arc; 1231 1231 typedef typename Digraph::Node Node; … … 1255 1255 /// 1256 1256 /// Default traits class of BfsVisit class. 1257 /// \tparam _DigraphThe type of the digraph the algorithm runs on.1258 template<class _Digraph>1257 /// \tparam GR The type of the digraph the algorithm runs on. 1258 template<class GR> 1259 1259 struct BfsVisitDefaultTraits { 1260 1260 1261 1261 /// \brief The type of the digraph the algorithm runs on. 1262 typedef _DigraphDigraph;1262 typedef GR Digraph; 1263 1263 1264 1264 /// \brief The type of the map that indicates which nodes are reached. … … 1281 1281 /// \ingroup search 1282 1282 /// 1283 /// \brief %BFS algorithm class with visitor interface.1283 /// \brief BFS algorithm class with visitor interface. 1284 1284 /// 1285 /// This class provides an efficient implementation of the %BFS algorithm1285 /// This class provides an efficient implementation of the BFS algorithm 1286 1286 /// with visitor interface. 1287 1287 /// 1288 /// The %BfsVisit class provides an alternative interface to the Bfs1288 /// The BfsVisit class provides an alternative interface to the Bfs 1289 1289 /// class. It works with callback mechanism, the BfsVisit object calls 1290 1290 /// the member functions of the \c Visitor class on every BFS event. … … 1295 1295 /// instead. 1296 1296 /// 1297 /// \tparam _DigraphThe type of the digraph the algorithm runs on.1298 /// The default value is1299 /// \ref ListDigraph. The value of _Digraph is not used directly by1300 /// \ref BfsVisit,it is only passed to \ref BfsVisitDefaultTraits.1301 /// \tparam _VisitorThe Visitor type that is used by the algorithm.1302 /// \ref BfsVisitor "BfsVisitor< _Digraph>" is an empty visitor, which1297 /// \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 1303 1303 /// does not observe the BFS events. If you want to observe the BFS 1304 1304 /// events, you should implement your own visitor class. 1305 /// \tparam _TraitsTraits class to set various data types used by the1305 /// \tparam TR Traits class to set various data types used by the 1306 1306 /// algorithm. The default traits class is 1307 /// \ref BfsVisitDefaultTraits "BfsVisitDefaultTraits< _Digraph>".1307 /// \ref BfsVisitDefaultTraits "BfsVisitDefaultTraits<GR>". 1308 1308 /// See \ref BfsVisitDefaultTraits for the documentation of 1309 1309 /// a BFS visit traits class. 1310 1310 #ifdef DOXYGEN 1311 template <typename _Digraph, typename _Visitor, typename _Traits>1311 template <typename GR, typename VS, typename TR> 1312 1312 #else 1313 template <typename _Digraph= ListDigraph,1314 typename _Visitor = BfsVisitor<_Digraph>,1315 typename _Traits = BfsVisitDefaultTraits<_Digraph> >1313 template <typename GR = ListDigraph, 1314 typename VS = BfsVisitor<GR>, 1315 typename TR = BfsVisitDefaultTraits<GR> > 1316 1316 #endif 1317 1317 class BfsVisit { … … 1319 1319 1320 1320 ///The traits class. 1321 typedef _TraitsTraits;1321 typedef TR Traits; 1322 1322 1323 1323 ///The type of the digraph the algorithm runs on. … … 1325 1325 1326 1326 ///The visitor type used by the algorithm. 1327 typedef _VisitorVisitor;1327 typedef VS Visitor; 1328 1328 1329 1329 ///The type of the map that indicates which nodes are reached. -
lemon/bits/array_map.h
r463 r525 136 136 // \brief Template assign operator. 137 137 // 138 // The given parameter should beconform to the ReadMap138 // The given parameter should conform to the ReadMap 139 139 // concecpt and could be indiced by the current item set of 140 140 // the NodeMap. In this case the value for each item -
lemon/bits/default_map.h
r564 r582 20 20 #define LEMON_BITS_DEFAULT_MAP_H 21 21 22 #include <lemon/config.h> 22 23 #include <lemon/bits/array_map.h> 23 24 #include <lemon/bits/vector_map.h> -
lemon/bits/path_dump.h
r566 r576 17 17 */ 18 18 19 #ifndef LEMON_BITS_P RED_MAP_PATH_H20 #define LEMON_BITS_P RED_MAP_PATH_H19 #ifndef LEMON_BITS_PATH_DUMP_H 20 #define LEMON_BITS_PATH_DUMP_H 21 21 22 22 #include <lemon/core.h> -
lemon/bits/vector_map.h
r463 r525 125 125 // \brief Template assign operator. 126 126 // 127 // The given parameter should beconform to the ReadMap127 // The given parameter should conform to the ReadMap 128 128 // concecpt and could be indiced by the current item set of 129 129 // the NodeMap. In this case the value for each item -
lemon/bits/windows.h
r511 r576 17 17 */ 18 18 19 #ifndef LEMON_ WINDOWS_H20 #define LEMON_ WINDOWS_H19 #ifndef LEMON_BITS_WINDOWS_H 20 #define LEMON_BITS_WINDOWS_H 21 21 22 22 #include <string> -
lemon/circulation.h
r463 r525 32 32 /// 33 33 /// Default traits class of Circulation class. 34 /// \tparam _DiraphDigraph type.35 /// \tparam _LCapMapLower bound capacity map type.36 /// \tparam _UCapMapUpper bound capacity map type.37 /// \tparam _DeltaMapDelta map type.38 template <typename _Diraph, typename _LCapMap,39 typename _UCapMap, typename _DeltaMap>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> 40 40 struct CirculationDefaultTraits { 41 41 42 42 /// \brief The type of the digraph the algorithm runs on. 43 typedef _DiraphDigraph;43 typedef GR Digraph; 44 44 45 45 /// \brief The type of the map that stores the circulation lower … … 48 48 /// The type of the map that stores the circulation lower bound. 49 49 /// It must meet the \ref concepts::ReadMap "ReadMap" concept. 50 typedef _LCapMapLCapMap;50 typedef LM LCapMap; 51 51 52 52 /// \brief The type of the map that stores the circulation upper … … 55 55 /// The type of the map that stores the circulation upper bound. 56 56 /// It must meet the \ref concepts::ReadMap "ReadMap" concept. 57 typedef _UCapMapUCapMap;57 typedef UM UCapMap; 58 58 59 59 /// \brief The type of the map that stores the lower bound for … … 63 63 /// of the nodes. It must meet the \ref concepts::ReadMap "ReadMap" 64 64 /// concept. 65 typedef _DeltaMapDeltaMap;65 typedef DM DeltaMap; 66 66 67 67 /// \brief The type of the flow values. … … 138 138 in this way. 139 139 140 \tparam _DigraphThe type of the digraph the algorithm runs on.141 \tparam _LCapMapThe type of the lower bound capacity map. The default142 map type is \ref concepts::Digraph::ArcMap " _Digraph::ArcMap<int>".143 \tparam _UCapMapThe type of the upper bound capacity map. The default144 map type is \c _LCapMap.145 \tparam _DeltaMapThe type of the map that stores the lower bound140 \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 146 146 for the supply of the nodes. The default map type is 147 \ c _Digraph::ArcMap<_UCapMap::Value>.147 \ref concepts::Digraph::NodeMap "GR::NodeMap<UM::Value>". 148 148 */ 149 149 #ifdef DOXYGEN 150 template< typename _Digraph,151 typename _LCapMap,152 typename _UCapMap,153 typename _DeltaMap,154 typename _Traits>150 template< typename GR, 151 typename LM, 152 typename UM, 153 typename DM, 154 typename TR > 155 155 #else 156 template< 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> > 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> > 163 161 #endif 164 162 class Circulation { … … 166 164 167 165 ///The \ref CirculationDefaultTraits "traits class" of the algorithm. 168 typedef _TraitsTraits;166 typedef TR Traits; 169 167 ///The type of the digraph the algorithm runs on. 170 168 typedef typename Traits::Digraph Digraph; -
lemon/clp.cc
r485 r587 57 57 } 58 58 59 ClpLp* ClpLp:: _newSolver() const {59 ClpLp* ClpLp::newSolver() const { 60 60 ClpLp* newlp = new ClpLp; 61 61 return newlp; 62 62 } 63 63 64 ClpLp* ClpLp:: _cloneSolver() const {64 ClpLp* ClpLp::cloneSolver() const { 65 65 ClpLp* copylp = new ClpLp(*this); 66 66 return copylp; -
lemon/clp.h
r485 r587 57 57 ~ClpLp(); 58 58 59 /// \e 60 virtual ClpLp* newSolver() const; 61 /// \e 62 virtual ClpLp* cloneSolver() const; 63 59 64 protected: 60 65 … … 66 71 67 72 protected: 68 69 virtual ClpLp* _newSolver() const;70 virtual ClpLp* _cloneSolver() const;71 73 72 74 virtual const char* _solverName() const; -
lemon/concepts/digraph.h
r463 r576 17 17 */ 18 18 19 #ifndef LEMON_CONCEPT _DIGRAPH_H20 #define LEMON_CONCEPT _DIGRAPH_H19 #ifndef LEMON_CONCEPTS_DIGRAPH_H 20 #define LEMON_CONCEPTS_DIGRAPH_H 21 21 22 22 ///\ingroup graph_concepts … … 485 485 486 486 487 #endif // LEMON_CONCEPT_DIGRAPH_H487 #endif -
lemon/concepts/graph.h
r463 r576 21 21 ///\brief The concept of Undirected Graphs. 22 22 23 #ifndef LEMON_CONCEPT _GRAPH_H24 #define LEMON_CONCEPT _GRAPH_H23 #ifndef LEMON_CONCEPTS_GRAPH_H 24 #define LEMON_CONCEPTS_GRAPH_H 25 25 26 26 #include <lemon/concepts/graph_components.h> 27 #include <lemon/concepts/graph.h>28 27 #include <lemon/core.h> 29 28 -
lemon/concepts/graph_components.h
r463 r581 22 22 23 23 24 #ifndef LEMON_CONCEPT _GRAPH_COMPONENTS_H25 #define LEMON_CONCEPT _GRAPH_COMPONENTS_H24 #ifndef LEMON_CONCEPTS_GRAPH_COMPONENTS_H 25 #define LEMON_CONCEPTS_GRAPH_COMPONENTS_H 26 26 27 27 #include <lemon/core.h> … … 115 115 /// 116 116 /// This class provides the minimal set of features needed for a 117 /// directed graph structure. All digraph concepts have to be117 /// directed graph structure. All digraph concepts have to 118 118 /// conform to this base directed graph. It just provides types 119 119 /// for nodes and arcs and functions to get the source and the … … 180 180 /// This class provides the minimal set of features needed for an 181 181 /// undirected graph structure. All undirected graph concepts have 182 /// to beconform to this base graph. It just provides types for182 /// to conform to this base graph. It just provides types for 183 183 /// nodes, arcs and edges and functions to get the 184 184 /// source and the target of the arcs and edges, … … 295 295 /// This class provides beside the core digraph features 296 296 /// core id functions for the digraph structure. 297 /// The most of the base digraphs should beconform to this concept.297 /// The most of the base digraphs should conform to this concept. 298 298 /// The id's are unique and immutable. 299 299 template <typename _Base = BaseDigraphComponent> … … 373 373 /// This class provides beside the core undirected graph features 374 374 /// core id functions for the undirected graph structure. The 375 /// most of the base undirected graphs should beconform to this375 /// most of the base undirected graphs should conform to this 376 376 /// concept. The id's are unique and immutable. 377 377 template <typename _Base = BaseGraphComponent> -
lemon/concepts/heap.h
r566 r576 21 21 ///\brief The concept of heaps. 22 22 23 #ifndef LEMON_CONCEPT _HEAP_H24 #define LEMON_CONCEPT _HEAP_H23 #ifndef LEMON_CONCEPTS_HEAP_H 24 #define LEMON_CONCEPTS_HEAP_H 25 25 26 26 #include <lemon/core.h> … … 244 244 } // namespace lemon 245 245 } 246 #endif // LEMON_CONCEPT_PATH_H246 #endif -
lemon/concepts/maps.h
r463 r576 17 17 */ 18 18 19 #ifndef LEMON_CONCEPT _MAPS_H20 #define LEMON_CONCEPT _MAPS_H19 #ifndef LEMON_CONCEPTS_MAPS_H 20 #define LEMON_CONCEPTS_MAPS_H 21 21 22 22 #include <lemon/core.h> … … 214 214 } //namespace lemon 215 215 216 #endif // LEMON_CONCEPT_MAPS_H216 #endif -
lemon/concepts/path.h
r463 r576 22 22 /// 23 23 24 #ifndef LEMON_CONCEPT _PATH_H25 #define LEMON_CONCEPT _PATH_H24 #ifndef LEMON_CONCEPTS_PATH_H 25 #define LEMON_CONCEPTS_PATH_H 26 26 27 27 #include <lemon/core.h> … … 306 306 } // namespace lemon 307 307 308 #endif // LEMON_CONCEPT_PATH_H308 #endif -
lemon/core.h
r463 r582 23 23 #include <algorithm> 24 24 25 #include <lemon/core.h> 25 26 #include <lemon/bits/enable_if.h> 26 27 #include <lemon/bits/traits.h> -
lemon/cplex.cc
r485 r587 452 452 CplexLp::~CplexLp() {} 453 453 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); } 456 456 457 457 const char* CplexLp::_solverName() const { return "CplexLp"; } … … 824 824 CplexMip::~CplexMip() {} 825 825 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); } 828 828 829 829 const char* CplexMip::_solverName() const { return "CplexMip"; } -
lemon/cplex.h
r485 r587 161 161 /// This class implements an interface for the CPLEX LP solver. 162 162 ///\ingroup lp_group 163 class CplexLp : public CplexBase, public LpSolver{163 class CplexLp : public LpSolver, public CplexBase { 164 164 public: 165 165 /// \e … … 171 171 /// \e 172 172 virtual ~CplexLp(); 173 174 /// \e 175 virtual CplexLp* cloneSolver() const; 176 /// \e 177 virtual CplexLp* newSolver() const; 173 178 174 179 private: … … 186 191 187 192 protected: 188 189 virtual CplexLp* _cloneSolver() const;190 virtual CplexLp* _newSolver() const;191 193 192 194 virtual const char* _solverName() const; … … 223 225 /// This class implements an interface for the CPLEX MIP solver. 224 226 ///\ingroup lp_group 225 class CplexMip : public CplexBase, public MipSolver{227 class CplexMip : public MipSolver, public CplexBase { 226 228 public: 227 229 /// \e -
lemon/dfs.h
r463 r525 50 50 ///It must meet the \ref concepts::WriteMap "WriteMap" concept. 51 51 typedef typename Digraph::template NodeMap<typename Digraph::Arc> PredMap; 52 ///Instantiates a PredMap.53 54 ///This function instantiates a PredMap.52 ///Instantiates a \c PredMap. 53 54 ///This function instantiates a \ref PredMap. 55 55 ///\param g is the digraph, to which we would like to define the 56 /// PredMap.56 ///\ref PredMap. 57 57 static PredMap *createPredMap(const Digraph &g) 58 58 { … … 65 65 ///It must meet the \ref concepts::WriteMap "WriteMap" concept. 66 66 typedef NullMap<typename Digraph::Node,bool> ProcessedMap; 67 ///Instantiates a ProcessedMap.68 69 ///This function instantiates a ProcessedMap.67 ///Instantiates a \c ProcessedMap. 68 69 ///This function instantiates a \ref ProcessedMap. 70 70 ///\param g is the digraph, to which 71 ///we would like to define the ProcessedMap71 ///we would like to define the \ref ProcessedMap. 72 72 #ifdef DOXYGEN 73 73 static ProcessedMap *createProcessedMap(const Digraph &g) … … 84 84 ///It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept. 85 85 typedef typename Digraph::template NodeMap<bool> ReachedMap; 86 ///Instantiates a ReachedMap.87 88 ///This function instantiates a ReachedMap.86 ///Instantiates a \c ReachedMap. 87 88 ///This function instantiates a \ref ReachedMap. 89 89 ///\param g is the digraph, to which 90 ///we would like to define the ReachedMap.90 ///we would like to define the \ref ReachedMap. 91 91 static ReachedMap *createReachedMap(const Digraph &g) 92 92 { … … 99 99 ///It must meet the \ref concepts::WriteMap "WriteMap" concept. 100 100 typedef typename Digraph::template NodeMap<int> DistMap; 101 ///Instantiates a DistMap.102 103 ///This function instantiates a DistMap.101 ///Instantiates a \c DistMap. 102 103 ///This function instantiates a \ref DistMap. 104 104 ///\param g is the digraph, to which we would like to define the 105 /// DistMap.105 ///\ref DistMap. 106 106 static DistMap *createDistMap(const Digraph &g) 107 107 { … … 221 221 }; 222 222 ///\brief \ref named-templ-param "Named parameter" for setting 223 /// PredMap type.223 ///\c PredMap type. 224 224 /// 225 225 ///\ref named-templ-param "Named parameter" for setting 226 /// PredMap type.226 ///\c PredMap type. 227 227 ///It must meet the \ref concepts::WriteMap "WriteMap" concept. 228 228 template <class T> … … 241 241 }; 242 242 ///\brief \ref named-templ-param "Named parameter" for setting 243 /// DistMap type.243 ///\c DistMap type. 244 244 /// 245 245 ///\ref named-templ-param "Named parameter" for setting 246 /// DistMap type.246 ///\c DistMap type. 247 247 ///It must meet the \ref concepts::WriteMap "WriteMap" concept. 248 248 template <class T> … … 261 261 }; 262 262 ///\brief \ref named-templ-param "Named parameter" for setting 263 /// ReachedMap type.263 ///\c ReachedMap type. 264 264 /// 265 265 ///\ref named-templ-param "Named parameter" for setting 266 /// ReachedMap type.266 ///\c ReachedMap type. 267 267 ///It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept. 268 268 template <class T> … … 281 281 }; 282 282 ///\brief \ref named-templ-param "Named parameter" for setting 283 /// ProcessedMap type.283 ///\c ProcessedMap type. 284 284 /// 285 285 ///\ref named-templ-param "Named parameter" for setting 286 /// ProcessedMap type.286 ///\c ProcessedMap type. 287 287 ///It must meet the \ref concepts::WriteMap "WriteMap" concept. 288 288 template <class T> … … 299 299 }; 300 300 ///\brief \ref named-templ-param "Named parameter" for setting 301 /// ProcessedMap type to be <tt>Digraph::NodeMap<bool></tt>.301 ///\c ProcessedMap type to be <tt>Digraph::NodeMap<bool></tt>. 302 302 /// 303 303 ///\ref named-templ-param "Named parameter" for setting 304 /// ProcessedMap type to be <tt>Digraph::NodeMap<bool></tt>.304 ///\c ProcessedMap type to be <tt>Digraph::NodeMap<bool></tt>. 305 305 ///If you don't set it explicitly, it will be automatically allocated. 306 306 struct SetStandardProcessedMap : … … 1127 1127 /// This class defines the interface of the DfsVisit events, and 1128 1128 /// it could be the base of a real visitor class. 1129 template <typename _Digraph>1129 template <typename GR> 1130 1130 struct DfsVisitor { 1131 typedef _DigraphDigraph;1131 typedef GR Digraph; 1132 1132 typedef typename Digraph::Arc Arc; 1133 1133 typedef typename Digraph::Node Node; … … 1165 1165 }; 1166 1166 #else 1167 template <typename _Digraph>1167 template <typename GR> 1168 1168 struct DfsVisitor { 1169 typedef _DigraphDigraph;1169 typedef GR Digraph; 1170 1170 typedef typename Digraph::Arc Arc; 1171 1171 typedef typename Digraph::Node Node; … … 1200 1200 /// Default traits class of DfsVisit class. 1201 1201 /// \tparam _Digraph The type of the digraph the algorithm runs on. 1202 template<class _Digraph>1202 template<class GR> 1203 1203 struct DfsVisitDefaultTraits { 1204 1204 1205 1205 /// \brief The type of the digraph the algorithm runs on. 1206 typedef _DigraphDigraph;1206 typedef GR Digraph; 1207 1207 1208 1208 /// \brief The type of the map that indicates which nodes are reached. … … 1225 1225 /// \ingroup search 1226 1226 /// 1227 /// \brief %DFS algorithm class with visitor interface.1227 /// \brief DFS algorithm class with visitor interface. 1228 1228 /// 1229 /// This class provides an efficient implementation of the %DFS algorithm1229 /// This class provides an efficient implementation of the DFS algorithm 1230 1230 /// with visitor interface. 1231 1231 /// 1232 /// The %DfsVisit class provides an alternative interface to the Dfs1232 /// The DfsVisit class provides an alternative interface to the Dfs 1233 1233 /// class. It works with callback mechanism, the DfsVisit object calls 1234 1234 /// the member functions of the \c Visitor class on every DFS event. … … 1239 1239 /// instead. 1240 1240 /// 1241 /// \tparam _DigraphThe type of the digraph the algorithm runs on.1242 /// The default value is1243 /// \ref ListDigraph. The value of _Digraph is not used directly by1244 /// \ref DfsVisit,it is only passed to \ref DfsVisitDefaultTraits.1245 /// \tparam _VisitorThe Visitor type that is used by the algorithm.1246 /// \ref DfsVisitor "DfsVisitor< _Digraph>" is an empty visitor, which1241 /// \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 1247 1247 /// does not observe the DFS events. If you want to observe the DFS 1248 1248 /// events, you should implement your own visitor class. 1249 /// \tparam _TraitsTraits class to set various data types used by the1249 /// \tparam TR Traits class to set various data types used by the 1250 1250 /// algorithm. The default traits class is 1251 /// \ref DfsVisitDefaultTraits "DfsVisitDefaultTraits< _Digraph>".1251 /// \ref DfsVisitDefaultTraits "DfsVisitDefaultTraits<GR>". 1252 1252 /// See \ref DfsVisitDefaultTraits for the documentation of 1253 1253 /// a DFS visit traits class. 1254 1254 #ifdef DOXYGEN 1255 template <typename _Digraph, typename _Visitor, typename _Traits>1255 template <typename GR, typename VS, typename TR> 1256 1256 #else 1257 template <typename _Digraph= ListDigraph,1258 typename _Visitor = DfsVisitor<_Digraph>,1259 typename _Traits = DfsVisitDefaultTraits<_Digraph> >1257 template <typename GR = ListDigraph, 1258 typename VS = DfsVisitor<GR>, 1259 typename TR = DfsVisitDefaultTraits<GR> > 1260 1260 #endif 1261 1261 class DfsVisit { … … 1263 1263 1264 1264 ///The traits class. 1265 typedef _TraitsTraits;1265 typedef TR Traits; 1266 1266 1267 1267 ///The type of the digraph the algorithm runs on. … … 1269 1269 1270 1270 ///The visitor type used by the algorithm. 1271 typedef _VisitorVisitor;1271 typedef VS Visitor; 1272 1272 1273 1273 ///The type of the map that indicates which nodes are reached. -
lemon/dijkstra.h
r463 r525 74 74 typedef typename LM::Value Value; 75 75 76 /// Operation traits for Dijkstra algorithm.76 /// Operation traits for %Dijkstra algorithm. 77 77 78 78 /// This class defines the operations that are used in the algorithm. … … 85 85 /// Usually it is \c Digraph::NodeMap<int>. 86 86 typedef typename Digraph::template NodeMap<int> HeapCrossRef; 87 ///Instantiates a \ refHeapCrossRef.87 ///Instantiates a \c HeapCrossRef. 88 88 89 89 ///This function instantiates a \ref HeapCrossRef. … … 95 95 } 96 96 97 ///The heap type used by the Dijkstra algorithm.97 ///The heap type used by the %Dijkstra algorithm. 98 98 99 99 ///The heap type used by the Dijkstra algorithm. … … 102 102 ///\sa Dijkstra 103 103 typedef BinHeap<typename LM::Value, HeapCrossRef, std::less<Value> > Heap; 104 ///Instantiates a \ refHeap.104 ///Instantiates a \c Heap. 105 105 106 106 ///This function instantiates a \ref Heap. … … 117 117 ///It must meet the \ref concepts::WriteMap "WriteMap" concept. 118 118 typedef typename Digraph::template NodeMap<typename Digraph::Arc> PredMap; 119 ///Instantiates a PredMap.120 121 ///This function instantiates a PredMap.119 ///Instantiates a \c PredMap. 120 121 ///This function instantiates a \ref PredMap. 122 122 ///\param g is the digraph, to which we would like to define the 123 /// PredMap.123 ///\ref PredMap. 124 124 static PredMap *createPredMap(const Digraph &g) 125 125 { … … 133 133 ///By default it is a NullMap. 134 134 typedef NullMap<typename Digraph::Node,bool> ProcessedMap; 135 ///Instantiates a ProcessedMap.136 137 ///This function instantiates a ProcessedMap.135 ///Instantiates a \c ProcessedMap. 136 137 ///This function instantiates a \ref ProcessedMap. 138 138 ///\param g is the digraph, to which 139 ///we would like to define the ProcessedMap139 ///we would like to define the \ref ProcessedMap. 140 140 #ifdef DOXYGEN 141 141 static ProcessedMap *createProcessedMap(const Digraph &g) … … 152 152 ///It must meet the \ref concepts::WriteMap "WriteMap" concept. 153 153 typedef typename Digraph::template NodeMap<typename LM::Value> DistMap; 154 ///Instantiates a DistMap.155 156 ///This function instantiates a DistMap.154 ///Instantiates a \c DistMap. 155 156 ///This function instantiates a \ref DistMap. 157 157 ///\param g is the digraph, to which we would like to define 158 ///the DistMap158 ///the \ref DistMap. 159 159 static DistMap *createDistMap(const Digraph &g) 160 160 { … … 217 217 ///The heap type used by the algorithm. 218 218 typedef typename TR::Heap Heap; 219 ///The operation traits class. 219 ///\brief The \ref DijkstraDefaultOperationTraits "operation traits class" 220 ///of the algorithm. 220 221 typedef typename TR::OperationTraits OperationTraits; 221 222 … … 233 234 const Digraph *G; 234 235 //Pointer to the length map. 235 const LengthMap * length;236 const LengthMap *_length; 236 237 //Pointer to the map of predecessors arcs. 237 238 PredMap *_pred; … … 298 299 }; 299 300 ///\brief \ref named-templ-param "Named parameter" for setting 300 /// PredMap type.301 ///\c PredMap type. 301 302 /// 302 303 ///\ref named-templ-param "Named parameter" for setting 303 /// PredMap type.304 ///\c PredMap type. 304 305 ///It must meet the \ref concepts::WriteMap "WriteMap" concept. 305 306 template <class T> … … 319 320 }; 320 321 ///\brief \ref named-templ-param "Named parameter" for setting 321 /// DistMap type.322 ///\c DistMap type. 322 323 /// 323 324 ///\ref named-templ-param "Named parameter" for setting 324 /// DistMap type.325 ///\c DistMap type. 325 326 ///It must meet the \ref concepts::WriteMap "WriteMap" concept. 326 327 template <class T> … … 340 341 }; 341 342 ///\brief \ref named-templ-param "Named parameter" for setting 342 /// ProcessedMap type.343 ///\c ProcessedMap type. 343 344 /// 344 345 ///\ref named-templ-param "Named parameter" for setting 345 /// ProcessedMap type.346 ///\c ProcessedMap type. 346 347 ///It must meet the \ref concepts::WriteMap "WriteMap" concept. 347 348 template <class T> … … 359 360 }; 360 361 ///\brief \ref named-templ-param "Named parameter" for setting 361 /// ProcessedMap type to be <tt>Digraph::NodeMap<bool></tt>.362 ///\c ProcessedMap type to be <tt>Digraph::NodeMap<bool></tt>. 362 363 /// 363 364 ///\ref named-templ-param "Named parameter" for setting 364 /// ProcessedMap type to be <tt>Digraph::NodeMap<bool></tt>.365 ///\c ProcessedMap type to be <tt>Digraph::NodeMap<bool></tt>. 365 366 ///If you don't set it explicitly, it will be automatically allocated. 366 367 struct SetStandardProcessedMap … … 440 441 /// 441 442 ///\ref named-templ-param "Named parameter" for setting 442 ///\ refOperationTraits type.443 ///\c OperationTraits type. 443 444 template <class T> 444 445 struct SetOperationTraits … … 459 460 460 461 ///Constructor. 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),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), 465 466 _pred(NULL), local_pred(false), 466 467 _dist(NULL), local_dist(false), … … 486 487 Dijkstra &lengthMap(const LengthMap &m) 487 488 { 488 length = &m;489 _length = &m; 489 490 return *this; 490 491 } … … 639 640 switch(_heap->state(w)) { 640 641 case Heap::PRE_HEAP: 641 _heap->push(w,OperationTraits::plus(oldvalue, (* length)[e]));642 _heap->push(w,OperationTraits::plus(oldvalue, (*_length)[e])); 642 643 _pred->set(w,e); 643 644 break; 644 645 case Heap::IN_HEAP: 645 646 { 646 Value newvalue = OperationTraits::plus(oldvalue, (* length)[e]);647 Value newvalue = OperationTraits::plus(oldvalue, (*_length)[e]); 647 648 if ( OperationTraits::less(newvalue, (*_heap)[w]) ) { 648 649 _heap->decrease(w, newvalue); -
lemon/dimacs.h
r463 r572 296 296 } 297 297 298 /// DIMACS plain digraph reader function. 299 /// 300 /// This function reads a digraph without any designated nodes and 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 301 316 /// maps from DIMACS format, i.e. from DIMACS files having a line 302 317 /// starting with … … 308 323 /// If the file type was previously evaluated by dimacsType(), then 309 324 /// the descriptor struct should be given by the \c dest parameter. 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; 325 template<typename Graph> 326 void readDimacsMat(std::istream& is, Graph &g, 327 DimacsDescriptor desc=DimacsDescriptor()) 328 { 315 329 if(desc.type==DimacsDescriptor::NONE) desc=dimacsType(is); 316 330 if(desc.type!=DimacsDescriptor::MAT) 317 331 throw FormatError("Problem type mismatch"); 318 _readDimacs(is, g, n, u, v, desc); 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 } 319 357 } 320 358 -
lemon/glpk.cc
r585 r589 541 541 } 542 542 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); } 545 545 546 546 const char* GlpkLp::_solverName() const { return "GlpkLp"; } … … 947 947 } 948 948 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); } 951 951 952 952 const char* GlpkMip::_solverName() const { return "GlpkMip"; } -
lemon/glpk.h
r585 r589 132 132 /// This class implements an interface for the GLPK LP solver. 133 133 ///\ingroup lp_group 134 class GlpkLp : public GlpkBase, public LpSolver{134 class GlpkLp : public LpSolver, public GlpkBase { 135 135 public: 136 136 … … 139 139 ///\e 140 140 GlpkLp(const GlpkLp&); 141 142 ///\e 143 virtual GlpkLp* cloneSolver() const; 144 ///\e 145 virtual GlpkLp* newSolver() const; 141 146 142 147 private: … … 148 153 149 154 protected: 150 151 virtual GlpkLp* _cloneSolver() const;152 virtual GlpkLp* _newSolver() const;153 155 154 156 virtual const char* _solverName() const; … … 166 168 virtual Value _getDualRay(int i) const; 167 169 168 ///\todo It should be clarified169 ///170 170 virtual ProblemType _getPrimalType() const; 171 171 virtual ProblemType _getDualType() const; … … 216 216 /// This class implements an interface for the GLPK MIP solver. 217 217 ///\ingroup lp_group 218 class GlpkMip : public GlpkBase, public MipSolver{218 class GlpkMip : public MipSolver, public GlpkBase { 219 219 public: 220 220 … … 224 224 GlpkMip(const GlpkMip&); 225 225 226 protected:227 228 virtual GlpkMip* _cloneSolver() const; 229 virtual GlpkMip* _newSolver() const;226 virtual GlpkMip* cloneSolver() const; 227 virtual GlpkMip* newSolver() const; 228 229 protected: 230 230 231 231 virtual const char* _solverName() const; -
lemon/lp_base.h
r561 r587 919 919 920 920 //Abstract virtual functions 921 virtual LpBase* _newSolver() const = 0;922 virtual LpBase* _cloneSolver() const = 0;923 921 924 922 virtual int _addColId(int col) { return cols.addIndex(col); } … … 987 985 /// Virtual destructor 988 986 virtual ~LpBase() {} 989 990 ///Creates a new LP problem991 LpBase* newSolver() {return _newSolver();}992 ///Makes a copy of the LP problem993 LpBase* cloneSolver() {return _cloneSolver();}994 987 995 988 ///Gives back the name of the solver. … … 1822 1815 public: 1823 1816 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 1824 1822 ///\name Solve the LP 1825 1823 … … 1936 1934 ///@} 1937 1935 1938 LpSolver* newSolver() {return _newSolver();}1939 LpSolver* cloneSolver() {return _cloneSolver();}1940 1941 1936 protected: 1942 1937 1943 virtual LpSolver* _newSolver() const = 0;1944 virtual LpSolver* _cloneSolver() const = 0;1945 1938 }; 1946 1939 … … 1976 1969 }; 1977 1970 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 1978 1976 ///\name Solve the MIP 1979 1977 … … 2063 2061 virtual Value _getSolValue() const = 0; 2064 2062 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;2074 2063 }; 2075 2064 -
lemon/lp_skeleton.cc
r482 r587 106 106 { return BASIC; } 107 107 108 LpSkeleton* LpSkeleton:: _newSolver() const108 LpSkeleton* LpSkeleton::newSolver() const 109 109 { return static_cast<LpSkeleton*>(0); } 110 110 111 LpSkeleton* LpSkeleton:: _cloneSolver() const111 LpSkeleton* LpSkeleton::cloneSolver() const 112 112 { return static_cast<LpSkeleton*>(0); } 113 113 … … 123 123 { return UNDEFINED; } 124 124 125 MipSkeleton* MipSkeleton:: _newSolver() const125 MipSkeleton* MipSkeleton::newSolver() const 126 126 { return static_cast<MipSkeleton*>(0); } 127 127 128 MipSkeleton* MipSkeleton:: _cloneSolver() const128 MipSkeleton* MipSkeleton::cloneSolver() const 129 129 { return static_cast<MipSkeleton*>(0); } 130 130 -
lemon/lp_skeleton.h
r482 r588 17 17 */ 18 18 19 #ifndef LEMON_LP_SKELETON 20 #define LEMON_LP_SKELETON 19 #ifndef LEMON_LP_SKELETON_H 20 #define LEMON_LP_SKELETON_H 21 21 22 22 #include <lemon/lp_base.h> 23 23 24 24 ///\file 25 ///\brief A skeleton file to implement LP solver interfaces 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. 26 29 namespace lemon { 27 30 28 ///A skeleton class to implement LP solver interfaces 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. 29 35 class SkeletonSolverBase : public virtual LpBase { 30 36 int col_num,row_num; … … 137 143 }; 138 144 139 /// \brief Interface for a skeleton LP solver145 /// \brief Skeleton class for an LP solver interface 140 146 /// 141 /// This class implements an interface for a skeleton LP solver. 147 ///This class does nothing, but it can serve as a skeleton when 148 ///implementing an interface to new solvers. 149 142 150 ///\ingroup lp_group 143 class LpSkeleton : public SkeletonSolverBase, public LpSolver{151 class LpSkeleton : public LpSolver, public SkeletonSolverBase { 144 152 public: 145 LpSkeleton() : SkeletonSolverBase(), LpSolver() {} 146 153 ///\e 154 LpSkeleton() : LpSolver(), SkeletonSolverBase() {} 155 ///\e 156 virtual LpSkeleton* newSolver() const; 157 ///\e 158 virtual LpSkeleton* cloneSolver() const; 147 159 protected: 148 160 … … 174 186 175 187 ///\e 176 virtual LpSkeleton* _newSolver() const;177 ///\e178 virtual LpSkeleton* _cloneSolver() const;179 ///\e180 188 virtual const char* _solverName() const; 181 189 182 190 }; 183 191 184 /// \brief Interface for a skeleton MIP solver192 /// \brief Skeleton class for a MIP solver interface 185 193 /// 186 /// This class implements an interface for a skeleton MIP solver. 194 ///This class does nothing, but it can serve as a skeleton when 195 ///implementing an interface to new solvers. 187 196 ///\ingroup lp_group 188 class MipSkeleton : public SkeletonSolverBase, public MipSolver{197 class MipSkeleton : public MipSolver, public SkeletonSolverBase { 189 198 public: 190 MipSkeleton() : SkeletonSolverBase(), MipSolver() {} 199 ///\e 200 MipSkeleton() : MipSolver(), SkeletonSolverBase() {} 201 ///\e 202 virtual MipSkeleton* newSolver() const; 203 ///\e 204 virtual MipSkeleton* cloneSolver() const; 191 205 192 206 protected: 193 207 ///\e 194 195 ///\bug Wrong interface196 ///197 208 virtual SolveExitStatus _solve(); 198 209 199 210 ///\e 200 201 ///\bug Wrong interface202 ///203 211 virtual Value _getSol(int i) const; 204 212 205 213 ///\e 206 207 ///\bug Wrong interface208 ///209 214 virtual Value _getSolValue() const; 210 215 211 216 ///\e 212 213 ///\bug Wrong interface214 ///215 217 virtual ProblemType _getType() const; 216 218 217 219 ///\e 218 virtual MipSkeleton* _newSolver() const;219 220 ///\e221 virtual MipSkeleton* _cloneSolver() const;222 ///\e223 220 virtual const char* _solverName() const; 224 225 221 }; 226 222 227 223 } //namespace lemon 228 224 229 #endif // LEMON_LP_SKELETON225 #endif -
lemon/preflow.h
r463 r525 32 32 /// 33 33 /// Default traits class of Preflow class. 34 /// \tparam _DigraphDigraph type.35 /// \tparam _CapacityMapCapacity map type.36 template <typename _Digraph, typename _CapacityMap>34 /// \tparam GR Digraph type. 35 /// \tparam CM Capacity map type. 36 template <typename GR, typename CM> 37 37 struct PreflowDefaultTraits { 38 38 39 39 /// \brief The type of the digraph the algorithm runs on. 40 typedef _DigraphDigraph;40 typedef GR Digraph; 41 41 42 42 /// \brief The type of the map that stores the arc capacities. … … 44 44 /// The type of the map that stores the arc capacities. 45 45 /// It must meet the \ref concepts::ReadMap "ReadMap" concept. 46 typedef _CapacityMapCapacityMap;46 typedef CM CapacityMap; 47 47 48 48 /// \brief The type of the flow values. … … 105 105 /// second phase constructs a feasible maximum flow on each arc. 106 106 /// 107 /// \tparam _DigraphThe type of the digraph the algorithm runs on.108 /// \tparam _CapacityMapThe type of the capacity map. The default map109 /// type is \ref concepts::Digraph::ArcMap " _Digraph::ArcMap<int>".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>". 110 110 #ifdef DOXYGEN 111 template <typename _Digraph, typename _CapacityMap, typename _Traits>111 template <typename GR, typename CM, typename TR> 112 112 #else 113 template <typename _Digraph,114 typename _CapacityMap = typename _Digraph::template ArcMap<int>,115 typename _Traits = PreflowDefaultTraits<_Digraph, _CapacityMap> >113 template <typename GR, 114 typename CM = typename GR::template ArcMap<int>, 115 typename TR = PreflowDefaultTraits<GR, CM> > 116 116 #endif 117 117 class Preflow { … … 119 119 120 120 ///The \ref PreflowDefaultTraits "traits class" of the algorithm. 121 typedef _TraitsTraits;121 typedef TR Traits; 122 122 ///The type of the digraph the algorithm runs on. 123 123 typedef typename Traits::Digraph Digraph; -
lemon/soplex.cc
r485 r587 20 20 #include <lemon/soplex.h> 21 21 22 #include <soplex /soplex.h>22 #include <soplex.h> 23 23 24 24 … … 55 55 } 56 56 57 SoplexLp* SoplexLp:: _newSolver() const {57 SoplexLp* SoplexLp::newSolver() const { 58 58 SoplexLp* newlp = new SoplexLp(); 59 59 return newlp; 60 60 } 61 61 62 SoplexLp* SoplexLp:: _cloneSolver() const {62 SoplexLp* SoplexLp::cloneSolver() const { 63 63 SoplexLp* newlp = new SoplexLp(*this); 64 64 return newlp; -
lemon/soplex.h
r485 r587 74 74 /// \e 75 75 ~SoplexLp(); 76 /// \e 77 virtual SoplexLp* newSolver() const; 78 /// \e 79 virtual SoplexLp* cloneSolver() const; 76 80 77 81 protected: 78 79 virtual SoplexLp* _newSolver() const;80 virtual SoplexLp* _cloneSolver() const;81 82 82 83 virtual const char* _solverName() const; -
m4/lx_check_soplex.m4
r480 r586 21 21 SOPLEX_CXXFLAGS="-I$with_soplex_includedir" 22 22 elif test x"$with_soplex" != x"yes"; then 23 SOPLEX_CXXFLAGS="-I$with_soplex/ include"23 SOPLEX_CXXFLAGS="-I$with_soplex/src" 24 24 fi 25 25 … … 39 39 40 40 lx_soplex_test_prog=' 41 #include <soplex /soplex.h>41 #include <soplex.h> 42 42 43 43 int main(int argc, char** argv) -
test/CMakeLists.txt
r569 r575 30 30 maps_test 31 31 max_matching_test 32 min_cost_arborescence_test 32 33 path_test 33 34 preflow_test -
test/Makefile.am
r569 r575 26 26 test/maps_test \ 27 27 test/max_matching_test \ 28 test/min_cost_arborescence_test \ 28 29 test/path_test \ 29 30 test/preflow_test \ … … 67 68 test_mip_test_SOURCES = test/mip_test.cc 68 69 test_max_matching_test_SOURCES = test/max_matching_test.cc 70 test_min_cost_arborescence_test_SOURCES = test/min_cost_arborescence_test.cc 69 71 test_path_test_SOURCES = test/path_test.cc 70 72 test_preflow_test_SOURCES = test/preflow_test.cc -
test/euler_test.cc
r569 r578 26 26 void checkDiEulerIt(const Digraph& g) 27 27 { 28 typename Digraph::template ArcMap<int> visitationNumber(g );28 typename Digraph::template ArcMap<int> visitationNumber(g, 0); 29 29 30 30 DiEulerIt<Digraph> e(g); 31 31 typename Digraph::Node firstNode = g.source(e); 32 typename Digraph::Node lastNode ;32 typename Digraph::Node lastNode = g.target(e); 33 33 34 34 for (; e != INVALID; ++e) … … 54 54 void checkEulerIt(const Graph& g) 55 55 { 56 typename Graph::template EdgeMap<int> visitationNumber(g );56 typename Graph::template EdgeMap<int> visitationNumber(g, 0); 57 57 58 58 EulerIt<Graph> e(g); 59 59 typename Graph::Node firstNode = g.u(e); 60 typename Graph::Node lastNode ;60 typename Graph::Node lastNode = g.v(e); 61 61 62 62 for (; e != INVALID; ++e) -
test/lp_test.cc
r585 r589 198 198 check(const_cast<const LpSolver::Expr&>(e)[p2]==0, buf.str()); 199 199 200 //Test for clone/new 201 LP* lpnew = lp.newSolver(); 202 LP* lpclone = lp.cloneSolver(); 203 delete lpnew; 204 delete lpclone; 200 205 201 206 } … … 248 253 if (stat == LpSolver::OPTIMAL) { 249 254 std::ostringstream sbuf; 250 sbuf << "Wrong optimal value: the right optimum is " << exp_opt; 255 sbuf << "Wrong optimal value (" << lp.primal() <<") with " 256 << lp.solverName() <<"\n the right optimum is " << exp_opt; 251 257 check(std::abs(lp.primal()-exp_opt) < 1e-3, sbuf.str()); 252 258 } … … 356 362 } 357 363 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 358 377 int main() 359 378 { … … 366 385 lpTest(lp_glpk1); 367 386 aTest(lp_glpk2); 387 cloneTest<GlpkLp>(); 368 388 } 369 389 #endif … … 382 402 #endif 383 403 } 404 cloneTest<CplexLp>(); 384 405 #endif 385 406 … … 389 410 lpTest(lp_soplex1); 390 411 aTest(lp_soplex2); 412 cloneTest<SoplexLp>(); 391 413 } 392 414 #endif … … 397 419 lpTest(lp_clp1); 398 420 aTest(lp_clp2); 421 cloneTest<ClpLp>(); 399 422 } 400 423 #endif -
test/mip_test.cc
r585 r589 107 107 } 108 108 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 } 109 120 110 121 int main() … … 115 126 GlpkMip mip1; 116 127 aTest(mip1); 128 cloneTest<GlpkMip>(); 117 129 } 118 130 #endif … … 130 142 #endif 131 143 } 144 cloneTest<CplexMip>(); 132 145 #endif 133 146 -
tools/Makefile.am
r570 r573 2 2 3 3 bin_PROGRAMS += \ 4 tools/dimacs-solver \ 4 5 tools/dimacs-to-lgf \ 5 6 tools/lgf-gen … … 9 10 endif WANT_TOOLS 10 11 12 tools_dimacs_solver_SOURCES = tools/dimacs-solver.cc 11 13 tools_dimacs_to_lgf_SOURCES = tools/dimacs-to-lgf.cc 12 14 tools_lgf_gen_SOURCES = tools/lgf-gen.cc
Note: See TracChangeset
for help on using the changeset viewer.