[Lemon-commits] [lemon_svn] alpar: r1812 - in hugo/trunk/src: lemon lemon/concept test

Lemon SVN svn at lemon.cs.elte.hu
Mon Nov 6 20:47:53 CET 2006


Author: alpar
Date: Mon Apr 18 16:59:24 2005
New Revision: 1812

Modified:
   hugo/trunk/src/lemon/bfs.h
   hugo/trunk/src/lemon/concept/graph.h
   hugo/trunk/src/lemon/concept/graph_component.h
   hugo/trunk/src/lemon/concept/maps.h
   hugo/trunk/src/lemon/concept/path.h
   hugo/trunk/src/lemon/concept/undir_graph.h
   hugo/trunk/src/lemon/dfs.h
   hugo/trunk/src/lemon/dijkstra.h
   hugo/trunk/src/lemon/graph_to_eps.h
   hugo/trunk/src/test/undir_graph_test.cc

Log:
More steps toward gcc-3.4 compatibility

Modified: hugo/trunk/src/lemon/bfs.h
==============================================================================
--- hugo/trunk/src/lemon/bfs.h	(original)
+++ hugo/trunk/src/lemon/bfs.h	Mon Apr 18 16:59:24 2005
@@ -86,7 +86,7 @@
     ///This function instantiates a \ref ProcessedMap. 
     ///\param G is the graph, to which
     ///we would like to define the \ref ProcessedMap
-    static ProcessedMap *createProcessedMap(const GR &G)
+    static ProcessedMap *createProcessedMap(const GR &)
     {
       return new ProcessedMap();
     }
@@ -769,7 +769,7 @@
     ///This function instantiates a \ref PredMap. 
     ///\param G is the graph, to which we would like to define the PredMap.
     ///\todo The graph alone may be insufficient to initialize
-    static PredMap *createPredMap(const GR &G) 
+    static PredMap *createPredMap(const GR &) 
     {
       return new PredMap();
     }
@@ -802,7 +802,7 @@
     ///This function instantiates a \ref ProcessedMap. 
     ///\param G is the graph, to which
     ///we would like to define the \ref ProcessedMap
-    static ProcessedMap *createProcessedMap(const GR &G)
+    static ProcessedMap *createProcessedMap(const GR &)
     {
       return new ProcessedMap();
     }
@@ -831,7 +831,7 @@
  
     ///This function instantiates a \ref DistMap. 
     ///\param G is the graph, to which we would like to define the \ref DistMap
-    static DistMap *createDistMap(const GR &G)
+    static DistMap *createDistMap(const GR &)
     {
       return new DistMap();
     }
@@ -988,7 +988,7 @@
     template<class T>
     struct DefPredMapBase : public Base {
       typedef T PredMap;
-      static PredMap *createPredMap(const Graph &G) { return 0; };
+      static PredMap *createPredMap(const Graph &) { return 0; };
       DefPredMapBase(const TR &b) : TR(b) {}
     };
     
@@ -1009,7 +1009,7 @@
     template<class T>
     struct DefReachedMapBase : public Base {
       typedef T ReachedMap;
-      static ReachedMap *createReachedMap(const Graph &G) { return 0; };
+      static ReachedMap *createReachedMap(const Graph &) { return 0; };
       DefReachedMapBase(const TR &b) : TR(b) {}
     };
     
@@ -1030,7 +1030,7 @@
     template<class T>
     struct DefProcessedMapBase : public Base {
       typedef T ProcessedMap;
-      static ProcessedMap *createProcessedMap(const Graph &G) { return 0; };
+      static ProcessedMap *createProcessedMap(const Graph &) { return 0; };
       DefProcessedMapBase(const TR &b) : TR(b) {}
     };
     
@@ -1071,7 +1071,7 @@
     template<class T>
     struct DefDistMapBase : public Base {
       typedef T DistMap;
-      static DistMap *createDistMap(const Graph &G) { return 0; };
+      static DistMap *createDistMap(const Graph &) { return 0; };
       DefDistMapBase(const TR &b) : TR(b) {}
     };
     

