Changeset 515:a7eeb8af6b34 in lemon0.x
 Timestamp:
 05/03/04 19:06:38 (17 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@675
 Location:
 src
 Files:

 3 edited
Legend:
 Unmodified
 Added
 Removed

src/include/skeletons/graph.h
r503 r515 88 88 NodeIt(Invalid) {} 89 89 /// Sets the iterator to the first node of \c G. 90 NodeIt(const GraphSkeleton & G) {}90 NodeIt(const GraphSkeleton &) {} 91 91 /// @warning The default constructor sets the iterator 92 92 /// to an undefined value. … … 135 135 ///@param n the node 136 136 ///@param G the graph 137 OutEdgeIt(const GraphSkeleton & G, Node n) {}137 OutEdgeIt(const GraphSkeleton &, Node) {} 138 138 }; 139 139 … … 286 286 typedef Node KeyType; 287 287 288 NodeMap(const GraphSkeleton & G) {}289 NodeMap(const GraphSkeleton & G, T t) {}290 291 template<typename TT> NodeMap(const NodeMap<TT> & m) {}288 NodeMap(const GraphSkeleton &) {} 289 NodeMap(const GraphSkeleton &, T) {} 290 291 template<typename TT> NodeMap(const NodeMap<TT> &) {} 292 292 293 293 /// Sets the value of a node. … … 324 324 typedef Edge KeyType; 325 325 326 EdgeMap(const GraphSkeleton & G) {}327 EdgeMap(const GraphSkeleton & G, T t) {}326 EdgeMap(const GraphSkeleton &) {} 327 EdgeMap(const GraphSkeleton &, T ) {} 328 328 329 329 ///\todo It can copy between different types. 330 330 /// 331 template<typename TT> EdgeMap(const EdgeMap<TT> & m) {}331 template<typename TT> EdgeMap(const EdgeMap<TT> &) {} 332 332 333 333 void set(Edge, T) {} 
src/test/graph_test.cc
r504 r515 109 109 { 110 110 Node k; 111 typename Graph::NodeMap<int> m(G); 112 typename Graph::NodeMap<int> const &cm = m; //Const map 113 typename Graph::NodeMap<int> mdef(G,12); //Inicialize with default value 114 typename Graph::NodeMap<int> mm(cm); //Copy 115 typename Graph::NodeMap<double> dm(cm); //Copy from another type 111 typename Graph::template NodeMap<int> m(G); 112 typename Graph::template NodeMap<int> const &cm = m; //Const map 113 //Inicialize with default value 114 typename Graph::template NodeMap<int> mdef(G,12); 115 typename Graph::template NodeMap<int> mm(cm); //Copy 116 typename Graph::template NodeMap<double> dm(cm); //Copy from another type 116 117 int v; 117 118 v=m[k]; m[k]=v; m.set(k,v); … … 123 124 { //bool NodeMap 124 125 Node k; 125 typename Graph::NodeMap<bool> m(G); 126 typename Graph::NodeMap<bool> const &cm = m; //Const map 127 typename Graph::NodeMap<bool> mdef(G,12); //Inicialize with default value 128 typename Graph::NodeMap<bool> mm(cm); //Copy 129 typename Graph::NodeMap<int> dm(cm); //Copy from another type 126 typename Graph::template NodeMap<bool> m(G); 127 typename Graph::template NodeMap<bool> const &cm = m; //Const map 128 //Inicialize with default value 129 typename Graph::template NodeMap<bool> mdef(G,12); 130 typename Graph::template NodeMap<bool> mm(cm); //Copy 131 typename Graph::template NodeMap<int> dm(cm); //Copy from another type 130 132 bool v; 131 133 v=m[k]; m[k]=v; m.set(k,v); … … 139 141 { 140 142 Edge k; 141 typename Graph::EdgeMap<int> m(G); 142 typename Graph::EdgeMap<int> const &cm = m; //Const map 143 typename Graph::EdgeMap<int> mdef(G,12); //Inicialize with default value 144 typename Graph::EdgeMap<int> mm(cm); //Copy 145 typename Graph::EdgeMap<double> dm(cm); //Copy from another type 143 typename Graph::template EdgeMap<int> m(G); 144 typename Graph::template EdgeMap<int> const &cm = m; //Const map 145 //Inicialize with default value 146 typename Graph::template EdgeMap<int> mdef(G,12); 147 typename Graph::template EdgeMap<int> mm(cm); //Copy 148 typename Graph::template EdgeMap<double> dm(cm); //Copy from another type 146 149 int v; 147 150 v=m[k]; m[k]=v; m.set(k,v); … … 153 156 { //bool EdgeMap 154 157 Edge k; 155 typename Graph::EdgeMap<bool> m(G); 156 typename Graph::EdgeMap<bool> const &cm = m; //Const map 157 typename Graph::EdgeMap<bool> mdef(G,12); //Inicialize with default value 158 typename Graph::EdgeMap<bool> mm(cm); //Copy 159 typename Graph::EdgeMap<int> dm(cm); //Copy from another type 158 typename Graph::template EdgeMap<bool> m(G); 159 typename Graph::template EdgeMap<bool> const &cm = m; //Const map 160 //Inicialize with default value 161 typename Graph::template EdgeMap<bool> mdef(G,12); 162 typename Graph::template EdgeMap<bool> mm(cm); //Copy 163 typename Graph::template EdgeMap<int> dm(cm); //Copy from another type 160 164 bool v; 161 165 v=m[k]; m[k]=v; m.set(k,v); 
src/work/alpar/list_graph.h
r508 r515 64 64 const ListGraph* G; 65 65 public: 66 virtual void add(const Key k) = NULL;67 virtual void erase(const Key k) = NULL;66 virtual void add(const Key k) = 0; 67 virtual void erase(const Key k) = 0; 68 68 DynMapBase(const ListGraph &_G) : G(&_G) {} 69 69 virtual ~DynMapBase() {} … … 764 764 const NodeSet* G; 765 765 public: 766 virtual void add(const Key k) = NULL;767 virtual void erase(const Key k) = NULL;766 virtual void add(const Key k) = 0; 767 virtual void erase(const Key k) = 0; 768 768 DynMapBase(const NodeSet &_G) : G(&_G) {} 769 769 virtual ~DynMapBase() {} … … 1153 1153 NodeGraphType &G; 1154 1154 1155 public: 1155 1156 class Node; 1156 1157 1158 private: 1157 1159 //Edges are double linked. 1158 1160 //The free edges are only single linked using the "next_in" field. … … 1171 1173 1172 1174 1173 typename NodeGraphType:: NodeMap<NodeT> nodes;1175 typename NodeGraphType::template NodeMap<NodeT> nodes; 1174 1176 1175 1177 std::vector<EdgeT> edges; … … 1184 1186 const EdgeSet* G; 1185 1187 public: 1186 virtual void add(const Key k) = NULL;1187 virtual void erase(const Key k) = NULL;1188 virtual void add(const Key k) = 0; 1189 virtual void erase(const Key k) = 0; 1188 1190 DynMapBase(const EdgeSet &_G) : G(&_G) {} 1189 1191 virtual ~DynMapBase() {} … … 1450 1452 for(G.first(m); 1451 1453 G.valid(m) && G.nodes[m].first_in == 1; G.next(m)); 1452 n = G.valid(m)?1:G.nodes[m].first_in; 1454 //AJJAJ! This is a non sense!!!!!!! 1455 this>n = G.valid(m)?1:G.nodes[m].first_in; 1453 1456 } 1454 1457 EdgeIt (Invalid i) : Edge(i) { } … … 1456 1459 ///\bug This is a workaround until somebody tells me how to 1457 1460 ///make class \c SymEdgeSet::SymEdgeMap friend of Edge 1458 int &idref() {return n;}1461 int &idref() {return this>n;} 1459 1462 }; 1460 1463 … … 1476 1479 }; 1477 1480 1478 template <typename T> class NodeMap : public NodeGraphType::NodeMap<T> 1481 template <typename T> class NodeMap : 1482 public NodeGraphType::template NodeMap<T> 1479 1483 { 1480 1484 public: 1481 1485 NodeMap(const EdgeSet &_G) : 1482 NodeGraphType::NodeMap<T>(_G.G) { } 1486 NodeGraphType::NodeMap(_G.G) { } //AJAJJ <T> would be wrong!!! 1483 1487 NodeMap(const EdgeSet &_G,const T &t) : 1484 NodeGraphType::NodeMap <T>(_G.G,t) { }1488 NodeGraphType::NodeMap(_G.G,t) { } 1485 1489 //It is unnecessary 1486 NodeMap(const typename NodeGraphType:: NodeMap<T> &m)1487 : NodeGraphType::NodeMap<T>(m) { }1490 NodeMap(const typename NodeGraphType::template NodeMap<T> &m) : 1491 NodeGraphType::NodeMap(m) { } 1488 1492 1489 1493 ///\todo It can copy between different types. 1490 1494 /// 1491 1495 template<typename TT> 1492 NodeMap(const typename NodeGraphType:: NodeMap<TT> &m)1493 : NodeGraphType::NodeMap <T>(m) { }1496 NodeMap(const typename NodeGraphType::template NodeMap<TT> &m) 1497 : NodeGraphType::NodeMap(m) { } 1494 1498 }; 1495 1499
Note: See TracChangeset
for help on using the changeset viewer.