To be compatible with gcc-3.4.0 ...
authoralpar
Mon, 03 May 2004 17:06:38 +0000
changeset 515a7eeb8af6b34
parent 514 fd991a24c857
child 516 c37949721c61
To be compatible with gcc-3.4.0 ...
src/include/skeletons/graph.h
src/test/graph_test.cc
src/work/alpar/list_graph.h
     1.1 --- a/src/include/skeletons/graph.h	Mon May 03 14:43:49 2004 +0000
     1.2 +++ b/src/include/skeletons/graph.h	Mon May 03 17:06:38 2004 +0000
     1.3 @@ -87,7 +87,7 @@
     1.4        /// \sa Invalid for more details.
     1.5        NodeIt(Invalid) {}
     1.6        /// Sets the iterator to the first node of \c G.
     1.7 -      NodeIt(const GraphSkeleton &G) {}
     1.8 +      NodeIt(const GraphSkeleton &) {}
     1.9        /// @warning The default constructor sets the iterator
    1.10        /// to an undefined value.
    1.11        NodeIt(const NodeIt &n) : Node(n) {}
    1.12 @@ -134,7 +134,7 @@
    1.13        /// node
    1.14        ///@param n the node
    1.15        ///@param G the graph
    1.16 -      OutEdgeIt(const GraphSkeleton & G, Node n) {}
    1.17 +      OutEdgeIt(const GraphSkeleton &, Node) {}
    1.18      };
    1.19  
    1.20      /// This iterator goes trough the incoming edges of a node.
    1.21 @@ -285,10 +285,10 @@
    1.22        typedef T ValueType;
    1.23        typedef Node KeyType;
    1.24  
    1.25 -      NodeMap(const GraphSkeleton &G) {}
    1.26 -      NodeMap(const GraphSkeleton &G, T t) {}
    1.27 +      NodeMap(const GraphSkeleton &) {}
    1.28 +      NodeMap(const GraphSkeleton &, T) {}
    1.29  
    1.30 -      template<typename TT> NodeMap(const NodeMap<TT> &m) {}
    1.31 +      template<typename TT> NodeMap(const NodeMap<TT> &) {}
    1.32  
    1.33        /// Sets the value of a node.
    1.34  
    1.35 @@ -323,12 +323,12 @@
    1.36        typedef T ValueType;
    1.37        typedef Edge KeyType;
    1.38  
    1.39 -      EdgeMap(const GraphSkeleton &G) {}
    1.40 -      EdgeMap(const GraphSkeleton &G, T t) {}
    1.41 +      EdgeMap(const GraphSkeleton &) {}
    1.42 +      EdgeMap(const GraphSkeleton &, T ) {}
    1.43      
    1.44        ///\todo It can copy between different types.
    1.45        ///
    1.46 -      template<typename TT> EdgeMap(const EdgeMap<TT> &m) {}
    1.47 +      template<typename TT> EdgeMap(const EdgeMap<TT> &) {}
    1.48  
    1.49        void set(Edge, T) {}
    1.50        //T get(Edge) const {return *(T*)0;}
     2.1 --- a/src/test/graph_test.cc	Mon May 03 14:43:49 2004 +0000
     2.2 +++ b/src/test/graph_test.cc	Mon May 03 17:06:38 2004 +0000
     2.3 @@ -108,11 +108,12 @@
     2.4    //NodeMap tests
     2.5    {
     2.6      Node k;
     2.7 -    typename Graph::NodeMap<int> m(G);
     2.8 -    typename Graph::NodeMap<int> const &cm = m;  //Const map
     2.9 -    typename Graph::NodeMap<int> mdef(G,12); //Inicialize with default value
    2.10 -    typename Graph::NodeMap<int> mm(cm);   //Copy
    2.11 -    typename Graph::NodeMap<double> dm(cm); //Copy from another type
    2.12 +    typename Graph::template NodeMap<int> m(G);
    2.13 +    typename Graph::template NodeMap<int> const &cm = m;  //Const map
    2.14 +    //Inicialize with default value
    2.15 +    typename Graph::template NodeMap<int> mdef(G,12);
    2.16 +    typename Graph::template NodeMap<int> mm(cm);   //Copy
    2.17 +    typename Graph::template NodeMap<double> dm(cm); //Copy from another type
    2.18      int v;
    2.19      v=m[k]; m[k]=v; m.set(k,v);
    2.20      v=cm[k];
    2.21 @@ -122,11 +123,12 @@
    2.22    }  
    2.23    { //bool NodeMap
    2.24      Node k;
    2.25 -    typename Graph::NodeMap<bool> m(G);
    2.26 -    typename Graph::NodeMap<bool> const &cm = m;  //Const map
    2.27 -    typename Graph::NodeMap<bool> mdef(G,12); //Inicialize with default value
    2.28 -    typename Graph::NodeMap<bool> mm(cm);   //Copy
    2.29 -    typename Graph::NodeMap<int> dm(cm); //Copy from another type
    2.30 +    typename Graph::template NodeMap<bool> m(G);
    2.31 +    typename Graph::template NodeMap<bool> const &cm = m;  //Const map
    2.32 +    //Inicialize with default value
    2.33 +    typename Graph::template NodeMap<bool> mdef(G,12);
    2.34 +    typename Graph::template NodeMap<bool> mm(cm);   //Copy
    2.35 +    typename Graph::template NodeMap<int> dm(cm); //Copy from another type
    2.36      bool v;
    2.37      v=m[k]; m[k]=v; m.set(k,v);
    2.38      v=cm[k];
    2.39 @@ -138,11 +140,12 @@
    2.40    //EdgeMap tests
    2.41    {
    2.42      Edge k;
    2.43 -    typename Graph::EdgeMap<int> m(G);
    2.44 -    typename Graph::EdgeMap<int> const &cm = m;  //Const map
    2.45 -    typename Graph::EdgeMap<int> mdef(G,12); //Inicialize with default value
    2.46 -    typename Graph::EdgeMap<int> mm(cm);   //Copy
    2.47 -    typename Graph::EdgeMap<double> dm(cm); //Copy from another type
    2.48 +    typename Graph::template EdgeMap<int> m(G);
    2.49 +    typename Graph::template EdgeMap<int> const &cm = m;  //Const map
    2.50 +    //Inicialize with default value
    2.51 +    typename Graph::template EdgeMap<int> mdef(G,12);
    2.52 +    typename Graph::template EdgeMap<int> mm(cm);   //Copy
    2.53 +    typename Graph::template EdgeMap<double> dm(cm); //Copy from another type
    2.54      int v;
    2.55      v=m[k]; m[k]=v; m.set(k,v);
    2.56      v=cm[k];
    2.57 @@ -152,11 +155,12 @@
    2.58    }  
    2.59    { //bool EdgeMap
    2.60      Edge k;
    2.61 -    typename Graph::EdgeMap<bool> m(G);
    2.62 -    typename Graph::EdgeMap<bool> const &cm = m;  //Const map
    2.63 -    typename Graph::EdgeMap<bool> mdef(G,12); //Inicialize with default value
    2.64 -    typename Graph::EdgeMap<bool> mm(cm);   //Copy
    2.65 -    typename Graph::EdgeMap<int> dm(cm); //Copy from another type
    2.66 +    typename Graph::template EdgeMap<bool> m(G);
    2.67 +    typename Graph::template EdgeMap<bool> const &cm = m;  //Const map
    2.68 +    //Inicialize with default value
    2.69 +    typename Graph::template EdgeMap<bool> mdef(G,12);
    2.70 +    typename Graph::template EdgeMap<bool> mm(cm);   //Copy
    2.71 +    typename Graph::template EdgeMap<int> dm(cm); //Copy from another type
    2.72      bool v;
    2.73      v=m[k]; m[k]=v; m.set(k,v);
    2.74      v=cm[k];
     3.1 --- a/src/work/alpar/list_graph.h	Mon May 03 14:43:49 2004 +0000
     3.2 +++ b/src/work/alpar/list_graph.h	Mon May 03 17:06:38 2004 +0000
     3.3 @@ -63,8 +63,8 @@
     3.4      protected:
     3.5        const ListGraph* G; 
     3.6      public:
     3.7 -      virtual void add(const Key k) = NULL;
     3.8 -      virtual void erase(const Key k) = NULL;
     3.9 +      virtual void add(const Key k) = 0;
    3.10 +      virtual void erase(const Key k) = 0;
    3.11        DynMapBase(const ListGraph &_G) : G(&_G) {}
    3.12        virtual ~DynMapBase() {}
    3.13        friend class ListGraph;
    3.14 @@ -763,8 +763,8 @@
    3.15      protected:
    3.16        const NodeSet* G; 
    3.17      public:
    3.18 -      virtual void add(const Key k) = NULL;
    3.19 -      virtual void erase(const Key k) = NULL;
    3.20 +      virtual void add(const Key k) = 0;
    3.21 +      virtual void erase(const Key k) = 0;
    3.22        DynMapBase(const NodeSet &_G) : G(&_G) {}
    3.23        virtual ~DynMapBase() {}
    3.24        friend class NodeSet;
    3.25 @@ -1152,8 +1152,10 @@
    3.26  
    3.27      NodeGraphType &G;
    3.28  
    3.29 +  public:
    3.30      class Node;
    3.31 -    
    3.32 +
    3.33 +  private:
    3.34      //Edges are double linked.
    3.35      //The free edges are only single linked using the "next_in" field.
    3.36      struct NodeT 
    3.37 @@ -1170,7 +1172,7 @@
    3.38      };
    3.39  
    3.40      
    3.41 -    typename NodeGraphType::NodeMap<NodeT> nodes;
    3.42 +    typename NodeGraphType::template NodeMap<NodeT> nodes;
    3.43      
    3.44      std::vector<EdgeT> edges;
    3.45      //The first free edge
    3.46 @@ -1183,8 +1185,8 @@
    3.47      protected:
    3.48        const EdgeSet* G; 
    3.49      public:
    3.50 -      virtual void add(const Key k) = NULL;
    3.51 -      virtual void erase(const Key k) = NULL;
    3.52 +      virtual void add(const Key k) = 0;
    3.53 +      virtual void erase(const Key k) = 0;
    3.54        DynMapBase(const EdgeSet &_G) : G(&_G) {}
    3.55        virtual ~DynMapBase() {}
    3.56        friend class EdgeSet;
    3.57 @@ -1449,13 +1451,14 @@
    3.58          NodeIt m;
    3.59  	for(G.first(m);
    3.60  	    G.valid(m) && G.nodes[m].first_in == -1;  G.next(m));
    3.61 -	n = G.valid(m)?-1:G.nodes[m].first_in;
    3.62 +	//AJJAJ! This is a non sense!!!!!!!
    3.63 +	this->n = G.valid(m)?-1:G.nodes[m].first_in;
    3.64        }
    3.65        EdgeIt (Invalid i) : Edge(i) { }
    3.66        EdgeIt() : Edge() { }
    3.67        ///\bug This is a workaround until somebody tells me how to
    3.68        ///make class \c SymEdgeSet::SymEdgeMap friend of Edge
    3.69 -      int &idref() {return n;}
    3.70 +      int &idref() {return this->n;}
    3.71      };
    3.72      
    3.73      class OutEdgeIt : public Edge {
    3.74 @@ -1475,22 +1478,23 @@
    3.75        InEdgeIt(const EdgeSet& G,Node v) :Edge(nodes[v].first_in) { }
    3.76      };
    3.77  
    3.78 -    template <typename T> class NodeMap : public NodeGraphType::NodeMap<T>
    3.79 +    template <typename T> class NodeMap : 
    3.80 +      public NodeGraphType::template NodeMap<T>
    3.81      {
    3.82      public:
    3.83        NodeMap(const EdgeSet &_G) :
    3.84 -	NodeGraphType::NodeMap<T>(_G.G) { }
    3.85 +        NodeGraphType::NodeMap(_G.G) { } //AJAJJ <T> would be wrong!!!
    3.86        NodeMap(const EdgeSet &_G,const T &t) :
    3.87 -	NodeGraphType::NodeMap<T>(_G.G,t) { }
    3.88 +	NodeGraphType::NodeMap(_G.G,t) { }
    3.89        //It is unnecessary
    3.90 -      NodeMap(const typename NodeGraphType::NodeMap<T> &m)
    3.91 -	: NodeGraphType::NodeMap<T>(m) { }
    3.92 +      NodeMap(const typename NodeGraphType::template NodeMap<T> &m) :
    3.93 +	NodeGraphType::NodeMap(m) { }
    3.94  
    3.95        ///\todo It can copy between different types.
    3.96        ///
    3.97        template<typename TT>
    3.98 -      NodeMap(const typename NodeGraphType::NodeMap<TT> &m)
    3.99 -	: NodeGraphType::NodeMap<T>(m) { }
   3.100 +      NodeMap(const typename NodeGraphType::template NodeMap<TT> &m)
   3.101 +	: NodeGraphType::NodeMap(m) { }
   3.102      };
   3.103      
   3.104      template <typename T> class EdgeMap : public DynMapBase<Edge>