Changes in / [607:49a39bae067c:605:f53d641aa967] in lemon
- Files:
-
- 33 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/groups.dox
r606 r478 21 21 /** 22 22 @defgroup datas Data Structures 23 This group contains the several data structures implemented in LEMON.23 This group describes the several data structures implemented in LEMON. 24 24 */ 25 25 … … 143 143 \brief Graph types between real graphs and graph adaptors. 144 144 145 This group contains some graph types between real graphs and graph adaptors.145 This group describes some graph types between real graphs and graph adaptors. 146 146 These classes wrap graphs to give new functionality as the adaptors do it. 147 147 On the other hand they are not light-weight structures as the adaptors. … … 153 153 \brief Map structures implemented in LEMON. 154 154 155 This group contains the map structures implemented in LEMON.155 This group describes the map structures implemented in LEMON. 156 156 157 157 LEMON provides several special purpose maps and map adaptors that e.g. combine … … 166 166 \brief Special graph-related maps. 167 167 168 This group contains maps that are specifically designed to assign168 This group describes maps that are specifically designed to assign 169 169 values to the nodes and arcs/edges of graphs. 170 170 … … 178 178 \brief Tools to create new maps from existing ones 179 179 180 This group contains map adaptors that are used to create "implicit"180 This group describes map adaptors that are used to create "implicit" 181 181 maps from other maps. 182 182 … … 241 241 \brief Two dimensional data storages implemented in LEMON. 242 242 243 This group contains two dimensional data storages implemented in LEMON.243 This group describes two dimensional data storages implemented in LEMON. 244 244 */ 245 245 … … 249 249 \brief %Path structures implemented in LEMON. 250 250 251 This group contains the path structures implemented in LEMON.251 This group describes the path structures implemented in LEMON. 252 252 253 253 LEMON provides flexible data structures to work with paths. … … 265 265 \brief Auxiliary data structures implemented in LEMON. 266 266 267 This group contains some data structures implemented in LEMON in267 This group describes some data structures implemented in LEMON in 268 268 order to make it easier to implement combinatorial algorithms. 269 269 */ … … 271 271 /** 272 272 @defgroup algs Algorithms 273 \brief This group contains the several algorithms273 \brief This group describes the several algorithms 274 274 implemented in LEMON. 275 275 276 This group contains the several algorithms276 This group describes the several algorithms 277 277 implemented in LEMON. 278 278 */ … … 283 283 \brief Common graph search algorithms. 284 284 285 This group contains the common graph search algorithms, namely285 This group describes the common graph search algorithms, namely 286 286 \e breadth-first \e search (BFS) and \e depth-first \e search (DFS). 287 287 */ … … 292 292 \brief Algorithms for finding shortest paths. 293 293 294 This group contains the algorithms for finding shortest paths in digraphs.294 This group describes the algorithms for finding shortest paths in digraphs. 295 295 296 296 - \ref Dijkstra algorithm for finding shortest paths from a source node … … 313 313 \brief Algorithms for finding maximum flows. 314 314 315 This group contains the algorithms for finding maximum flows and315 This group describes the algorithms for finding maximum flows and 316 316 feasible circulations. 317 317 … … 346 346 \brief Algorithms for finding minimum cost flows and circulations. 347 347 348 This group contains the algorithms for finding minimum cost flows and348 This group describes the algorithms for finding minimum cost flows and 349 349 circulations. 350 350 … … 383 383 \brief Algorithms for finding minimum cut in graphs. 384 384 385 This group contains the algorithms for finding minimum cut in graphs.385 This group describes the algorithms for finding minimum cut in graphs. 386 386 387 387 The \e minimum \e cut \e problem is to find a non-empty and non-complete … … 400 400 - \ref NagamochiIbaraki "Nagamochi-Ibaraki algorithm" for 401 401 calculating minimum cut in undirected graphs. 402 - \ref GomoryHu "Gomory-Hu tree computation" for calculating402 - \ref GomoryHuTree "Gomory-Hu tree computation" for calculating 403 403 all-pairs minimum cut in undirected graphs. 404 404 … … 412 412 \brief Algorithms for discovering the graph properties 413 413 414 This group contains the algorithms for discovering the graph properties414 This group describes the algorithms for discovering the graph properties 415 415 like connectivity, bipartiteness, euler property, simplicity etc. 416 416 … … 424 424 \brief Algorithms for planarity checking, embedding and drawing 425 425 426 This group contains the algorithms for planarity checking,426 This group describes the algorithms for planarity checking, 427 427 embedding and drawing. 428 428 … … 475 475 \brief Algorithms for finding a minimum cost spanning tree in a graph. 476 476 477 This group contains the algorithms for finding a minimum cost spanning477 This group describes the algorithms for finding a minimum cost spanning 478 478 tree in a graph. 479 479 */ … … 484 484 \brief Auxiliary algorithms implemented in LEMON. 485 485 486 This group contains some algorithms implemented in LEMON486 This group describes some algorithms implemented in LEMON 487 487 in order to make it easier to implement complex algorithms. 488 488 */ … … 493 493 \brief Approximation algorithms. 494 494 495 This group contains the approximation and heuristic algorithms495 This group describes the approximation and heuristic algorithms 496 496 implemented in LEMON. 497 497 */ … … 499 499 /** 500 500 @defgroup gen_opt_group General Optimization Tools 501 \brief This group contains some general optimization frameworks501 \brief This group describes some general optimization frameworks 502 502 implemented in LEMON. 503 503 504 This group contains some general optimization frameworks504 This group describes some general optimization frameworks 505 505 implemented in LEMON. 506 506 */ … … 511 511 \brief Lp and Mip solver interfaces for LEMON. 512 512 513 This group contains Lp and Mip solver interfaces for LEMON. The513 This group describes Lp and Mip solver interfaces for LEMON. The 514 514 various LP solvers could be used in the same manner with this 515 515 interface. … … 530 530 \brief Metaheuristics for LEMON library. 531 531 532 This group contains some metaheuristic optimization tools.532 This group describes some metaheuristic optimization tools. 533 533 */ 534 534 … … 545 545 \brief Simple basic graph utilities. 546 546 547 This group contains some simple basic graph utilities.547 This group describes some simple basic graph utilities. 548 548 */ 549 549 … … 553 553 \brief Tools for development, debugging and testing. 554 554 555 This group contains several useful tools for development,555 This group describes several useful tools for development, 556 556 debugging and testing. 557 557 */ … … 562 562 \brief Simple tools for measuring the performance of algorithms. 563 563 564 This group contains simple tools for measuring the performance564 This group describes simple tools for measuring the performance 565 565 of algorithms. 566 566 */ … … 571 571 \brief Exceptions defined in LEMON. 572 572 573 This group contains the exceptions defined in LEMON.573 This group describes the exceptions defined in LEMON. 574 574 */ 575 575 … … 578 578 \brief Graph Input-Output methods 579 579 580 This group contains the tools for importing and exporting graphs580 This group describes the tools for importing and exporting graphs 581 581 and graph related data. Now it supports the \ref lgf-format 582 582 "LEMON Graph Format", the \c DIMACS format and the encapsulated … … 589 589 \brief Reading and writing LEMON Graph Format. 590 590 591 This group contains methods for reading and writing591 This group describes methods for reading and writing 592 592 \ref lgf-format "LEMON Graph Format". 593 593 */ … … 598 598 \brief General \c EPS drawer and graph exporter 599 599 600 This group contains general \c EPS drawing methods and special600 This group describes general \c EPS drawing methods and special 601 601 graph exporting tools. 602 602 */ … … 622 622 \brief Skeleton classes and concept checking classes 623 623 624 This group contains the data/algorithm skeletons and concept checking624 This group describes the data/algorithm skeletons and concept checking 625 625 classes implemented in LEMON. 626 626 … … 652 652 \brief Skeleton and concept checking classes for graph structures 653 653 654 This group contains the skeletons and concept checking classes of LEMON's654 This group describes the skeletons and concept checking classes of LEMON's 655 655 graph structures and helper classes used to implement these. 656 656 */ … … 661 661 \brief Skeleton and concept checking classes for maps 662 662 663 This group contains the skeletons and concept checking classes of maps.663 This group describes the skeletons and concept checking classes of maps. 664 664 */ 665 665 -
doc/mainpage.dox
r606 r463 46 46 "Quick Tour to LEMON" which will guide you along. 47 47 48 If you already feel like using our library, see the 49 <a class="el" href="http://lemon.cs.elte.hu/pub/tutorial/">LEMON Tutorial</a>. 48 If you already feel like using our library, see the page that tells you 49 \ref getstart "How to start using LEMON". 50 51 If you 52 want to see how LEMON works, see 53 some \ref demoprograms "demo programs". 50 54 51 55 If you know what you are looking for then try to find it under the 52 <a class="el" href="modules.html">Modules</a> section. 56 <a class="el" href="modules.html">Modules</a> 57 section. 53 58 54 59 If you are a user of the old (0.x) series of LEMON, please check out the -
lemon/adaptors.h
r606 r566 2255 2255 /// This map adaptor class adapts two arc maps of the underlying 2256 2256 /// digraph to get an arc map of the undirected graph. 2257 /// Its value type is inherited from the first arc map type (\c FW). 2258 /// \tparam FW The type of the "foward" arc map. 2259 /// \tparam BK The type of the "backward" arc map. 2260 template <typename FW, typename BK> 2257 /// Its value type is inherited from the first arc map type 2258 /// (\c %ForwardMap). 2259 template <typename ForwardMap, typename BackwardMap> 2261 2260 class CombinedArcMap { 2262 2261 public: … … 2265 2264 typedef typename Parent::Arc Key; 2266 2265 /// The value type of the map 2267 typedef typename F W::Value Value;2268 2269 typedef typename MapTraits<F W>::ReferenceMapTag ReferenceMapTag;2270 2271 typedef typename MapTraits<F W>::ReturnValue ReturnValue;2272 typedef typename MapTraits<F W>::ConstReturnValue ConstReturnValue;2273 typedef typename MapTraits<F W>::ReturnValue Reference;2274 typedef typename MapTraits<F W>::ConstReturnValue ConstReference;2266 typedef typename ForwardMap::Value Value; 2267 2268 typedef typename MapTraits<ForwardMap>::ReferenceMapTag ReferenceMapTag; 2269 2270 typedef typename MapTraits<ForwardMap>::ReturnValue ReturnValue; 2271 typedef typename MapTraits<ForwardMap>::ConstReturnValue ConstReturnValue; 2272 typedef typename MapTraits<ForwardMap>::ReturnValue Reference; 2273 typedef typename MapTraits<ForwardMap>::ConstReturnValue ConstReference; 2275 2274 2276 2275 /// Constructor 2277 CombinedArcMap(F W& forward, BK& backward)2276 CombinedArcMap(ForwardMap& forward, BackwardMap& backward) 2278 2277 : _forward(&forward), _backward(&backward) {} 2279 2278 … … 2307 2306 protected: 2308 2307 2309 F W* _forward;2310 B K* _backward;2308 ForwardMap* _forward; 2309 BackwardMap* _backward; 2311 2310 2312 2311 }; … … 2315 2314 /// 2316 2315 /// This function just returns a combined arc map. 2317 template <typename FW, typename BK> 2318 static CombinedArcMap<FW, BK> 2319 combinedArcMap(FW& forward, BK& backward) { 2320 return CombinedArcMap<FW, BK>(forward, backward); 2321 } 2322 2323 template <typename FW, typename BK> 2324 static CombinedArcMap<const FW, BK> 2325 combinedArcMap(const FW& forward, BK& backward) { 2326 return CombinedArcMap<const FW, BK>(forward, backward); 2327 } 2328 2329 template <typename FW, typename BK> 2330 static CombinedArcMap<FW, const BK> 2331 combinedArcMap(FW& forward, const BK& backward) { 2332 return CombinedArcMap<FW, const BK>(forward, backward); 2333 } 2334 2335 template <typename FW, typename BK> 2336 static CombinedArcMap<const FW, const BK> 2337 combinedArcMap(const FW& forward, const BK& backward) { 2338 return CombinedArcMap<const FW, const BK>(forward, backward); 2316 template <typename ForwardMap, typename BackwardMap> 2317 static CombinedArcMap<ForwardMap, BackwardMap> 2318 combinedArcMap(ForwardMap& forward, BackwardMap& backward) { 2319 return CombinedArcMap<ForwardMap, BackwardMap>(forward, backward); 2320 } 2321 2322 template <typename ForwardMap, typename BackwardMap> 2323 static CombinedArcMap<const ForwardMap, BackwardMap> 2324 combinedArcMap(const ForwardMap& forward, BackwardMap& backward) { 2325 return CombinedArcMap<const ForwardMap, 2326 BackwardMap>(forward, backward); 2327 } 2328 2329 template <typename ForwardMap, typename BackwardMap> 2330 static CombinedArcMap<ForwardMap, const BackwardMap> 2331 combinedArcMap(ForwardMap& forward, const BackwardMap& backward) { 2332 return CombinedArcMap<ForwardMap, 2333 const BackwardMap>(forward, backward); 2334 } 2335 2336 template <typename ForwardMap, typename BackwardMap> 2337 static CombinedArcMap<const ForwardMap, const BackwardMap> 2338 combinedArcMap(const ForwardMap& forward, const BackwardMap& backward) { 2339 return CombinedArcMap<const ForwardMap, 2340 const BackwardMap>(forward, backward); 2339 2341 } 2340 2342 … … 3405 3407 /// This map adaptor class adapts two node maps of the original digraph 3406 3408 /// to get a node map of the split digraph. 3407 /// Its value type is inherited from the first node map type (\c IN). 3408 /// \tparam IN The type of the node map for the in-nodes. 3409 /// \tparam OUT The type of the node map for the out-nodes. 3410 template <typename IN, typename OUT> 3409 /// Its value type is inherited from the first node map type 3410 /// (\c InNodeMap). 3411 template <typename InNodeMap, typename OutNodeMap> 3411 3412 class CombinedNodeMap { 3412 3413 public: … … 3415 3416 typedef Node Key; 3416 3417 /// The value type of the map 3417 typedef typename I N::Value Value;3418 3419 typedef typename MapTraits<I N>::ReferenceMapTag ReferenceMapTag;3420 typedef typename MapTraits<I N>::ReturnValue ReturnValue;3421 typedef typename MapTraits<I N>::ConstReturnValue ConstReturnValue;3422 typedef typename MapTraits<I N>::ReturnValue Reference;3423 typedef typename MapTraits<I N>::ConstReturnValue ConstReference;3418 typedef typename InNodeMap::Value Value; 3419 3420 typedef typename MapTraits<InNodeMap>::ReferenceMapTag ReferenceMapTag; 3421 typedef typename MapTraits<InNodeMap>::ReturnValue ReturnValue; 3422 typedef typename MapTraits<InNodeMap>::ConstReturnValue ConstReturnValue; 3423 typedef typename MapTraits<InNodeMap>::ReturnValue Reference; 3424 typedef typename MapTraits<InNodeMap>::ConstReturnValue ConstReference; 3424 3425 3425 3426 /// Constructor 3426 CombinedNodeMap(I N& in_map, OUT& out_map)3427 CombinedNodeMap(InNodeMap& in_map, OutNodeMap& out_map) 3427 3428 : _in_map(in_map), _out_map(out_map) {} 3428 3429 … … 3456 3457 private: 3457 3458 3458 I N& _in_map;3459 O UT& _out_map;3459 InNodeMap& _in_map; 3460 OutNodeMap& _out_map; 3460 3461 3461 3462 }; … … 3465 3466 /// 3466 3467 /// This function just returns a combined node map. 3467 template <typename IN, typename OUT> 3468 static CombinedNodeMap<IN, OUT> 3469 combinedNodeMap(IN& in_map, OUT& out_map) { 3470 return CombinedNodeMap<IN, OUT>(in_map, out_map); 3471 } 3472 3473 template <typename IN, typename OUT> 3474 static CombinedNodeMap<const IN, OUT> 3475 combinedNodeMap(const IN& in_map, OUT& out_map) { 3476 return CombinedNodeMap<const IN, OUT>(in_map, out_map); 3477 } 3478 3479 template <typename IN, typename OUT> 3480 static CombinedNodeMap<IN, const OUT> 3481 combinedNodeMap(IN& in_map, const OUT& out_map) { 3482 return CombinedNodeMap<IN, const OUT>(in_map, out_map); 3483 } 3484 3485 template <typename IN, typename OUT> 3486 static CombinedNodeMap<const IN, const OUT> 3487 combinedNodeMap(const IN& in_map, const OUT& out_map) { 3488 return CombinedNodeMap<const IN, const OUT>(in_map, out_map); 3468 template <typename InNodeMap, typename OutNodeMap> 3469 static CombinedNodeMap<InNodeMap, OutNodeMap> 3470 combinedNodeMap(InNodeMap& in_map, OutNodeMap& out_map) { 3471 return CombinedNodeMap<InNodeMap, OutNodeMap>(in_map, out_map); 3472 } 3473 3474 template <typename InNodeMap, typename OutNodeMap> 3475 static CombinedNodeMap<const InNodeMap, OutNodeMap> 3476 combinedNodeMap(const InNodeMap& in_map, OutNodeMap& out_map) { 3477 return CombinedNodeMap<const InNodeMap, OutNodeMap>(in_map, out_map); 3478 } 3479 3480 template <typename InNodeMap, typename OutNodeMap> 3481 static CombinedNodeMap<InNodeMap, const OutNodeMap> 3482 combinedNodeMap(InNodeMap& in_map, const OutNodeMap& out_map) { 3483 return CombinedNodeMap<InNodeMap, const OutNodeMap>(in_map, out_map); 3484 } 3485 3486 template <typename InNodeMap, typename OutNodeMap> 3487 static CombinedNodeMap<const InNodeMap, const OutNodeMap> 3488 combinedNodeMap(const InNodeMap& in_map, const OutNodeMap& out_map) { 3489 return CombinedNodeMap<const InNodeMap, 3490 const OutNodeMap>(in_map, out_map); 3489 3491 } 3490 3492 … … 3494 3496 /// This map adaptor class adapts an arc map and a node map of the 3495 3497 /// original digraph to get an arc map of the split digraph. 3496 /// Its value type is inherited from the original arc map type (\c AM). 3497 /// \tparam AM The type of the arc map. 3498 /// \tparam NM the type of the node map. 3499 template <typename AM, typename NM> 3498 /// Its value type is inherited from the original arc map type 3499 /// (\c ArcMap). 3500 template <typename ArcMap, typename NodeMap> 3500 3501 class CombinedArcMap { 3501 3502 public: … … 3504 3505 typedef Arc Key; 3505 3506 /// The value type of the map 3506 typedef typename A M::Value Value;3507 3508 typedef typename MapTraits<A M>::ReferenceMapTag ReferenceMapTag;3509 typedef typename MapTraits<A M>::ReturnValue ReturnValue;3510 typedef typename MapTraits<A M>::ConstReturnValue ConstReturnValue;3511 typedef typename MapTraits<A M>::ReturnValue Reference;3512 typedef typename MapTraits<A M>::ConstReturnValue ConstReference;3507 typedef typename ArcMap::Value Value; 3508 3509 typedef typename MapTraits<ArcMap>::ReferenceMapTag ReferenceMapTag; 3510 typedef typename MapTraits<ArcMap>::ReturnValue ReturnValue; 3511 typedef typename MapTraits<ArcMap>::ConstReturnValue ConstReturnValue; 3512 typedef typename MapTraits<ArcMap>::ReturnValue Reference; 3513 typedef typename MapTraits<ArcMap>::ConstReturnValue ConstReference; 3513 3514 3514 3515 /// Constructor 3515 CombinedArcMap(A M& arc_map, NM& node_map)3516 CombinedArcMap(ArcMap& arc_map, NodeMap& node_map) 3516 3517 : _arc_map(arc_map), _node_map(node_map) {} 3517 3518 … … 3544 3545 3545 3546 private: 3546 3547 AM& _arc_map; 3548 NM& _node_map; 3549 3547 ArcMap& _arc_map; 3548 NodeMap& _node_map; 3550 3549 }; 3551 3550 -
lemon/bin_heap.h
r606 r463 34 34 ///\brief A Binary Heap implementation. 35 35 /// 36 ///This class implements the \e binary \e heap data structure. 37 /// 38 ///A \e heap is a data structure for storing items with specified values 39 ///called \e priorities in such a way that finding the item with minimum 40 ///priority is efficient. \c Comp specifies the ordering of the priorities. 41 ///In a heap one can change the priority of an item, add or erase an 42 ///item, etc. 36 ///This class implements the \e binary \e heap data structure. A \e heap 37 ///is a data structure for storing items with specified values called \e 38 ///priorities in such a way that finding the item with minimum priority is 39 ///efficient. \c Compare specifies the ordering of the priorities. In a heap 40 ///one can change the priority of an item, add or erase an item, etc. 43 41 /// 44 ///\tparam PRType of the priority of the items.45 ///\tparam IM A read and writable item map with int values, used internally42 ///\tparam _Prio Type of the priority of the items. 43 ///\tparam _ItemIntMap A read and writable Item int map, used internally 46 44 ///to handle the cross references. 47 ///\tparam Comp A functor class for the ordering of the priorities.48 /// The default is \c std::less<PR>.45 ///\tparam _Compare A class for the ordering of the priorities. The 46 ///default is \c std::less<_Prio>. 49 47 /// 50 48 ///\sa FibHeap 51 49 ///\sa Dijkstra 52 template <typename PR, typename IM, typename Comp = std::less<PR> > 50 template <typename _Prio, typename _ItemIntMap, 51 typename _Compare = std::less<_Prio> > 53 52 class BinHeap { 54 53 55 54 public: 56 55 ///\e 57 typedef IMItemIntMap;58 ///\e 59 typedef PRPrio;56 typedef _ItemIntMap ItemIntMap; 57 ///\e 58 typedef _Prio Prio; 60 59 ///\e 61 60 typedef typename ItemIntMap::Key Item; … … 63 62 typedef std::pair<Item,Prio> Pair; 64 63 ///\e 65 typedef CompCompare;64 typedef _Compare Compare; 66 65 67 66 /// \brief Type to represent the items states. … … 71 70 /// heap's point of view, but may be useful to the user. 72 71 /// 73 /// The item-int map must be initialized in such way that it assigns74 /// \c PRE_HEAP (<tt>-1</tt>) to any element to be put in the heap.72 /// The ItemIntMap \e should be initialized in such way that it maps 73 /// PRE_HEAP (-1) to any element to be put in the heap... 75 74 enum State { 76 IN_HEAP = 0, ///< \e77 PRE_HEAP = -1, ///< \e78 POST_HEAP = -2 ///< \e75 IN_HEAP = 0, 76 PRE_HEAP = -1, 77 POST_HEAP = -2 79 78 }; 80 79 81 80 private: 82 std::vector<Pair> _data;83 Compare _comp;84 ItemIntMap & _iim;81 std::vector<Pair> data; 82 Compare comp; 83 ItemIntMap &iim; 85 84 86 85 public: … … 88 87 /// 89 88 /// The constructor. 90 /// \param map should be given to the constructor, since it is used 91 /// internally to handle the cross references. The value of the map 92 /// must be \c PRE_HEAP (<tt>-1</tt>) for every item. 93 explicit BinHeap(ItemIntMap &map) : _iim(map) {} 94 95 /// \brief The constructor. 96 /// 97 /// The constructor. 98 /// \param map should be given to the constructor, since it is used 89 /// \param _iim should be given to the constructor, since it is used 99 90 /// internally to handle the cross references. The value of the map 100 91 /// should be PRE_HEAP (-1) for each element. 101 /// 102 /// \param comp The comparator function object. 103 BinHeap(ItemIntMap &map, const Compare &comp) 104 : _iim(map), _comp(comp) {} 92 explicit BinHeap(ItemIntMap &_iim) : iim(_iim) {} 93 94 /// \brief The constructor. 95 /// 96 /// The constructor. 97 /// \param _iim should be given to the constructor, since it is used 98 /// internally to handle the cross references. The value of the map 99 /// should be PRE_HEAP (-1) for each element. 100 /// 101 /// \param _comp The comparator function object. 102 BinHeap(ItemIntMap &_iim, const Compare &_comp) 103 : iim(_iim), comp(_comp) {} 105 104 106 105 … … 108 107 /// 109 108 /// \brief Returns the number of items stored in the heap. 110 int size() const { return _data.size(); }109 int size() const { return data.size(); } 111 110 112 111 /// \brief Checks if the heap stores no items. 113 112 /// 114 113 /// Returns \c true if and only if the heap stores no items. 115 bool empty() const { return _data.empty(); }114 bool empty() const { return data.empty(); } 116 115 117 116 /// \brief Make empty this heap. … … 122 121 /// each item to \c PRE_HEAP. 123 122 void clear() { 124 _data.clear();123 data.clear(); 125 124 } 126 125 … … 130 129 static int second_child(int i) { return 2*i+2; } 131 130 bool less(const Pair &p1, const Pair &p2) const { 132 return _comp(p1.second, p2.second);131 return comp(p1.second, p2.second); 133 132 } 134 133 135 134 int bubble_up(int hole, Pair p) { 136 135 int par = parent(hole); 137 while( hole>0 && less(p, _data[par]) ) {138 move( _data[par],hole);136 while( hole>0 && less(p,data[par]) ) { 137 move(data[par],hole); 139 138 hole = par; 140 139 par = parent(hole); … … 147 146 int child = second_child(hole); 148 147 while(child < length) { 149 if( less( _data[child-1], _data[child]) ) {148 if( less(data[child-1], data[child]) ) { 150 149 --child; 151 150 } 152 if( !less( _data[child], p) )151 if( !less(data[child], p) ) 153 152 goto ok; 154 move( _data[child], hole);153 move(data[child], hole); 155 154 hole = child; 156 155 child = second_child(hole); 157 156 } 158 157 child--; 159 if( child<length && less( _data[child], p) ) {160 move( _data[child], hole);158 if( child<length && less(data[child], p) ) { 159 move(data[child], hole); 161 160 hole=child; 162 161 } … … 167 166 168 167 void move(const Pair &p, int i) { 169 _data[i] = p;170 _iim.set(p.first, i);168 data[i] = p; 169 iim.set(p.first, i); 171 170 } 172 171 … … 177 176 /// \param p The pair to insert. 178 177 void push(const Pair &p) { 179 int n = _data.size();180 _data.resize(n+1);178 int n = data.size(); 179 data.resize(n+1); 181 180 bubble_up(n, p); 182 181 } … … 195 194 /// \pre The heap must be nonempty. 196 195 Item top() const { 197 return _data[0].first;196 return data[0].first; 198 197 } 199 198 … … 203 202 /// \pre The heap must be nonempty. 204 203 Prio prio() const { 205 return _data[0].second;204 return data[0].second; 206 205 } 207 206 … … 212 211 /// \pre The heap must be non-empty. 213 212 void pop() { 214 int n = _data.size()-1;215 _iim.set(_data[0].first, POST_HEAP);213 int n = data.size()-1; 214 iim.set(data[0].first, POST_HEAP); 216 215 if (n > 0) { 217 bubble_down(0, _data[n], n);218 } 219 _data.pop_back();216 bubble_down(0, data[n], n); 217 } 218 data.pop_back(); 220 219 } 221 220 … … 226 225 /// \pre The item should be in the heap. 227 226 void erase(const Item &i) { 228 int h = _iim[i];229 int n = _data.size()-1;230 _iim.set(_data[h].first, POST_HEAP);227 int h = iim[i]; 228 int n = data.size()-1; 229 iim.set(data[h].first, POST_HEAP); 231 230 if( h < n ) { 232 if ( bubble_up(h, _data[n]) == h) {233 bubble_down(h, _data[n], n);231 if ( bubble_up(h, data[n]) == h) { 232 bubble_down(h, data[n], n); 234 233 } 235 234 } 236 _data.pop_back();235 data.pop_back(); 237 236 } 238 237 … … 241 240 /// 242 241 /// This function returns the priority of item \c i. 243 /// \param i The item.244 242 /// \pre \c i must be in the heap. 243 /// \param i The item. 245 244 Prio operator[](const Item &i) const { 246 int idx = _iim[i];247 return _data[idx].second;245 int idx = iim[i]; 246 return data[idx].second; 248 247 } 249 248 … … 256 255 /// \param p The priority. 257 256 void set(const Item &i, const Prio &p) { 258 int idx = _iim[i];257 int idx = iim[i]; 259 258 if( idx < 0 ) { 260 259 push(i,p); 261 260 } 262 else if( _comp(p, _data[idx].second) ) {261 else if( comp(p, data[idx].second) ) { 263 262 bubble_up(idx, Pair(i,p)); 264 263 } 265 264 else { 266 bubble_down(idx, Pair(i,p), _data.size());265 bubble_down(idx, Pair(i,p), data.size()); 267 266 } 268 267 } … … 271 270 /// 272 271 /// This method decreases the priority of item \c i to \c p. 273 /// \param i The item.274 /// \param p The priority.275 272 /// \pre \c i must be stored in the heap with priority at least \c 276 273 /// p relative to \c Compare. 274 /// \param i The item. 275 /// \param p The priority. 277 276 void decrease(const Item &i, const Prio &p) { 278 int idx = _iim[i];277 int idx = iim[i]; 279 278 bubble_up(idx, Pair(i,p)); 280 279 } … … 283 282 /// 284 283 /// This method sets the priority of item \c i to \c p. 285 /// \param i The item.286 /// \param p The priority.287 284 /// \pre \c i must be stored in the heap with priority at most \c 288 285 /// p relative to \c Compare. 286 /// \param i The item. 287 /// \param p The priority. 289 288 void increase(const Item &i, const Prio &p) { 290 int idx = _iim[i];291 bubble_down(idx, Pair(i,p), _data.size());289 int idx = iim[i]; 290 bubble_down(idx, Pair(i,p), data.size()); 292 291 } 293 292 … … 301 300 /// \param i The item. 302 301 State state(const Item &i) const { 303 int s = _iim[i];302 int s = iim[i]; 304 303 if( s>=0 ) 305 304 s=0; … … 321 320 erase(i); 322 321 } 323 _iim[i] = st;322 iim[i] = st; 324 323 break; 325 324 case IN_HEAP: … … 335 334 /// with the same prioriority as prevoiusly the \c i item. 336 335 void replace(const Item& i, const Item& j) { 337 int idx = _iim[i];338 _iim.set(i, _iim[j]);339 _iim.set(j, idx);340 _data[idx].first = j;336 int idx = iim[i]; 337 iim.set(i, iim[j]); 338 iim.set(j, idx); 339 data[idx].first = j; 341 340 } 342 341 -
lemon/bits/edge_set_extender.h
r606 r566 25 25 #include <lemon/bits/map_extender.h> 26 26 27 // \ingroup digraphbits28 // \file29 // \brief Extenders for the arc set types27 ///\ingroup digraphbits 28 ///\file 29 ///\brief Extenders for the arc set types 30 30 namespace lemon { 31 31 32 // \ingroup digraphbits33 // 34 // \brief Extender for the ArcSets32 /// \ingroup digraphbits 33 /// 34 /// \brief Extender for the ArcSets 35 35 template <typename Base> 36 36 class ArcSetExtender : public Base { … … 73 73 // Alteration notifier extensions 74 74 75 // The arc observer registry.75 /// The arc observer registry. 76 76 typedef AlterationNotifier<ArcSetExtender, Arc> ArcNotifier; 77 77 … … 84 84 using Parent::notifier; 85 85 86 // Gives back the arc alteration notifier. 86 /// \brief Gives back the arc alteration notifier. 87 /// 88 /// Gives back the arc alteration notifier. 87 89 ArcNotifier& notifier(Arc) const { 88 90 return arc_notifier; … … 184 186 }; 185 187 186 // \brief Base node of the iterator187 // 188 // Returns the base node (ie. the source in this case) of the iterator188 /// \brief Base node of the iterator 189 /// 190 /// Returns the base node (ie. the source in this case) of the iterator 189 191 Node baseNode(const OutArcIt &e) const { 190 192 return Parent::source(static_cast<const Arc&>(e)); 191 193 } 192 // \brief Running node of the iterator193 // 194 // Returns the running node (ie. the target in this case) of the195 // iterator194 /// \brief Running node of the iterator 195 /// 196 /// Returns the running node (ie. the target in this case) of the 197 /// iterator 196 198 Node runningNode(const OutArcIt &e) const { 197 199 return Parent::target(static_cast<const Arc&>(e)); 198 200 } 199 201 200 // \brief Base node of the iterator201 // 202 // Returns the base node (ie. the target in this case) of the iterator202 /// \brief Base node of the iterator 203 /// 204 /// Returns the base node (ie. the target in this case) of the iterator 203 205 Node baseNode(const InArcIt &e) const { 204 206 return Parent::target(static_cast<const Arc&>(e)); 205 207 } 206 // \brief Running node of the iterator207 // 208 // Returns the running node (ie. the source in this case) of the209 // iterator208 /// \brief Running node of the iterator 209 /// 210 /// Returns the running node (ie. the source in this case) of the 211 /// iterator 210 212 Node runningNode(const InArcIt &e) const { 211 213 return Parent::source(static_cast<const Arc&>(e)); … … 270 272 271 273 272 // \ingroup digraphbits273 // 274 // \brief Extender for the EdgeSets274 /// \ingroup digraphbits 275 /// 276 /// \brief Extender for the EdgeSets 275 277 template <typename Base> 276 278 class EdgeSetExtender : public Base { … … 491 493 }; 492 494 493 // \brief Base node of the iterator494 // 495 // Returns the base node (ie. the source in this case) of the iterator495 /// \brief Base node of the iterator 496 /// 497 /// Returns the base node (ie. the source in this case) of the iterator 496 498 Node baseNode(const OutArcIt &e) const { 497 499 return Parent::source(static_cast<const Arc&>(e)); 498 500 } 499 // \brief Running node of the iterator500 // 501 // Returns the running node (ie. the target in this case) of the502 // iterator501 /// \brief Running node of the iterator 502 /// 503 /// Returns the running node (ie. the target in this case) of the 504 /// iterator 503 505 Node runningNode(const OutArcIt &e) const { 504 506 return Parent::target(static_cast<const Arc&>(e)); 505 507 } 506 508 507 // \brief Base node of the iterator508 // 509 // Returns the base node (ie. the target in this case) of the iterator509 /// \brief Base node of the iterator 510 /// 511 /// Returns the base node (ie. the target in this case) of the iterator 510 512 Node baseNode(const InArcIt &e) const { 511 513 return Parent::target(static_cast<const Arc&>(e)); 512 514 } 513 // \brief Running node of the iterator514 // 515 // Returns the running node (ie. the source in this case) of the516 // iterator515 /// \brief Running node of the iterator 516 /// 517 /// Returns the running node (ie. the source in this case) of the 518 /// iterator 517 519 Node runningNode(const InArcIt &e) const { 518 520 return Parent::source(static_cast<const Arc&>(e)); 519 521 } 520 522 521 // Base node of the iterator522 // 523 // Returns the base node of the iterator523 /// Base node of the iterator 524 /// 525 /// Returns the base node of the iterator 524 526 Node baseNode(const IncEdgeIt &e) const { 525 527 return e.direction ? u(e) : v(e); 526 528 } 527 // Running node of the iterator528 // 529 // Returns the running node of the iterator529 /// Running node of the iterator 530 /// 531 /// Returns the running node of the iterator 530 532 Node runningNode(const IncEdgeIt &e) const { 531 533 return e.direction ? v(e) : u(e); -
lemon/circulation.h
r606 r525 216 216 ///@{ 217 217 218 template <typename T>218 template <typename _FlowMap> 219 219 struct SetFlowMapTraits : public Traits { 220 typedef TFlowMap;220 typedef _FlowMap FlowMap; 221 221 static FlowMap *createFlowMap(const Digraph&) { 222 222 LEMON_ASSERT(false, "FlowMap is not initialized"); … … 230 230 /// \ref named-templ-param "Named parameter" for setting FlowMap 231 231 /// type. 232 template <typename T>232 template <typename _FlowMap> 233 233 struct SetFlowMap 234 234 : public Circulation<Digraph, LCapMap, UCapMap, DeltaMap, 235 SetFlowMapTraits< T> > {235 SetFlowMapTraits<_FlowMap> > { 236 236 typedef Circulation<Digraph, LCapMap, UCapMap, DeltaMap, 237 SetFlowMapTraits< T> > Create;237 SetFlowMapTraits<_FlowMap> > Create; 238 238 }; 239 239 240 template <typename T>240 template <typename _Elevator> 241 241 struct SetElevatorTraits : public Traits { 242 typedef TElevator;242 typedef _Elevator Elevator; 243 243 static Elevator *createElevator(const Digraph&, int) { 244 244 LEMON_ASSERT(false, "Elevator is not initialized"); … … 256 256 /// \ref run() or \ref init(). 257 257 /// \sa SetStandardElevator 258 template <typename T>258 template <typename _Elevator> 259 259 struct SetElevator 260 260 : public Circulation<Digraph, LCapMap, UCapMap, DeltaMap, 261 SetElevatorTraits< T> > {261 SetElevatorTraits<_Elevator> > { 262 262 typedef Circulation<Digraph, LCapMap, UCapMap, DeltaMap, 263 SetElevatorTraits< T> > Create;263 SetElevatorTraits<_Elevator> > Create; 264 264 }; 265 265 266 template <typename T>266 template <typename _Elevator> 267 267 struct SetStandardElevatorTraits : public Traits { 268 typedef TElevator;268 typedef _Elevator Elevator; 269 269 static Elevator *createElevator(const Digraph& digraph, int max_level) { 270 270 return new Elevator(digraph, max_level); … … 284 284 /// before calling \ref run() or \ref init(). 285 285 /// \sa SetElevator 286 template <typename T>286 template <typename _Elevator> 287 287 struct SetStandardElevator 288 288 : public Circulation<Digraph, LCapMap, UCapMap, DeltaMap, 289 SetStandardElevatorTraits< T> > {289 SetStandardElevatorTraits<_Elevator> > { 290 290 typedef Circulation<Digraph, LCapMap, UCapMap, DeltaMap, 291 SetStandardElevatorTraits< T> > Create;291 SetStandardElevatorTraits<_Elevator> > Create; 292 292 }; 293 293 … … 683 683 /// 684 684 /// \note This function calls \ref barrier() for each node, 685 /// so it runs in O(n)time.685 /// so it runs in \f$O(n)\f$ time. 686 686 /// 687 687 /// \pre Either \ref run() or \ref init() must be called before -
lemon/concepts/graph.h
r606 r576 602 602 /// \brief Opposite node on an arc 603 603 /// 604 /// \return The opposite of the given node on the given edge.604 /// \return the opposite of the given Node on the given Edge 605 605 Node oppositeNode(Node, Edge) const { return INVALID; } 606 606 607 607 /// \brief First node of the edge. 608 608 /// 609 /// \return The first node of the given edge.609 /// \return the first node of the given Edge. 610 610 /// 611 611 /// Naturally edges don't have direction and thus 612 /// don't have source and target node. However we use \c u() and \c v()613 /// methods to query the two nodes of the arc. The direction of the614 /// arcwhich arises this way is called the inherent direction of the612 /// don't have source and target node. But we use these two methods 613 /// to query the two nodes of the arc. The direction of the arc 614 /// which arises this way is called the inherent direction of the 615 615 /// edge, and is used to define the "default" direction 616 616 /// of the directed versions of the arcs. 617 /// \sa v() 618 /// \sa direction() 617 /// \sa direction 619 618 Node u(Edge) const { return INVALID; } 620 619 621 620 /// \brief Second node of the edge. 622 ///623 /// \return The second node of the given edge.624 ///625 /// Naturally edges don't have direction and thus626 /// don't have source and target node. However we use \c u() and \c v()627 /// methods to query the two nodes of the arc. The direction of the628 /// arc which arises this way is called the inherent direction of the629 /// edge, and is used to define the "default" direction630 /// of the directed versions of the arcs.631 /// \sa u()632 /// \sa direction()633 621 Node v(Edge) const { return INVALID; } 634 622 -
lemon/concepts/graph_components.h
r606 r581 21 21 ///\brief The concept of graph components. 22 22 23 23 24 #ifndef LEMON_CONCEPTS_GRAPH_COMPONENTS_H 24 25 #define LEMON_CONCEPTS_GRAPH_COMPONENTS_H … … 44 45 45 46 #ifndef DOXYGEN 46 template <char sel= '0'>47 template <char _selector = '0'> 47 48 #endif 48 49 class GraphItem { … … 296 297 /// The most of the base digraphs should conform to this concept. 297 298 /// The id's are unique and immutable. 298 template <typename BAS= BaseDigraphComponent>299 class IDableDigraphComponent : public BAS{300 public: 301 302 typedef BASBase;299 template <typename _Base = BaseDigraphComponent> 300 class IDableDigraphComponent : public _Base { 301 public: 302 303 typedef _Base Base; 303 304 typedef typename Base::Node Node; 304 305 typedef typename Base::Arc Arc; … … 374 375 /// most of the base undirected graphs should conform to this 375 376 /// concept. The id's are unique and immutable. 376 template <typename BAS= BaseGraphComponent>377 class IDableGraphComponent : public IDableDigraphComponent< BAS> {378 public: 379 380 typedef BASBase;377 template <typename _Base = BaseGraphComponent> 378 class IDableGraphComponent : public IDableDigraphComponent<_Base> { 379 public: 380 381 typedef _Base Base; 381 382 typedef typename Base::Edge Edge; 382 383 383 using IDableDigraphComponent< Base>::id;384 using IDableDigraphComponent<_Base>::id; 384 385 385 386 /// \brief Gives back an unique integer id for the Edge. … … 425 426 /// Skeleton class for graph NodeIt and ArcIt. 426 427 /// 427 template <typename GR, typenameItem>428 class GraphItemIt : public Item {428 template <typename _Graph, typename _Item> 429 class GraphItemIt : public _Item { 429 430 public: 430 431 /// \brief Default constructor. … … 442 443 /// Sets the iterator to the first item of \c the graph. 443 444 /// 444 explicit GraphItemIt(const GR&) {}445 explicit GraphItemIt(const _Graph&) {} 445 446 /// \brief Invalid constructor \& conversion. 446 447 /// … … 479 480 ++(++it1); 480 481 481 Item bi = it1;482 _Item bi = it1; 482 483 bi = it2; 483 484 } 484 GR& g;485 _Graph& g; 485 486 }; 486 487 }; … … 489 490 /// 490 491 /// \note Because InArcIt and OutArcIt may not inherit from the same 491 /// base class, the \c sel is a additional template parameter (selector).492 /// ForInArcIt you should instantiate it with character 'i' and for492 /// base class, the _selector is a additional template parameter. For 493 /// InArcIt you should instantiate it with character 'i' and for 493 494 /// OutArcIt with 'o'. 494 template <typename GR,495 typename Item = typename GR::Arc,496 typename Base = typename GR::Node,497 char sel= '0'>498 class GraphIncIt : public Item {495 template <typename _Graph, 496 typename _Item = typename _Graph::Arc, 497 typename _Base = typename _Graph::Node, 498 char _selector = '0'> 499 class GraphIncIt : public _Item { 499 500 public: 500 501 /// \brief Default constructor. … … 507 508 /// Copy constructor. 508 509 /// 509 GraphIncIt(GraphIncIt const& gi) : Item(gi) {}510 GraphIncIt(GraphIncIt const& gi) : _Item(gi) {} 510 511 /// \brief Sets the iterator to the first arc incoming into or outgoing 511 512 /// from the node. … … 514 515 /// from the node. 515 516 /// 516 explicit GraphIncIt(const GR&, constBase&) {}517 explicit GraphIncIt(const _Graph&, const _Base&) {} 517 518 /// \brief Invalid constructor \& conversion. 518 519 /// … … 546 547 struct Constraints { 547 548 void constraints() { 548 checkConcept<GraphItem< sel>, _GraphIncIt>();549 checkConcept<GraphItem<_selector>, _GraphIncIt>(); 549 550 _GraphIncIt it1(graph, node); 550 551 _GraphIncIt it2; … … 553 554 ++it2 = it1; 554 555 ++(++it1); 555 Item e = it1;556 _Item e = it1; 556 557 e = it2; 557 558 558 559 } 559 560 560 Item arc;561 Base node;562 GRgraph;561 _Item arc; 562 _Base node; 563 _Graph graph; 563 564 _GraphIncIt it; 564 565 }; … … 571 572 /// iterator based iterable interface for the digraph structure. 572 573 /// This concept is part of the Digraph concept. 573 template <typename BAS= BaseDigraphComponent>574 class IterableDigraphComponent : public BAS{575 576 public: 577 578 typedef BASBase;574 template <typename _Base = BaseDigraphComponent> 575 class IterableDigraphComponent : public _Base { 576 577 public: 578 579 typedef _Base Base; 579 580 typedef typename Base::Node Node; 580 581 typedef typename Base::Arc Arc; … … 756 757 /// based iterable interface for the undirected graph structure. 757 758 /// This concept is part of the Graph concept. 758 template <typename BAS= BaseGraphComponent>759 class IterableGraphComponent : public IterableDigraphComponent< BAS> {760 public: 761 762 typedef BASBase;759 template <typename _Base = BaseGraphComponent> 760 class IterableGraphComponent : public IterableDigraphComponent<_Base> { 761 public: 762 763 typedef _Base Base; 763 764 typedef typename Base::Node Node; 764 765 typedef typename Base::Arc Arc; … … 773 774 /// @{ 774 775 775 using IterableDigraphComponent< Base>::first;776 using IterableDigraphComponent< Base>::next;776 using IterableDigraphComponent<_Base>::first; 777 using IterableDigraphComponent<_Base>::next; 777 778 778 779 /// \brief Gives back the first edge in the iterating … … 808 809 void nextInc(Edge&, bool&) const {} 809 810 810 using IterableDigraphComponent< Base>::baseNode;811 using IterableDigraphComponent< Base>::runningNode;811 using IterableDigraphComponent<_Base>::baseNode; 812 using IterableDigraphComponent<_Base>::runningNode; 812 813 813 814 /// @} … … 875 876 876 877 const _Graph& graph; 878 877 879 }; 878 880 }; … … 886 888 /// alteration occured in the digraph all the observers will 887 889 /// notified about it. 888 template <typename BAS= BaseDigraphComponent>889 class AlterableDigraphComponent : public BAS{890 public: 891 892 typedef BASBase;890 template <typename _Base = BaseDigraphComponent> 891 class AlterableDigraphComponent : public _Base { 892 public: 893 894 typedef _Base Base; 893 895 typedef typename Base::Node Node; 894 896 typedef typename Base::Arc Arc; … … 944 946 /// alteration occured in the graph all the observers will 945 947 /// notified about it. 946 template <typename BAS= BaseGraphComponent>947 class AlterableGraphComponent : public AlterableDigraphComponent< BAS> {948 public: 949 950 typedef BASBase;948 template <typename _Base = BaseGraphComponent> 949 class AlterableGraphComponent : public AlterableDigraphComponent<_Base> { 950 public: 951 952 typedef _Base Base; 951 953 typedef typename Base::Edge Edge; 952 954 … … 973 975 974 976 const _Graph& graph; 975 }; 977 978 }; 979 976 980 }; 977 981 … … 981 985 /// (NodeMap, ArcMap), that is maps that can be used to 982 986 /// associate data to graph descriptors (nodes or arcs). 983 template <typename GR, typename K, typename V>984 class GraphMap : public ReadWriteMap< K, V> {985 public: 986 987 typedef ReadWriteMap< K, V> Parent;987 template <typename _Graph, typename _Item, typename _Value> 988 class GraphMap : public ReadWriteMap<_Item, _Value> { 989 public: 990 991 typedef ReadWriteMap<_Item, _Value> Parent; 988 992 989 993 /// The graph type of the map. 990 typedef GRGraph;994 typedef _Graph Graph; 991 995 /// The key type of the map. 992 typedef KKey;996 typedef _Item Key; 993 997 /// The value type of the map. 994 typedef VValue;998 typedef _Value Value; 995 999 996 1000 /// \brief Construct a new map. … … 1052 1056 /// map interface for the digraph structure. 1053 1057 /// This concept is part of the Digraph concept. 1054 template <typename BAS= BaseDigraphComponent>1055 class MappableDigraphComponent : public BAS{1056 public: 1057 1058 typedef BASBase;1058 template <typename _Base = BaseDigraphComponent> 1059 class MappableDigraphComponent : public _Base { 1060 public: 1061 1062 typedef _Base Base; 1059 1063 typedef typename Base::Node Node; 1060 1064 typedef typename Base::Arc Arc; … … 1066 1070 /// ReadWrite map of the nodes. 1067 1071 /// 1068 template <typename V>1069 class NodeMap : public GraphMap<Digraph, Node, V> {1072 template <typename _Value> 1073 class NodeMap : public GraphMap<Digraph, Node, _Value> { 1070 1074 public: 1071 typedef GraphMap<MappableDigraphComponent, Node, V> Parent;1075 typedef GraphMap<MappableDigraphComponent, Node, _Value> Parent; 1072 1076 1073 1077 /// \brief Construct a new map. … … 1080 1084 /// 1081 1085 /// Construct a new map for the digraph and initalise the values. 1082 NodeMap(const MappableDigraphComponent& digraph, const V& value)1086 NodeMap(const MappableDigraphComponent& digraph, const _Value& value) 1083 1087 : Parent(digraph, value) {} 1084 1088 … … 1094 1098 template <typename CMap> 1095 1099 NodeMap& operator=(const CMap&) { 1096 checkConcept<ReadMap<Node, V>, CMap>();1100 checkConcept<ReadMap<Node, _Value>, CMap>(); 1097 1101 return *this; 1098 1102 } … … 1104 1108 /// ReadWrite map of the arcs. 1105 1109 /// 1106 template <typename V>1107 class ArcMap : public GraphMap<Digraph, Arc, V> {1110 template <typename _Value> 1111 class ArcMap : public GraphMap<Digraph, Arc, _Value> { 1108 1112 public: 1109 typedef GraphMap<MappableDigraphComponent, Arc, V> Parent;1113 typedef GraphMap<MappableDigraphComponent, Arc, _Value> Parent; 1110 1114 1111 1115 /// \brief Construct a new map. … … 1118 1122 /// 1119 1123 /// Construct a new map for the digraph and initalise the values. 1120 ArcMap(const MappableDigraphComponent& digraph, const V& value)1124 ArcMap(const MappableDigraphComponent& digraph, const _Value& value) 1121 1125 : Parent(digraph, value) {} 1122 1126 … … 1132 1136 template <typename CMap> 1133 1137 ArcMap& operator=(const CMap&) { 1134 checkConcept<ReadMap<Arc, V>, CMap>();1138 checkConcept<ReadMap<Arc, _Value>, CMap>(); 1135 1139 return *this; 1136 1140 } … … 1188 1192 /// map interface for the graph structure. 1189 1193 /// This concept is part of the Graph concept. 1190 template <typename BAS= BaseGraphComponent>1191 class MappableGraphComponent : public MappableDigraphComponent< BAS> {1192 public: 1193 1194 typedef BASBase;1194 template <typename _Base = BaseGraphComponent> 1195 class MappableGraphComponent : public MappableDigraphComponent<_Base> { 1196 public: 1197 1198 typedef _Base Base; 1195 1199 typedef typename Base::Edge Edge; 1196 1200 … … 1201 1205 /// ReadWrite map of the edges. 1202 1206 /// 1203 template <typename V>1204 class EdgeMap : public GraphMap<Graph, Edge, V> {1207 template <typename _Value> 1208 class EdgeMap : public GraphMap<Graph, Edge, _Value> { 1205 1209 public: 1206 typedef GraphMap<MappableGraphComponent, Edge, V> Parent;1210 typedef GraphMap<MappableGraphComponent, Edge, _Value> Parent; 1207 1211 1208 1212 /// \brief Construct a new map. … … 1215 1219 /// 1216 1220 /// Construct a new map for the graph and initalise the values. 1217 EdgeMap(const MappableGraphComponent& graph, const V& value)1221 EdgeMap(const MappableGraphComponent& graph, const _Value& value) 1218 1222 : Parent(graph, value) {} 1219 1223 … … 1229 1233 template <typename CMap> 1230 1234 EdgeMap& operator=(const CMap&) { 1231 checkConcept<ReadMap<Edge, V>, CMap>();1235 checkConcept<ReadMap<Edge, _Value>, CMap>(); 1232 1236 return *this; 1233 1237 } … … 1273 1277 /// difference between the base and this interface is that the 1274 1278 /// digraph alterations should handled already on this level. 1275 template <typename BAS= BaseDigraphComponent>1276 class ExtendableDigraphComponent : public BAS{1277 public: 1278 typedef BASBase;1279 1280 typedef typename Base::Node Node;1281 typedef typename Base::Arc Arc;1279 template <typename _Base = BaseDigraphComponent> 1280 class ExtendableDigraphComponent : public _Base { 1281 public: 1282 typedef _Base Base; 1283 1284 typedef typename _Base::Node Node; 1285 typedef typename _Base::Arc Arc; 1282 1286 1283 1287 /// \brief Adds a new node to the digraph. … … 1318 1322 /// that the graph alterations should handled already on this 1319 1323 /// level. 1320 template <typename BAS= BaseGraphComponent>1321 class ExtendableGraphComponent : public BAS{1322 public: 1323 1324 typedef BASBase;1325 typedef typename Base::Node Node;1326 typedef typename Base::Edge Edge;1324 template <typename _Base = BaseGraphComponent> 1325 class ExtendableGraphComponent : public _Base { 1326 public: 1327 1328 typedef _Base Base; 1329 typedef typename _Base::Node Node; 1330 typedef typename _Base::Edge Edge; 1327 1331 1328 1332 /// \brief Adds a new node to the graph. … … 1362 1366 /// the base and this interface is that the digraph alterations 1363 1367 /// should handled already on this level. 1364 template <typename BAS= BaseDigraphComponent>1365 class ErasableDigraphComponent : public BAS{1366 public: 1367 1368 typedef BASBase;1368 template <typename _Base = BaseDigraphComponent> 1369 class ErasableDigraphComponent : public _Base { 1370 public: 1371 1372 typedef _Base Base; 1369 1373 typedef typename Base::Node Node; 1370 1374 typedef typename Base::Arc Arc; … … 1402 1406 /// main difference between the base and this interface is that 1403 1407 /// the graph alterations should handled already on this level. 1404 template <typename BAS= BaseGraphComponent>1405 class ErasableGraphComponent : public BAS{1406 public: 1407 1408 typedef BASBase;1408 template <typename _Base = BaseGraphComponent> 1409 class ErasableGraphComponent : public _Base { 1410 public: 1411 1412 typedef _Base Base; 1409 1413 typedef typename Base::Node Node; 1410 1414 typedef typename Base::Edge Edge; … … 1442 1446 /// the base and this interface is that the digraph alterations 1443 1447 /// should handled already on this level. 1444 template <typename BAS= BaseDigraphComponent>1445 class ClearableDigraphComponent : public BAS{1446 public: 1447 1448 typedef BASBase;1448 template <typename _Base = BaseDigraphComponent> 1449 class ClearableDigraphComponent : public _Base { 1450 public: 1451 1452 typedef _Base Base; 1449 1453 1450 1454 /// \brief Erase all nodes and arcs from the digraph. … … 1471 1475 /// main difference between the base and this interface is that 1472 1476 /// the graph alterations should handled already on this level. 1473 template <typename BAS= BaseGraphComponent>1474 class ClearableGraphComponent : public ClearableDigraphComponent< BAS> {1475 public: 1476 1477 typedef BASBase;1477 template <typename _Base = BaseGraphComponent> 1478 class ClearableGraphComponent : public ClearableDigraphComponent<_Base> { 1479 public: 1480 1481 typedef _Base Base; 1478 1482 1479 1483 template <typename _Graph> -
lemon/concepts/heap.h
r606 r576 36 36 /// \brief The heap concept. 37 37 /// 38 /// Concept class describing the main interface of heaps. A \e heap 39 /// is a data structure for storing items with specified values called 40 /// \e priorities in such a way that finding the item with minimum 41 /// priority is efficient. In a heap one can change the priority of an 42 /// item, add or erase an item, etc. 43 /// 44 /// \tparam PR Type of the priority of the items. 45 /// \tparam IM A read and writable item map with int values, used 46 /// internally to handle the cross references. 47 /// \tparam Comp A functor class for the ordering of the priorities. 48 /// The default is \c std::less<PR>. 49 #ifdef DOXYGEN 50 template <typename PR, typename IM, typename Comp = std::less<PR> > 51 #else 52 template <typename PR, typename IM> 53 #endif 38 /// Concept class describing the main interface of heaps. 39 template <typename Priority, typename ItemIntMap> 54 40 class Heap { 55 41 public: 56 42 57 /// Type of the item-int map.58 typedef IM ItemIntMap;59 /// Type of the priorities.60 typedef PR Prio;61 43 /// Type of the items stored in the heap. 62 44 typedef typename ItemIntMap::Key Item; 45 46 /// Type of the priorities. 47 typedef Priority Prio; 63 48 64 49 /// \brief Type to represent the states of the items. … … 69 54 /// the user. 70 55 /// 71 /// The item-int map must be initialized in such way that it assigns72 /// \c PRE_HEAP (<tt>-1</tt>) to any element to be put in the heap.56 /// The \c ItemIntMap must be initialized in such a way, that it 57 /// assigns \c PRE_HEAP (<tt>-1</tt>) to every item. 73 58 enum State { 74 IN_HEAP = 0, ///< The "in heap" state constant.75 PRE_HEAP = -1, ///< The "pre heap" state constant.76 POST_HEAP = -2 ///< The "post heap" state constant.59 IN_HEAP = 0, 60 PRE_HEAP = -1, 61 POST_HEAP = -2 77 62 }; 78 63 … … 135 120 /// 136 121 /// Returns the priority of the given item. 137 /// \param i The item.138 122 /// \pre \c i must be in the heap. 123 /// \param i The item. 139 124 Prio operator[](const Item &i) const {} 140 125 … … 153 138 /// 154 139 /// Decreases the priority of an item to the given value. 140 /// \pre \c i must be stored in the heap with priority at least \c p. 155 141 /// \param i The item. 156 142 /// \param p The priority. 157 /// \pre \c i must be stored in the heap with priority at least \c p.158 143 void decrease(const Item &i, const Prio &p) {} 159 144 … … 161 146 /// 162 147 /// Increases the priority of an item to the given value. 148 /// \pre \c i must be stored in the heap with priority at most \c p. 163 149 /// \param i The item. 164 150 /// \param p The priority. 165 /// \pre \c i must be stored in the heap with priority at most \c p.166 151 void increase(const Item &i, const Prio &p) {} 167 152 -
lemon/concepts/path.h
r606 r576 39 39 /// A skeleton structure for representing directed paths in a 40 40 /// digraph. 41 /// \tparam GRThe digraph type in which the path is.41 /// \tparam _Digraph The digraph type in which the path is. 42 42 /// 43 43 /// In a sense, the path can be treated as a list of arcs. The … … 46 46 /// paths cannot store the source. 47 47 /// 48 template <typename GR>48 template <typename _Digraph> 49 49 class Path { 50 50 public: 51 51 52 52 /// Type of the underlying digraph. 53 typedef GRDigraph;53 typedef _Digraph Digraph; 54 54 /// Arc type of the underlying digraph. 55 55 typedef typename Digraph::Arc Arc; … … 206 206 /// assigned to a real path and the dumpers can be implemented as 207 207 /// an adaptor class to the predecessor map. 208 /// 209 /// \tparam GRThe digraph type in which the path is.208 209 /// \tparam _Digraph The digraph type in which the path is. 210 210 /// 211 211 /// The paths can be constructed from any path type by a 212 212 /// template constructor or a template assignment operator. 213 template <typename GR> 213 /// 214 template <typename _Digraph> 214 215 class PathDumper { 215 216 public: 216 217 217 218 /// Type of the underlying digraph. 218 typedef GRDigraph;219 typedef _Digraph Digraph; 219 220 /// Arc type of the underlying digraph. 220 221 typedef typename Digraph::Arc Arc; -
lemon/connectivity.h
r606 r463 47 47 /// Check whether the given undirected graph is connected. 48 48 /// \param graph The undirected graph. 49 /// \return \c true when there is path between any two nodes in the graph.49 /// \return %True when there is path between any two nodes in the graph. 50 50 /// \note By definition, the empty graph is connected. 51 51 template <typename Graph> … … 235 235 /// graph is strongly connected when any two nodes of the graph are 236 236 /// connected with directed paths in both direction. 237 /// \return \c false when the graph is not strongly connected.237 /// \return %False when the graph is not strongly connected. 238 238 /// \see connected 239 239 /// … … 710 710 /// 711 711 /// \param graph The graph. 712 /// \return \c true when the graph bi-node-connected.712 /// \return %True when the graph bi-node-connected. 713 713 template <typename Graph> 714 714 bool biNodeConnected(const Graph& graph) { … … 1231 1231 /// of the map will be set exactly once, the values will be set descending 1232 1232 /// order. 1233 /// \return \c false when the graph is not DAG.1233 /// \return %False when the graph is not DAG. 1234 1234 /// 1235 1235 /// \see topologicalSort … … 1280 1280 /// Check that the given directed graph is a DAG. The DAG is 1281 1281 /// an Directed Acyclic Digraph. 1282 /// \return \c false when the graph is not DAG.1282 /// \return %False when the graph is not DAG. 1283 1283 /// \see acyclic 1284 1284 template <typename Digraph> … … 1322 1322 /// Check that the given undirected graph acyclic. 1323 1323 /// \param graph The undirected graph. 1324 /// \return \c true when there is no circle in the graph.1324 /// \return %True when there is no circle in the graph. 1325 1325 /// \see dag 1326 1326 template <typename Graph> … … 1356 1356 /// Check that the given undirected graph is tree. 1357 1357 /// \param graph The undirected graph. 1358 /// \return \c true when the graph is acyclic and connected.1358 /// \return %True when the graph is acyclic and connected. 1359 1359 template <typename Graph> 1360 1360 bool tree(const Graph& graph) { … … 1449 1449 /// or not. The \ref Bfs algorithm is used to calculate the result. 1450 1450 /// \param graph The undirected graph. 1451 /// \return \c true if \c graph is bipartite, \cfalse otherwise.1451 /// \return %True if \c graph is bipartite, %false otherwise. 1452 1452 /// \sa bipartitePartitions 1453 1453 template<typename Graph> … … 1490 1490 /// \retval partMap A writable bool map of nodes. It will be set as the 1491 1491 /// two partitions of the graph. 1492 /// \return \c true if \c graph is bipartite, \cfalse otherwise.1492 /// \return %True if \c graph is bipartite, %false otherwise. 1493 1493 template<typename Graph, typename NodeMap> 1494 1494 inline bool bipartitePartitions(const Graph &graph, NodeMap &partMap){ -
lemon/core.h
r606 r582 1035 1035 ///\sa findArc() 1036 1036 ///\sa ArcLookUp, AllArcLookUp, DynArcLookUp 1037 template <typename GR>1038 class ConArcIt : public GR::Arc {1037 template <typename _Graph> 1038 class ConArcIt : public _Graph::Arc { 1039 1039 public: 1040 1040 1041 typedef GRGraph;1041 typedef _Graph Graph; 1042 1042 typedef typename Graph::Arc Parent; 1043 1043 … … 1158 1158 /// 1159 1159 ///\sa findEdge() 1160 template <typename GR>1161 class ConEdgeIt : public GR::Edge {1160 template <typename _Graph> 1161 class ConEdgeIt : public _Graph::Edge { 1162 1162 public: 1163 1163 1164 typedef GRGraph;1164 typedef _Graph Graph; 1165 1165 typedef typename Graph::Edge Parent; 1166 1166 … … 1212 1212 ///queries. 1213 1213 /// 1214 ///\tparam G RThe type of the underlying digraph.1214 ///\tparam G The type of the underlying digraph. 1215 1215 /// 1216 1216 ///\sa ArcLookUp 1217 1217 ///\sa AllArcLookUp 1218 template <typename GR>1218 template<class G> 1219 1219 class DynArcLookUp 1220 : protected ItemSetTraits<G R, typename GR::Arc>::ItemNotifier::ObserverBase1220 : protected ItemSetTraits<G, typename G::Arc>::ItemNotifier::ObserverBase 1221 1221 { 1222 1222 public: 1223 typedef typename ItemSetTraits<G R, typename GR::Arc>1223 typedef typename ItemSetTraits<G, typename G::Arc> 1224 1224 ::ItemNotifier::ObserverBase Parent; 1225 1225 1226 TEMPLATE_DIGRAPH_TYPEDEFS(G R);1227 typedef G RDigraph;1226 TEMPLATE_DIGRAPH_TYPEDEFS(G); 1227 typedef G Digraph; 1228 1228 1229 1229 protected: 1230 1230 1231 class AutoNodeMap : public ItemSetTraits<G R, Node>::template Map<Arc>::Type {1231 class AutoNodeMap : public ItemSetTraits<G, Node>::template Map<Arc>::Type { 1232 1232 public: 1233 1233 1234 typedef typename ItemSetTraits<G R, Node>::template Map<Arc>::Type Parent;1235 1236 AutoNodeMap(const G R& digraph) : Parent(digraph, INVALID) {}1234 typedef typename ItemSetTraits<G, Node>::template Map<Arc>::Type Parent; 1235 1236 AutoNodeMap(const G& digraph) : Parent(digraph, INVALID) {} 1237 1237 1238 1238 virtual void add(const Node& node) { … … 1624 1624 ///(<em>O</em>(<em>m</em> log<em>m</em>)) to the number of arcs). 1625 1625 /// 1626 ///\tparam G RThe type of the underlying digraph.1626 ///\tparam G The type of the underlying digraph. 1627 1627 /// 1628 1628 ///\sa DynArcLookUp 1629 1629 ///\sa AllArcLookUp 1630 template<class G R>1630 template<class G> 1631 1631 class ArcLookUp 1632 1632 { 1633 1633 public: 1634 TEMPLATE_DIGRAPH_TYPEDEFS(G R);1635 typedef G RDigraph;1634 TEMPLATE_DIGRAPH_TYPEDEFS(G); 1635 typedef G Digraph; 1636 1636 1637 1637 protected: … … 1734 1734 ///(<em>O</em>(<em>m</em> log<em>m</em>)) to the number of arcs). 1735 1735 /// 1736 ///\tparam G RThe type of the underlying digraph.1736 ///\tparam G The type of the underlying digraph. 1737 1737 /// 1738 1738 ///\sa DynArcLookUp 1739 1739 ///\sa ArcLookUp 1740 template<class G R>1741 class AllArcLookUp : public ArcLookUp<G R>1740 template<class G> 1741 class AllArcLookUp : public ArcLookUp<G> 1742 1742 { 1743 using ArcLookUp<G R>::_g;1744 using ArcLookUp<G R>::_right;1745 using ArcLookUp<G R>::_left;1746 using ArcLookUp<G R>::_head;1747 1748 TEMPLATE_DIGRAPH_TYPEDEFS(G R);1749 typedef G RDigraph;1743 using ArcLookUp<G>::_g; 1744 using ArcLookUp<G>::_right; 1745 using ArcLookUp<G>::_left; 1746 using ArcLookUp<G>::_head; 1747 1748 TEMPLATE_DIGRAPH_TYPEDEFS(G); 1749 typedef G Digraph; 1750 1750 1751 1751 typename Digraph::template ArcMap<Arc> _next; … … 1774 1774 ///It builds up the search database, which remains valid until the digraph 1775 1775 ///changes. 1776 AllArcLookUp(const Digraph &g) : ArcLookUp<G R>(g), _next(g) {refreshNext();}1776 AllArcLookUp(const Digraph &g) : ArcLookUp<G>(g), _next(g) {refreshNext();} 1777 1777 1778 1778 ///Refresh the data structure at a node. … … 1784 1784 void refresh(Node n) 1785 1785 { 1786 ArcLookUp<G R>::refresh(n);1786 ArcLookUp<G>::refresh(n); 1787 1787 refreshNext(_head[n]); 1788 1788 } … … 1831 1831 Arc operator()(Node s, Node t, Arc prev=INVALID) const {} 1832 1832 #else 1833 using ArcLookUp<G R>::operator() ;1833 using ArcLookUp<G>::operator() ; 1834 1834 Arc operator()(Node s, Node t, Arc prev) const 1835 1835 { -
lemon/dijkstra.h
r606 r525 39 39 /// This operation traits class defines all computational operations and 40 40 /// constants which are used in the Dijkstra algorithm. 41 template <typename V >41 template <typename Value> 42 42 struct DijkstraDefaultOperationTraits { 43 /// \e44 typedef V Value;45 43 /// \brief Gives back the zero value of the type. 46 44 static Value zero() { … … 61 59 ///Default traits class of Dijkstra class. 62 60 ///\tparam GR The type of the digraph. 63 ///\tparam L ENThe type of the length map.64 template< typename GR, typename LEN>61 ///\tparam LM The type of the length map. 62 template<class GR, class LM> 65 63 struct DijkstraDefaultTraits 66 64 { … … 72 70 ///The type of the map that stores the arc lengths. 73 71 ///It must meet the \ref concepts::ReadMap "ReadMap" concept. 74 typedef L ENLengthMap;72 typedef LM LengthMap; 75 73 ///The type of the length of the arcs. 76 typedef typename L EN::Value Value;74 typedef typename LM::Value Value; 77 75 78 76 /// Operation traits for %Dijkstra algorithm. … … 103 101 ///\sa BinHeap 104 102 ///\sa Dijkstra 105 typedef BinHeap<typename L EN::Value, HeapCrossRef, std::less<Value> > Heap;103 typedef BinHeap<typename LM::Value, HeapCrossRef, std::less<Value> > Heap; 106 104 ///Instantiates a \c Heap. 107 105 … … 153 151 ///The type of the map that stores the distances of the nodes. 154 152 ///It must meet the \ref concepts::WriteMap "WriteMap" concept. 155 typedef typename Digraph::template NodeMap<typename L EN::Value> DistMap;153 typedef typename Digraph::template NodeMap<typename LM::Value> DistMap; 156 154 ///Instantiates a \c DistMap. 157 155 … … 183 181 ///\tparam GR The type of the digraph the algorithm runs on. 184 182 ///The default type is \ref ListDigraph. 185 ///\tparam L ENA \ref concepts::ReadMap "readable" arc map that specifies183 ///\tparam LM A \ref concepts::ReadMap "readable" arc map that specifies 186 184 ///the lengths of the arcs. 187 185 ///It is read once for each arc, so the map may involve in … … 190 188 ///concepts::Digraph::ArcMap "GR::ArcMap<int>". 191 189 #ifdef DOXYGEN 192 template <typename GR, typename L EN, typename TR>190 template <typename GR, typename LM, typename TR> 193 191 #else 194 192 template <typename GR=ListDigraph, 195 typename L EN=typename GR::template ArcMap<int>,196 typename TR=DijkstraDefaultTraits<GR,L EN> >193 typename LM=typename GR::template ArcMap<int>, 194 typename TR=DijkstraDefaultTraits<GR,LM> > 197 195 #endif 198 196 class Dijkstra { … … 916 914 ///Default traits class of dijkstra() function. 917 915 ///\tparam GR The type of the digraph. 918 ///\tparam L ENThe type of the length map.919 template<class GR, class L EN>916 ///\tparam LM The type of the length map. 917 template<class GR, class LM> 920 918 struct DijkstraWizardDefaultTraits 921 919 { … … 926 924 ///The type of the map that stores the arc lengths. 927 925 ///It must meet the \ref concepts::ReadMap "ReadMap" concept. 928 typedef L ENLengthMap;926 typedef LM LengthMap; 929 927 ///The type of the length of the arcs. 930 typedef typename L EN::Value Value;928 typedef typename LM::Value Value; 931 929 932 930 /// Operation traits for Dijkstra algorithm. … … 1010 1008 ///The type of the map that stores the distances of the nodes. 1011 1009 ///It must meet the \ref concepts::WriteMap "WriteMap" concept. 1012 typedef typename Digraph::template NodeMap<typename L EN::Value> DistMap;1010 typedef typename Digraph::template NodeMap<typename LM::Value> DistMap; 1013 1011 ///Instantiates a DistMap. 1014 1012 … … 1036 1034 /// The \ref DijkstraWizardBase is a class to be the default traits of the 1037 1035 /// \ref DijkstraWizard class. 1038 template< typename GR, typename LEN>1039 class DijkstraWizardBase : public DijkstraWizardDefaultTraits<GR,L EN>1036 template<class GR,class LM> 1037 class DijkstraWizardBase : public DijkstraWizardDefaultTraits<GR,LM> 1040 1038 { 1041 typedef DijkstraWizardDefaultTraits<GR,L EN> Base;1039 typedef DijkstraWizardDefaultTraits<GR,LM> Base; 1042 1040 protected: 1043 1041 //The type of the nodes in the digraph. … … 1073 1071 /// \param g The digraph the algorithm runs on. 1074 1072 /// \param l The length map. 1075 DijkstraWizardBase(const GR &g,const L EN&l) :1073 DijkstraWizardBase(const GR &g,const LM &l) : 1076 1074 _g(reinterpret_cast<void*>(const_cast<GR*>(&g))), 1077 _length(reinterpret_cast<void*>(const_cast<L EN*>(&l))),1075 _length(reinterpret_cast<void*>(const_cast<LM*>(&l))), 1078 1076 _processed(0), _pred(0), _dist(0), _path(0), _di(0) {} 1079 1077 … … 1284 1282 ///\sa DijkstraWizard 1285 1283 ///\sa Dijkstra 1286 template< typename GR, typename LEN>1287 DijkstraWizard<DijkstraWizardBase<GR,L EN> >1288 dijkstra(const GR &digraph, const L EN&length)1284 template<class GR, class LM> 1285 DijkstraWizard<DijkstraWizardBase<GR,LM> > 1286 dijkstra(const GR &digraph, const LM &length) 1289 1287 { 1290 return DijkstraWizard<DijkstraWizardBase<GR,L EN> >(digraph,length);1288 return DijkstraWizard<DijkstraWizardBase<GR,LM> >(digraph,length); 1291 1289 } 1292 1290 -
lemon/edge_set.h
r606 r559 256 256 /// concept. 257 257 /// 258 /// This class fully conformsto the \ref concepts::Digraph258 /// This class is fully conform to the \ref concepts::Digraph 259 259 /// "Digraph" concept. 260 260 template <typename GR> … … 337 337 /// Add a new arc to the digraph with source node \c s 338 338 /// and target node \c t. 339 /// \return The new arc.339 /// \return the new arc. 340 340 Arc addArc(const Node& s, const Node& t) { 341 341 return Parent::addArc(s, t); … … 685 685 /// concept. 686 686 /// 687 /// This class fully conformsto the \ref concepts::Graph "Graph"687 /// This class is fully conform to the \ref concepts::Graph "Graph" 688 688 /// concept. 689 689 template <typename GR> … … 762 762 /// Add a new edge to the graph with node \c u 763 763 /// and node \c v endpoints. 764 /// \return The new edge.764 /// \return the new edge. 765 765 Edge addEdge(const Node& u, const Node& v) { 766 766 return Parent::addEdge(u, v); … … 953 953 /// validity can be checked with the \c valid() member function. 954 954 /// 955 /// This class fully conformsto the \ref concepts::Digraph955 /// This class is fully conform to the \ref concepts::Digraph 956 956 /// "Digraph" concept. 957 957 template <typename GR> … … 1042 1042 /// Add a new arc to the digraph with source node \c s 1043 1043 /// and target node \c t. 1044 /// \return The new arc.1044 /// \return the new arc. 1045 1045 Arc addArc(const Node& s, const Node& t) { 1046 1046 return Parent::addArc(s, t); … … 1301 1301 /// be checked with the \c valid() member function. 1302 1302 /// 1303 /// This class fully conformsto the \ref concepts::Graph1303 /// This class is fully conform to the \ref concepts::Graph 1304 1304 /// "Graph" concept. 1305 1305 template <typename GR> … … 1390 1390 /// Add a new edge to the graph with node \c u 1391 1391 /// and node \c v endpoints. 1392 /// \return The new edge.1392 /// \return the new edge. 1393 1393 Edge addEdge(const Node& u, const Node& v) { 1394 1394 return Parent::addEdge(u, v); -
lemon/elevator.h
r606 r566 47 47 ///\sa LinkedElevator 48 48 /// 49 ///\param G RType of the underlying graph.50 ///\param Item Type of the items the data is assigned to ( \c GR::Node,51 /// \c GR::Arc or \c GR::Edge).52 template<class G R, class Item>49 ///\param Graph Type of the underlying graph. 50 ///\param Item Type of the items the data is assigned to (Graph::Node, 51 ///Graph::Arc, Graph::Edge). 52 template<class Graph, class Item> 53 53 class Elevator 54 54 { … … 61 61 62 62 typedef Item *Vit; 63 typedef typename ItemSetTraits<G R,Item>::template Map<Vit>::Type VitMap;64 typedef typename ItemSetTraits<G R,Item>::template Map<int>::Type IntMap;65 66 const G R&_g;63 typedef typename ItemSetTraits<Graph,Item>::template Map<Vit>::Type VitMap; 64 typedef typename ItemSetTraits<Graph,Item>::template Map<int>::Type IntMap; 65 66 const Graph &_g; 67 67 int _max_level; 68 68 int _item_num; … … 106 106 ///\param max_level The maximum allowed level. 107 107 ///Set the range of the possible labels to <tt>[0..max_level]</tt>. 108 Elevator(const G R&graph,int max_level) :108 Elevator(const Graph &graph,int max_level) : 109 109 _g(graph), 110 110 _max_level(max_level), … … 123 123 ///Set the range of the possible labels to <tt>[0..max_level]</tt>, 124 124 ///where \c max_level is equal to the number of labeled items in the graph. 125 Elevator(const G R&graph) :125 Elevator(const Graph &graph) : 126 126 _g(graph), 127 _max_level(countItems<G R, Item>(graph)),127 _max_level(countItems<Graph, Item>(graph)), 128 128 _item_num(_max_level), 129 129 _where(graph), … … 431 431 _last_active[0]=&_items[0]-1; 432 432 Vit n=&_items[0]; 433 for(typename ItemSetTraits<G R,Item>::ItemIt i(_g);i!=INVALID;++i)433 for(typename ItemSetTraits<Graph,Item>::ItemIt i(_g);i!=INVALID;++i) 434 434 { 435 435 *n=i; … … 490 490 ///\sa Elevator 491 491 /// 492 ///\param G RType of the underlying graph.493 ///\param Item Type of the items the data is assigned to ( \c GR::Node,494 /// \c GR::Arc or \c GR::Edge).495 template <class G R, class Item>492 ///\param Graph Type of the underlying graph. 493 ///\param Item Type of the items the data is assigned to (Graph::Node, 494 ///Graph::Arc, Graph::Edge). 495 template <class Graph, class Item> 496 496 class LinkedElevator { 497 497 public: … … 502 502 private: 503 503 504 typedef typename ItemSetTraits<G R,Item>::504 typedef typename ItemSetTraits<Graph,Item>:: 505 505 template Map<Item>::Type ItemMap; 506 typedef typename ItemSetTraits<G R,Item>::506 typedef typename ItemSetTraits<Graph,Item>:: 507 507 template Map<int>::Type IntMap; 508 typedef typename ItemSetTraits<G R,Item>::508 typedef typename ItemSetTraits<Graph,Item>:: 509 509 template Map<bool>::Type BoolMap; 510 510 511 const G R&_graph;511 const Graph &_graph; 512 512 int _max_level; 513 513 int _item_num; … … 526 526 ///\param max_level The maximum allowed level. 527 527 ///Set the range of the possible labels to <tt>[0..max_level]</tt>. 528 LinkedElevator(const G R& graph, int max_level)528 LinkedElevator(const Graph& graph, int max_level) 529 529 : _graph(graph), _max_level(max_level), _item_num(_max_level), 530 530 _first(_max_level + 1), _last(_max_level + 1), … … 539 539 ///Set the range of the possible labels to <tt>[0..max_level]</tt>, 540 540 ///where \c max_level is equal to the number of labeled items in the graph. 541 LinkedElevator(const G R& graph)542 : _graph(graph), _max_level(countItems<G R, Item>(graph)),541 LinkedElevator(const Graph& graph) 542 : _graph(graph), _max_level(countItems<Graph, Item>(graph)), 543 543 _item_num(_max_level), 544 544 _first(_max_level + 1), _last(_max_level + 1), … … 936 936 } 937 937 _init_level = 0; 938 for(typename ItemSetTraits<G R,Item>::ItemIt i(_graph);938 for(typename ItemSetTraits<Graph,Item>::ItemIt i(_graph); 939 939 i != INVALID; ++i) { 940 940 _level.set(i, _max_level); -
lemon/euler.h
r606 r569 55 55 ///If \c g is not Euler then the resulted tour will not be full or closed. 56 56 ///\sa EulerIt 57 template< typename GR>57 template<class Digraph> 58 58 class DiEulerIt 59 59 { 60 typedef typename GR::Node Node;61 typedef typename GR::NodeIt NodeIt;62 typedef typename GR::Arc Arc;63 typedef typename GR::ArcIt ArcIt;64 typedef typename GR::OutArcIt OutArcIt;65 typedef typename GR::InArcIt InArcIt;66 67 const GR&g;68 typename GR::template NodeMap<OutArcIt> nedge;60 typedef typename Digraph::Node Node; 61 typedef typename Digraph::NodeIt NodeIt; 62 typedef typename Digraph::Arc Arc; 63 typedef typename Digraph::ArcIt ArcIt; 64 typedef typename Digraph::OutArcIt OutArcIt; 65 typedef typename Digraph::InArcIt InArcIt; 66 67 const Digraph &g; 68 typename Digraph::template NodeMap<OutArcIt> nedge; 69 69 std::list<Arc> euler; 70 70 … … 73 73 ///Constructor 74 74 75 ///\param grA digraph.75 ///\param _g A digraph. 76 76 ///\param start The starting point of the tour. If it is not given 77 77 /// the tour will start from the first node. 78 DiEulerIt(const GR &gr, typename GR::Node start =INVALID)79 : g( gr), nedge(g)78 DiEulerIt(const Digraph &_g,typename Digraph::Node start=INVALID) 79 : g(_g), nedge(g) 80 80 { 81 81 if(start==INVALID) start=NodeIt(g); … … 146 146 ///If \c g is not Euler then the resulted tour will not be full or closed. 147 147 ///\sa EulerIt 148 template< typename GR>148 template<class Digraph> 149 149 class EulerIt 150 150 { 151 typedef typename GR::Node Node;152 typedef typename GR::NodeIt NodeIt;153 typedef typename GR::Arc Arc;154 typedef typename GR::Edge Edge;155 typedef typename GR::ArcIt ArcIt;156 typedef typename GR::OutArcIt OutArcIt;157 typedef typename GR::InArcIt InArcIt;158 159 const GR&g;160 typename GR::template NodeMap<OutArcIt> nedge;161 typename GR::template EdgeMap<bool> visited;151 typedef typename Digraph::Node Node; 152 typedef typename Digraph::NodeIt NodeIt; 153 typedef typename Digraph::Arc Arc; 154 typedef typename Digraph::Edge Edge; 155 typedef typename Digraph::ArcIt ArcIt; 156 typedef typename Digraph::OutArcIt OutArcIt; 157 typedef typename Digraph::InArcIt InArcIt; 158 159 const Digraph &g; 160 typename Digraph::template NodeMap<OutArcIt> nedge; 161 typename Digraph::template EdgeMap<bool> visited; 162 162 std::list<Arc> euler; 163 163 … … 166 166 ///Constructor 167 167 168 ///\param grAn graph.168 ///\param _g An graph. 169 169 ///\param start The starting point of the tour. If it is not given 170 170 /// the tour will start from the first node. 171 EulerIt(const GR &gr, typename GR::Node start =INVALID)172 : g( gr), nedge(g), visited(g,false)171 EulerIt(const Digraph &_g,typename Digraph::Node start=INVALID) 172 : g(_g), nedge(g), visited(g,false) 173 173 { 174 174 if(start==INVALID) start=NodeIt(g); … … 239 239 ///for each node. <em>Therefore, there are digraphs which are not Eulerian, 240 240 ///but still have an Euler tour</em>. 241 template< typename GR>241 template<class Digraph> 242 242 #ifdef DOXYGEN 243 243 bool 244 244 #else 245 typename enable_if<UndirectedTagIndicator< GR>,bool>::type246 eulerian(const GR&g)247 { 248 for(typename GR::NodeIt n(g);n!=INVALID;++n)245 typename enable_if<UndirectedTagIndicator<Digraph>,bool>::type 246 eulerian(const Digraph &g) 247 { 248 for(typename Digraph::NodeIt n(g);n!=INVALID;++n) 249 249 if(countIncEdges(g,n)%2) return false; 250 250 return connected(g); 251 251 } 252 template<class GR>253 typename disable_if<UndirectedTagIndicator< GR>,bool>::type252 template<class Digraph> 253 typename disable_if<UndirectedTagIndicator<Digraph>,bool>::type 254 254 #endif 255 eulerian(const GR&g)256 { 257 for(typename GR::NodeIt n(g);n!=INVALID;++n)255 eulerian(const Digraph &g) 256 { 257 for(typename Digraph::NodeIt n(g);n!=INVALID;++n) 258 258 if(countInArcs(g,n)!=countOutArcs(g,n)) return false; 259 return connected(Undirector<const GR>(g));259 return connected(Undirector<const Digraph>(g)); 260 260 } 261 261 -
lemon/graph_to_eps.h
r606 r562 65 65 ///Default traits class of \ref GraphToEps. 66 66 /// 67 ///\ param GRis the type of the underlying graph.68 template<class G R>67 ///\c G is the type of the underlying graph. 68 template<class G> 69 69 struct DefaultGraphToEpsTraits 70 70 { 71 typedef G RGraph;71 typedef G Graph; 72 72 typedef typename Graph::Node Node; 73 73 typedef typename Graph::NodeIt NodeIt; … … 140 140 141 141 ///Constructor 142 ///\param gr Reference to the graph to be printed. 143 ///\param ost Reference to the output stream. 142 ///\param _g Reference to the graph to be printed. 143 ///\param _os Reference to the output stream. 144 ///\param _os Reference to the output stream. 144 145 ///By default it is <tt>std::cout</tt>. 145 ///\param pros If it is \c true, then the \c ostream referenced by \cos146 ///\param _pros If it is \c true, then the \c ostream referenced by \c _os 146 147 ///will be explicitly deallocated by the destructor. 147 DefaultGraphToEpsTraits(const G R &gr, std::ostream& ost =std::cout,148 bool pros =false) :149 g( gr), os(ost),148 DefaultGraphToEpsTraits(const G &_g,std::ostream& _os=std::cout, 149 bool _pros=false) : 150 g(_g), os(_os), 150 151 _coords(dim2::Point<double>(1,1)), _nodeSizes(1), _nodeShapes(0), 151 152 _nodeColors(WHITE), _arcColors(BLACK), … … 158 159 _showNodeText(false), _nodeTexts(false), _nodeTextSize(1), 159 160 _showNodePsText(false), _nodePsTexts(false), _nodePsTextsPreamble(0), 160 _undirected(lemon::UndirectedTagIndicator<G R>::value),161 _pleaseRemoveOsStream( pros), _scaleToA4(false),161 _undirected(lemon::UndirectedTagIndicator<G>::value), 162 _pleaseRemoveOsStream(_pros), _scaleToA4(false), 162 163 _nodeTextColorType(SAME_COL), _nodeTextColors(BLACK), 163 164 _autoNodeScale(false), … … 1134 1135 ///to the end of the parameter list. 1135 1136 ///\sa GraphToEps 1136 ///\sa graphToEps(G R&g, const char *file_name)1137 template<class G R>1138 GraphToEps<DefaultGraphToEpsTraits<G R> >1139 graphToEps(G R&g, std::ostream& os=std::cout)1137 ///\sa graphToEps(G &g, const char *file_name) 1138 template<class G> 1139 GraphToEps<DefaultGraphToEpsTraits<G> > 1140 graphToEps(G &g, std::ostream& os=std::cout) 1140 1141 { 1141 1142 return 1142 GraphToEps<DefaultGraphToEpsTraits<G R> >(DefaultGraphToEpsTraits<GR>(g,os));1143 GraphToEps<DefaultGraphToEpsTraits<G> >(DefaultGraphToEpsTraits<G>(g,os)); 1143 1144 } 1144 1145 … … 1147 1148 ///\ingroup eps_io 1148 1149 ///This function does the same as 1149 ///\ref graphToEps(G R&g,std::ostream& os)1150 ///\ref graphToEps(G &g,std::ostream& os) 1150 1151 ///but it writes its output into the file \c file_name 1151 1152 ///instead of a stream. 1152 ///\sa graphToEps(G R&g, std::ostream& os)1153 template<class G R>1154 GraphToEps<DefaultGraphToEpsTraits<G R> >1155 graphToEps(G R&g,const char *file_name)1153 ///\sa graphToEps(G &g, std::ostream& os) 1154 template<class G> 1155 GraphToEps<DefaultGraphToEpsTraits<G> > 1156 graphToEps(G &g,const char *file_name) 1156 1157 { 1157 1158 std::ostream* os = new std::ofstream(file_name); … … 1160 1161 throw IoError("Cannot write file", file_name); 1161 1162 } 1162 return GraphToEps<DefaultGraphToEpsTraits<G R> >1163 (DefaultGraphToEpsTraits<G R>(g,*os,true));1163 return GraphToEps<DefaultGraphToEpsTraits<G> > 1164 (DefaultGraphToEpsTraits<G>(g,*os,true)); 1164 1165 } 1165 1166 … … 1168 1169 ///\ingroup eps_io 1169 1170 ///This function does the same as 1170 ///\ref graphToEps(G R&g,std::ostream& os)1171 ///\ref graphToEps(G &g,std::ostream& os) 1171 1172 ///but it writes its output into the file \c file_name 1172 1173 ///instead of a stream. 1173 ///\sa graphToEps(G R&g, std::ostream& os)1174 template<class G R>1175 GraphToEps<DefaultGraphToEpsTraits<G R> >1176 graphToEps(G R&g,const std::string& file_name)1174 ///\sa graphToEps(G &g, std::ostream& os) 1175 template<class G> 1176 GraphToEps<DefaultGraphToEpsTraits<G> > 1177 graphToEps(G &g,const std::string& file_name) 1177 1178 { 1178 1179 std::ostream* os = new std::ofstream(file_name.c_str()); … … 1181 1182 throw IoError("Cannot write file", file_name); 1182 1183 } 1183 return GraphToEps<DefaultGraphToEpsTraits<G R> >1184 (DefaultGraphToEpsTraits<G R>(g,*os,true));1184 return GraphToEps<DefaultGraphToEpsTraits<G> > 1185 (DefaultGraphToEpsTraits<G>(g,*os,true)); 1185 1186 } 1186 1187 -
lemon/grid_graph.h
r606 r463 497 497 ///\endcode 498 498 /// 499 /// This graph type fully conformsto the \ref concepts::Graph499 /// This graph type is fully conform to the \ref concepts::Graph 500 500 /// "Graph" concept, and it also has an important extra feature 501 501 /// that its maps are real \ref concepts::ReferenceMap -
lemon/hao_orlin.h
r606 r463 58 58 /// algorithm or you can use the algorithm of Nagamochi and Ibaraki 59 59 /// which solves the undirected problem in 60 /// \f$ O(nm + n^2 \log n) \f$ time: it is implemented in the60 /// \f$ O(nm + n^2 \log(n)) \f$ time: it is implemented in the 61 61 /// NagamochiIbaraki algorithm class. 62 62 /// 63 /// \param GR The digraph class the algorithm runs on.64 /// \param CAP An arc map of capacities which can be any numreric type.65 /// The default type is \ref concepts::Digraph::ArcMap "GR::ArcMap<int>".66 /// \param TOL Tolerance class for handling inexact computations. The67 /// default t olerance type is \ref Tolerance "Tolerance<CAP::Value>".63 /// \param _Digraph is the graph type of the algorithm. 64 /// \param _CapacityMap is an edge map of capacities which should 65 /// be any numreric type. The default type is _Digraph::ArcMap<int>. 66 /// \param _Tolerance is the handler of the inexact computation. The 67 /// default type for this is Tolerance<CapacityMap::Value>. 68 68 #ifdef DOXYGEN 69 template <typename GR, typename CAP, typename TOL>69 template <typename _Digraph, typename _CapacityMap, typename _Tolerance> 70 70 #else 71 template <typename GR,72 typename CAP = typename GR::template ArcMap<int>,73 typename TOL = Tolerance<typename CAP::Value> >71 template <typename _Digraph, 72 typename _CapacityMap = typename _Digraph::template ArcMap<int>, 73 typename _Tolerance = Tolerance<typename _CapacityMap::Value> > 74 74 #endif 75 75 class HaoOrlin { 76 76 private: 77 77 78 typedef GRDigraph;79 typedef CAPCapacityMap;80 typedef TOLTolerance;78 typedef _Digraph Digraph; 79 typedef _CapacityMap CapacityMap; 80 typedef _Tolerance Tolerance; 81 81 82 82 typedef typename CapacityMap::Value Value; … … 818 818 /// \name Execution control 819 819 /// The simplest way to execute the algorithm is to use 820 /// one of the member functions called \ ref run().820 /// one of the member functions called \c run(...). 821 821 /// \n 822 822 /// If you need more control on the execution, -
lemon/hypercube_graph.h
r606 r463 292 292 /// (assuming that the size of \c int is 32 bit). 293 293 /// 294 /// This graph type fully conformsto the \ref concepts::Graph294 /// This graph type is fully conform to the \ref concepts::Graph 295 295 /// "Graph" concept, and it also has an important extra feature 296 296 /// that its maps are real \ref concepts::ReferenceMap -
lemon/lgf_reader.h
r606 r564 449 449 /// a single pass, because the arcs are not constructed when the node 450 450 /// maps are read. 451 template <typename GR>451 template <typename _Digraph> 452 452 class DigraphReader { 453 453 public: 454 454 455 typedef GR Digraph; 455 typedef _Digraph Digraph; 456 TEMPLATE_DIGRAPH_TYPEDEFS(Digraph); 456 457 457 458 private: 458 459 459 TEMPLATE_DIGRAPH_TYPEDEFS(Digraph);460 460 461 461 std::istream* _is; … … 1247 1247 /// arc map. Similarly, an attribute can be read into an arc, if 1248 1248 /// it's value is an edge label prefixed with \c '+' or \c '-'. 1249 template <typename GR>1249 template <typename _Graph> 1250 1250 class GraphReader { 1251 1251 public: 1252 1252 1253 typedef GR Graph; 1253 typedef _Graph Graph; 1254 TEMPLATE_GRAPH_TYPEDEFS(Graph); 1254 1255 1255 1256 private: 1256 1257 TEMPLATE_GRAPH_TYPEDEFS(Graph);1258 1257 1259 1258 std::istream* _is; … … 1358 1357 1359 1358 private: 1360 template <typename G raph>1361 friend GraphReader<G raph> graphReader(Graph& graph, std::istream& is);1362 template <typename G raph>1363 friend GraphReader<G raph> graphReader(Graph& graph, const std::string& fn);1364 template <typename G raph>1365 friend GraphReader<G raph> graphReader(Graph& graph, const char *fn);1359 template <typename GR> 1360 friend GraphReader<GR> graphReader(GR& graph, std::istream& is); 1361 template <typename GR> 1362 friend GraphReader<GR> graphReader(GR& graph, const std::string& fn); 1363 template <typename GR> 1364 friend GraphReader<GR> graphReader(GR& graph, const char *fn); 1366 1365 1367 1366 GraphReader(GraphReader& other) -
lemon/lgf_writer.h
r606 r564 407 407 /// the \c ostream() function, hence the second pass can append its 408 408 /// output to the output of the first pass. 409 template <typename GR>409 template <typename _Digraph> 410 410 class DigraphWriter { 411 411 public: 412 412 413 typedef GRDigraph;413 typedef _Digraph Digraph; 414 414 TEMPLATE_DIGRAPH_TYPEDEFS(Digraph); 415 415 … … 975 975 /// section as a \c '+' or a \c '-' prefix (depends on the direction 976 976 /// of the arc) and the label of corresponding edge. 977 template <typename GR>977 template <typename _Graph> 978 978 class GraphWriter { 979 979 public: 980 980 981 typedef GRGraph;981 typedef _Graph Graph; 982 982 TEMPLATE_GRAPH_TYPEDEFS(Graph); 983 983 … … 1074 1074 private: 1075 1075 1076 template <typename G raph>1077 friend GraphWriter<G raph> graphWriter(const Graph& graph,1078 1079 template <typename G raph>1080 friend GraphWriter<G raph> graphWriter(const Graph& graph,1081 1082 template <typename G raph>1083 friend GraphWriter<G raph> graphWriter(const Graph& graph,1084 1076 template <typename GR> 1077 friend GraphWriter<GR> graphWriter(const GR& graph, 1078 std::ostream& os); 1079 template <typename GR> 1080 friend GraphWriter<GR> graphWriter(const GR& graph, 1081 const std::string& fn); 1082 template <typename GR> 1083 friend GraphWriter<GR> graphWriter(const GR& graph, 1084 const char *fn); 1085 1085 1086 1086 GraphWriter(GraphWriter& other) -
lemon/list_graph.h
r606 r463 352 352 353 353 ///Add a new node to the digraph. 354 ///\return The new node.354 ///\return the new node. 355 355 Node addNode() { return Parent::addNode(); } 356 356 … … 359 359 ///Add a new arc to the digraph with source node \c s 360 360 ///and target node \c t. 361 ///\return The new arc.361 ///\return the new arc. 362 362 Arc addArc(const Node& s, const Node& t) { 363 363 return Parent::addArc(s, t); … … 1209 1209 /// 1210 1210 /// Add a new node to the graph. 1211 /// \return The new node.1211 /// \return the new node. 1212 1212 Node addNode() { return Parent::addNode(); } 1213 1213 … … 1216 1216 /// Add a new edge to the graph with source node \c s 1217 1217 /// and target node \c t. 1218 /// \return The new edge.1218 /// \return the new edge. 1219 1219 Edge addEdge(const Node& s, const Node& t) { 1220 1220 return Parent::addEdge(s, t); -
lemon/maps.h
r606 r463 64 64 class NullMap : public MapBase<K, V> { 65 65 public: 66 ///\e 67 typedef K Key; 68 ///\e 69 typedef V Value; 66 typedef MapBase<K, V> Parent; 67 typedef typename Parent::Key Key; 68 typedef typename Parent::Value Value; 70 69 71 70 /// Gives back a default constructed element. … … 104 103 V _value; 105 104 public: 106 ///\e 107 typedef K Key; 108 ///\e 109 typedef V Value; 105 typedef MapBase<K, V> Parent; 106 typedef typename Parent::Key Key; 107 typedef typename Parent::Value Value; 110 108 111 109 /// Default constructor … … 171 169 class ConstMap<K, Const<V, v> > : public MapBase<K, V> { 172 170 public: 173 ///\e 174 typedef K Key; 175 ///\e 176 typedef V Value; 171 typedef MapBase<K, V> Parent; 172 typedef typename Parent::Key Key; 173 typedef typename Parent::Value Value; 177 174 178 175 /// Constructor. … … 206 203 class IdentityMap : public MapBase<T, T> { 207 204 public: 208 ///\e 209 typedef T Key; 210 ///\e 211 typedef T Value; 205 typedef MapBase<T, T> Parent; 206 typedef typename Parent::Key Key; 207 typedef typename Parent::Value Value; 212 208 213 209 /// Gives back the given value without any modification. … … 250 246 public: 251 247 248 typedef MapBase<int, V> Parent; 252 249 /// Key type 253 typedef intKey;250 typedef typename Parent::Key Key; 254 251 /// Value type 255 typedef VValue;252 typedef typename Parent::Value Value; 256 253 /// Reference type 257 254 typedef typename Vector::reference Reference; … … 357 354 /// The simplest way of using this map is through the sparseMap() 358 355 /// function. 359 template <typename K, typename V, typename Comp = std::less<K> >356 template <typename K, typename V, typename Compare = std::less<K> > 360 357 class SparseMap : public MapBase<K, V> { 361 358 template <typename K1, typename V1, typename C1> … … 363 360 public: 364 361 362 typedef MapBase<K, V> Parent; 365 363 /// Key type 366 typedef KKey;364 typedef typename Parent::Key Key; 367 365 /// Value type 368 typedef VValue;366 typedef typename Parent::Value Value; 369 367 /// Reference type 370 368 typedef Value& Reference; … … 376 374 private: 377 375 378 typedef std::map<K, V, Comp > Map;376 typedef std::map<K, V, Compare> Map; 379 377 Map _map; 380 378 Value _value; … … 492 490 const M2 &_m2; 493 491 public: 494 ///\e 495 typedef typename M2::Key Key; 496 ///\e 497 typedef typename M1::Value Value; 492 typedef MapBase<typename M2::Key, typename M1::Value> Parent; 493 typedef typename Parent::Key Key; 494 typedef typename Parent::Value Value; 498 495 499 496 /// Constructor 500 497 ComposeMap(const M1 &m1, const M2 &m2) : _m1(m1), _m2(m2) {} 501 498 502 /// \e499 /// \e 503 500 typename MapTraits<M1>::ConstReturnValue 504 501 operator[](const Key &k) const { return _m1[_m2[k]]; } … … 549 546 F _f; 550 547 public: 551 ///\e 552 typedef typename M1::Key Key; 553 ///\e 554 typedef V Value; 548 typedef MapBase<typename M1::Key, V> Parent; 549 typedef typename Parent::Key Key; 550 typedef typename Parent::Value Value; 555 551 556 552 /// Constructor 557 553 CombineMap(const M1 &m1, const M2 &m2, const F &f = F()) 558 554 : _m1(m1), _m2(m2), _f(f) {} 559 /// \e555 /// \e 560 556 Value operator[](const Key &k) const { return _f(_m1[k],_m2[k]); } 561 557 }; … … 620 616 F _f; 621 617 public: 622 ///\e 623 typedef K Key; 624 ///\e 625 typedef V Value; 618 typedef MapBase<K, V> Parent; 619 typedef typename Parent::Key Key; 620 typedef typename Parent::Value Value; 626 621 627 622 /// Constructor 628 623 FunctorToMap(const F &f = F()) : _f(f) {} 629 /// \e624 /// \e 630 625 Value operator[](const Key &k) const { return _f(k); } 631 626 }; … … 675 670 const M &_m; 676 671 public: 677 ///\e 678 typedef typename M::Key Key; 679 ///\e 680 typedef typename M::Value Value; 681 682 typedef typename M::Key argument_type; 683 typedef typename M::Value result_type; 672 typedef MapBase<typename M::Key, typename M::Value> Parent; 673 typedef typename Parent::Key Key; 674 typedef typename Parent::Value Value; 675 676 typedef typename Parent::Key argument_type; 677 typedef typename Parent::Value result_type; 684 678 685 679 /// Constructor 686 680 MapToFunctor(const M &m) : _m(m) {} 687 /// \e681 /// \e 688 682 Value operator()(const Key &k) const { return _m[k]; } 689 /// \e683 /// \e 690 684 Value operator[](const Key &k) const { return _m[k]; } 691 685 }; … … 716 710 const M &_m; 717 711 public: 718 ///\e 719 typedef typename M::Key Key; 720 ///\e 721 typedef V Value; 712 typedef MapBase<typename M::Key, V> Parent; 713 typedef typename Parent::Key Key; 714 typedef typename Parent::Value Value; 722 715 723 716 /// Constructor … … 727 720 ConvertMap(const M &m) : _m(m) {} 728 721 729 /// \e722 /// \e 730 723 Value operator[](const Key &k) const { return _m[k]; } 731 724 }; … … 759 752 M2 &_m2; 760 753 public: 761 ///\e 762 typedef typename M1::Key Key; 763 ///\e 764 typedef typename M1::Value Value; 754 typedef MapBase<typename M1::Key, typename M1::Value> Parent; 755 typedef typename Parent::Key Key; 756 typedef typename Parent::Value Value; 765 757 766 758 /// Constructor … … 806 798 const M2 &_m2; 807 799 public: 808 ///\e 809 typedef typename M1::Key Key; 810 ///\e 811 typedef typename M1::Value Value; 800 typedef MapBase<typename M1::Key, typename M1::Value> Parent; 801 typedef typename Parent::Key Key; 802 typedef typename Parent::Value Value; 812 803 813 804 /// Constructor 814 805 AddMap(const M1 &m1, const M2 &m2) : _m1(m1), _m2(m2) {} 815 /// \e806 /// \e 816 807 Value operator[](const Key &k) const { return _m1[k]+_m2[k]; } 817 808 }; … … 855 846 const M2 &_m2; 856 847 public: 857 ///\e 858 typedef typename M1::Key Key; 859 ///\e 860 typedef typename M1::Value Value; 848 typedef MapBase<typename M1::Key, typename M1::Value> Parent; 849 typedef typename Parent::Key Key; 850 typedef typename Parent::Value Value; 861 851 862 852 /// Constructor 863 853 SubMap(const M1 &m1, const M2 &m2) : _m1(m1), _m2(m2) {} 864 /// \e854 /// \e 865 855 Value operator[](const Key &k) const { return _m1[k]-_m2[k]; } 866 856 }; … … 905 895 const M2 &_m2; 906 896 public: 907 ///\e 908 typedef typename M1::Key Key; 909 ///\e 910 typedef typename M1::Value Value; 897 typedef MapBase<typename M1::Key, typename M1::Value> Parent; 898 typedef typename Parent::Key Key; 899 typedef typename Parent::Value Value; 911 900 912 901 /// Constructor 913 902 MulMap(const M1 &m1,const M2 &m2) : _m1(m1), _m2(m2) {} 914 /// \e903 /// \e 915 904 Value operator[](const Key &k) const { return _m1[k]*_m2[k]; } 916 905 }; … … 954 943 const M2 &_m2; 955 944 public: 956 ///\e 957 typedef typename M1::Key Key; 958 ///\e 959 typedef typename M1::Value Value; 945 typedef MapBase<typename M1::Key, typename M1::Value> Parent; 946 typedef typename Parent::Key Key; 947 typedef typename Parent::Value Value; 960 948 961 949 /// Constructor 962 950 DivMap(const M1 &m1,const M2 &m2) : _m1(m1), _m2(m2) {} 963 /// \e951 /// \e 964 952 Value operator[](const Key &k) const { return _m1[k]/_m2[k]; } 965 953 }; … … 1005 993 C _v; 1006 994 public: 1007 ///\e 1008 typedef typename M::Key Key; 1009 ///\e 1010 typedef typename M::Value Value; 995 typedef MapBase<typename M::Key, typename M::Value> Parent; 996 typedef typename Parent::Key Key; 997 typedef typename Parent::Value Value; 1011 998 1012 999 /// Constructor … … 1016 1003 /// \param v The constant value. 1017 1004 ShiftMap(const M &m, const C &v) : _m(m), _v(v) {} 1018 /// \e1005 /// \e 1019 1006 Value operator[](const Key &k) const { return _m[k]+_v; } 1020 1007 }; … … 1036 1023 C _v; 1037 1024 public: 1038 ///\e 1039 typedef typename M::Key Key; 1040 ///\e 1041 typedef typename M::Value Value; 1025 typedef MapBase<typename M::Key, typename M::Value> Parent; 1026 typedef typename Parent::Key Key; 1027 typedef typename Parent::Value Value; 1042 1028 1043 1029 /// Constructor … … 1047 1033 /// \param v The constant value. 1048 1034 ShiftWriteMap(M &m, const C &v) : _m(m), _v(v) {} 1049 /// \e1035 /// \e 1050 1036 Value operator[](const Key &k) const { return _m[k]+_v; } 1051 /// \e1037 /// \e 1052 1038 void set(const Key &k, const Value &v) { _m.set(k, v-_v); } 1053 1039 }; … … 1108 1094 C _v; 1109 1095 public: 1110 ///\e 1111 typedef typename M::Key Key; 1112 ///\e 1113 typedef typename M::Value Value; 1096 typedef MapBase<typename M::Key, typename M::Value> Parent; 1097 typedef typename Parent::Key Key; 1098 typedef typename Parent::Value Value; 1114 1099 1115 1100 /// Constructor … … 1119 1104 /// \param v The constant value. 1120 1105 ScaleMap(const M &m, const C &v) : _m(m), _v(v) {} 1121 /// \e1106 /// \e 1122 1107 Value operator[](const Key &k) const { return _v*_m[k]; } 1123 1108 }; … … 1140 1125 C _v; 1141 1126 public: 1142 ///\e 1143 typedef typename M::Key Key; 1144 ///\e 1145 typedef typename M::Value Value; 1127 typedef MapBase<typename M::Key, typename M::Value> Parent; 1128 typedef typename Parent::Key Key; 1129 typedef typename Parent::Value Value; 1146 1130 1147 1131 /// Constructor … … 1151 1135 /// \param v The constant value. 1152 1136 ScaleWriteMap(M &m, const C &v) : _m(m), _v(v) {} 1153 /// \e1137 /// \e 1154 1138 Value operator[](const Key &k) const { return _v*_m[k]; } 1155 /// \e1139 /// \e 1156 1140 void set(const Key &k, const Value &v) { _m.set(k, v/_v); } 1157 1141 }; … … 1210 1194 const M& _m; 1211 1195 public: 1212 ///\e 1213 typedef typename M::Key Key; 1214 ///\e 1215 typedef typename M::Value Value; 1196 typedef MapBase<typename M::Key, typename M::Value> Parent; 1197 typedef typename Parent::Key Key; 1198 typedef typename Parent::Value Value; 1216 1199 1217 1200 /// Constructor 1218 1201 NegMap(const M &m) : _m(m) {} 1219 /// \e1202 /// \e 1220 1203 Value operator[](const Key &k) const { return -_m[k]; } 1221 1204 }; … … 1246 1229 M &_m; 1247 1230 public: 1248 ///\e 1249 typedef typename M::Key Key; 1250 ///\e 1251 typedef typename M::Value Value; 1231 typedef MapBase<typename M::Key, typename M::Value> Parent; 1232 typedef typename Parent::Key Key; 1233 typedef typename Parent::Value Value; 1252 1234 1253 1235 /// Constructor 1254 1236 NegWriteMap(M &m) : _m(m) {} 1255 /// \e1237 /// \e 1256 1238 Value operator[](const Key &k) const { return -_m[k]; } 1257 /// \e1239 /// \e 1258 1240 void set(const Key &k, const Value &v) { _m.set(k, -v); } 1259 1241 }; … … 1301 1283 const M &_m; 1302 1284 public: 1303 ///\e 1304 typedef typename M::Key Key; 1305 ///\e 1306 typedef typename M::Value Value; 1285 typedef MapBase<typename M::Key, typename M::Value> Parent; 1286 typedef typename Parent::Key Key; 1287 typedef typename Parent::Value Value; 1307 1288 1308 1289 /// Constructor 1309 1290 AbsMap(const M &m) : _m(m) {} 1310 /// \e1291 /// \e 1311 1292 Value operator[](const Key &k) const { 1312 1293 Value tmp = _m[k]; … … 1357 1338 class TrueMap : public MapBase<K, bool> { 1358 1339 public: 1359 ///\e 1360 typedef K Key; 1361 ///\e 1362 typedef bool Value; 1340 typedef MapBase<K, bool> Parent; 1341 typedef typename Parent::Key Key; 1342 typedef typename Parent::Value Value; 1363 1343 1364 1344 /// Gives back \c true. … … 1395 1375 class FalseMap : public MapBase<K, bool> { 1396 1376 public: 1397 ///\e 1398 typedef K Key; 1399 ///\e 1400 typedef bool Value; 1377 typedef MapBase<K, bool> Parent; 1378 typedef typename Parent::Key Key; 1379 typedef typename Parent::Value Value; 1401 1380 1402 1381 /// Gives back \c false. … … 1441 1420 const M2 &_m2; 1442 1421 public: 1443 ///\e 1444 typedef typename M1::Key Key; 1445 ///\e 1446 typedef bool Value; 1422 typedef MapBase<typename M1::Key, bool> Parent; 1423 typedef typename Parent::Key Key; 1424 typedef typename Parent::Value Value; 1447 1425 1448 1426 /// Constructor 1449 1427 AndMap(const M1 &m1, const M2 &m2) : _m1(m1), _m2(m2) {} 1450 /// \e1428 /// \e 1451 1429 Value operator[](const Key &k) const { return _m1[k]&&_m2[k]; } 1452 1430 }; … … 1490 1468 const M2 &_m2; 1491 1469 public: 1492 ///\e 1493 typedef typename M1::Key Key; 1494 ///\e 1495 typedef bool Value; 1470 typedef MapBase<typename M1::Key, bool> Parent; 1471 typedef typename Parent::Key Key; 1472 typedef typename Parent::Value Value; 1496 1473 1497 1474 /// Constructor 1498 1475 OrMap(const M1 &m1, const M2 &m2) : _m1(m1), _m2(m2) {} 1499 /// \e1476 /// \e 1500 1477 Value operator[](const Key &k) const { return _m1[k]||_m2[k]; } 1501 1478 }; … … 1530 1507 const M &_m; 1531 1508 public: 1532 ///\e 1533 typedef typename M::Key Key; 1534 ///\e 1535 typedef bool Value; 1509 typedef MapBase<typename M::Key, bool> Parent; 1510 typedef typename Parent::Key Key; 1511 typedef typename Parent::Value Value; 1536 1512 1537 1513 /// Constructor 1538 1514 NotMap(const M &m) : _m(m) {} 1539 /// \e1515 /// \e 1540 1516 Value operator[](const Key &k) const { return !_m[k]; } 1541 1517 }; … … 1557 1533 M &_m; 1558 1534 public: 1559 ///\e 1560 typedef typename M::Key Key; 1561 ///\e 1562 typedef bool Value; 1535 typedef MapBase<typename M::Key, bool> Parent; 1536 typedef typename Parent::Key Key; 1537 typedef typename Parent::Value Value; 1563 1538 1564 1539 /// Constructor 1565 1540 NotWriteMap(M &m) : _m(m) {} 1566 /// \e1541 /// \e 1567 1542 Value operator[](const Key &k) const { return !_m[k]; } 1568 /// \e1543 /// \e 1569 1544 void set(const Key &k, bool v) { _m.set(k, !v); } 1570 1545 }; … … 1621 1596 const M2 &_m2; 1622 1597 public: 1623 ///\e 1624 typedef typename M1::Key Key; 1625 ///\e 1626 typedef bool Value; 1598 typedef MapBase<typename M1::Key, bool> Parent; 1599 typedef typename Parent::Key Key; 1600 typedef typename Parent::Value Value; 1627 1601 1628 1602 /// Constructor 1629 1603 EqualMap(const M1 &m1, const M2 &m2) : _m1(m1), _m2(m2) {} 1630 /// \e1604 /// \e 1631 1605 Value operator[](const Key &k) const { return _m1[k]==_m2[k]; } 1632 1606 }; … … 1670 1644 const M2 &_m2; 1671 1645 public: 1672 ///\e 1673 typedef typename M1::Key Key; 1674 ///\e 1675 typedef bool Value; 1646 typedef MapBase<typename M1::Key, bool> Parent; 1647 typedef typename Parent::Key Key; 1648 typedef typename Parent::Value Value; 1676 1649 1677 1650 /// Constructor 1678 1651 LessMap(const M1 &m1, const M2 &m2) : _m1(m1), _m2(m2) {} 1679 /// \e1652 /// \e 1680 1653 Value operator[](const Key &k) const { return _m1[k]<_m2[k]; } 1681 1654 }; … … 1733 1706 /// function. 1734 1707 /// 1735 /// \tparam I TThe type of the iterator.1736 /// \tparam K EYThe key type of the map. The default value set1708 /// \tparam It The type of the iterator. 1709 /// \tparam Ke The key type of the map. The default value set 1737 1710 /// according to the iterator type should work in most cases. 1738 1711 /// … … 1740 1713 /// for the elements or the iterator should be an inserter iterator. 1741 1714 #ifdef DOXYGEN 1742 template <typename I T, typename KEY>1715 template <typename It, typename Ke> 1743 1716 #else 1744 template <typename I T,1745 typename K EY = typename _maps_bits::IteratorTraits<IT>::Value>1717 template <typename It, 1718 typename Ke=typename _maps_bits::IteratorTraits<It>::Value> 1746 1719 #endif 1747 class LoggerBoolMap : public MapBase<KEY, bool> { 1748 public: 1749 1750 ///\e 1751 typedef KEY Key; 1752 ///\e 1720 class LoggerBoolMap { 1721 public: 1722 typedef It Iterator; 1723 1724 typedef Ke Key; 1753 1725 typedef bool Value; 1754 ///\e1755 typedef IT Iterator;1756 1726 1757 1727 /// Constructor … … 1816 1786 /// @{ 1817 1787 1818 /// \brief Provides an immutable and unique id for each item in a graph. 1819 /// 1820 /// IdMap provides a unique and immutable id for each item of the 1821 /// same type (\c Node, \c Arc or \c Edge) in a graph. This id is 1822 /// - \b unique: different items get different ids, 1823 /// - \b immutable: the id of an item does not change (even if you 1824 /// delete other nodes). 1825 /// 1826 /// Using this map you get access (i.e. can read) the inner id values of 1827 /// the items stored in the graph, which is returned by the \c id() 1828 /// function of the graph. This map can be inverted with its member 1788 /// Provides an immutable and unique id for each item in the graph. 1789 1790 /// The IdMap class provides a unique and immutable id for each item of the 1791 /// same type (e.g. node) in the graph. This id is <ul><li>\b unique: 1792 /// different items (nodes) get different ids <li>\b immutable: the id of an 1793 /// item (node) does not change (even if you delete other nodes). </ul> 1794 /// Through this map you get access (i.e. can read) the inner id values of 1795 /// the items stored in the graph. This map can be inverted with its member 1829 1796 /// class \c InverseMap or with the \c operator() member. 1830 1797 /// 1831 /// \tparam GR The graph type. 1832 /// \tparam K The key type of the map (\c GR::Node, \c GR::Arc or 1833 /// \c GR::Edge). 1834 /// 1835 /// \see DescriptorMap 1836 template <typename GR, typename K> 1837 class IdMap : public MapBase<K, int> { 1838 public: 1839 /// The graph type of IdMap. 1840 typedef GR Graph; 1841 /// The key type of IdMap (\c Node, \c Arc or \c Edge). 1842 typedef K Item; 1843 /// The key type of IdMap (\c Node, \c Arc or \c Edge). 1844 typedef K Key; 1845 /// The value type of IdMap. 1798 template <typename _Graph, typename _Item> 1799 class IdMap { 1800 public: 1801 typedef _Graph Graph; 1846 1802 typedef int Value; 1803 typedef _Item Item; 1804 typedef _Item Key; 1847 1805 1848 1806 /// \brief Constructor. … … 1856 1814 int operator[](const Item& item) const { return _graph->id(item);} 1857 1815 1858 /// \brief Gives back the \eitem by its id.1859 /// 1860 /// Gives back the \eitem by its id.1816 /// \brief Gives back the item by its id. 1817 /// 1818 /// Gives back the item by its id. 1861 1819 Item operator()(int id) { return _graph->fromId(id, Item()); } 1862 1820 … … 1866 1824 public: 1867 1825 1868 /// \brief Th isclass represents the inverse of its owner (IdMap).1869 /// 1870 /// Th isclass represents the inverse of its owner (IdMap).1826 /// \brief The class represents the inverse of its owner (IdMap). 1827 /// 1828 /// The class represents the inverse of its owner (IdMap). 1871 1829 /// \see inverse() 1872 1830 class InverseMap { … … 1886 1844 /// 1887 1845 /// Gives back the given item from its id. 1846 /// 1888 1847 Item operator[](int id) const { return _graph->fromId(id, Item());} 1889 1848 … … 1896 1855 /// Gives back the inverse of the IdMap. 1897 1856 InverseMap inverse() const { return InverseMap(*_graph);} 1898 }; 1899 1900 1901 /// \brief General invertable graph map type. 1902 1903 /// This class provides simple invertable graph maps. 1904 /// It wraps an arbitrary \ref concepts::ReadWriteMap "ReadWriteMap" 1857 1858 }; 1859 1860 1861 /// \brief General invertable graph-map type. 1862 1863 /// This type provides simple invertable graph-maps. 1864 /// The InvertableMap wraps an arbitrary ReadWriteMap 1905 1865 /// and if a key is set to a new value then store it 1906 1866 /// in the inverse map. … … 1909 1869 /// with stl compatible forward iterator. 1910 1870 /// 1911 /// \tparam GR The graph type. 1912 /// \tparam K The key type of the map (\c GR::Node, \c GR::Arc or 1913 /// \c GR::Edge). 1914 /// \tparam V The value type of the map. 1871 /// \tparam _Graph The graph type. 1872 /// \tparam _Item The item type of the graph. 1873 /// \tparam _Value The value type of the map. 1915 1874 /// 1916 1875 /// \see IterableValueMap 1917 template <typename GR, typename K, typename V>1876 template <typename _Graph, typename _Item, typename _Value> 1918 1877 class InvertableMap 1919 : protected ItemSetTraits< GR, K>::template Map<V>::Type {1878 : protected ItemSetTraits<_Graph, _Item>::template Map<_Value>::Type { 1920 1879 private: 1921 1880 1922 typedef typename ItemSetTraits<GR, K>:: 1923 template Map<V>::Type Map; 1924 1925 typedef std::map<V, K> Container; 1881 typedef typename ItemSetTraits<_Graph, _Item>:: 1882 template Map<_Value>::Type Map; 1883 typedef _Graph Graph; 1884 1885 typedef std::map<_Value, _Item> Container; 1926 1886 Container _inv_map; 1927 1887 1928 1888 public: 1929 1889 1930 /// The graph type of InvertableMap. 1931 typedef GR Graph; 1932 /// The key type of InvertableMap (\c Node, \c Arc or \c Edge). 1933 typedef K Item; 1934 /// The key type of InvertableMap (\c Node, \c Arc or \c Edge). 1935 typedef K Key; 1936 /// The value type of InvertableMap. 1937 typedef V Value; 1890 /// The key type of InvertableMap (Node, Arc, Edge). 1891 typedef typename Map::Key Key; 1892 /// The value type of the InvertableMap. 1893 typedef typename Map::Value Value; 1938 1894 1939 1895 /// \brief Constructor. 1940 1896 /// 1941 /// Construct a new InvertableMap for the given graph. 1897 /// Construct a new InvertableMap for the graph. 1898 /// 1942 1899 explicit InvertableMap(const Graph& graph) : Map(graph) {} 1943 1900 … … 1946 1903 /// This iterator is an stl compatible forward 1947 1904 /// iterator on the values of the map. The values can 1948 /// be accessed in the <tt>[beginValue, endValue)</tt> range. 1905 /// be accessed in the [beginValue, endValue) range. 1906 /// 1949 1907 class ValueIterator 1950 1908 : public std::iterator<std::forward_iterator_tag, Value> { … … 1978 1936 /// Returns an stl compatible iterator to the 1979 1937 /// first value of the map. The values of the 1980 /// map can be accessed in the <tt>[beginValue, endValue)</tt>1938 /// map can be accessed in the [beginValue, endValue) 1981 1939 /// range. 1982 1940 ValueIterator beginValue() const { … … 1988 1946 /// Returns an stl compatible iterator after the 1989 1947 /// last value of the map. The values of the 1990 /// map can be accessed in the <tt>[beginValue, endValue)</tt>1948 /// map can be accessed in the [beginValue, endValue) 1991 1949 /// range. 1992 1950 ValueIterator endValue() const { … … 1994 1952 } 1995 1953 1996 /// \brief Sets the value associated with the given key.1997 /// 1998 /// Sets the value associated with the given key.1954 /// \brief The setter function of the map. 1955 /// 1956 /// Sets the mapped value. 1999 1957 void set(const Key& key, const Value& val) { 2000 1958 Value oldval = Map::operator[](key); … … 2007 1965 } 2008 1966 2009 /// \brief Returns the value associated with the given key.2010 /// 2011 /// Returns the value associated with the givenkey.1967 /// \brief The getter function of the map. 1968 /// 1969 /// It gives back the value associated with the key. 2012 1970 typename MapTraits<Map>::ConstReturnValue 2013 1971 operator[](const Key& key) const { … … 2025 1983 protected: 2026 1984 2027 /// \brief Erase the key from the map and the inverse map.2028 /// 2029 /// Erase the key from the map and the inverse map. It is called by the1985 /// \brief Erase the key from the map. 1986 /// 1987 /// Erase the key to the map. It is called by the 2030 1988 /// \c AlterationNotifier. 2031 1989 virtual void erase(const Key& key) { … … 2038 1996 } 2039 1997 2040 /// \brief Erase more keys from the map and the inverse map.2041 /// 2042 /// Erase more keys from the map and the inverse map. It is called by the1998 /// \brief Erase more keys from the map. 1999 /// 2000 /// Erase more keys from the map. It is called by the 2043 2001 /// \c AlterationNotifier. 2044 2002 virtual void erase(const std::vector<Key>& keys) { … … 2053 2011 } 2054 2012 2055 /// \brief Clear the keys from the map and theinverse map.2056 /// 2057 /// Clear the keys from the map and theinverse map. It is called by the2013 /// \brief Clear the keys from the map and inverse map. 2014 /// 2015 /// Clear the keys from the map and inverse map. It is called by the 2058 2016 /// \c AlterationNotifier. 2059 2017 virtual void clear() { … … 2067 2025 /// 2068 2026 /// The inverse of this map. The subscript operator of the map 2069 /// gives back the item that was last assigned to the value.2027 /// gives back always the item what was last assigned to the value. 2070 2028 class InverseMap { 2071 2029 public: 2072 /// \brief Constructor 2030 /// \brief Constructor of the InverseMap. 2073 2031 /// 2074 2032 /// Constructor of the InverseMap. … … 2083 2041 /// \brief Subscript operator. 2084 2042 /// 2085 /// Subscript operator. It gives back the item2086 /// that was last assigned to the givenvalue.2043 /// Subscript operator. It gives back always the item 2044 /// what was last assigned to the value. 2087 2045 Value operator[](const Key& key) const { 2088 2046 return _inverted(key); … … 2093 2051 }; 2094 2052 2095 /// \brief It gives back the read-onlyinverse map.2096 /// 2097 /// It gives back the read-onlyinverse map.2053 /// \brief It gives back the just readable inverse map. 2054 /// 2055 /// It gives back the just readable inverse map. 2098 2056 InverseMap inverse() const { 2099 2057 return InverseMap(*this); … … 2103 2061 2104 2062 /// \brief Provides a mutable, continuous and unique descriptor for each 2105 /// item in a graph. 2106 /// 2107 /// DescriptorMap provides a unique and continuous (but mutable) 2108 /// descriptor (id) for each item of the same type (\c Node, \c Arc or 2109 /// \c Edge) in a graph. This id is 2110 /// - \b unique: different items get different ids, 2111 /// - \b continuous: the range of the ids is the set of integers 2112 /// between 0 and \c n-1, where \c n is the number of the items of 2113 /// this type (\c Node, \c Arc or \c Edge). So the id of an item can 2114 /// change if you delete an other item of the same type, i.e. this 2115 /// id is mutable. 2116 /// 2117 /// Thus this id is not (necessarily) the same as what can get using 2118 /// the \c id() function of the graph or \ref IdMap. 2119 /// This map can be inverted with its member class \c InverseMap, 2120 /// or with the \c operator() member. 2121 /// 2122 /// \tparam GR The graph type. 2123 /// \tparam K The key type of the map (\c GR::Node, \c GR::Arc or 2124 /// \c GR::Edge). 2125 /// 2126 /// \see IdMap 2127 template <typename GR, typename K> 2063 /// item in the graph. 2064 /// 2065 /// The DescriptorMap class provides a unique and continuous (but mutable) 2066 /// descriptor (id) for each item of the same type (e.g. node) in the 2067 /// graph. This id is <ul><li>\b unique: different items (nodes) get 2068 /// different ids <li>\b continuous: the range of the ids is the set of 2069 /// integers between 0 and \c n-1, where \c n is the number of the items of 2070 /// this type (e.g. nodes) (so the id of a node can change if you delete an 2071 /// other node, i.e. this id is mutable). </ul> This map can be inverted 2072 /// with its member class \c InverseMap, or with the \c operator() member. 2073 /// 2074 /// \tparam _Graph The graph class the \c DescriptorMap belongs to. 2075 /// \tparam _Item The Item is the Key of the Map. It may be Node, Arc or 2076 /// Edge. 2077 template <typename _Graph, typename _Item> 2128 2078 class DescriptorMap 2129 : protected ItemSetTraits< GR, K>::template Map<int>::Type {2130 2131 typedef typename ItemSetTraits<GR, K>::template Map<int>::Type Map;2132 2133 public: 2134 /// The graph type of DescriptorMap.2135 typedef GR Graph;2136 /// The key type of DescriptorMap (\c Node, \c Arc or \c Edge).2137 typedef K Item; 2138 /// The key type of DescriptorMap ( \c Node, \c Arc or \cEdge).2139 typedef KKey;2079 : protected ItemSetTraits<_Graph, _Item>::template Map<int>::Type { 2080 2081 typedef _Item Item; 2082 typedef typename ItemSetTraits<_Graph, _Item>::template Map<int>::Type Map; 2083 2084 public: 2085 /// The graph class of DescriptorMap. 2086 typedef _Graph Graph; 2087 2088 /// The key type of DescriptorMap (Node, Arc, Edge). 2089 typedef typename Map::Key Key; 2140 2090 /// The value type of DescriptorMap. 2141 typedef intValue;2091 typedef typename Map::Value Value; 2142 2092 2143 2093 /// \brief Constructor. 2144 2094 /// 2145 2095 /// Constructor for descriptor map. 2146 explicit DescriptorMap(const Graph& gr) : Map(gr) {2096 explicit DescriptorMap(const Graph& _graph) : Map(_graph) { 2147 2097 Item it; 2148 2098 const typename Map::Notifier* nf = Map::notifier(); … … 2155 2105 protected: 2156 2106 2157 /// \brief Add sa new key to the map.2107 /// \brief Add a new key to the map. 2158 2108 /// 2159 2109 /// Add a new key to the map. It is called by the … … 2265 2215 2266 2216 public: 2267 2268 2217 /// \brief The inverse map type of DescriptorMap. 2269 2218 /// … … 2271 2220 class InverseMap { 2272 2221 public: 2273 /// \brief Constructor 2222 /// \brief Constructor of the InverseMap. 2274 2223 /// 2275 2224 /// Constructor of the InverseMap. … … 2286 2235 /// 2287 2236 /// Subscript operator. It gives back the item 2288 /// that the descriptor currently belongs to.2237 /// that the descriptor belongs to currently. 2289 2238 Value operator[](const Key& key) const { 2290 2239 return _inverted(key); … … 2310 2259 }; 2311 2260 2312 /// \brief Map of the source nodes of arcs in a digraph. 2313 /// 2314 /// SourceMap provides access for the source node of each arc in a digraph, 2315 /// which is returned by the \c source() function of the digraph. 2316 /// \tparam GR The digraph type. 2261 /// \brief Returns the source of the given arc. 2262 /// 2263 /// The SourceMap gives back the source Node of the given arc. 2317 2264 /// \see TargetMap 2318 template <typename GR>2265 template <typename Digraph> 2319 2266 class SourceMap { 2320 2267 public: 2321 2268 2322 ///\e 2323 typedef typename GR::Arc Key; 2324 ///\e 2325 typedef typename GR::Node Value; 2269 typedef typename Digraph::Node Value; 2270 typedef typename Digraph::Arc Key; 2326 2271 2327 2272 /// \brief Constructor 2328 2273 /// 2329 /// Constructor .2274 /// Constructor 2330 2275 /// \param digraph The digraph that the map belongs to. 2331 explicit SourceMap(const GR& digraph) : _graph(digraph) {} 2332 2333 /// \brief Returns the source node of the given arc. 2334 /// 2335 /// Returns the source node of the given arc. 2276 explicit SourceMap(const Digraph& digraph) : _digraph(digraph) {} 2277 2278 /// \brief The subscript operator. 2279 /// 2280 /// The subscript operator. 2281 /// \param arc The arc 2282 /// \return The source of the arc 2336 2283 Value operator[](const Key& arc) const { 2337 return _ graph.source(arc);2284 return _digraph.source(arc); 2338 2285 } 2339 2286 2340 2287 private: 2341 const GR& _graph;2288 const Digraph& _digraph; 2342 2289 }; 2343 2290 … … 2346 2293 /// This function just returns an \c SourceMap class. 2347 2294 /// \relates SourceMap 2348 template <typename GR> 2349 inline SourceMap<GR> sourceMap(const GR& graph) { 2350 return SourceMap<GR>(graph); 2351 } 2352 2353 /// \brief Map of the target nodes of arcs in a digraph. 2354 /// 2355 /// TargetMap provides access for the target node of each arc in a digraph, 2356 /// which is returned by the \c target() function of the digraph. 2357 /// \tparam GR The digraph type. 2295 template <typename Digraph> 2296 inline SourceMap<Digraph> sourceMap(const Digraph& digraph) { 2297 return SourceMap<Digraph>(digraph); 2298 } 2299 2300 /// \brief Returns the target of the given arc. 2301 /// 2302 /// The TargetMap gives back the target Node of the given arc. 2358 2303 /// \see SourceMap 2359 template <typename GR>2304 template <typename Digraph> 2360 2305 class TargetMap { 2361 2306 public: 2362 2307 2363 ///\e 2364 typedef typename GR::Arc Key; 2365 ///\e 2366 typedef typename GR::Node Value; 2308 typedef typename Digraph::Node Value; 2309 typedef typename Digraph::Arc Key; 2367 2310 2368 2311 /// \brief Constructor 2369 2312 /// 2370 /// Constructor .2313 /// Constructor 2371 2314 /// \param digraph The digraph that the map belongs to. 2372 explicit TargetMap(const GR& digraph) : _graph(digraph) {} 2373 2374 /// \brief Returns the target node of the given arc. 2375 /// 2376 /// Returns the target node of the given arc. 2315 explicit TargetMap(const Digraph& digraph) : _digraph(digraph) {} 2316 2317 /// \brief The subscript operator. 2318 /// 2319 /// The subscript operator. 2320 /// \param e The arc 2321 /// \return The target of the arc 2377 2322 Value operator[](const Key& e) const { 2378 return _ graph.target(e);2323 return _digraph.target(e); 2379 2324 } 2380 2325 2381 2326 private: 2382 const GR& _graph;2327 const Digraph& _digraph; 2383 2328 }; 2384 2329 … … 2387 2332 /// This function just returns a \c TargetMap class. 2388 2333 /// \relates TargetMap 2389 template <typename GR> 2390 inline TargetMap<GR> targetMap(const GR& graph) { 2391 return TargetMap<GR>(graph); 2392 } 2393 2394 /// \brief Map of the "forward" directed arc view of edges in a graph. 2395 /// 2396 /// ForwardMap provides access for the "forward" directed arc view of 2397 /// each edge in a graph, which is returned by the \c direct() function 2398 /// of the graph with \c true parameter. 2399 /// \tparam GR The graph type. 2334 template <typename Digraph> 2335 inline TargetMap<Digraph> targetMap(const Digraph& digraph) { 2336 return TargetMap<Digraph>(digraph); 2337 } 2338 2339 /// \brief Returns the "forward" directed arc view of an edge. 2340 /// 2341 /// Returns the "forward" directed arc view of an edge. 2400 2342 /// \see BackwardMap 2401 template <typename G R>2343 template <typename Graph> 2402 2344 class ForwardMap { 2403 2345 public: 2404 2346 2405 typedef typename G R::Arc Value;2406 typedef typename G R::Edge Key;2347 typedef typename Graph::Arc Value; 2348 typedef typename Graph::Edge Key; 2407 2349 2408 2350 /// \brief Constructor 2409 2351 /// 2410 /// Constructor .2352 /// Constructor 2411 2353 /// \param graph The graph that the map belongs to. 2412 explicit ForwardMap(const GR& graph) : _graph(graph) {} 2413 2414 /// \brief Returns the "forward" directed arc view of the given edge. 2415 /// 2416 /// Returns the "forward" directed arc view of the given edge. 2354 explicit ForwardMap(const Graph& graph) : _graph(graph) {} 2355 2356 /// \brief The subscript operator. 2357 /// 2358 /// The subscript operator. 2359 /// \param key An edge 2360 /// \return The "forward" directed arc view of edge 2417 2361 Value operator[](const Key& key) const { 2418 2362 return _graph.direct(key, true); … … 2420 2364 2421 2365 private: 2422 const G R& _graph;2366 const Graph& _graph; 2423 2367 }; 2424 2368 … … 2427 2371 /// This function just returns an \c ForwardMap class. 2428 2372 /// \relates ForwardMap 2429 template <typename GR> 2430 inline ForwardMap<GR> forwardMap(const GR& graph) { 2431 return ForwardMap<GR>(graph); 2432 } 2433 2434 /// \brief Map of the "backward" directed arc view of edges in a graph. 2435 /// 2436 /// BackwardMap provides access for the "backward" directed arc view of 2437 /// each edge in a graph, which is returned by the \c direct() function 2438 /// of the graph with \c false parameter. 2439 /// \tparam GR The graph type. 2373 template <typename Graph> 2374 inline ForwardMap<Graph> forwardMap(const Graph& graph) { 2375 return ForwardMap<Graph>(graph); 2376 } 2377 2378 /// \brief Returns the "backward" directed arc view of an edge. 2379 /// 2380 /// Returns the "backward" directed arc view of an edge. 2440 2381 /// \see ForwardMap 2441 template <typename G R>2382 template <typename Graph> 2442 2383 class BackwardMap { 2443 2384 public: 2444 2385 2445 typedef typename G R::Arc Value;2446 typedef typename G R::Edge Key;2386 typedef typename Graph::Arc Value; 2387 typedef typename Graph::Edge Key; 2447 2388 2448 2389 /// \brief Constructor 2449 2390 /// 2450 /// Constructor .2391 /// Constructor 2451 2392 /// \param graph The graph that the map belongs to. 2452 explicit BackwardMap(const GR& graph) : _graph(graph) {} 2453 2454 /// \brief Returns the "backward" directed arc view of the given edge. 2455 /// 2456 /// Returns the "backward" directed arc view of the given edge. 2393 explicit BackwardMap(const Graph& graph) : _graph(graph) {} 2394 2395 /// \brief The subscript operator. 2396 /// 2397 /// The subscript operator. 2398 /// \param key An edge 2399 /// \return The "backward" directed arc view of edge 2457 2400 Value operator[](const Key& key) const { 2458 2401 return _graph.direct(key, false); … … 2460 2403 2461 2404 private: 2462 const G R& _graph;2405 const Graph& _graph; 2463 2406 }; 2464 2407 … … 2467 2410 /// This function just returns a \c BackwardMap class. 2468 2411 /// \relates BackwardMap 2469 template <typename GR> 2470 inline BackwardMap<GR> backwardMap(const GR& graph) { 2471 return BackwardMap<GR>(graph); 2472 } 2473 2474 /// \brief Map of the in-degrees of nodes in a digraph. 2412 template <typename Graph> 2413 inline BackwardMap<Graph> backwardMap(const Graph& graph) { 2414 return BackwardMap<Graph>(graph); 2415 } 2416 2417 /// \brief Potential difference map 2418 /// 2419 /// If there is an potential map on the nodes then we 2420 /// can get an arc map as we get the substraction of the 2421 /// values of the target and source. 2422 template <typename Digraph, typename NodeMap> 2423 class PotentialDifferenceMap { 2424 public: 2425 typedef typename Digraph::Arc Key; 2426 typedef typename NodeMap::Value Value; 2427 2428 /// \brief Constructor 2429 /// 2430 /// Contructor of the map 2431 explicit PotentialDifferenceMap(const Digraph& digraph, 2432 const NodeMap& potential) 2433 : _digraph(digraph), _potential(potential) {} 2434 2435 /// \brief Const subscription operator 2436 /// 2437 /// Const subscription operator 2438 Value operator[](const Key& arc) const { 2439 return _potential[_digraph.target(arc)] - 2440 _potential[_digraph.source(arc)]; 2441 } 2442 2443 private: 2444 const Digraph& _digraph; 2445 const NodeMap& _potential; 2446 }; 2447 2448 /// \brief Returns a PotentialDifferenceMap. 2449 /// 2450 /// This function just returns a PotentialDifferenceMap. 2451 /// \relates PotentialDifferenceMap 2452 template <typename Digraph, typename NodeMap> 2453 PotentialDifferenceMap<Digraph, NodeMap> 2454 potentialDifferenceMap(const Digraph& digraph, const NodeMap& potential) { 2455 return PotentialDifferenceMap<Digraph, NodeMap>(digraph, potential); 2456 } 2457 2458 /// \brief Map of the node in-degrees. 2475 2459 /// 2476 2460 /// This map returns the in-degree of a node. Once it is constructed, 2477 /// the degrees are stored in a standard \cNodeMap, so each query is done2461 /// the degrees are stored in a standard NodeMap, so each query is done 2478 2462 /// in constant time. On the other hand, the values are updated automatically 2479 2463 /// whenever the digraph changes. 2480 2464 /// 2481 /// \warning Besides \c addNode() and \c addArc(), a digraph structure 2482 /// may provide alternative ways to modify the digraph. 2483 /// The correct behavior of InDegMap is not guarantied if these additional 2484 /// features are used. For example the functions 2485 /// \ref ListDigraph::changeSource() "changeSource()", 2465 /// \warning Besides addNode() and addArc(), a digraph structure may provide 2466 /// alternative ways to modify the digraph. The correct behavior of InDegMap 2467 /// is not guarantied if these additional features are used. For example 2468 /// the functions \ref ListDigraph::changeSource() "changeSource()", 2486 2469 /// \ref ListDigraph::changeTarget() "changeTarget()" and 2487 2470 /// \ref ListDigraph::reverseArc() "reverseArc()" … … 2489 2472 /// 2490 2473 /// \sa OutDegMap 2491 template <typename GR> 2474 2475 template <typename _Digraph> 2492 2476 class InDegMap 2493 : protected ItemSetTraits< GR, typename GR::Arc>2477 : protected ItemSetTraits<_Digraph, typename _Digraph::Arc> 2494 2478 ::ItemNotifier::ObserverBase { 2495 2479 2496 2480 public: 2497 2498 /// The digraph type 2499 typedef GR Digraph; 2500 /// The key type 2481 2482 typedef _Digraph Digraph; 2483 typedef int Value; 2501 2484 typedef typename Digraph::Node Key; 2502 /// The value type2503 typedef int Value;2504 2485 2505 2486 typedef typename ItemSetTraits<Digraph, typename Digraph::Arc> … … 2543 2524 /// \brief Constructor. 2544 2525 /// 2545 /// Constructor for creating anin-degree map.2546 explicit InDegMap(const Digraph& graph)2547 : _digraph( graph), _deg(graph) {2526 /// Constructor for creating in-degree map. 2527 explicit InDegMap(const Digraph& digraph) 2528 : _digraph(digraph), _deg(digraph) { 2548 2529 Parent::attach(_digraph.notifier(typename Digraph::Arc())); 2549 2530 … … 2553 2534 } 2554 2535 2555 /// \brief Gives back the in-degree of a Node.2556 ///2557 2536 /// Gives back the in-degree of a Node. 2558 2537 int operator[](const Key& key) const { … … 2601 2580 }; 2602 2581 2603 /// \brief Map of the out-degrees of nodes in a digraph.2582 /// \brief Map of the node out-degrees. 2604 2583 /// 2605 2584 /// This map returns the out-degree of a node. Once it is constructed, 2606 /// the degrees are stored in a standard \cNodeMap, so each query is done2585 /// the degrees are stored in a standard NodeMap, so each query is done 2607 2586 /// in constant time. On the other hand, the values are updated automatically 2608 2587 /// whenever the digraph changes. 2609 2588 /// 2610 /// \warning Besides \c addNode() and \c addArc(), a digraph structure 2611 /// may provide alternative ways to modify the digraph. 2612 /// The correct behavior of OutDegMap is not guarantied if these additional 2613 /// features are used. For example the functions 2614 /// \ref ListDigraph::changeSource() "changeSource()", 2589 /// \warning Besides addNode() and addArc(), a digraph structure may provide 2590 /// alternative ways to modify the digraph. The correct behavior of OutDegMap 2591 /// is not guarantied if these additional features are used. For example 2592 /// the functions \ref ListDigraph::changeSource() "changeSource()", 2615 2593 /// \ref ListDigraph::changeTarget() "changeTarget()" and 2616 2594 /// \ref ListDigraph::reverseArc() "reverseArc()" … … 2618 2596 /// 2619 2597 /// \sa InDegMap 2620 template <typename GR> 2598 2599 template <typename _Digraph> 2621 2600 class OutDegMap 2622 : protected ItemSetTraits< GR, typename GR::Arc>2601 : protected ItemSetTraits<_Digraph, typename _Digraph::Arc> 2623 2602 ::ItemNotifier::ObserverBase { 2624 2603 2625 2604 public: 2626 2605 2627 /// The digraph type 2628 typedef GR Digraph; 2629 /// The key type 2606 typedef _Digraph Digraph; 2607 typedef int Value; 2630 2608 typedef typename Digraph::Node Key; 2631 /// The value type2632 typedef int Value;2633 2609 2634 2610 typedef typename ItemSetTraits<Digraph, typename Digraph::Arc> … … 2670 2646 /// \brief Constructor. 2671 2647 /// 2672 /// Constructor for creating anout-degree map.2673 explicit OutDegMap(const Digraph& graph)2674 : _digraph( graph), _deg(graph) {2648 /// Constructor for creating out-degree map. 2649 explicit OutDegMap(const Digraph& digraph) 2650 : _digraph(digraph), _deg(digraph) { 2675 2651 Parent::attach(_digraph.notifier(typename Digraph::Arc())); 2676 2652 … … 2680 2656 } 2681 2657 2682 /// \brief Gives back the out-degree of a Node.2683 ///2684 2658 /// Gives back the out-degree of a Node. 2685 2659 int operator[](const Key& key) const { … … 2728 2702 }; 2729 2703 2730 /// \brief Potential difference map2731 ///2732 /// PotentialMap returns the difference between the potentials of the2733 /// source and target nodes of each arc in a digraph, i.e. it returns2734 /// \code2735 /// potential[gr.target(arc)] - potential[gr.source(arc)].2736 /// \endcode2737 /// \tparam GR The digraph type.2738 /// \tparam POT A node map storing the potentials.2739 template <typename GR, typename POT>2740 class PotentialDifferenceMap {2741 public:2742 /// Key type2743 typedef typename GR::Arc Key;2744 /// Value type2745 typedef typename POT::Value Value;2746 2747 /// \brief Constructor2748 ///2749 /// Contructor of the map.2750 explicit PotentialDifferenceMap(const GR& gr,2751 const POT& potential)2752 : _digraph(gr), _potential(potential) {}2753 2754 /// \brief Returns the potential difference for the given arc.2755 ///2756 /// Returns the potential difference for the given arc, i.e.2757 /// \code2758 /// potential[gr.target(arc)] - potential[gr.source(arc)].2759 /// \endcode2760 Value operator[](const Key& arc) const {2761 return _potential[_digraph.target(arc)] -2762 _potential[_digraph.source(arc)];2763 }2764 2765 private:2766 const GR& _digraph;2767 const POT& _potential;2768 };2769 2770 /// \brief Returns a PotentialDifferenceMap.2771 ///2772 /// This function just returns a PotentialDifferenceMap.2773 /// \relates PotentialDifferenceMap2774 template <typename GR, typename POT>2775 PotentialDifferenceMap<GR, POT>2776 potentialDifferenceMap(const GR& gr, const POT& potential) {2777 return PotentialDifferenceMap<GR, POT>(gr, potential);2778 }2779 2780 2704 /// @} 2781 2705 } -
lemon/max_matching.h
r606 r463 56 56 /// decomposition() after running the algorithm. 57 57 /// 58 /// \param GRThe graph type the algorithm runs on.59 template <typename GR>58 /// \param _Graph The graph type the algorithm runs on. 59 template <typename _Graph> 60 60 class MaxMatching { 61 61 public: 62 62 63 typedef GRGraph;63 typedef _Graph Graph; 64 64 typedef typename Graph::template NodeMap<typename Graph::Arc> 65 65 MatchingMap; … … 464 464 /// map must have the property that there are no two incident edges 465 465 /// with true value, ie. it contains a matching. 466 /// \return \c true if the map contains a matching.466 /// \return %True if the map contains a matching. 467 467 template <typename MatchingMap> 468 468 bool matchingInit(const MatchingMap& matching) { … … 614 614 /// maximum weighted matching algorithm. The implementation is based 615 615 /// on extensive use of priority queues and provides 616 /// \f$O(nm\log n)\f$ time complexity.616 /// \f$O(nm\log(n))\f$ time complexity. 617 617 /// 618 618 /// The maximum weighted matching problem is to find undirected … … 648 648 /// of a blossom. If the value type is integral then the dual 649 649 /// solution is multiplied by \ref MaxWeightedMatching::dualScale "4". 650 template <typename GR,651 typename WM = typename GR::template EdgeMap<int> >650 template <typename _Graph, 651 typename _WeightMap = typename _Graph::template EdgeMap<int> > 652 652 class MaxWeightedMatching { 653 653 public: 654 654 655 ///\e 656 typedef GR Graph; 657 ///\e 658 typedef WM WeightMap; 659 ///\e 655 typedef _Graph Graph; 656 typedef _WeightMap WeightMap; 660 657 typedef typename WeightMap::Value Value; 661 658 … … 1961 1958 /// maximum weighted perfect matching algorithm. The implementation 1962 1959 /// is based on extensive use of priority queues and provides 1963 /// \f$O(nm\log n)\f$ time complexity.1960 /// \f$O(nm\log(n))\f$ time complexity. 1964 1961 /// 1965 1962 /// The maximum weighted matching problem is to find undirected … … 1994 1991 /// of a blossom. If the value type is integral then the dual 1995 1992 /// solution is multiplied by \ref MaxWeightedMatching::dualScale "4". 1996 template <typename GR,1997 typename WM = typename GR::template EdgeMap<int> >1993 template <typename _Graph, 1994 typename _WeightMap = typename _Graph::template EdgeMap<int> > 1998 1995 class MaxWeightedPerfectMatching { 1999 1996 public: 2000 1997 2001 typedef GRGraph;2002 typedef WMWeightMap;1998 typedef _Graph Graph; 1999 typedef _WeightMap WeightMap; 2003 2000 typedef typename WeightMap::Value Value; 2004 2001 -
lemon/min_cost_arborescence.h
r606 r522 36 36 /// 37 37 /// Default traits class for MinCostArborescence class. 38 /// \param GRDigraph type.39 /// \param CMType of cost map.40 template <class GR, class CM>38 /// \param _Digraph Digraph type. 39 /// \param _CostMap Type of cost map. 40 template <class _Digraph, class _CostMap> 41 41 struct MinCostArborescenceDefaultTraits{ 42 42 43 43 /// \brief The digraph type the algorithm runs on. 44 typedef GRDigraph;44 typedef _Digraph Digraph; 45 45 46 46 /// \brief The type of the map that stores the arc costs. … … 48 48 /// The type of the map that stores the arc costs. 49 49 /// It must meet the \ref concepts::ReadMap "ReadMap" concept. 50 typedef CMCostMap;50 typedef _CostMap CostMap; 51 51 52 52 /// \brief The value type of the costs. … … 64 64 typedef typename Digraph::template ArcMap<bool> ArborescenceMap; 65 65 66 /// \brief Instantiates a \cArborescenceMap.67 /// 68 /// This function instantiates a \ cArborescenceMap.66 /// \brief Instantiates a ArborescenceMap. 67 /// 68 /// This function instantiates a \ref ArborescenceMap. 69 69 /// \param digraph is the graph, to which we would like to 70 /// calculate the \cArborescenceMap.70 /// calculate the ArborescenceMap. 71 71 static ArborescenceMap *createArborescenceMap(const Digraph &digraph){ 72 72 return new ArborescenceMap(digraph); 73 73 } 74 74 75 /// \brief The type of the \cPredMap76 /// 77 /// The type of the \cPredMap. It is a node map with an arc value type.75 /// \brief The type of the PredMap 76 /// 77 /// The type of the PredMap. It is a node map with an arc value type. 78 78 typedef typename Digraph::template NodeMap<typename Digraph::Arc> PredMap; 79 79 80 /// \brief Instantiates a \cPredMap.81 /// 82 /// This function instantiates a \ cPredMap.83 /// \param digraph The digraphto which we would like to define the84 /// \cPredMap.80 /// \brief Instantiates a PredMap. 81 /// 82 /// This function instantiates a \ref PredMap. 83 /// \param _digraph is the digraph, to which we would like to define the 84 /// PredMap. 85 85 static PredMap *createPredMap(const Digraph &digraph){ 86 86 return new PredMap(digraph); … … 99 99 /// the minimum cost subgraph which are union of arborescences with the 100 100 /// given sources and spans all the nodes which are reachable from the 101 /// sources. The time complexity of the algorithm is O(n<sup>2</sup>+e).101 /// sources. The time complexity of the algorithm is \f$ O(n^2+e) \f$. 102 102 /// 103 103 /// The algorithm provides also an optimal dual solution, therefore 104 104 /// the optimality of the solution can be checked. 105 105 /// 106 /// \param GRThe digraph type the algorithm runs on. The default value106 /// \param _Digraph The digraph type the algorithm runs on. The default value 107 107 /// is \ref ListDigraph. 108 /// \param CMThis read-only ArcMap determines the costs of the108 /// \param _CostMap This read-only ArcMap determines the costs of the 109 109 /// arcs. It is read once for each arc, so the map may involve in 110 110 /// relatively time consuming process to compute the arc cost if 111 111 /// it is necessary. The default map type is \ref 112 112 /// concepts::Digraph::ArcMap "Digraph::ArcMap<int>". 113 /// \param TRTraits class to set various data types used113 /// \param _Traits Traits class to set various data types used 114 114 /// by the algorithm. The default traits class is 115 115 /// \ref MinCostArborescenceDefaultTraits 116 /// "MinCostArborescenceDefaultTraits< GR, CM>". See \ref116 /// "MinCostArborescenceDefaultTraits<_Digraph, _CostMap>". See \ref 117 117 /// MinCostArborescenceDefaultTraits for the documentation of a 118 118 /// MinCostArborescence traits class. 119 /// 120 /// \author Balazs Dezso 119 121 #ifndef DOXYGEN 120 template <typename GR= ListDigraph,121 typename CM = typename GR::template ArcMap<int>,122 typename TR=123 MinCostArborescenceDefaultTraits<GR, CM> >122 template <typename _Digraph = ListDigraph, 123 typename _CostMap = typename _Digraph::template ArcMap<int>, 124 typename _Traits = 125 MinCostArborescenceDefaultTraits<_Digraph, _CostMap> > 124 126 #else 125 template <typename GR, typename CM, typedef TR>127 template <typename _Digraph, typename _CostMap, typedef _Traits> 126 128 #endif 127 129 class MinCostArborescence { … … 129 131 130 132 /// The traits. 131 typedef TRTraits;133 typedef _Traits Traits; 132 134 /// The type of the underlying digraph. 133 135 typedef typename Traits::Digraph Digraph; … … 439 441 /// \brief Constructor. 440 442 /// 441 /// \param digraph The digraph the algorithm will run on.442 /// \param cost The cost map used by the algorithm.443 /// \param _digraph The digraph the algorithm will run on. 444 /// \param _cost The cost map used by the algorithm. 443 445 MinCostArborescence(const Digraph& digraph, const CostMap& cost) 444 446 : _digraph(&digraph), _cost(&cost), _pred(0), local_pred(false), … … 455 457 /// 456 458 /// Sets the arborescence map. 457 /// \return <tt>(*this)</tt>459 /// \return \c (*this) 458 460 MinCostArborescence& arborescenceMap(ArborescenceMap& m) { 459 461 if (local_arborescence) { … … 468 470 /// 469 471 /// Sets the arborescence map. 470 /// \return <tt>(*this)</tt>472 /// \return \c (*this) 471 473 MinCostArborescence& predMap(PredMap& m) { 472 474 if (local_pred) { -
lemon/path.h
r606 r564 41 41 /// 42 42 /// A structure for representing directed path in a digraph. 43 /// \tparam GRThe digraph type in which the path is.43 /// \tparam _Digraph The digraph type in which the path is. 44 44 /// 45 45 /// In a sense, the path can be treated as a list of arcs. The … … 53 53 /// implementation uses two vectors for storing the front and back 54 54 /// insertions. 55 template <typename GR>55 template <typename _Digraph> 56 56 class Path { 57 57 public: 58 58 59 typedef GRDigraph;59 typedef _Digraph Digraph; 60 60 typedef typename Digraph::Arc Arc; 61 61 … … 138 138 /// \brief The nth arc. 139 139 /// 140 /// \pre \c n is in the <tt>[0..length() - 1]</tt> range.140 /// \pre n is in the [0..length() - 1] range 141 141 const Arc& nth(int n) const { 142 142 return n < int(head.size()) ? *(head.rbegin() + n) : … … 146 146 /// \brief Initialize arc iterator to point to the nth arc 147 147 /// 148 /// \pre \c n is in the <tt>[0..length() - 1]</tt> range.148 /// \pre n is in the [0..length() - 1] range 149 149 ArcIt nthIt(int n) const { 150 150 return ArcIt(*this, n); … … 229 229 /// 230 230 /// A structure for representing directed path in a digraph. 231 /// \tparam GRThe digraph type in which the path is.231 /// \tparam _Digraph The digraph type in which the path is. 232 232 /// 233 233 /// In a sense, the path can be treated as a list of arcs. The … … 241 241 /// then the \c Path type because it use just one vector for the 242 242 /// arcs. 243 template <typename GR>243 template <typename _Digraph> 244 244 class SimplePath { 245 245 public: 246 246 247 typedef GRDigraph;247 typedef _Digraph Digraph; 248 248 typedef typename Digraph::Arc Arc; 249 249 … … 330 330 /// \brief The nth arc. 331 331 /// 332 /// \pre \c n is in the <tt>[0..length() - 1]</tt> range.332 /// \pre n is in the [0..length() - 1] range 333 333 const Arc& nth(int n) const { 334 334 return data[n]; … … 393 393 /// 394 394 /// A structure for representing directed path in a digraph. 395 /// \tparam GRThe digraph type in which the path is.395 /// \tparam _Digraph The digraph type in which the path is. 396 396 /// 397 397 /// In a sense, the path can be treated as a list of arcs. The … … 405 405 /// time. The front and back insertion and erasure is O(1) time 406 406 /// and it can be splited and spliced in O(1) time. 407 template <typename GR>407 template <typename _Digraph> 408 408 class ListPath { 409 409 public: 410 410 411 typedef GRDigraph;411 typedef _Digraph Digraph; 412 412 typedef typename Digraph::Arc Arc; 413 413 … … 508 508 /// 509 509 /// This function looks for the nth arc in O(n) time. 510 /// \pre \c n is in the <tt>[0..length() - 1]</tt> range.510 /// \pre n is in the [0..length() - 1] range 511 511 const Arc& nth(int n) const { 512 512 Node *node = first; … … 733 733 /// 734 734 /// A structure for representing directed path in a digraph. 735 /// \tparam GRThe digraph type in which the path is.735 /// \tparam _Digraph The digraph type in which the path is. 736 736 /// 737 737 /// In a sense, the path can be treated as a list of arcs. The … … 747 747 /// it is intented to be 748 748 /// used when you want to store a large number of paths. 749 template <typename GR>749 template <typename _Digraph> 750 750 class StaticPath { 751 751 public: 752 752 753 typedef GRDigraph;753 typedef _Digraph Digraph; 754 754 typedef typename Digraph::Arc Arc; 755 755 … … 834 834 /// \brief The nth arc. 835 835 /// 836 /// \pre \c n is in the <tt>[0..length() - 1]</tt> range.836 /// \pre n is in the [0..length() - 1] range 837 837 const Arc& nth(int n) const { 838 838 return arcs[n]; -
lemon/preflow.h
r606 r525 33 33 /// Default traits class of Preflow class. 34 34 /// \tparam GR Digraph type. 35 /// \tparam C APCapacity map type.36 template <typename GR, typename C AP>35 /// \tparam CM Capacity map type. 36 template <typename GR, typename CM> 37 37 struct PreflowDefaultTraits { 38 38 … … 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 C APCapacityMap;46 typedef CM CapacityMap; 47 47 48 48 /// \brief The type of the flow values. … … 95 95 /// 96 96 /// This class provides an implementation of Goldberg-Tarjan's \e preflow 97 /// \e push-relabel algorithm producing a \ref max_flow 98 /// "flow of maximum value" in a digraph. 99 /// The preflow algorithms are the fastest known maximum 97 /// \e push-relabel algorithm producing a flow of maximum value in a 98 /// digraph. The preflow algorithms are the fastest known maximum 100 99 /// flow algorithms. The current implementation use a mixture of the 101 100 /// \e "highest label" and the \e "bound decrease" heuristics. … … 107 106 /// 108 107 /// \tparam GR The type of the digraph the algorithm runs on. 109 /// \tparam C APThe type of the capacity map. The default map108 /// \tparam CM The type of the capacity map. The default map 110 109 /// type is \ref concepts::Digraph::ArcMap "GR::ArcMap<int>". 111 110 #ifdef DOXYGEN 112 template <typename GR, typename C AP, typename TR>111 template <typename GR, typename CM, typename TR> 113 112 #else 114 113 template <typename GR, 115 typename C AP= typename GR::template ArcMap<int>,116 typename TR = PreflowDefaultTraits<GR, C AP> >114 typename CM = typename GR::template ArcMap<int>, 115 typename TR = PreflowDefaultTraits<GR, CM> > 117 116 #endif 118 117 class Preflow { … … 196 195 ///@{ 197 196 198 template <typename T>197 template <typename _FlowMap> 199 198 struct SetFlowMapTraits : public Traits { 200 typedef TFlowMap;199 typedef _FlowMap FlowMap; 201 200 static FlowMap *createFlowMap(const Digraph&) { 202 201 LEMON_ASSERT(false, "FlowMap is not initialized"); … … 210 209 /// \ref named-templ-param "Named parameter" for setting FlowMap 211 210 /// type. 212 template <typename T>211 template <typename _FlowMap> 213 212 struct SetFlowMap 214 : public Preflow<Digraph, CapacityMap, SetFlowMapTraits< T> > {213 : public Preflow<Digraph, CapacityMap, SetFlowMapTraits<_FlowMap> > { 215 214 typedef Preflow<Digraph, CapacityMap, 216 SetFlowMapTraits< T> > Create;215 SetFlowMapTraits<_FlowMap> > Create; 217 216 }; 218 217 219 template <typename T>218 template <typename _Elevator> 220 219 struct SetElevatorTraits : public Traits { 221 typedef TElevator;220 typedef _Elevator Elevator; 222 221 static Elevator *createElevator(const Digraph&, int) { 223 222 LEMON_ASSERT(false, "Elevator is not initialized"); … … 235 234 /// \ref run() or \ref init(). 236 235 /// \sa SetStandardElevator 237 template <typename T>236 template <typename _Elevator> 238 237 struct SetElevator 239 : public Preflow<Digraph, CapacityMap, SetElevatorTraits< T> > {238 : public Preflow<Digraph, CapacityMap, SetElevatorTraits<_Elevator> > { 240 239 typedef Preflow<Digraph, CapacityMap, 241 SetElevatorTraits< T> > Create;240 SetElevatorTraits<_Elevator> > Create; 242 241 }; 243 242 244 template <typename T>243 template <typename _Elevator> 245 244 struct SetStandardElevatorTraits : public Traits { 246 typedef TElevator;245 typedef _Elevator Elevator; 247 246 static Elevator *createElevator(const Digraph& digraph, int max_level) { 248 247 return new Elevator(digraph, max_level); … … 262 261 /// before calling \ref run() or \ref init(). 263 262 /// \sa SetElevator 264 template <typename T>263 template <typename _Elevator> 265 264 struct SetStandardElevator 266 265 : public Preflow<Digraph, CapacityMap, 267 SetStandardElevatorTraits< T> > {266 SetStandardElevatorTraits<_Elevator> > { 268 267 typedef Preflow<Digraph, CapacityMap, 269 SetStandardElevatorTraits< T> > Create;268 SetStandardElevatorTraits<_Elevator> > Create; 270 269 }; 271 270 … … 948 947 /// 949 948 /// \note This function calls \ref minCut() for each node, so it runs in 950 /// O(n)time.949 /// \f$O(n)\f$ time. 951 950 /// 952 951 /// \pre Either \ref run() or \ref init() must be called before -
lemon/radix_sort.h
r606 r467 206 206 /// 207 207 /// This is a special quick sort algorithm where the pivot 208 /// values to split the items are choosen to be 2<sup>k</sup>209 /// for each \c k.210 /// Therefore, the time complexity of the algorithm is O(log(c)*n) and211 /// it uses O(log(c)) additional space, where \c c is the maximal value212 /// and \c n is thenumber of the items in the container.208 /// values to split the items are choosen to be \f$ 2^k \f$ for each \c k. 209 /// Therefore, the time complexity of the 210 /// algorithm is \f$ O(\log(c)n) \f$ and it uses \f$ O(\log(c)) \f$, 211 /// additional space, where \c c is the maximal value and \c n is the 212 /// number of the items in the container. 213 213 /// 214 214 /// \param first The begin of the given range. … … 431 431 /// byte-by-byte. First, it counts how many times a byte value occurs 432 432 /// in the container, then it copies the corresponding items to 433 /// another container in asceding order in O(n) time.434 /// 435 /// The time complexity of the algorithm is O(log(c)*n)and436 /// it uses O(n)additional space, where \c c is the433 /// another container in asceding order in \c O(n) time. 434 /// 435 /// The time complexity of the algorithm is \f$ O(\log(c)n) \f$ and 436 /// it uses \f$ O(n) \f$, additional space, where \c c is the 437 437 /// maximal value and \c n is the number of the items in the 438 438 /// container. -
lemon/random.h
r606 r564 604 604 /// function with the <tt>/dev/urandom</tt> file. If it does not success, 605 605 /// it uses the \c seedFromTime(). 606 /// \return Currently always \ctrue.606 /// \return Currently always true. 607 607 bool seed() { 608 608 #ifndef WIN32 … … 625 625 /// \param file The source file 626 626 /// \param offset The offset, from the file read. 627 /// \return \c true when the seeding successes.627 /// \return True when the seeding successes. 628 628 #ifndef WIN32 629 629 bool seedFromFile(const std::string& file = "/dev/urandom", int offset = 0) … … 646 646 /// current process id and the current time for initialize the 647 647 /// random sequence. 648 /// \return Currently always \ctrue.648 /// \return Currently always true. 649 649 bool seedFromTime() { 650 650 #ifndef WIN32 -
lemon/smart_graph.h
r606 r463 226 226 ///Add a new node to the digraph. 227 227 228 /// Add a new node to the digraph.229 /// \return The new node.228 /// \return the new node. 229 /// 230 230 Node addNode() { return Parent::addNode(); } 231 231 … … 234 234 ///Add a new arc to the digraph with source node \c s 235 235 ///and target node \c t. 236 ///\return The new arc.236 ///\return the new arc. 237 237 Arc addArc(const Node& s, const Node& t) { 238 238 return Parent::addArc(s, t); … … 667 667 ///Add a new node to the graph. 668 668 669 /// Add a new node to the graph.670 /// \return The new node.669 /// \return the new node. 670 /// 671 671 Node addNode() { return Parent::addNode(); } 672 672 … … 675 675 ///Add a new edge to the graph with node \c s 676 676 ///and \c t. 677 ///\return The new edge.677 ///\return the new edge. 678 678 Edge addEdge(const Node& s, const Node& t) { 679 679 return Parent::addEdge(s, t); -
lemon/suurballe.h
r606 r566 46 46 /// \ref CapacityScaling "successive shortest path" algorithm. 47 47 /// 48 /// \tparam GRThe digraph type the algorithm runs on.48 /// \tparam Digraph The digraph type the algorithm runs on. 49 49 /// The default value is \c ListDigraph. 50 /// \tparam L ENThe type of the length (cost) map.50 /// \tparam LengthMap The type of the length (cost) map. 51 51 /// The default value is <tt>Digraph::ArcMap<int></tt>. 52 52 /// … … 56 56 /// with \ref SplitNodes. 57 57 #ifdef DOXYGEN 58 template <typename GR, typename LEN>58 template <typename Digraph, typename LengthMap> 59 59 #else 60 template < typename GR= ListDigraph,61 typename L EN = typename GR::template ArcMap<int> >60 template < typename Digraph = ListDigraph, 61 typename LengthMap = typename Digraph::template ArcMap<int> > 62 62 #endif 63 63 class Suurballe 64 64 { 65 TEMPLATE_DIGRAPH_TYPEDEFS(GR); 66 65 TEMPLATE_DIGRAPH_TYPEDEFS(Digraph); 66 67 typedef typename LengthMap::Value Length; 67 68 typedef ConstMap<Arc, int> ConstArcMap; 68 typedef typename GR::template NodeMap<Arc> PredMap;69 typedef typename Digraph::template NodeMap<Arc> PredMap; 69 70 70 71 public: 71 72 72 /// The type of the digraph the algorithm runs on.73 typedef GR Digraph;74 /// The type of the length map.75 typedef LEN LengthMap;76 /// The type of the lengths.77 typedef typename LengthMap::Value Length;78 73 /// The type of the flow map. 79 74 typedef typename Digraph::template ArcMap<int> FlowMap; … … 262 257 /// the found arc-disjoint paths. 263 258 /// 264 /// \return <tt>(*this)</tt>259 /// \return \c (*this) 265 260 Suurballe& flowMap(FlowMap &map) { 266 261 if (_local_flow) { … … 279 274 /// minimum cost flow problem. 280 275 /// 281 /// \return <tt>(*this)</tt>276 /// \return \c (*this) 282 277 Suurballe& potentialMap(PotentialMap &map) { 283 278 if (_local_potential) { … … 464 459 /// 465 460 /// This function returns the total length (cost) of the found paths 466 /// (flow). The complexity of the function is O(e).461 /// (flow). The complexity of the function is \f$ O(e) \f$. 467 462 /// 468 463 /// \pre \ref run() or \ref findFlow() must be called before using -
lemon/unionfind.h
r606 r463 52 52 /// \pre You need to add all the elements by the \ref insert() 53 53 /// method. 54 template <typename IM>54 template <typename _ItemIntMap> 55 55 class UnionFind { 56 56 public: 57 57 58 ///\e 59 typedef IM ItemIntMap; 60 ///\e 58 typedef _ItemIntMap ItemIntMap; 61 59 typedef typename ItemIntMap::Key Item; 62 60 … … 173 171 /// method. 174 172 /// 175 template <typename IM>173 template <typename _ItemIntMap> 176 174 class UnionFindEnum { 177 175 public: 178 176 179 ///\e 180 typedef IM ItemIntMap; 181 ///\e 177 typedef _ItemIntMap ItemIntMap; 182 178 typedef typename ItemIntMap::Key Item; 183 179 … … 632 628 /// \pre You need to add all the elements by the \ref insert() 633 629 /// method. 634 template <typename IM>630 template <typename _ItemIntMap> 635 631 class ExtendFindEnum { 636 632 public: 637 633 638 ///\e 639 typedef IM ItemIntMap; 640 ///\e 634 typedef _ItemIntMap ItemIntMap; 641 635 typedef typename ItemIntMap::Key Item; 642 636 … … 955 949 /// \pre You need to add all the elements by the \ref insert() 956 950 /// method. 957 template <typename V, typename IM, typename Comp = std::less<V> > 951 /// 952 template <typename _Value, typename _ItemIntMap, 953 typename _Comp = std::less<_Value> > 958 954 class HeapUnionFind { 959 955 public: 960 956 961 ///\e 962 typedef V Value; 963 ///\e 964 typedef typename IM::Key Item; 965 ///\e 966 typedef IM ItemIntMap; 967 ///\e 968 typedef Comp Compare; 957 typedef _Value Value; 958 typedef typename _ItemIntMap::Key Item; 959 960 typedef _ItemIntMap ItemIntMap; 961 962 typedef _Comp Comp; 969 963 970 964 private: … … 1608 1602 /// \brief Gives back the priority of the current item. 1609 1603 /// 1610 /// Gives back the priority of the current item.1604 /// \return Gives back the priority of the current item. 1611 1605 const Value& operator[](const Item& item) const { 1612 1606 return nodes[index[item]].prio; … … 1653 1647 /// \brief Gives back the minimum priority of the class. 1654 1648 /// 1655 /// Gives back the minimum priority of the class.1649 /// \return Gives back the minimum priority of the class. 1656 1650 const Value& classPrio(int cls) const { 1657 1651 return nodes[~(classes[cls].parent)].prio; … … 1667 1661 /// \brief Gives back a representant item of the class. 1668 1662 /// 1669 /// Gives back a representant item of the class.1670 1663 /// The representant is indpendent from the priorities of the 1671 1664 /// items. 1665 /// \return Gives back a representant item of the class. 1672 1666 const Item& classRep(int id) const { 1673 1667 int parent = classes[id].parent;
Note: See TracChangeset
for help on using the changeset viewer.