[Lemon-commits] [lemon_svn] alpar: r675 - in hugo/trunk/src: include/skeletons test work/alpar
Lemon SVN
svn at lemon.cs.elte.hu
Mon Nov 6 20:40:54 CET 2006
Author: alpar
Date: Mon May 3 19:06:38 2004
New Revision: 675
Modified:
hugo/trunk/src/include/skeletons/graph.h
hugo/trunk/src/test/graph_test.cc
hugo/trunk/src/work/alpar/list_graph.h
Log:
To be compatible with gcc-3.4.0 ...
Modified: hugo/trunk/src/include/skeletons/graph.h
==============================================================================
--- hugo/trunk/src/include/skeletons/graph.h (original)
+++ hugo/trunk/src/include/skeletons/graph.h Mon May 3 19:06:38 2004
@@ -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<typename TT> NodeMap(const NodeMap<TT> &m) {}
+ template<typename TT> NodeMap(const NodeMap<TT> &) {}
/// 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<typename TT> EdgeMap(const EdgeMap<TT> &m) {}
+ template<typename TT> EdgeMap(const EdgeMap<TT> &) {}
void set(Edge, T) {}
//T get(Edge) const {return *(T*)0;}
Modified: hugo/trunk/src/test/graph_test.cc
==============================================================================
--- hugo/trunk/src/test/graph_test.cc (original)
+++ hugo/trunk/src/test/graph_test.cc Mon May 3 19:06:38 2004
@@ -108,11 +108,12 @@
//NodeMap tests
{
Node k;
- typename Graph::NodeMap<int> m(G);
- typename Graph::NodeMap<int> const &cm = m; //Const map
- typename Graph::NodeMap<int> mdef(G,12); //Inicialize with default value
- typename Graph::NodeMap<int> mm(cm); //Copy
- typename Graph::NodeMap<double> dm(cm); //Copy from another type
+ typename Graph::template NodeMap<int> m(G);
+ typename Graph::template NodeMap<int> const &cm = m; //Const map
+ //Inicialize with default value
+ typename Graph::template NodeMap<int> mdef(G,12);
+ typename Graph::template NodeMap<int> mm(cm); //Copy
+ typename Graph::template NodeMap<double> 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<bool> m(G);
- typename Graph::NodeMap<bool> const &cm = m; //Const map
- typename Graph::NodeMap<bool> mdef(G,12); //Inicialize with default value
- typename Graph::NodeMap<bool> mm(cm); //Copy
- typename Graph::NodeMap<int> dm(cm); //Copy from another type
+ typename Graph::template NodeMap<bool> m(G);
+ typename Graph::template NodeMap<bool> const &cm = m; //Const map
+ //Inicialize with default value
+ typename Graph::template NodeMap<bool> mdef(G,12);
+ typename Graph::template NodeMap<bool> mm(cm); //Copy
+ typename Graph::template NodeMap<int> 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<int> m(G);
- typename Graph::EdgeMap<int> const &cm = m; //Const map
- typename Graph::EdgeMap<int> mdef(G,12); //Inicialize with default value
- typename Graph::EdgeMap<int> mm(cm); //Copy
- typename Graph::EdgeMap<double> dm(cm); //Copy from another type
+ typename Graph::template EdgeMap<int> m(G);
+ typename Graph::template EdgeMap<int> const &cm = m; //Const map
+ //Inicialize with default value
+ typename Graph::template EdgeMap<int> mdef(G,12);
+ typename Graph::template EdgeMap<int> mm(cm); //Copy
+ typename Graph::template EdgeMap<double> 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<bool> m(G);
- typename Graph::EdgeMap<bool> const &cm = m; //Const map
- typename Graph::EdgeMap<bool> mdef(G,12); //Inicialize with default value
- typename Graph::EdgeMap<bool> mm(cm); //Copy
- typename Graph::EdgeMap<int> dm(cm); //Copy from another type
+ typename Graph::template EdgeMap<bool> m(G);
+ typename Graph::template EdgeMap<bool> const &cm = m; //Const map
+ //Inicialize with default value
+ typename Graph::template EdgeMap<bool> mdef(G,12);
+ typename Graph::template EdgeMap<bool> mm(cm); //Copy
+ typename Graph::template EdgeMap<int> dm(cm); //Copy from another type
bool v;
v=m[k]; m[k]=v; m.set(k,v);
v=cm[k];
Modified: hugo/trunk/src/work/alpar/list_graph.h
==============================================================================
--- hugo/trunk/src/work/alpar/list_graph.h (original)
+++ hugo/trunk/src/work/alpar/list_graph.h Mon May 3 19:06:38 2004
@@ -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<NodeT> nodes;
+ typename NodeGraphType::template NodeMap<NodeT> nodes;
std::vector<EdgeT> 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 <typename T> class NodeMap : public NodeGraphType::NodeMap<T>
+ template <typename T> class NodeMap :
+ public NodeGraphType::template NodeMap<T>
{
public:
NodeMap(const EdgeSet &_G) :
- NodeGraphType::NodeMap<T>(_G.G) { }
+ NodeGraphType::NodeMap(_G.G) { } //AJAJJ <T> would be wrong!!!
NodeMap(const EdgeSet &_G,const T &t) :
- NodeGraphType::NodeMap<T>(_G.G,t) { }
+ NodeGraphType::NodeMap(_G.G,t) { }
//It is unnecessary
- NodeMap(const typename NodeGraphType::NodeMap<T> &m)
- : NodeGraphType::NodeMap<T>(m) { }
+ NodeMap(const typename NodeGraphType::template NodeMap<T> &m) :
+ NodeGraphType::NodeMap(m) { }
///\todo It can copy between different types.
///
template<typename TT>
- NodeMap(const typename NodeGraphType::NodeMap<TT> &m)
- : NodeGraphType::NodeMap<T>(m) { }
+ NodeMap(const typename NodeGraphType::template NodeMap<TT> &m)
+ : NodeGraphType::NodeMap(m) { }
};
template <typename T> class EdgeMap : public DynMapBase<Edge>
More information about the Lemon-commits
mailing list