COIN-OR::LEMON - Graph Library

source: lemon-0.x/src/test/path_test.cc @ 831:b6ae3446098a

Last change on this file since 831:b6ae3446098a was 831:b6ae3446098a, checked in by Hegyi Péter, 16 years ago

The first version of new path test program. The old became old_path_test.

File size: 2.9 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  //??? operator GraphEdge () const {}
51
52  //INVALIDra megy a ++????
53  i=++j;                          //EdgeIt& operator++() {}
54  b=(i==j);                       //bool operator==(const EdgeIt& e) const {return true;}
55  b=(i!=j);                       //bool operator!=(const EdgeIt& e) const {return true;}
56
57
58  NodeIt l;                       //NodeIt() {}
59  NodeIt m(INVALID);              //NodeIt(Invalid) {}
60  NodeIt n(p);                    //NodeIt(const Path &_p) {}
61
62  //operator const GraphNode& () const {}
63
64  l=++m;                          //NodeIt& operator++() {}
65  b=(m==n);                       //bool operator==(const NodeIt& e) const {}
66  b=(m!=n);                       //bool operator!=(const NodeIt& e) const {}
67
68  typename Path::Builder builder(p);     //Builder(Path &_P) : P(_P) {}
69  builder.setStartNode(gn);              //void setStartNode(const GraphNode &) {}
70  builder.pushFront(ge);                 //void pushFront(const GraphEdge& e) {}
71  builder.pushBack(ge);                  //void pushBack(const GraphEdge& e) {}
72  builder.commit();                      //void commit() {}
73  builder.reserveFront(st);              //void reserveFront(size_t r) {}
74  builder.reserveBack(st);               //void reserveBack(size_t r) {}
75
76}
77
78template void checkCompilePath< skeleton::Path<ListGraph> >(skeleton::Path<ListGraph> &);
79template void checkCompilePath< DirPath<ListGraph> >(DirPath<ListGraph> &);
80template void checkCompilePath< UndirPath<ListGraph> >(UndirPath<ListGraph> &);
81
82int main()
83{
84}
Note: See TracBrowser for help on using the repository browser.