# HG changeset patch # User alpar # Date 1083603998 0 # Node ID a7eeb8af6b3436aef820dee896fd724c802599c9 # Parent fd991a24c8577fc09c9aa18ef7446e463873ccbd To be compatible with gcc-3.4.0 ... diff -r fd991a24c857 -r a7eeb8af6b34 src/include/skeletons/graph.h --- a/src/include/skeletons/graph.h Mon May 03 14:43:49 2004 +0000 +++ b/src/include/skeletons/graph.h Mon May 03 17:06:38 2004 +0000 @@ -87,7 +87,7 @@ /// \sa Invalid for more details. NodeIt(Invalid) {} /// Sets the iterator to the first node of \c G. - NodeIt(const GraphSkeleton &G) {} + NodeIt(const GraphSkeleton &) {} /// @warning The default constructor sets the iterator /// to an undefined value. NodeIt(const NodeIt &n) : Node(n) {} @@ -134,7 +134,7 @@ /// node ///@param n the node ///@param G the graph - OutEdgeIt(const GraphSkeleton & G, Node n) {} + OutEdgeIt(const GraphSkeleton &, Node) {} }; /// This iterator goes trough the incoming edges of a node. @@ -285,10 +285,10 @@ typedef T ValueType; typedef Node KeyType; - NodeMap(const GraphSkeleton &G) {} - NodeMap(const GraphSkeleton &G, T t) {} + NodeMap(const GraphSkeleton &) {} + NodeMap(const GraphSkeleton &, T) {} - template NodeMap(const NodeMap &m) {} + template NodeMap(const NodeMap &) {} /// Sets the value of a node. @@ -323,12 +323,12 @@ typedef T ValueType; typedef Edge KeyType; - EdgeMap(const GraphSkeleton &G) {} - EdgeMap(const GraphSkeleton &G, T t) {} + EdgeMap(const GraphSkeleton &) {} + EdgeMap(const GraphSkeleton &, T ) {} ///\todo It can copy between different types. /// - template EdgeMap(const EdgeMap &m) {} + template EdgeMap(const EdgeMap &) {} void set(Edge, T) {} //T get(Edge) const {return *(T*)0;} diff -r fd991a24c857 -r a7eeb8af6b34 src/test/graph_test.cc --- a/src/test/graph_test.cc Mon May 03 14:43:49 2004 +0000 +++ b/src/test/graph_test.cc Mon May 03 17:06:38 2004 +0000 @@ -108,11 +108,12 @@ //NodeMap tests { Node k; - typename Graph::NodeMap m(G); - typename Graph::NodeMap const &cm = m; //Const map - typename Graph::NodeMap mdef(G,12); //Inicialize with default value - typename Graph::NodeMap mm(cm); //Copy - typename Graph::NodeMap dm(cm); //Copy from another type + typename Graph::template NodeMap m(G); + typename Graph::template NodeMap const &cm = m; //Const map + //Inicialize with default value + typename Graph::template NodeMap mdef(G,12); + typename Graph::template NodeMap mm(cm); //Copy + typename Graph::template NodeMap dm(cm); //Copy from another type int v; v=m[k]; m[k]=v; m.set(k,v); v=cm[k]; @@ -122,11 +123,12 @@ } { //bool NodeMap Node k; - typename Graph::NodeMap m(G); - typename Graph::NodeMap const &cm = m; //Const map - typename Graph::NodeMap mdef(G,12); //Inicialize with default value - typename Graph::NodeMap mm(cm); //Copy - typename Graph::NodeMap dm(cm); //Copy from another type + typename Graph::template NodeMap m(G); + typename Graph::template NodeMap const &cm = m; //Const map + //Inicialize with default value + typename Graph::template NodeMap mdef(G,12); + typename Graph::template NodeMap mm(cm); //Copy + typename Graph::template NodeMap dm(cm); //Copy from another type bool v; v=m[k]; m[k]=v; m.set(k,v); v=cm[k]; @@ -138,11 +140,12 @@ //EdgeMap tests { Edge k; - typename Graph::EdgeMap m(G); - typename Graph::EdgeMap const &cm = m; //Const map - typename Graph::EdgeMap mdef(G,12); //Inicialize with default value - typename Graph::EdgeMap mm(cm); //Copy - typename Graph::EdgeMap dm(cm); //Copy from another type + typename Graph::template EdgeMap m(G); + typename Graph::template EdgeMap const &cm = m; //Const map + //Inicialize with default value + typename Graph::template EdgeMap mdef(G,12); + typename Graph::template EdgeMap mm(cm); //Copy + typename Graph::template EdgeMap dm(cm); //Copy from another type int v; v=m[k]; m[k]=v; m.set(k,v); v=cm[k]; @@ -152,11 +155,12 @@ } { //bool EdgeMap Edge k; - typename Graph::EdgeMap m(G); - typename Graph::EdgeMap const &cm = m; //Const map - typename Graph::EdgeMap mdef(G,12); //Inicialize with default value - typename Graph::EdgeMap mm(cm); //Copy - typename Graph::EdgeMap dm(cm); //Copy from another type + typename Graph::template EdgeMap m(G); + typename Graph::template EdgeMap const &cm = m; //Const map + //Inicialize with default value + typename Graph::template EdgeMap mdef(G,12); + typename Graph::template EdgeMap mm(cm); //Copy + typename Graph::template EdgeMap dm(cm); //Copy from another type bool v; v=m[k]; m[k]=v; m.set(k,v); v=cm[k]; diff -r fd991a24c857 -r a7eeb8af6b34 src/work/alpar/list_graph.h --- a/src/work/alpar/list_graph.h Mon May 03 14:43:49 2004 +0000 +++ b/src/work/alpar/list_graph.h Mon May 03 17:06:38 2004 +0000 @@ -63,8 +63,8 @@ protected: const ListGraph* G; public: - virtual void add(const Key k) = NULL; - virtual void erase(const Key k) = NULL; + virtual void add(const Key k) = 0; + virtual void erase(const Key k) = 0; DynMapBase(const ListGraph &_G) : G(&_G) {} virtual ~DynMapBase() {} friend class ListGraph; @@ -763,8 +763,8 @@ protected: const NodeSet* G; public: - virtual void add(const Key k) = NULL; - virtual void erase(const Key k) = NULL; + virtual void add(const Key k) = 0; + virtual void erase(const Key k) = 0; DynMapBase(const NodeSet &_G) : G(&_G) {} virtual ~DynMapBase() {} friend class NodeSet; @@ -1152,8 +1152,10 @@ NodeGraphType &G; + public: class Node; - + + private: //Edges are double linked. //The free edges are only single linked using the "next_in" field. struct NodeT @@ -1170,7 +1172,7 @@ }; - typename NodeGraphType::NodeMap nodes; + typename NodeGraphType::template NodeMap nodes; std::vector edges; //The first free edge @@ -1183,8 +1185,8 @@ protected: const EdgeSet* G; public: - virtual void add(const Key k) = NULL; - virtual void erase(const Key k) = NULL; + virtual void add(const Key k) = 0; + virtual void erase(const Key k) = 0; DynMapBase(const EdgeSet &_G) : G(&_G) {} virtual ~DynMapBase() {} friend class EdgeSet; @@ -1449,13 +1451,14 @@ NodeIt m; for(G.first(m); G.valid(m) && G.nodes[m].first_in == -1; G.next(m)); - n = G.valid(m)?-1:G.nodes[m].first_in; + //AJJAJ! This is a non sense!!!!!!! + this->n = G.valid(m)?-1:G.nodes[m].first_in; } EdgeIt (Invalid i) : Edge(i) { } EdgeIt() : Edge() { } ///\bug This is a workaround until somebody tells me how to ///make class \c SymEdgeSet::SymEdgeMap friend of Edge - int &idref() {return n;} + int &idref() {return this->n;} }; class OutEdgeIt : public Edge { @@ -1475,22 +1478,23 @@ InEdgeIt(const EdgeSet& G,Node v) :Edge(nodes[v].first_in) { } }; - template class NodeMap : public NodeGraphType::NodeMap + template class NodeMap : + public NodeGraphType::template NodeMap { public: NodeMap(const EdgeSet &_G) : - NodeGraphType::NodeMap(_G.G) { } + NodeGraphType::NodeMap(_G.G) { } //AJAJJ would be wrong!!! NodeMap(const EdgeSet &_G,const T &t) : - NodeGraphType::NodeMap(_G.G,t) { } + NodeGraphType::NodeMap(_G.G,t) { } //It is unnecessary - NodeMap(const typename NodeGraphType::NodeMap &m) - : NodeGraphType::NodeMap(m) { } + NodeMap(const typename NodeGraphType::template NodeMap &m) : + NodeGraphType::NodeMap(m) { } ///\todo It can copy between different types. /// template - NodeMap(const typename NodeGraphType::NodeMap &m) - : NodeGraphType::NodeMap(m) { } + NodeMap(const typename NodeGraphType::template NodeMap &m) + : NodeGraphType::NodeMap(m) { } }; template class EdgeMap : public DynMapBase