COIN-OR::LEMON - Graph Library

source: lemon-0.x/src/test/path_test.cc @ 844:9bf990cb066d

Last change on this file since 844:9bf990cb066d was 832:fbee94295d75, checked in by Hegyi Péter, 20 years ago

Eliminating redundant lines.

File size: 2.8 KB
Line 
1#include <string>
2#include <iostream>
3#include <hugo/skeletons/path.h>
4#include <hugo/path.h>
5#include <hugo/list_graph.h>
6
7using namespace std;
8using namespace hugo;
9using namespace skeleton;
10
11template<class Path> void checkCompilePath(Path &P)
12{
13  typedef typename Path::EdgeIt EdgeIt;
14  typedef typename Path::NodeIt NodeIt;
15  typedef typename Path::GraphNode GraphNode;
16  typedef typename Path::GraphEdge GraphEdge;
17  //typedef typename Path::Builder Builder;
18  //??? ha csinalok ilyet es siman Builderrel peldanyositok, akkor warningol. Talan friend miatt? De ki az?
19
20  EdgeIt ei;
21  NodeIt ni;
22  GraphNode gn;
23  GraphEdge ge;
24
25  size_t st;
26  bool b;
27
28  //Path(const Graph &_G) {}      //the constructor has been already called
29
30  st=P.length();                  //size_t length() const {return 0;}
31  b=P.empty();                    //bool empty() const {}
32  P.clear();                      //void clear() {}
33
34  gn=P.head();                    //GraphNode/*It*/ head() const {return INVALID;}
35  gn=P.tail();                    //GraphNode/*It*/ tail() const {return INVALID;}
36
37  ei=P.first(ei);                 //It& first(It &i) const { return i=It(*this); }
38
39  ni=P.head(ei);                  //NodeIt head(const EdgeIt& e) const {}
40  ni=P.tail(ei);                  //NodeIt tail(const EdgeIt& e) const {}
41
42
43  ListGraph lg;
44  Path p(lg);
45
46  EdgeIt i;                       //EdgeIt() {}
47  EdgeIt j(INVALID);              //EdgeIt(Invalid) {}
48  EdgeIt k(p);                    //EdgeIt(const Path &_p) {}
49
50  i=++j;                          //EdgeIt& operator++() {}
51  b=(i==j);                       //bool operator==(const EdgeIt& e) const {return true;}
52  b=(i!=j);                       //bool operator!=(const EdgeIt& e) const {return true;}
53
54
55  NodeIt l;                       //NodeIt() {}
56  NodeIt m(INVALID);              //NodeIt(Invalid) {}
57  NodeIt n(p);                    //NodeIt(const Path &_p) {}
58
59  l=++m;                          //NodeIt& operator++() {}
60  b=(m==n);                       //bool operator==(const NodeIt& e) const {}
61  b=(m!=n);                       //bool operator!=(const NodeIt& e) const {}
62
63  typename Path::Builder builder(p);     //Builder(Path &_P) : P(_P) {}
64  builder.setStartNode(gn);              //void setStartNode(const GraphNode &) {}
65  builder.pushFront(ge);                 //void pushFront(const GraphEdge& e) {}
66  builder.pushBack(ge);                  //void pushBack(const GraphEdge& e) {}
67  builder.commit();                      //void commit() {}
68  builder.reserveFront(st);              //void reserveFront(size_t r) {}
69  builder.reserveBack(st);               //void reserveBack(size_t r) {}
70
71}
72
73template void checkCompilePath< skeleton::Path<ListGraph> >(skeleton::Path<ListGraph> &);
74template void checkCompilePath< DirPath<ListGraph> >(DirPath<ListGraph> &);
75template void checkCompilePath< UndirPath<ListGraph> >(UndirPath<ListGraph> &);
76
77int main()
78{
79}
Note: See TracBrowser for help on using the repository browser.