Changeset 910:5a89cacf17f1 in lemon-0.x
- Timestamp:
- 09/27/04 20:11:27 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1221
- Location:
- src/hugo
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/hugo/graph_wrapper.h
r906 r910 28 28 #include <hugo/invalid.h> 29 29 #include <hugo/maps.h> 30 #include <hugo/map_defines.h> 30 31 #include <iostream> 31 32 … … 315 316 /// This wrapper shows a graph with filtered node-set and 316 317 /// edge-set. Given a bool-valued map on the node-set and one on 317 /// the edge-set of the graphs, the iterators show sonly the objects318 /// the edge-set of the graphs, the iterators show only the objects 318 319 /// having true value. 319 320 /// The quick brown fox iterators jump over … … 578 579 }; 579 580 580 /// \brief An undirected graph template.581 ///582 ///\warning Graph wrappers are in even more experimental state than the other583 ///parts of the lib. Use them at your own risk.584 ///585 /// An undirected graph template.586 /// This class works as an undirected graph and a directed graph of587 /// class \c Graph is used for the physical storage.588 /// \ingroup graphs581 // /// \brief An undirected graph template. 582 // /// 583 // ///\warning Graph wrappers are in even more experimental state than the other 584 // ///parts of the lib. Use them at your own risk. 585 // /// 586 // /// An undirected graph template. 587 // /// This class works as an undirected graph and a directed graph of 588 // /// class \c Graph is used for the physical storage. 589 // /// \ingroup graphs 589 590 template<typename Graph> 590 591 class UndirGraph : public UndirGraphWrapper<Graph> { … … 609 610 /// 610 611 /// Suppose that for a directed graph $G=(V, A)$, 611 /// two predicates on the edge-set, $forward_filter$, and $backward_filter$ 612 /// two bool valued maps on the edge-set, 613 /// $forward_filter$, and $backward_filter$ 612 614 /// is given, and we are dealing with the directed graph 613 615 /// a $G'=(V, \{uv : uv\in A \mbox{ and } forward_filter(uv) \mbox{ is true}\}+\{vu : uv\in A \mbox{ and } backward_filter(uv) \mbox{ is true}\})$. … … 622 624 /// But BidirGraphWrapper is obtained from 623 625 /// SubBidirGraphWrapper by considering everywhere true 624 /// predicates bothforward_filter and backward_filter.626 /// valued maps both for forward_filter and backward_filter. 625 627 /// Finally, one of the most important applications of SubBidirGraphWrapper 626 628 /// is ResGraphWrapper, which stands for the residual graph in directed … … 629 631 /// above mentioned graph structure without its physical storage, 630 632 /// that is the whole stuff eats constant memory. 631 /// As the oppositely directed edges are logical different,633 /// As the oppositely directed edges are logically different, 632 634 /// the maps are able to attach different values for them. 633 635 template<typename Graph, … … 671 673 typedef typename Graph::Edge GraphEdge; 672 674 /// SubBidirGraphWrapper<..., ..., ...>::Edge is inherited from 673 /// Graph::Edge. It contains an extra bool flag which shows if the 675 /// Graph::Edge. It contains an extra bool flag which is true 676 /// if and only if the 674 677 /// edge is the backward version of the original edge. 675 678 class Edge : public Graph::Edge { … … 1131 1134 /// \brief Residual capacity map. 1132 1135 /// 1133 /// In generic residual graphs the residual capacity can be obtained as a map. Not tested. 1136 /// In generic residual graphs the residual capacity can be obtained 1137 /// as a map. 1134 1138 class ResCap { 1135 1139 protected: -
src/hugo/min_cost_flow.h
r906 r910 72 72 73 73 74 typedef ResGraphWrapper<const Graph,int,CapacityMap,EdgeIntMap> ResG raphType;75 typedef typename ResG raphType::Edge ResGraphEdge;74 typedef ResGraphWrapper<const Graph,int,CapacityMap,EdgeIntMap> ResGW; 75 typedef typename ResGW::Edge ResGraphEdge; 76 76 77 77 class ModLengthMap { 78 78 typedef typename Graph::template NodeMap<Length> NodeMap; 79 const ResG raphType& G;79 const ResGW& G; 80 80 const LengthMap &ol; 81 81 const NodeMap &pot; … … 84 84 typedef typename LengthMap::ValueType ValueType; 85 85 86 ValueType operator[](typename ResG raphType::Edge e) const {86 ValueType operator[](typename ResGW::Edge e) const { 87 87 if (G.forward(e)) 88 88 return ol[e]-(pot[G.head(e)]-pot[G.tail(e)]); … … 91 91 } 92 92 93 ModLengthMap(const ResG raphType& _G,93 ModLengthMap(const ResGW& _G, 94 94 const LengthMap &o, const NodeMap &p) : 95 95 G(_G), /*rev(_rev),*/ ol(o), pot(p){}; … … 153 153 154 154 //We need a residual graph 155 ResG raphTyperes_graph(G, capacity, flow);155 ResGW res_graph(G, capacity, flow); 156 156 157 157 158 158 ModLengthMap mod_length(res_graph, length, potential); 159 159 160 Dijkstra<ResG raphType, ModLengthMap> dijkstra(res_graph, mod_length);160 Dijkstra<ResGW, ModLengthMap> dijkstra(res_graph, mod_length); 161 161 162 162 int i; … … 169 169 170 170 //We have to change the potential 171 for(typename ResG raphType::NodeIt n(res_graph); n!=INVALID; ++n)171 for(typename ResGW::NodeIt n(res_graph); n!=INVALID; ++n) 172 172 potential[n] += dijkstra.distMap()[n]; 173 173 -
src/hugo/tight_edge_filter_map.h
r906 r910 17 17 #ifndef HUGO_TIGHT_EDGE_FILTER_MAP_H 18 18 #define HUGO_TIGHT_EDGE_FILTER_MAP_H 19 20 #include <hugo/maps.h> 19 21 20 22 // /// \file … … 39 41 template<typename Graph, 40 42 typename NodePotentialMap, typename EdgeDistanceMap> 41 class TightEdgeFilterMap {43 class TightEdgeFilterMap : public MapBase<typename Graph::Edge, bool> { 42 44 protected: 43 45 const Graph* g;
Note: See TracChangeset
for help on using the changeset viewer.