Modified: hugo/trunk/src/lemon/concept/graph.h
==============================================================================
--- hugo/trunk/src/lemon/concept/graph.h	(original)
+++ hugo/trunk/src/lemon/concept/graph.h	Mon Apr 18 16:59:24 2005
@@ -185,7 +185,7 @@
 	
 	/// Copy constructor.
 	///
-	NodeIt(const NodeIt&) { }
+	NodeIt(const NodeIt& n) : Node(n) { }
 	/// Invalid constructor \& conversion.
 
 	/// Initialize the iterator to be invalid.
@@ -195,7 +195,7 @@
 
 	/// Sets the iterator to the first node of \c g.
 	///
-	NodeIt(const StaticGraph& g) { }
+	NodeIt(const StaticGraph&) { }
 	/// Node -> NodeIt conversion.
 
 	/// Sets the iterator to the node of \c g pointed by the trivial 
@@ -267,7 +267,7 @@
 
 	/// Copy constructor.
 	///
-	OutEdgeIt(const OutEdgeIt&) { }
+	OutEdgeIt(const OutEdgeIt& e) : Edge(e) { }
 	/// Initialize the iterator to be invalid.
 
 	/// Initialize the iterator to be invalid.
@@ -279,7 +279,7 @@
 	/// node
 	///@param n the node
 	///@param g the graph
-	OutEdgeIt(const StaticGraph& g, const Node& n) { }
+	OutEdgeIt(const StaticGraph&, const Node&) { }
 	/// Edge -> OutEdgeIt conversion
 
 	/// Sets the iterator to the value of the trivial iterator \c e.
@@ -316,7 +316,7 @@
 
 	/// Copy constructor.
 	///
-	InEdgeIt(const InEdgeIt&) { }
+	InEdgeIt(const InEdgeIt& e) : Edge(e) { }
 	/// Initialize the iterator to be invalid.
 
 	/// Initialize the iterator to be invalid.
@@ -328,13 +328,13 @@
 	/// node
 	///@param n the node
 	///@param g the graph
-	InEdgeIt(const StaticGraph& g, const Node& n) { }
+	InEdgeIt(const StaticGraph&, const Node&) { }
 	/// Edge -> InEdgeIt conversion
 
 	/// Sets the iterator to the value of the trivial iterator \c e.
 	/// This feature necessitates that each time we 
 	/// iterate the edge-set, the iteration order is the same.
-	InEdgeIt(const StaticGraph& g, const Edge& n) { }
+	InEdgeIt(const StaticGraph&, const Edge&) { }
 	/// Next incoming edge
 
 	/// Assign the iterator to the next inedge of the corresponding node.
@@ -361,7 +361,7 @@
 
 	/// Copy constructor.
 	///
-	EdgeIt(const EdgeIt&) { }
+	EdgeIt(const EdgeIt& e) : Edge(e) { }
 	/// Initialize the iterator to be invalid.
 
 	/// Initialize the iterator to be invalid.
@@ -372,7 +372,7 @@
 	/// This constructor set the iterator to the first edge of
 	/// node
 	///@param g the graph
-	EdgeIt(const StaticGraph& g) { }
+	EdgeIt(const StaticGraph&) { }
 	/// Edge -> EdgeIt conversion
 
 	/// Sets the iterator to the value of the trivial iterator \c e.
@@ -413,7 +413,7 @@
 	NodeMap(const StaticGraph&, T) { }
 
 	///Copy constructor
-	NodeMap(const NodeMap&) { }
+	NodeMap(const NodeMap& nm) : ReadWriteMap< Node, T >(nm) { }
 	///Assignment operator
 	NodeMap& operator=(const NodeMap&) { return *this; }
 	// \todo fix this concept
@@ -436,7 +436,7 @@
 	///\e
 	EdgeMap(const StaticGraph&, T) { }
 	///Copy constructor
-	EdgeMap(const EdgeMap&) { }
+	EdgeMap(const EdgeMap& em) : ReadWriteMap<Edge,T>(em) { }
 	///Assignment operator
 	EdgeMap& operator=(const EdgeMap&) { return *this; }
 	// \todo fix this concept    
@@ -470,7 +470,7 @@
       ///Add a new edge to the graph with source node \c s
       ///and target node \c t.
       ///\return the new edge.
-      Edge addEdge(Node s, Node t) { return INVALID; }
+      Edge addEdge(Node, Node) { return INVALID; }
     
       /// Resets the graph.
 
