OKlibrary  0.2.1.6
Graphs.hpp
Go to the documentation of this file.
00001 // Oliver Kullmann, 15.9.2003 (Swansea)
00002 /* Copyright 2003 - 2007 Oliver Kullmann
00003 This file is part of the OKlibrary. OKlibrary is free software; you can redistribute
00004 it and/or modify it under the terms of the GNU General Public License as published by
00005 the Free Software Foundation and included in this library; either version 3 of the
00006 License, or any later version. */
00007 
00008 #ifndef GRAPHSWAECHTER
00009 #define GRAPHSWAECHTER
00010 
00011 #include <boost/graph/graph_traits.hpp>
00012 
00013 namespace Graphs {
00014 
00015   class MutableAdjacencyGraph_ViaIntegers {
00016 
00017     typedef unsigned int Index;
00018 
00019     Index N;
00020 
00021     friend class boost::graph_traits<Graphs::MutableAdjacencyGraph_ViaIntegers>;
00022     class Vertices {
00023       Index v;
00024       friend class MutableAdjacencyGraph_ViaIntegers;
00025       Vertices(Index v) : v(v) {}
00026     public :
00027       Vertices() : v(0) {}
00028       friend bool operator ==(Vertices lhs, Vertices rhs) {
00029   return lhs.v == rhs.v;
00030       }
00031       
00032     };
00033     class Edges {
00034       Index l, r;
00035       friend class MutableAdjacencyGraph_ViaIntegers;
00036       Edges(Index l, Index r) : l(l), r(r) {}
00037     public :
00038       Edges() : l(0), r(0) {}
00039       friend bool operator ==(Edges lhs, Edges rhs) {
00040   return lhs.l == rhs.l and lhs.r == rhs.r;
00041       }
00042     };
00043     
00044   public :
00045 
00046    
00047     
00048     
00049   };
00050 
00051 }
00052 
00053 namespace boost {
00054 
00055   template <>
00056   struct graph_traits<Graphs::MutableAdjacencyGraph_ViaIntegers> {
00057     typedef Graphs::MutableAdjacencyGraph_ViaIntegers::Vertices vertex_descriptor;
00058     typedef Graphs::MutableAdjacencyGraph_ViaIntegers::Edges edge_descriptor;
00059     typedef boost::adjacency_matrix_tag traversal_category;
00060   };
00061 
00062 }
00063 
00064 namespace Graphs {
00065 
00066   bool operator !=(boost::graph_traits<MutableAdjacencyGraph_ViaIntegers>::vertex_descriptor lhs, boost::graph_traits<MutableAdjacencyGraph_ViaIntegers>::vertex_descriptor rhs) {
00067     return !(lhs == rhs);
00068   }
00069   bool operator !=(boost::graph_traits<MutableAdjacencyGraph_ViaIntegers>::edge_descriptor lhs, boost::graph_traits<MutableAdjacencyGraph_ViaIntegers>::edge_descriptor rhs) {
00070     return !(lhs == rhs);
00071   }
00072 
00073 }
00074 
00075 #endif
00076