1.1 --- a/src/work/alpar/gwrapper.h Fri Feb 20 00:29:19 2004 +0000
1.2 +++ b/src/work/alpar/gwrapper.h Fri Feb 20 21:45:07 2004 +0000
1.3 @@ -2,7 +2,7 @@
1.4 #ifndef GRAPH_WRAPPER_H
1.5 #define GRAPH_WRAPPER_H
1.6
1.7 -namespace marci {
1.8 +namespace hugo {
1.9
1.10 template<typename G>
1.11 class TrivGraphWrapper
2.1 --- a/src/work/alpar/smart_graph.h Fri Feb 20 00:29:19 2004 +0000
2.2 +++ b/src/work/alpar/smart_graph.h Fri Feb 20 21:45:07 2004 +0000
2.3 @@ -1,10 +1,12 @@
2.4 +// -*- mode:C++ -*-
2.5 +
2.6 #ifndef SMART_GRAPH_H
2.7 #define SMART_GRAPH_H
2.8
2.9 #include <iostream>
2.10 #include <vector>
2.11
2.12 -namespace marci {
2.13 +namespace hugo {
2.14
2.15 class SmartGraph {
2.16
2.17 @@ -35,58 +37,17 @@
2.18 class OutEdgeIt;
2.19 class InEdgeIt;
2.20
2.21 -// class NodeIt { int n; };
2.22 -// class EachNodeIt : public NodeIt { };
2.23 -// class EdgeIt { int n; };
2.24 -// class EachEdgeIt : public EdgeIt {};
2.25 -// class OutEdgeIt : public EdgeIt {};
2.26 -// class InEdgeIt : public EdgeIt {};
2.27 + // class NodeIt { int n; };
2.28 + // class EachNodeIt : public NodeIt { };
2.29 + // class EdgeIt { int n; };
2.30 + // class EachEdgeIt : public EdgeIt {};
2.31 + // class OutEdgeIt : public EdgeIt {};
2.32 + // class InEdgeIt : public EdgeIt {};
2.33 // class SymEdgeIt;
2.34 -
2.35 - template <typename T> class NodeMap;
2.36 +
2.37 + template <typename T> class NodeMap;
2.38 template <typename T> class EdgeMap;
2.39
2.40 - private:
2.41 -
2.42 - template <typename T> friend class NodeMap;
2.43 - template <typename T> friend class EdgeMap;
2.44 -
2.45 - template <typename T>
2.46 - class NodeMap {
2.47 - const SmartGraph& G;
2.48 - std::vector<T> container;
2.49 - public:
2.50 - typedef T ValueType;
2.51 - typedef NodeIt KeyType;
2.52 - NodeMap(const SmartGraph& _G) : G(_G), container(G.nodeNum()) { }
2.53 - NodeMap(const SmartGraph& _G, T a) :
2.54 - G(_G), container(G.nodeNum(), a) { }
2.55 - void set(NodeIt n, T a) { container[n.n]=a; }
2.56 - T get(NodeIt n) const { return container[n.n]; }
2.57 - T& operator[](NodeIt n) { return container[n.n]; }
2.58 - const T& operator[](NodeIt n) const { return container[n.n]; }
2.59 - void resize() { container.resize(G.nodeNum()); }
2.60 - void resize(T a) { container.resize(G.nodeNum(), a); }
2.61 - };
2.62 -
2.63 - template <typename T>
2.64 - class EdgeMap {
2.65 - const SmartGraph& G;
2.66 - std::vector<T> container;
2.67 - public:
2.68 - typedef T ValueType;
2.69 - typedef EdgeIt KeyType;
2.70 - EdgeMap(const SmartGraph& _G) : G(_G), container(G.edgeNum()) { }
2.71 - EdgeMap(const SmartGraph& _G, T a) :
2.72 - G(_G), container(G.edgeNum(), a) { }
2.73 - void set(EdgeIt e, T a) { container[e.n]=a; }
2.74 - T get(EdgeIt e) const { return container[e.n]; }
2.75 - T& operator[](EdgeIt e) { return container[e.n]; }
2.76 - const T& operator[](EdgeIt e) const { return container[e.n]; }
2.77 - void resize() { container.resize(G.edgeNum()); }
2.78 - void resize(T a) { container.resize(G.edgeNum(), a); }
2.79 - };
2.80 -
2.81 public:
2.82
2.83 /* default constructor */
2.84 @@ -136,8 +97,9 @@
2.85 bool valid(EachEdgeIt e) const { return e.n<int(edges.size()); }
2.86 bool valid(NodeIt n) const { return n.n<int(nodes.size()); }
2.87
2.88 - template <typename It> It next(It it) const {
2.89 - It tmp(it); return goNext(it); }
2.90 + template <typename It> It next(It it) const
2.91 + // { It tmp(it); return goNext(tmp); }
2.92 + { It tmp; tmp.n=it.n+1; return tmp; }
2.93
2.94 NodeIt& goNext(NodeIt& it) const { ++it.n; return it; }
2.95 OutEdgeIt& goNext(OutEdgeIt& it) const
2.96 @@ -228,7 +190,49 @@
2.97 InEdgeIt() : EdgeIt() { }
2.98 InEdgeIt(const SmartGraph& G,NodeIt v) :EdgeIt(G.nodes[v.n].first_in){}
2.99 };
2.100 +
2.101 + // Map types
2.102 +
2.103 + template <typename T>
2.104 + class NodeMap {
2.105 + const SmartGraph& G;
2.106 + std::vector<T> container;
2.107 + public:
2.108 + typedef T ValueType;
2.109 + typedef NodeIt KeyType;
2.110 + NodeMap(const SmartGraph& _G) : G(_G), container(G.nodeNum()) { }
2.111 + NodeMap(const SmartGraph& _G, T a) :
2.112 + G(_G), container(G.nodeNum(), a) { }
2.113 + void set(NodeIt n, T a) { container[n.n]=a; }
2.114 + T get(NodeIt n) const { return container[n.n]; }
2.115 + T& operator[](NodeIt n) { return container[n.n]; }
2.116 + const T& operator[](NodeIt n) const { return container[n.n]; }
2.117 + void update() { container.resize(G.nodeNum()); }
2.118 + void update(T a) { container.resize(G.nodeNum(), a); }
2.119 + };
2.120 +
2.121 + template <typename T>
2.122 + class EdgeMap {
2.123 + const SmartGraph& G;
2.124 + std::vector<T> container;
2.125 + public:
2.126 + typedef T ValueType;
2.127 + typedef EdgeIt KeyType;
2.128 + EdgeMap(const SmartGraph& _G) : G(_G), container(G.edgeNum()) { }
2.129 + EdgeMap(const SmartGraph& _G, T a) :
2.130 + G(_G), container(G.edgeNum(), a) { }
2.131 + void set(EdgeIt e, T a) { container[e.n]=a; }
2.132 + T get(EdgeIt e) const { return container[e.n]; }
2.133 + T& operator[](EdgeIt e) { return container[e.n]; }
2.134 + const T& operator[](EdgeIt e) const { return container[e.n]; }
2.135 + void update() { container.resize(G.edgeNum()); }
2.136 + void update(T a) { container.resize(G.edgeNum(), a); }
2.137 + };
2.138 +
2.139 +
2.140 +
2.141 +
2.142 };
2.143 -} //namespace marci
2.144 +} //namespace hugo
2.145
2.146 #endif //SMART_GRAPH_H
3.1 --- a/src/work/athos/pf_demo.cc Fri Feb 20 00:29:19 2004 +0000
3.2 +++ b/src/work/athos/pf_demo.cc Fri Feb 20 21:45:07 2004 +0000
3.3 @@ -7,7 +7,7 @@
3.4 //#include "marci_property_vector.hh"
3.5 #include "preflow_push.hh"
3.6
3.7 -using namespace marci;
3.8 +using namespace hugo;
3.9
3.10
3.11 int main (int, char*[])
4.1 --- a/src/work/athos/preflow_push.hh Fri Feb 20 00:29:19 2004 +0000
4.2 +++ b/src/work/athos/preflow_push.hh Fri Feb 20 21:45:07 2004 +0000
4.3 @@ -12,7 +12,7 @@
4.4
4.5 using namespace std;
4.6
4.7 -namespace marci {
4.8 +namespace hugo {
4.9
4.10 template <typename graph_type, typename T>
4.11 class preflow_push {
4.12 @@ -434,6 +434,6 @@
4.13 }//run
4.14
4.15
4.16 -}//namespace marci
4.17 +}//namespace hugo
4.18
4.19 #endif //PREFLOW_PUSH_HH
5.1 --- a/src/work/athos/reverse_bfs.hh Fri Feb 20 00:29:19 2004 +0000
5.2 +++ b/src/work/athos/reverse_bfs.hh Fri Feb 20 21:45:07 2004 +0000
5.3 @@ -96,7 +96,7 @@
5.4
5.5 };
5.6
5.7 -} // namespace marci
5.8 +} // namespace hugo
5.9
5.10 #endif //REVERSE_BFS_HH
5.11
6.1 --- a/src/work/bfs_iterator.hh Fri Feb 20 00:29:19 2004 +0000
6.2 +++ b/src/work/bfs_iterator.hh Fri Feb 20 21:45:07 2004 +0000
6.3 @@ -6,7 +6,7 @@
6.4 #include <utility>
6.5 #include <graph_wrapper.h>
6.6
6.7 -namespace marci {
6.8 +namespace hugo {
6.9
6.10 template <typename Graph>
6.11 struct bfs {
6.12 @@ -755,6 +755,6 @@
6.13
6.14
6.15
6.16 -} // namespace marci
6.17 +} // namespace hugo
6.18
6.19 #endif //BFS_ITERATOR_HH
7.1 --- a/src/work/bin_heap_demo.cc Fri Feb 20 00:29:19 2004 +0000
7.2 +++ b/src/work/bin_heap_demo.cc Fri Feb 20 21:45:07 2004 +0000
7.3 @@ -3,7 +3,7 @@
7.4 #include <string>
7.5 #include <map>
7.6
7.7 -using namespace marci;
7.8 +using namespace hugo;
7.9 using namespace std;
7.10
7.11 class string_int_map;
8.1 --- a/src/work/jacint/dijkstra.hh Fri Feb 20 00:29:19 2004 +0000
8.2 +++ b/src/work/jacint/dijkstra.hh Fri Feb 20 21:45:07 2004 +0000
8.3 @@ -52,7 +52,7 @@
8.4
8.5
8.6 namespace std {
8.7 - namespace marci {
8.8 + namespace hugo {
8.9
8.10
8.11
8.12 @@ -185,7 +185,7 @@
8.13
8.14
8.15
8.16 - } // namespace marci
8.17 + } // namespace hugo
8.18 }
8.19 #endif //DIJKSTRA_HH
8.20
9.1 --- a/src/work/jacint/flow_test.cc Fri Feb 20 00:29:19 2004 +0000
9.2 +++ b/src/work/jacint/flow_test.cc Fri Feb 20 21:45:07 2004 +0000
9.3 @@ -8,7 +8,7 @@
9.4 #include <reverse_bfs.h>
9.5 //#include <dijkstra.h>
9.6
9.7 -using namespace marci;
9.8 +using namespace hugo;
9.9
9.10
9.11 int main (int, char*[])
10.1 --- a/src/work/jacint/preflow_hl2.h Fri Feb 20 00:29:19 2004 +0000
10.2 +++ b/src/work/jacint/preflow_hl2.h Fri Feb 20 21:45:07 2004 +0000
10.3 @@ -41,7 +41,7 @@
10.4 #include <stack>
10.5 #include <queue>
10.6
10.7 -namespace marci {
10.8 +namespace hugo {
10.9
10.10 template <typename Graph, typename T,
10.11 typename FlowMap=typename Graph::EdgeMap<T>, typename CapMap=typename Graph::EdgeMap<T>,
10.12 @@ -396,7 +396,7 @@
10.13
10.14
10.15 };
10.16 -}//namespace marci
10.17 +}//namespace hugo
10.18 #endif
10.19
10.20
11.1 --- a/src/work/jacint/preflow_hl3.h Fri Feb 20 00:29:19 2004 +0000
11.2 +++ b/src/work/jacint/preflow_hl3.h Fri Feb 20 21:45:07 2004 +0000
11.3 @@ -44,7 +44,7 @@
11.4 #include <stack>
11.5 #include <queue>
11.6
11.7 -namespace marci {
11.8 +namespace hugo {
11.9
11.10 template <typename Graph, typename T,
11.11 typename FlowMap=typename Graph::EdgeMap<T>, typename CapMap=typename Graph::EdgeMap<T>,
11.12 @@ -464,7 +464,7 @@
11.13
11.14
11.15 };
11.16 -}//namespace marci
11.17 +}//namespace hugo
11.18 #endif
11.19
11.20
12.1 --- a/src/work/jacint/preflow_hl4.h Fri Feb 20 00:29:19 2004 +0000
12.2 +++ b/src/work/jacint/preflow_hl4.h Fri Feb 20 21:45:07 2004 +0000
12.3 @@ -44,7 +44,7 @@
12.4 #include <stack>
12.5 #include <queue>
12.6
12.7 -namespace marci {
12.8 +namespace hugo {
12.9
12.10 template <typename Graph, typename T,
12.11 typename FlowMap=typename Graph::EdgeMap<T>,
12.12 @@ -478,7 +478,7 @@
12.13
12.14
12.15 };
12.16 -}//namespace marci
12.17 +}//namespace hugo
12.18 #endif
12.19
12.20
13.1 --- a/src/work/jacint/preflow_push_hl.h Fri Feb 20 00:29:19 2004 +0000
13.2 +++ b/src/work/jacint/preflow_push_hl.h Fri Feb 20 21:45:07 2004 +0000
13.3 @@ -43,7 +43,7 @@
13.4 #include <stack>
13.5 #include <queue>
13.6
13.7 -namespace marci {
13.8 +namespace hugo {
13.9
13.10 template <typename Graph, typename T,
13.11 typename FlowMap=typename Graph::EdgeMap<T>, typename CapMap=typename Graph::EdgeMap<T>,
13.12 @@ -390,7 +390,7 @@
13.13
13.14
13.15 };
13.16 -}//namespace marci
13.17 +}//namespace hugo
13.18 #endif
13.19
13.20
14.1 --- a/src/work/jacint/preflow_push_hl.hh Fri Feb 20 00:29:19 2004 +0000
14.2 +++ b/src/work/jacint/preflow_push_hl.hh Fri Feb 20 21:45:07 2004 +0000
14.3 @@ -32,7 +32,7 @@
14.4 #include <marci_property_vector.hh>
14.5 #include <reverse_bfs.hh>
14.6
14.7 -namespace marci {
14.8 +namespace hugo {
14.9
14.10 template <typename graph_type, typename T>
14.11 class preflow_push_hl {
14.12 @@ -312,7 +312,7 @@
14.13
14.14
14.15 };
14.16 -}//namespace marci
14.17 +}//namespace hugo
14.18 #endif
14.19
14.20
15.1 --- a/src/work/jacint/preflow_push_max_flow.h Fri Feb 20 00:29:19 2004 +0000
15.2 +++ b/src/work/jacint/preflow_push_max_flow.h Fri Feb 20 21:45:07 2004 +0000
15.3 @@ -33,7 +33,7 @@
15.4 #include <reverse_bfs.h>
15.5
15.6
15.7 -namespace marci {
15.8 +namespace hugo {
15.9
15.10 template <typename Graph, typename T,
15.11 typename FlowMap=typename Graph::EdgeMap<T>, typename CapMap=typename Graph::EdgeMap<T>,
15.12 @@ -287,7 +287,7 @@
15.13
15.14
15.15 };
15.16 -}//namespace marci
15.17 +}//namespace hugo
15.18 #endif
15.19
15.20
16.1 --- a/src/work/jacint/preflow_push_max_flow.hh Fri Feb 20 00:29:19 2004 +0000
16.2 +++ b/src/work/jacint/preflow_push_max_flow.hh Fri Feb 20 21:45:07 2004 +0000
16.3 @@ -32,7 +32,7 @@
16.4 #include <reverse_bfs.hh>
16.5
16.6
16.7 -namespace marci {
16.8 +namespace hugo {
16.9
16.10 template <typename graph_type, typename T>
16.11 class preflow_push_max_flow {
16.12 @@ -306,7 +306,7 @@
16.13
16.14
16.15 };
16.16 -}//namespace marci
16.17 +}//namespace hugo
16.18 #endif
16.19
16.20
17.1 --- a/src/work/jacint/reverse_bfs.h Fri Feb 20 00:29:19 2004 +0000
17.2 +++ b/src/work/jacint/reverse_bfs.h Fri Feb 20 21:45:07 2004 +0000
17.3 @@ -82,7 +82,7 @@
17.4
17.5 };
17.6
17.7 -} // namespace marci
17.8 +} // namespace hugo
17.9
17.10 #endif //REVERSE_BFS_HH
17.11
18.1 --- a/src/work/jacint/reverse_bfs.hh Fri Feb 20 00:29:19 2004 +0000
18.2 +++ b/src/work/jacint/reverse_bfs.hh Fri Feb 20 21:45:07 2004 +0000
18.3 @@ -87,7 +87,7 @@
18.4
18.5 };
18.6
18.7 -} // namespace marci
18.8 +} // namespace hugo
18.9
18.10 #endif //REVERSE_BFS_HH
18.11
19.1 --- a/src/work/marci/dimacs.hh Fri Feb 20 00:29:19 2004 +0000
19.2 +++ b/src/work/marci/dimacs.hh Fri Feb 20 21:45:07 2004 +0000
19.3 @@ -5,7 +5,7 @@
19.4 #include <string>
19.5 #include <vector>
19.6
19.7 -namespace marci {
19.8 +namespace hugo {
19.9
19.10 template<typename Graph, typename CapacityMap>
19.11 void readDimacsMaxFlow(std::istream& is, Graph &G, typename Graph::NodeIt &s, typename Graph::NodeIt &t, CapacityMap& capacity) {
19.12 @@ -49,13 +49,13 @@
19.13 is >> i >> j >> cap;
19.14 getline(is, str);
19.15 typename Graph::EdgeIt e=G.addEdge(nodes[i], nodes[j]);
19.16 - capacity.resize();
19.17 + capacity.update();
19.18 capacity.set(e, cap);
19.19 break;
19.20 }
19.21 }
19.22 }
19.23
19.24 -} //namespace marci
19.25 +} //namespace hugo
19.26
19.27 #endif //DIMACS_HH
20.1 --- a/src/work/marci/edmonds_karp_demo.cc Fri Feb 20 00:29:19 2004 +0000
20.2 +++ b/src/work/marci/edmonds_karp_demo.cc Fri Feb 20 21:45:07 2004 +0000
20.3 @@ -6,7 +6,7 @@
20.4 #include <edmonds_karp.hh>
20.5 #include <time_measure.h>
20.6
20.7 -using namespace marci;
20.8 +using namespace hugo;
20.9
20.10 // Use a DIMACS max flow file as stdin.
20.11 // read_dimacs_demo < dimacs_max_flow_file
21.1 --- a/src/work/marci/graph_wrapper.h Fri Feb 20 00:29:19 2004 +0000
21.2 +++ b/src/work/marci/graph_wrapper.h Fri Feb 20 21:45:07 2004 +0000
21.3 @@ -2,7 +2,7 @@
21.4 #ifndef GRAPH_WRAPPER_H
21.5 #define GRAPH_WRAPPER_H
21.6
21.7 -namespace marci {
21.8 +namespace hugo {
21.9
21.10 template<typename Graph>
21.11 class TrivGraphWrapper {
21.12 @@ -573,7 +573,7 @@
21.13
21.14
21.15
21.16 -} //namespace marci
21.17 +} //namespace hugo
21.18
21.19 #endif //GRAPH_WRAPPER_H
21.20
22.1 --- a/src/work/marci/preflow_demo_athos.cc Fri Feb 20 00:29:19 2004 +0000
22.2 +++ b/src/work/marci/preflow_demo_athos.cc Fri Feb 20 21:45:07 2004 +0000
22.3 @@ -6,7 +6,7 @@
22.4 #include <preflow_push.hh>
22.5 #include <time_measure.h>
22.6
22.7 -using namespace marci;
22.8 +using namespace hugo;
22.9
22.10 // Use a DIMACS max flow file as stdin.
22.11 // read_dimacs_demo < dimacs_max_flow_file
23.1 --- a/src/work/marci/preflow_demo_jacint.cc Fri Feb 20 00:29:19 2004 +0000
23.2 +++ b/src/work/marci/preflow_demo_jacint.cc Fri Feb 20 21:45:07 2004 +0000
23.3 @@ -7,7 +7,7 @@
23.4 #include <preflow_push_hl.h>
23.5 #include <time_measure.h>
23.6
23.7 -using namespace marci;
23.8 +using namespace hugo;
23.9
23.10 // Use a DIMACS max flow file as stdin.
23.11 // read_dimacs_demo < dimacs_max_flow_file