Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

sym_graph.h

Go to the documentation of this file.
00001 /* -*- C++ -*-
00002  * src/lemon/concept/graph.h - Part of LEMON, a generic C++ optimization library
00003  *
00004  * Copyright (C) 2004 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
00005  * (Egervary Combinatorial Optimization Research Group, EGRES).
00006  *
00007  * Permission to use, modify and distribute this software is granted
00008  * provided that this copyright notice appears in all copies. For
00009  * precise terms see the accompanying LICENSE file.
00010  *
00011  * This software is provided "AS IS" with no warranty of any kind,
00012  * express or implied, and with no claim as to its suitability for any
00013  * purpose.
00014  *
00015  */
00016 
00017 #ifndef LEMON_CONCEPT_SYM_GRAPH_H
00018 #define LEMON_CONCEPT_SYM_GRAPH_H
00019 
00023 
00024 #include <lemon/invalid.h>
00025 #include <lemon/concept/graph.h>
00026 #include <lemon/concept/maps.h>
00027 
00028 namespace lemon {
00029   namespace concept {
00030     
00033 
00035   
00049     class StaticSymGraph
00050     {
00051     public:
00053 
00056       StaticSymGraph() { }
00058 
00059 //       ///\todo It is not clear, what we expect from a copy constructor.
00060 //       ///E.g. How to assign the nodes/edges to each other? What about maps?
00061 //       StaticGraph(const StaticGraph& g) { }
00062 
00065 
00070       class Node {
00071       public:
00073 
00076         Node() { }
00078 
00081         Node(const Node&) { }
00082 
00084 
00087         Node(Invalid) { }
00089 
00092         bool operator==(Node) const { return true; }
00093 
00095         
00098         bool operator!=(Node) const { return true; }
00099 
00101 
00107         bool operator<(Node) const { return true; }
00108       };
00109     
00111 
00119       class NodeIt : public Node {
00120       public:
00122 
00125         NodeIt() { }
00127         
00130         NodeIt(const NodeIt&) { }
00132 
00135         NodeIt(Invalid) { }
00137 
00140         NodeIt(const StaticSymGraph& g) { }
00142 
00147         NodeIt(const StaticSymGraph& g, const Node& n) { }
00149 
00152         NodeIt& operator++() { return *this; }
00153       };
00154     
00155     
00157 
00160       class SymEdge {
00161       public:
00163 
00166         SymEdge() { }
00168 
00171         SymEdge(const SymEdge&) { }
00173 
00176         SymEdge(Invalid) { }
00178 
00181         bool operator==(SymEdge) const { return true; }
00183 
00186         bool operator!=(SymEdge) const { return true; }
00188 
00194         bool operator<(SymEdge) const { return true; }
00195       };
00196 
00197 
00199 
00202       class Edge : public SymEdge {
00203       public:
00205 
00208         Edge() { }
00210 
00213         Edge(const Edge&) { }
00215 
00218         Edge(Invalid) { }
00220 
00223         bool operator==(Edge) const { return true; }
00225 
00228         bool operator!=(Edge) const { return true; }
00230 
00236         bool operator<(Edge) const { return true; }
00237       };
00238     
00240 
00250     
00251       class OutEdgeIt : public Edge {
00252       public:
00254 
00257         OutEdgeIt() { }
00259 
00262         OutEdgeIt(const OutEdgeIt&) { }
00264 
00267         OutEdgeIt(Invalid) { }
00269     
00274         OutEdgeIt(const StaticSymGraph& g, const Node& n) { }
00276 
00280         OutEdgeIt(const StaticSymGraph& g, const Edge& e) { }
00282         
00285         OutEdgeIt& operator++() { return *this; }
00286       };
00287 
00289 
00299 
00300       class InEdgeIt : public Edge {
00301       public:
00303 
00306         InEdgeIt() { }
00308 
00311         InEdgeIt(const InEdgeIt&) { }
00313 
00316         InEdgeIt(Invalid) { }
00318     
00323         InEdgeIt(const StaticSymGraph& g, const Node& n) { }
00325 
00329         InEdgeIt(const StaticSymGraph& g, const Edge& n) { }
00331 
00334         InEdgeIt& operator++() { return *this; }
00335       };
00337 
00345       class SymEdgeIt : public SymEdge {
00346       public:
00348 
00351         SymEdgeIt() { }
00353 
00356         SymEdgeIt(const SymEdgeIt&) { }
00358 
00361         SymEdgeIt(Invalid) { }
00363     
00367         SymEdgeIt(const StaticSymGraph& g) { }
00369 
00373         SymEdgeIt(const StaticSymGraph&, const SymEdge&) { } 
00375         
00378         SymEdgeIt& operator++() { return *this; }
00379       };
00381 
00389       class EdgeIt : public Edge {
00390       public:
00392 
00395         EdgeIt() { }
00397 
00400         EdgeIt(const EdgeIt&) { }
00402 
00405         EdgeIt(Invalid) { }
00407     
00411         EdgeIt(const StaticSymGraph& g) { }
00413 
00417         EdgeIt(const StaticSymGraph&, const Edge&) { } 
00419         
00422         EdgeIt& operator++() { return *this; }
00423       };
00424 
00426 
00430       NodeIt& first(NodeIt& i) const { return i; }
00431 
00433 
00436       InEdgeIt& first(InEdgeIt &i, Node) const { return i; }
00438 
00441       OutEdgeIt& first(OutEdgeIt& i, Node) const { return i; }
00443 
00446       EdgeIt& first(EdgeIt& i) const { return i; }
00448 
00451       SymEdgeIt& first(SymEdgeIt& i) const { return i; }
00452 
00454 
00457       Node target(Edge) const { return INVALID; }
00459 
00462       Node source(Edge) const { return INVALID; }
00463   
00465 
00468       Node target(SymEdge) const { return INVALID; }
00470 
00473       Node source(SymEdge) const { return INVALID; }
00475 
00479       int id(const Node&) const { return 0; }
00481 
00485       int id(const Edge&) const { return 0; }
00486 
00490       int id(const SymEdge&) const { return 0; }
00491 
00493       
00496       int nodeNum() const { return 0; }
00498 
00501       int edgeNum() const { return 0; }
00502 
00505       int symEdgeNum() const { return 0; }
00506 
00507 
00509       Edge forward(SymEdge) const {return INVALID;} 
00510 
00512       Edge backward(SymEdge) const {return INVALID;};
00513 
00515       Edge opposite(Edge) const {return INVALID;}
00516 
00523       template<class T> class NodeMap : public ReferenceMap< Node, T >
00524       {
00525       public:
00526 
00528         NodeMap(const StaticSymGraph&) { }
00530         NodeMap(const StaticSymGraph&, T) { }
00531 
00533         template<typename TT> NodeMap(const NodeMap<TT>&) { }
00535         template<typename TT> NodeMap& operator=(const NodeMap<TT>&)
00536         { return *this; }
00537       };
00538 
00540 
00546       template<class T> class EdgeMap
00547         : public ReferenceMap<Edge,T>
00548       {
00549       public:
00550 
00552         EdgeMap(const StaticSymGraph&) { }
00554         EdgeMap(const StaticSymGraph&, T) { }
00555     
00557         template<typename TT> EdgeMap(const EdgeMap<TT>&) { }
00559         template<typename TT> EdgeMap &operator=(const EdgeMap<TT>&)
00560         { return *this; }
00561       };
00562 
00564 
00570       template<class T> class SymEdgeMap
00571         : public ReferenceMap<SymEdge,T>
00572       {
00573       public:
00574 
00576         SymEdgeMap(const StaticSymGraph&) { }
00578         SymEdgeMap(const StaticSymGraph&, T) { }
00579     
00581         template<typename TT> SymEdgeMap(const SymEdgeMap<TT>&) { }
00583         template<typename TT> SymEdgeMap &operator=(const SymEdgeMap<TT>&)
00584         { return *this; }
00585       };
00586     };
00587 
00588 
00589   
00591 
00595     class ExtendableSymGraph : public StaticSymGraph
00596     {
00597     public:
00599 
00602       ExtendableSymGraph() { }
00604 
00607       Node addNode() { return INVALID; }
00609 
00613       SymEdge addEdge(Node h, Node t) { return INVALID; }
00614     
00616 
00620       void clear() { }
00621     };
00622 
00624   
00627     class ErasableSymGraph : public ExtendableSymGraph
00628     {
00629     public:
00631 
00634       ErasableSymGraph() { }
00636 
00639       void erase(Node n) { }
00641 
00644       void erase(SymEdge e) { }
00645     };
00646 
00647     // @}
00648   } //namespace concept  
00649 } //namespace lemon
00650 
00651 
00652 
00653 #endif // LEMON_CONCEPT_GRAPH_H

Generated on Sat Mar 19 10:58:39 2005 for LEMON by  doxygen 1.4.1