src/work/alpar/gwrapper.h
changeset 145 07c32a103bbb
parent 105 a3c73e9b9b2e
child 147 f3f1d7a4a8d3
equal deleted inserted replaced
3:4f9c7bc0a288 4:1187ec5d4171
   115   RevGraphWrapper() {graph = NULL;}
   115   RevGraphWrapper() {graph = NULL;}
   116   RevGraphWrapper(G &g) {graph = &g;}
   116   RevGraphWrapper(G &g) {graph = &g;}
   117 };
   117 };
   118 
   118 
   119 template<typename G>
   119 template<typename G>
       
   120 class RevGraphExt : public G
       
   121 {
       
   122 public:
       
   123   //  typedef G BaseGraph;
       
   124 
       
   125   typedef typename G::EdgeIt EdgeIt;
       
   126   
       
   127   typedef typename G::InEdgeIt OutEdgeIt;
       
   128   typedef typename G::OutEdgeIt InEdgeIt;
       
   129   typedef typename G::SymEdgeIt SymEdgeIt;
       
   130   typedef typename G::EachEdgeIt EachEdgeIt;
       
   131 
       
   132   typedef typename G::NodeIt NodeIt;
       
   133     
       
   134 //   template<typename I> I &getFirst(I &i); { return graph->getFirst(i); }
       
   135 //   template<typename I,typename P> I &getFirst(I &i,const P &p);
       
   136 //   { return graph->getFirst(i,p); }
       
   137 //   template<typename I> I next(const I i); { return graph->goNext(i); }
       
   138 //   template<typename I> I &goNext(I &i); { return graph->goNext(i); }
       
   139 
       
   140   NodeIt head(const EdgeIt &e);
       
   141   { return G::tail(e); }
       
   142   NodeIt tail(const EdgeIt &e);
       
   143   { return G::head(e); }
       
   144   
       
   145 //   template<typename I> NodeIt aNode(const I e);
       
   146 //   { return graph->aNode(e); }
       
   147 //   template<typename I> NodeIt bNode(const I e);
       
   148 //   { return graph->bNode(e); }
       
   149   
       
   150 //   template<typename I> bool valid(const I i);
       
   151 //   { return graph->valid(i); }
       
   152   
       
   153 //   template<typename I> void setInvalid(const I &i);
       
   154 //   { return graph->setInvalid(i); }
       
   155   
       
   156 //   NodeIt addNode(); { return graph->addNode(); }
       
   157 
       
   158   EdgeIt addEdge(const NodeIt from,const NodeIt to);
       
   159   { return G::addEdge(to,from); }
       
   160   
       
   161 //   template<I> void delete(I i); { graph->delete(i); }
       
   162   
       
   163 //   void clean();  { graph->clean(); }
       
   164   
       
   165 //   template<class T> class NodeMap : public typename G::NodeMap<T>;
       
   166 //   template<class T> class EdgeMap : public typename G::EdgeMap<T>;
       
   167   
       
   168 //   void SetG(G &g) {graph = &g;}
       
   169   
       
   170 //   RevGraphWrapper() {graph = NULL;}
       
   171 //   RevGraphWrapper(G &g) {graph = &g;}
       
   172 };
       
   173 
       
   174 template<typename G>
   120 class SymGraphWrapper
   175 class SymGraphWrapper
   121 {
   176 {
   122   G *graph;
   177   G *graph;
   123   
   178   
   124 public:
   179 public:
   169   void SetG(G &g) {graph = &g;}
   224   void SetG(G &g) {graph = &g;}
   170   
   225   
   171   RevGraphWrapper() {graph = NULL;}
   226   RevGraphWrapper() {graph = NULL;}
   172   RevGraphWrapper(G &g) {graph = &g;}
   227   RevGraphWrapper(G &g) {graph = &g;}
   173 };
   228 };
       
   229 
       
   230 
       
   231 
       
   232 
       
   233 
       
   234 
       
   235 
       
   236 
       
   237 
       
   238 
       
   239 
       
   240 
       
   241 
       
   242 
       
   243 
       
   244 
       
   245 
   174 
   246 
   175 
   247 
   176 // FIXME: comparison should be made better!!!
   248 // FIXME: comparison should be made better!!!
   177 template<typename G, typename lomap, typename fmap, typename himap>
   249 template<typename G, typename lomap, typename fmap, typename himap>
   178 class ResGraphWrapper
   250 class ResGraphWrapper