[Lemon-commits] [lemon_svn] marci: r1221 - hugo/trunk/src/hugo
Lemon SVN
svn at lemon.cs.elte.hu
Mon Nov 6 20:43:58 CET 2006
Author: marci
Date: Mon Sep 27 20:11:27 2004
New Revision: 1221
Modified:
hugo/trunk/src/hugo/graph_wrapper.h
hugo/trunk/src/hugo/min_cost_flow.h
hugo/trunk/src/hugo/tight_edge_filter_map.h
Log:
minor corrections
Modified: hugo/trunk/src/hugo/graph_wrapper.h
==============================================================================
--- hugo/trunk/src/hugo/graph_wrapper.h (original)
+++ hugo/trunk/src/hugo/graph_wrapper.h Mon Sep 27 20:11:27 2004
@@ -27,6 +27,7 @@
#include <hugo/invalid.h>
#include <hugo/maps.h>
+#include <hugo/map_defines.h>
#include <iostream>
namespace hugo {
@@ -314,7 +315,7 @@
///
/// This wrapper shows a graph with filtered node-set and
/// edge-set. Given a bool-valued map on the node-set and one on
- /// the edge-set of the graphs, the iterators shows only the objects
+ /// the edge-set of the graphs, the iterators show only the objects
/// having true value.
/// The quick brown fox iterators jump over
/// the lazy dog nodes or edges if their values for are false in the
@@ -577,15 +578,15 @@
};
- /// \brief An undirected graph template.
- ///
- ///\warning Graph wrappers are in even more experimental state than the other
- ///parts of the lib. Use them at your own risk.
- ///
- /// An undirected graph template.
- /// This class works as an undirected graph and a directed graph of
- /// class \c Graph is used for the physical storage.
- /// \ingroup graphs
+// /// \brief An undirected graph template.
+// ///
+// ///\warning Graph wrappers are in even more experimental state than the other
+// ///parts of the lib. Use them at your own risk.
+// ///
+// /// An undirected graph template.
+// /// This class works as an undirected graph and a directed graph of
+// /// class \c Graph is used for the physical storage.
+// /// \ingroup graphs
template<typename Graph>
class UndirGraph : public UndirGraphWrapper<Graph> {
typedef UndirGraphWrapper<Graph> Parent;
@@ -608,7 +609,8 @@
///parts of the lib. Use them at you own risk.
///
/// Suppose that for a directed graph $G=(V, A)$,
- /// two predicates on the edge-set, $forward_filter$, and $backward_filter$
+ /// two bool valued maps on the edge-set,
+ /// $forward_filter$, and $backward_filter$
/// is given, and we are dealing with the directed graph
/// 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}\})$.
/// The purpose of writing + instead of union is because parallel
@@ -621,14 +623,14 @@
/// \c RevGraphWrapper is implemented in a different way.
/// But BidirGraphWrapper is obtained from
/// SubBidirGraphWrapper by considering everywhere true
- /// predicates both forward_filter and backward_filter.
+ /// valued maps both for forward_filter and backward_filter.
/// Finally, one of the most important applications of SubBidirGraphWrapper
/// is ResGraphWrapper, which stands for the residual graph in directed
/// flow and circulation problems.
/// As wrappers usually, the SubBidirGraphWrapper implements the
/// above mentioned graph structure without its physical storage,
/// that is the whole stuff eats constant memory.
- /// As the oppositely directed edges are logical different,
+ /// As the oppositely directed edges are logically different,
/// the maps are able to attach different values for them.
template<typename Graph,
typename ForwardFilterMap, typename BackwardFilterMap>
@@ -670,7 +672,8 @@
typedef typename Graph::Edge GraphEdge;
/// SubBidirGraphWrapper<..., ..., ...>::Edge is inherited from
- /// Graph::Edge. It contains an extra bool flag which shows if the
+ /// Graph::Edge. It contains an extra bool flag which is true
+ /// if and only if the
/// edge is the backward version of the original edge.
class Edge : public Graph::Edge {
friend class SubBidirGraphWrapper<Graph,
@@ -1130,7 +1133,8 @@
/// \brief Residual capacity map.
///
- /// In generic residual graphs the residual capacity can be obtained as a map. Not tested.
+ /// In generic residual graphs the residual capacity can be obtained
+ /// as a map.
class ResCap {
protected:
const ResGraphWrapper<Graph, Number, CapacityMap, FlowMap>* res_graph;
Modified: hugo/trunk/src/hugo/min_cost_flow.h
==============================================================================
--- hugo/trunk/src/hugo/min_cost_flow.h (original)
+++ hugo/trunk/src/hugo/min_cost_flow.h Mon Sep 27 20:11:27 2004
@@ -71,26 +71,26 @@
typedef typename Graph::template EdgeMap<int> EdgeIntMap;
- typedef ResGraphWrapper<const Graph,int,CapacityMap,EdgeIntMap> ResGraphType;
- typedef typename ResGraphType::Edge ResGraphEdge;
+ typedef ResGraphWrapper<const Graph,int,CapacityMap,EdgeIntMap> ResGW;
+ typedef typename ResGW::Edge ResGraphEdge;
class ModLengthMap {
typedef typename Graph::template NodeMap<Length> NodeMap;
- const ResGraphType& G;
+ const ResGW& G;
const LengthMap &ol;
const NodeMap &pot;
public :
typedef typename LengthMap::KeyType KeyType;
typedef typename LengthMap::ValueType ValueType;
- ValueType operator[](typename ResGraphType::Edge e) const {
+ ValueType operator[](typename ResGW::Edge e) const {
if (G.forward(e))
return ol[e]-(pot[G.head(e)]-pot[G.tail(e)]);
else
return -ol[e]-(pot[G.head(e)]-pot[G.tail(e)]);
}
- ModLengthMap(const ResGraphType& _G,
+ ModLengthMap(const ResGW& _G,
const LengthMap &o, const NodeMap &p) :
G(_G), /*rev(_rev),*/ ol(o), pot(p){};
};//ModLengthMap
@@ -152,12 +152,12 @@
//We need a residual graph
- ResGraphType res_graph(G, capacity, flow);
+ ResGW res_graph(G, capacity, flow);
ModLengthMap mod_length(res_graph, length, potential);
- Dijkstra<ResGraphType, ModLengthMap> dijkstra(res_graph, mod_length);
+ Dijkstra<ResGW, ModLengthMap> dijkstra(res_graph, mod_length);
int i;
for (i=0; i<k; ++i){
@@ -168,7 +168,7 @@
};
//We have to change the potential
- for(typename ResGraphType::NodeIt n(res_graph); n!=INVALID; ++n)
+ for(typename ResGW::NodeIt n(res_graph); n!=INVALID; ++n)
potential[n] += dijkstra.distMap()[n];
Modified: hugo/trunk/src/hugo/tight_edge_filter_map.h
==============================================================================
--- hugo/trunk/src/hugo/tight_edge_filter_map.h (original)
+++ hugo/trunk/src/hugo/tight_edge_filter_map.h Mon Sep 27 20:11:27 2004
@@ -17,6 +17,8 @@
#ifndef HUGO_TIGHT_EDGE_FILTER_MAP_H
#define HUGO_TIGHT_EDGE_FILTER_MAP_H
+#include <hugo/maps.h>
+
// /// \file
// /// \brief Maximum flow algorithms.
// /// \ingroup galgs
@@ -38,7 +40,7 @@
/// types, e.g. with int.
template<typename Graph,
typename NodePotentialMap, typename EdgeDistanceMap>
- class TightEdgeFilterMap {
+ class TightEdgeFilterMap : public MapBase<typename Graph::Edge, bool> {
protected:
const Graph* g;
NodePotentialMap* node_potential;
More information about the Lemon-commits
mailing list