Changeset 174:44700ed9ffaa in lemon0.x for src/work/alpar
 Timestamp:
 03/12/04 10:19:54 (20 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@250
 Location:
 src/work/alpar
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

src/work/alpar/emptygraph.h
r165 r174 1 // *mode: c++; * 1 // * c++ * 2 #ifndef EMPTYGRAPH_H 3 #define EMPTYGRAPH_H 2 4 3 5 #include <invalid.h> … … 35 37 Node() {} //FIXME 36 38 /// Initialize the iterator to be invalid 37 Node(Invalid) {} ;39 Node(Invalid) {} 38 40 //Node(const Node &) {} 39 41 bool operator==(Node n) const { return true; } //FIXME … … 48 50 NodeIt() {} //FIXME 49 51 /// Initialize the iterator to be invalid 50 NodeIt(Invalid) {} ;52 NodeIt(Invalid) {} 51 53 /// Sets the iterator to the first node of \c G. 52 54 NodeIt(const EmptyGraph &G) {} … … 62 64 Edge() {} //FIXME 63 65 /// Initialize the iterator to be invalid 64 Edge(Invalid) {} ;66 Edge(Invalid) {} 65 67 //Edge(const Edge &) {} 66 68 bool operator==(Edge n) const { return true; } //FIXME … … 76 78 OutEdgeIt() {} 77 79 /// Initialize the iterator to be invalid 78 OutEdgeIt(Invalid) {} ;80 OutEdgeIt(Invalid) {} 79 81 /// This constructor sets the iterator to first outgoing edge. 80 82 … … 92 94 InEdgeIt() {} 93 95 /// Initialize the iterator to be invalid 94 InEdgeIt(Invalid) {} ;96 InEdgeIt(Invalid) {} 95 97 InEdgeIt(const EmptyGraph &, Node) {} 96 98 }; … … 102 104 EdgeIt() {} 103 105 /// Initialize the iterator to be invalid 104 EdgeIt(Invalid) {} ;106 EdgeIt(Invalid) {} 105 107 EdgeIt(const EmptyGraph &) {} 106 108 }; … … 150 152 151 153 /// Checks if a node iterator is valid 152 bool valid(const Node) const { return true;} ;154 bool valid(const Node) const { return true;} 153 155 /// Checks if an edge iterator is valid 154 bool valid(const Edge) const { return true;} ;156 bool valid(const Edge) const { return true;} 155 157 156 158 ///Gives back the \e id of a node. 157 int id(const Node) const { return 0;} ;159 int id(const Node) const { return 0;} 158 160 ///Gives back the \e id of an edge. 159 int id(const Edge) const { return 0;} ;161 int id(const Edge) const { return 0;} 160 162 161 163 //void setInvalid(Node &) const {}; … … 173 175 int edgeNum() { return 0;} 174 176 175 EmptyGraph() {} ;176 EmptyGraph(const EmptyGraph &G) {} ;177 EmptyGraph() {} 178 EmptyGraph(const EmptyGraph &G) {} 177 179 178 180 … … 218 220 // @} 219 221 220 } ;222 } //namespace hugo 221 223 222 224 … … 237 239 238 240 // } 241 242 #endif // EMPTYGRAPH_H 
src/work/alpar/smart_graph.h
r164 r174 97 97 Node head(Edge e) const { return edges[e.n].head; } 98 98 99 // Node aNode(const OutEdgeIt& e) const { return tail(e); } 100 // Node aNode(const InEdgeIt& e) const { return head(e); } 99 // Marci 100 Node aNode(OutEdgeIt e) const { return edges[e.n].tail; } 101 Node aNode(InEdgeIt e) const { return edges[e.n].head; } 101 102 // //Node aNode(const SymEdge& e) const { return e.aNode(); } 102 103 103 // Node bNode(const OutEdgeIt& e) const { return head(e); } 104 // Node bNode(const InEdgeIt& e) const { return tail(e); } 104 // Marci 105 Node bNode(OutEdgeIt e) const { return edges[e.n].head; } 106 Node bNode(InEdgeIt e) const { return edges[e.n].tail; } 105 107 // //Node bNode(const SymEdge& e) const { return e.bNode(); } 106 108 … … 117 119 It first() const { 118 120 It e; 119 getFirst(e); 121 //Marci 122 /*getF*/first(e); 120 123 return e; 121 124 } … … 124 127 It first(Node v) const { 125 128 It e; 126 getFirst(e, v); 129 //Marci 130 /*getF*/first(e, v); 127 131 return e; 128 132 } … … 139 143 //{ It tmp; tmp.n=it.n+1; return tmp; } 140 144 141 Node& next(Node& it) const { it.n=(it.n+2)%nodes.size()1; return it; } 145 //FIXME correction Marci: I changed to NodeIt from Node 146 //NodeIt& next(NodeIt& it) const { it.n=(it.n+2)%nodes.size()1; return it; } 147 NodeIt& next(NodeIt& it) const { 148 it.n=(it.n+2)%(nodes.size()+1)1; 149 return it; 150 } 142 151 OutEdgeIt& next(OutEdgeIt& it) const 143 152 { it.n=edges[it.n].next_out; return it; } … … 217 226 public: 218 227 Edge() { } 219 Edge (Invalid i) { n=1; } 228 // Marci: kiszedtem az Invalid ibol az it 229 Edge (Invalid) { n=1; } 220 230 bool operator==(const Edge i) const {return n==i.n;} 221 231 bool operator!=(const Edge i) const {return n!=i.n;}
Note: See TracChangeset
for help on using the changeset viewer.