@@ -500,12 +500,12 @@
 
       /// Deletes node \c n node.
       ///
-      void erase(Node n) { }
+      void erase(Node) { }
       /// Deletes an edge.
 
       /// Deletes edge \c e edge.
       ///
-      void erase(Edge e) { }
+      void erase(Edge) { }
 
       template <typename _Graph>
       struct Constraints : public _ErasableGraph::Constraints<_Graph> {};

Modified: hugo/trunk/src/lemon/concept/graph_component.h
==============================================================================
--- hugo/trunk/src/lemon/concept/graph_component.h	(original)
+++ hugo/trunk/src/lemon/concept/graph_component.h	Mon Apr 18 16:59:24 2005
@@ -304,7 +304,7 @@
       /// Gives back the node by the unique id.
       /// If the graph does not contain node with the given id
       /// then the result of the function is undetermined. 
-      Node fromId(int id, Node) const { return INVALID;}
+      Node fromId(int , Node) const { return INVALID;}
 
       /// \brief Gives back an unique integer id for the Edge. 
       ///
@@ -317,7 +317,7 @@
       /// Gives back the edge by the unique id.
       /// If the graph does not contain edge with the given id
       /// then the result of the function is undetermined. 
-      Edge fromId(int id, Edge) const { return INVALID;}
+      Edge fromId(int, Edge) const { return INVALID;}
 
       template <typename _Graph>
       struct Constraints {
@@ -398,7 +398,7 @@
 
       /// Adds a new Edge connects the two Nodes to the graph.
       ///
-      Edge addEdge(const Node& from, const Node& to) {
+      Edge addEdge(const Node&, const Node&) {
 	return INVALID;
       }
 
@@ -745,7 +745,7 @@
       /// \brief Copy constructor.
       ///
       /// Copy Constructor.
-      GraphMap(const GraphMap&) {}
+      GraphMap(const GraphMap& gm) :ReadWriteMap<Item, _Value>(gm) {}
       
       /// \brief Assign operator.
       ///
@@ -809,7 +809,7 @@
 	/// \brief Copy constructor.
 	///
 	/// Copy Constructor.
-	NodeMap(const NodeMap&) {}
+	NodeMap(const NodeMap& nm) : GraphMap<Graph, Node, _Value>(nm) {}
 
 	/// \brief Assign operator.
 	///
@@ -839,7 +839,7 @@
 	/// \brief Copy constructor.
 	///
 	/// Copy Constructor.
-	EdgeMap(const EdgeMap&) {}
+	EdgeMap(const EdgeMap& em) :GraphMap<Graph, Edge, _Value>(em) {}
 
 	/// \brief Assign operator.
 	///
@@ -917,7 +917,7 @@
       /// \brief Add an edge to the graph.
       ///
       /// Add an edge to the graph and notify the observers.
-      Edge addEdge(const Node& from, const Node& to) {
+      Edge addEdge(const Node&, const Node&) {
 	return INVALID;
       }
 

Modified: hugo/trunk/src/lemon/concept/maps.h
==============================================================================
--- hugo/trunk/src/lemon/concept/maps.h	(original)
+++ hugo/trunk/src/lemon/concept/maps.h	Mon Apr 18 16:59:24 2005
@@ -76,7 +76,7 @@
       typedef T Value;
 
       /// Sets the value associated with a key.
-      void set(const Key &k,const Value &t) {}
+      void set(const Key &,const Value &) {}
 
       ///Default constructor
       WriteMap() {}
@@ -114,9 +114,9 @@
       typedef T Value;
 
       /// Returns the value associated with a key.
-      Value operator[](const Key &k) const {return Value();}
+      Value operator[](const Key &) const {return Value();}
       /// Sets the value associated with a key.
-      void set(const Key &k,const Value &t) {}
+      void set(const Key & ,const Value &) {}
 
       template<typename _ReadWriteMap>
       struct Constraints {

Modified: hugo/trunk/src/lemon/concept/path.h
==============================================================================
--- hugo/trunk/src/lemon/concept/path.h	(original)
+++ hugo/trunk/src/lemon/concept/path.h	Mon Apr 18 16:59:24 2005
@@ -54,7 +54,7 @@
 
       /// \param _G The graph in which the path is.
       ///
-      Path(const Graph &_G) {}
+      Path(const Graph &) {}
 
       /// Length of the path.
       int length() const {return 0;}
@@ -86,13 +86,13 @@
       ///
       /// Returns node iterator pointing to the target node of the
       /// given edge iterator.
-      NodeIt target(const EdgeIt& e) const {return INVALID;}
+      NodeIt target(const EdgeIt&) const {return INVALID;}
 
       /// \brief The source of an edge.
       ///
       /// Returns node iterator pointing to the source node of the
       /// given edge iterator.
-      NodeIt source(const EdgeIt& e) const {return INVALID;}
+      NodeIt source(const EdgeIt&) const {return INVALID;}
 
 
       /* Iterator classes */
@@ -112,7 +112,7 @@
 	/// Invalid constructor
 	EdgeIt(Invalid) {}
 	/// Constructor with starting point
-	EdgeIt(const Path &_p) {}
+	EdgeIt(const Path &) {}
 
 	operator GraphEdge () const {}
 
@@ -120,9 +120,9 @@
 	EdgeIt& operator++() {return *this;}
 
 	/// Comparison operator
-	bool operator==(const EdgeIt& e) const {return true;}
+	bool operator==(const EdgeIt&) const {return true;}
 	/// Comparison operator
-	bool operator!=(const EdgeIt& e) const {return true;}
+	bool operator!=(const EdgeIt&) const {return true;}
 // 	/// Comparison operator
 //      /// \todo It is not clear what is the "natural" ordering.
 // 	bool operator<(const EdgeIt& e) const {}
@@ -144,7 +144,7 @@
 	/// Invalid constructor
 	NodeIt(Invalid) {}
 	/// Constructor with starting point
-	NodeIt(const Path &_p) {}
+	NodeIt(const Path &) {}
 
 	///Conversion to Graph::Node
 	operator const GraphNode& () const {}
@@ -152,9 +152,9 @@
 	NodeIt& operator++() {return *this;}
 
 	/// Comparison operator
-	bool operator==(const NodeIt& e) const {return true;}
+	bool operator==(const NodeIt&) const {return true;}
 	/// Comparison operator
-	bool operator!=(const NodeIt& e) const {return true;}
+	bool operator!=(const NodeIt&) const {return true;}
 // 	/// Comparison operator
 //      /// \todo It is not clear what is the "natural" ordering.
 // 	bool operator<(const NodeIt& e) const {}
@@ -201,14 +201,14 @@
 	///Push a new edge to the front of the path.
 	///If the path is empty, you \em must call \ref setStartNode() before
 	///the first use of \ref pushFront().
-	void pushFront(const GraphEdge& e) {}
+	void pushFront(const GraphEdge&) {}
 
 	///Push a new edge to the back of the path
 
 	///Push a new edge to the back of the path.
 	///If the path is empty, you \em must call \ref setStartNode() before
 	///the first use of \ref pushBack().
-	void pushBack(const GraphEdge& e) {}
+	void pushBack(const GraphEdge&) {}
 
 	///Commit the changes to the path.
 	void commit() {}
@@ -218,13 +218,13 @@
 	///If you know a reasonable upper bound on the number of the edges
 	///to add to the front of the path,
 	///using this function you may speed up the building.
-	void reserveFront(size_t r) {}
+	void reserveFront(size_t) {}
 	///Reserve (back) storage for the builder in advance.
 
 	///If you know a reasonable upper bound on the number of the edges
 	///to add to the back of the path,
 	///using this function you may speed up the building.
-	void reserveBack(size_t r) {}
+	void reserveBack(size_t) {}
       };
     };
 

Modified: hugo/trunk/src/lemon/concept/undir_graph.h
==============================================================================
--- hugo/trunk/src/lemon/concept/undir_graph.h	(original)
+++ hugo/trunk/src/lemon/concept/undir_graph.h	Mon Apr 18 16:59:24 2005
@@ -46,7 +46,7 @@
       UndirGraphEdge() {}
 
       /// \e
-      UndirGraphEdge(const UndirGraphEdge&) {}
+      UndirGraphEdge(const UndirGraphEdge& e) : UndirGraph::UndirEdge(e) {}
 
       /// \e
       UndirGraphEdge(Invalid) {}
@@ -469,13 +469,13 @@
       /// Base node of the iterator
       ///
       /// Returns the base node of the iterator
-      Node baseNode(IncEdgeIt e) const {
+      Node baseNode(IncEdgeIt) const {
 	return INVALID;
       }
       /// Running node of the iterator
       ///
       /// Returns the running node of the iterator
-      Node runningNode(IncEdgeIt e) const {
+      Node runningNode(IncEdgeIt) const {
 	return INVALID;
       }
 

Modified: hugo/trunk/src/lemon/dfs.h
==============================================================================
--- hugo/trunk/src/lemon/dfs.h	(original)
+++ hugo/trunk/src/lemon/dfs.h	Mon Apr 18 16:59:24 2005
@@ -86,7 +86,7 @@
     ///This function instantiates a \ref ProcessedMap. 
     ///\param G is the graph, to which
     ///we would like to define the \ref ProcessedMap
-    static ProcessedMap *createProcessedMap(const GR &G)
+    static ProcessedMap *createProcessedMap(const GR &)
     {
       return new ProcessedMap();
     }
@@ -776,7 +776,7 @@
     ///This function instantiates a \ref PredMap. 
     ///\param G is the graph, to which we would like to define the PredMap.
     ///\todo The graph alone may be insufficient to initialize
-    static PredMap *createPredMap(const GR &G) 
+    static PredMap *createPredMap(const GR &) 
     {
       return new PredMap();
     }
@@ -809,7 +809,7 @@
     ///This function instantiates a \ref ProcessedMap. 
     ///\param G is the graph, to which
     ///we would like to define the \ref ProcessedMap
-    static ProcessedMap *createProcessedMap(const GR &G)
+    static ProcessedMap *createProcessedMap(const GR &)
     {
       return new ProcessedMap();
     }
@@ -838,7 +838,7 @@
  
     ///This function instantiates a \ref DistMap. 
     ///\param G is the graph, to which we would like to define the \ref DistMap
-    static DistMap *createDistMap(const GR &G)
+    static DistMap *createDistMap(const GR &)
     {
       return new DistMap();
     }
@@ -994,7 +994,7 @@
     template<class T>
     struct DefPredMapBase : public Base {
       typedef T PredMap;
-      static PredMap *createPredMap(const Graph &G) { return 0; };
+      static PredMap *createPredMap(const Graph &) { return 0; };
       DefPredMapBase(const TR &b) : TR(b) {}
     };
     
@@ -1015,7 +1015,7 @@
     template<class T>
     struct DefReachedMapBase : public Base {
       typedef T ReachedMap;
-      static ReachedMap *createReachedMap(const Graph &G) { return 0; };
+      static ReachedMap *createReachedMap(const Graph &) { return 0; };
       DefReachedMapBase(const TR &b) : TR(b) {}
     };
     
@@ -1036,7 +1036,7 @@
     template<class T>
     struct DefProcessedMapBase : public Base {
       typedef T ProcessedMap;
-      static ProcessedMap *createProcessedMap(const Graph &G) { return 0; };
+      static ProcessedMap *createProcessedMap(const Graph &) { return 0; };
       DefProcessedMapBase(const TR &b) : TR(b) {}
     };
     
@@ -1077,7 +1077,7 @@
     template<class T>
     struct DefDistMapBase : public Base {
       typedef T DistMap;
-      static DistMap *createDistMap(const Graph &G) { return 0; };
+      static DistMap *createDistMap(const Graph &) { return 0; };
       DefDistMapBase(const TR &b) : TR(b) {}
     };
     

Modified: hugo/trunk/src/lemon/dijkstra.h
==============================================================================
--- hugo/trunk/src/lemon/dijkstra.h	(original)
+++ hugo/trunk/src/lemon/dijkstra.h	Mon Apr 18 16:59:24 2005
@@ -787,7 +787,7 @@
     ///This function instantiates a \ref PredMap. 
     ///\param G is the graph, to which we would like to define the PredMap.
     ///\todo The graph alone may be insufficient for the initialization
-    static PredMap *createPredMap(const GR &G) 
+    static PredMap *createPredMap(const GR &) 
     {
       return new PredMap();
     }
@@ -805,7 +805,7 @@
     ///This function instantiates a \ref ProcessedMap. 
     ///\param G is the graph, to which
     ///we would like to define the \ref ProcessedMap
-    static ProcessedMap *createProcessedMap(const GR &G)
+    static ProcessedMap *createProcessedMap(const GR &)
     {
       return new ProcessedMap();
     }
@@ -819,7 +819,7 @@
  
     ///This function instantiates a \ref DistMap. 
     ///\param G is the graph, to which we would like to define the \ref DistMap
-    static DistMap *createDistMap(const GR &G)
+    static DistMap *createDistMap(const GR &)
     {
       return new DistMap();
     }
@@ -974,7 +974,7 @@
     template<class T>
     struct DefPredMapBase : public Base {
       typedef T PredMap;
-      static PredMap *createPredMap(const Graph &G) { return 0; };
+      static PredMap *createPredMap(const Graph &) { return 0; };
       DefPredMapBase(const TR &b) : TR(b) {}
     };
     
@@ -1015,7 +1015,7 @@
     template<class T>
     struct DefDistMapBase : public Base {
       typedef T DistMap;
-      static DistMap *createDistMap(const Graph &G) { return 0; };
+      static DistMap *createDistMap(const Graph &) { return 0; };
       DefDistMapBase(const TR &b) : TR(b) {}
     };
     

Modified: hugo/trunk/src/lemon/graph_to_eps.h
==============================================================================
--- hugo/trunk/src/lemon/graph_to_eps.h	(original)
+++ hugo/trunk/src/lemon/graph_to_eps.h	Mon Apr 18 16:59:24 2005
@@ -363,10 +363,10 @@
     edgeLess(const Graph &_g) : g(_g) {}
     bool operator()(Edge a,Edge b) const 
     {
-      Node ai=min(g.source(a),g.target(a));
-      Node aa=max(g.source(a),g.target(a));
-      Node bi=min(g.source(b),g.target(b));
-      Node ba=max(g.source(b),g.target(b));
+      Node ai=std::min(g.source(a),g.target(a));
+      Node aa=std::max(g.source(a),g.target(a));
+      Node bi=std::min(g.source(b),g.target(b));
+      Node ba=std::max(g.source(b),g.target(b));
       return ai<bi ||
 	(ai==bi && (aa < ba || 
 		    (aa==ba && ai==g.source(a) && bi==g.target(b))));

Modified: hugo/trunk/src/test/undir_graph_test.cc
==============================================================================
--- hugo/trunk/src/test/undir_graph_test.cc	(original)
+++ hugo/trunk/src/test/undir_graph_test.cc	Mon Apr 18 16:59:24 2005
@@ -56,26 +56,26 @@
   typedef typename Graph::UndirEdgeIt UEdgeIt;
   typedef typename Graph::EdgeIt EdgeIt;
 
-  cout << "Nodes" << endl;
+  std::cout << "Nodes" << std::endl;
   int i=0;
   for(NodeIt it(g); it!=INVALID; ++it, ++i) {
-    cout << "  " << i << ": " << g.id(it) << endl;
+    std::cout << "  " << i << ": " << g.id(it) << std::endl;
   }
 
-  cout << "UndirEdge" << endl;
+  std::cout << "UndirEdge" << std::endl;
   i=0;
   for(UEdgeIt it(g); it!=INVALID; ++it, ++i) {
-    cout << "  " << i << ": " << g.id(it) 
+    std::cout << "  " << i << ": " << g.id(it) 
 	 << " (" << g.id(g.source(it)) << ", " << g.id(g.target(it)) 
-	 << ")" << endl;
+	 << ")" << std::endl;
   }
 
-  cout << "Edge" << endl;
+  std::cout << "Edge" << std::endl;
   i=0;
   for(EdgeIt it(g); it!=INVALID; ++it, ++i) {
-    cout << "  " << i << ": " << g.id(it)
+    std::cout << "  " << i << ": " << g.id(it)
 	 << " (" << g.id(g.source(it)) << ", " << g.id(g.target(it)) 
-	 << ")" << endl;
+	 << ")" << std::endl;
   }
 
 }



More information about the Lemon-commits mailing list