Changeset 503:769f31e9f7b0 in lemon0.x
 Timestamp:
 05/03/04 09:27:29 (17 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@663
 Location:
 src
 Files:

 1 added
 3 edited
Legend:
 Unmodified
 Added
 Removed

src/include/skeletons/graph.h
r463 r503 1 1 // * c++ * 2 #ifndef HUGO_ GRAPH_H3 #define HUGO_ GRAPH_H2 #ifndef HUGO_SKELETON_GRAPH_H 3 #define HUGO_SKELETON_GRAPH_H 4 4 5 5 ///\file … … 59 59 /// Two iterators are equal if and only if they point to the 60 60 /// same object or both are invalid. 61 bool operator==(Node n) const { return true; }61 bool operator==(Node) const { return true; } 62 62 63 63 /// \sa \ref operator==(Node n) 64 64 /// 65 bool operator!=(Node n) const { return true; }66 67 bool operator<(Node n) const { return true; }65 bool operator!=(Node) const { return true; } 66 67 bool operator<(Node) const { return true; } 68 68 }; 69 69 … … 91 91 /// @warning The default constructor sets the iterator 92 92 /// to an undefined value. 93 NodeIt(const NodeIt & ) {}93 NodeIt(const NodeIt &n) : Node(n) {} 94 94 }; 95 95 … … 105 105 /// Two iterators are equal if and only if they point to the 106 106 /// same object or both are invalid. 107 bool operator==(Edge n) const { return true; }108 bool operator!=(Edge n) const { return true; }109 bool operator<(Edge n) const { return true; }107 bool operator==(Edge) const { return true; } 108 bool operator!=(Edge) const { return true; } 109 bool operator<(Edge) const { return true; } 110 110 }; 111 111 … … 188 188 189 189 /// The first incoming edge. 190 InEdgeIt &first(InEdgeIt &i, Node n) const { return i;}190 InEdgeIt &first(InEdgeIt &i, Node) const { return i;} 191 191 /// The first outgoing edge. 192 OutEdgeIt &first(OutEdgeIt &i, Node n) const { return i;}192 OutEdgeIt &first(OutEdgeIt &i, Node) const { return i;} 193 193 // SymEdgeIt &first(SymEdgeIt &, Node) const { return i;} 194 194 /// The first edge of the Graph. … … 259 259 ///and head node \c head. 260 260 ///\return the new edge. 261 Edge addEdge(Node tail, Node head) { return INVALID;}261 Edge addEdge(Node, Node) { return INVALID;} 262 262 263 263 /// Resets the graph. … … 295 295 /// Sets the value associated with node \c i to the value \c t. 296 296 /// 297 void set(Node i, T t) {}298 // /Gets the value of a node.299 T get(Node i) const {return *(T*)0;} //FIXME: Is it necessary300 T &operator[](Node i) {return *(T*)0;}301 const T &operator[](Node i) const {return *(T*)0;}297 void set(Node, T) {} 298 // Gets the value of a node. 299 //T get(Node i) const {return *(T*)0;} //FIXME: Is it necessary? 300 T &operator[](Node) {return *(T*)0;} 301 const T &operator[](Node) const {return *(T*)0;} 302 302 303 303 /// Updates the map if the graph has been changed … … 327 327 EdgeMap(const GraphSkeleton &G, T t) {} 328 328 329 void set(Edge i, T t) {} 330 T get(Edge i) const {return *(T*)0;} 331 T &operator[](Edge i) {return *(T*)0;} 329 ///\todo It can copy between different types. 330 /// 331 template<typename TT> EdgeMap(const EdgeMap<TT> &m) {} 332 333 void set(Edge, T) {} 334 //T get(Edge) const {return *(T*)0;} 335 T &operator[](Edge) {return *(T*)0;} 336 const T &operator[](Edge) const {return *(T*)0;} 332 337 333 338 void update() {} … … 392 397 // } 393 398 394 #endif // HUGO_ GRAPH_H399 #endif // HUGO_SKELETON_GRAPH_H 
src/include/smart_graph.h
r491 r503 81 81 public: 82 82 83 83 84 class NodeIt; 84 85 class EdgeIt; … … 139 140 bool valid(Node n) const { return n.n!=1; } 140 141 142 ///\deprecated Use 143 ///\code 144 /// e=INVALID; 145 ///\endcode 146 ///instead. 141 147 void setInvalid(Edge &e) { e.n=1; } 148 ///\deprecated Use 149 ///\code 150 /// e=INVALID; 151 ///\endcode 152 ///instead. 142 153 void setInvalid(Node &n) { n.n=1; } 143 154 … … 198 209 public: 199 210 Node() {} 200 Node (Invalid i) { n=1; }211 Node (Invalid) { n=1; } 201 212 bool operator==(const Node i) const {return n==i.n;} 202 213 bool operator!=(const Node i) const {return n!=i.n;} … … 380 391 DynMapBase<Edge>(*m.G), container(m.container) 381 392 { 382 G>dyn_ node_maps.push_back(this);393 G>dyn_edge_maps.push_back(this); 383 394 } 384 395 … … 390 401 DynMapBase<Edge>(*m.G) 391 402 { 392 G>dyn_ node_maps.push_back(this);403 G>dyn_edge_maps.push_back(this); 393 404 typename std::vector<TT>::const_iterator i; 394 405 for(typename std::vector<TT>::const_iterator i=m.container.begin(); 
src/work/alpar/list_graph.h
r491 r503 317 317 public: 318 318 Node() {} 319 Node (Invalid i) { n=1; }319 Node (Invalid) { n=1; } 320 320 bool operator==(const Node i) const {return n==i.n;} 321 321 bool operator!=(const Node i) const {return n!=i.n;} … … 504 504 DynMapBase<Edge>(*m.G), container(m.container) 505 505 { 506 G>dyn_ node_maps.push_back(this);506 G>dyn_edge_maps.push_back(this); 507 507 } 508 508 … … 514 514 DynMapBase<Edge>(*m.G) 515 515 { 516 G>dyn_ node_maps.push_back(this);516 G>dyn_edge_maps.push_back(this); 517 517 typename std::vector<TT>::const_iterator i; 518 518 for(typename std::vector<TT>::const_iterator i=m.container.begin(); … … 1295 1295 } 1296 1296 else { 1297 typename NodeGraphType::Noden;1298 for(n= G.next(edges[it.n].head);1299 G.valid(n) && nodes[n].first_in == 1;1300 G.next(n)) ;1301 it.n = ( G.valid(n))?1:nodes[n].first_in;1297 NodeIt n; 1298 for(n=next(edges[it.n].head); 1299 valid(n) && nodes[n].first_in == 1; 1300 next(n)) ; 1301 it.n = (valid(n))?1:nodes[n].first_in; 1302 1302 } 1303 1303 return it; … … 1386 1386 // } 1387 1387 1388 public: 1388 1389 class Node : public NodeGraphType::Node { 1389 1390 friend class EdgeSet; … … 1445 1446 public: 1446 1447 EdgeIt(const EdgeSet& G) : Edge() { 1447 typename NodeGraphType::Node m; 1448 // typename NodeGraphType::Node m; 1449 NodeIt m; 1448 1450 for(G.first(m); 1449 G.valid(m) && nodes[m].first_in == 1; G.next[m]);1450 n = G.valid(m)?1: nodes[m].first_in;1451 G.valid(m) && G.nodes[m].first_in == 1; G.next(m)); 1452 n = G.valid(m)?1:G.nodes[m].first_in; 1451 1453 } 1452 1454 EdgeIt (Invalid i) : Edge(i) { } … … 1515 1517 DynMapBase<Edge>(*m.G), container(m.container) 1516 1518 { 1517 G>dyn_ node_maps.push_back(this);1519 G>dyn_edge_maps.push_back(this); 1518 1520 } 1519 1521 … … 1525 1527 DynMapBase<Edge>(*m.G) 1526 1528 { 1527 G>dyn_ node_maps.push_back(this);1529 G>dyn_edge_maps.push_back(this); 1528 1530 typename std::vector<TT>::const_iterator i; 1529 1531 for(typename std::vector<TT>::const_iterator i=m.container.begin();
Note: See TracChangeset
for help on using the changeset viewer.