New symmetric Graph concept.
New symmetric list and smart graph.
Symmetric Graph tests based on the Graph Tests.
2 * src/test/path_test.cc - Part of HUGOlib, a generic C++ optimization library
4 * Copyright (C) 2004 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
5 * (Egervary Combinatorial Optimization Research Group, EGRES).
7 * Permission to use, modify and distribute this software is granted
8 * provided that this copyright notice appears in all copies. For
9 * precise terms see the accompanying LICENSE file.
11 * This software is provided "AS IS" with no warranty of any kind,
12 * express or implied, and with no claim as to its suitability for any
19 #include <hugo/skeletons/path.h>
20 #include <hugo/path.h>
21 #include <hugo/list_graph.h>
25 using namespace skeleton;
27 template<class Path> void checkCompilePath(Path &P)
29 typedef typename Path::EdgeIt EdgeIt;
30 typedef typename Path::NodeIt NodeIt;
31 typedef typename Path::GraphNode GraphNode;
32 typedef typename Path::GraphEdge GraphEdge;
33 //typedef typename Path::Builder Builder;
34 //??? ha csinalok ilyet es siman Builderrel peldanyositok, akkor warningol. Talan friend miatt? De ki az?
44 //Path(const Graph &_G) {} //the constructor has been already called
46 st=P.length(); //size_t length() const {return 0;}
47 b=P.empty(); //bool empty() const {}
48 P.clear(); //void clear() {}
50 gn=P.head(); //GraphNode/*It*/ head() const {return INVALID;}
51 gn=P.tail(); //GraphNode/*It*/ tail() const {return INVALID;}
53 ei=P.first(ei); //It& first(It &i) const { return i=It(*this); }
55 ni=P.head(ei); //NodeIt head(const EdgeIt& e) const {}
56 ni=P.tail(ei); //NodeIt tail(const EdgeIt& e) const {}
62 EdgeIt i; //EdgeIt() {}
63 EdgeIt j(INVALID); //EdgeIt(Invalid) {}
64 EdgeIt k(p); //EdgeIt(const Path &_p) {}
66 i=++j; //EdgeIt& operator++() {}
67 b=(i==j); //bool operator==(const EdgeIt& e) const {return true;}
68 b=(i!=j); //bool operator!=(const EdgeIt& e) const {return true;}
71 NodeIt l; //NodeIt() {}
72 NodeIt m(INVALID); //NodeIt(Invalid) {}
73 NodeIt n(p); //NodeIt(const Path &_p) {}
75 l=++m; //NodeIt& operator++() {}
76 b=(m==n); //bool operator==(const NodeIt& e) const {}
77 b=(m!=n); //bool operator!=(const NodeIt& e) const {}
79 typename Path::Builder builder(p); //Builder(Path &_P) : P(_P) {}
80 builder.setStartNode(gn); //void setStartNode(const GraphNode &) {}
81 builder.pushFront(ge); //void pushFront(const GraphEdge& e) {}
82 builder.pushBack(ge); //void pushBack(const GraphEdge& e) {}
83 builder.commit(); //void commit() {}
84 builder.reserveFront(st); //void reserveFront(size_t r) {}
85 builder.reserveBack(st); //void reserveBack(size_t r) {}
89 template void checkCompilePath< skeleton::Path<ListGraph> >(skeleton::Path<ListGraph> &);
90 template void checkCompilePath< DirPath<ListGraph> >(DirPath<ListGraph> &);
91 template void checkCompilePath< UndirPath<ListGraph> >(UndirPath<ListGraph> &);