X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=bgl.cpp;h=5d1e0ad2540d63f8248e2ce28813dc5a8b082a00;hb=7aae3c873a9e339b52a1b1ef220035d2445d9a88;hp=325617eca59b114fff476833f347eeb3cc718e90;hpb=4a1ef2e9fce14d796b3fb10884e177d39d493745;p=moebius2.git diff --git a/bgl.cpp b/bgl.cpp index 325617e..5d1e0ad 100644 --- a/bgl.cpp +++ b/bgl.cpp @@ -47,8 +47,6 @@ extern "C" { #define VMASK (YMASK|XMASK) #define ESHIFT (YBITS+XBITS) -class Graph { }; // this is a dummy as our graph has no actual representation - using namespace boost; /* @@ -105,6 +103,8 @@ class OutEdgeIterator : typedef counting_iterator VertexIterator; namespace boost { + class Graph { }; // this is a dummy as our graph has no actual representation + // We make Graph a model of various BGL Graph concepts. // This mainly means that graph_traits has lots of stuff. @@ -115,6 +115,7 @@ namespace boost { public virtual vertex_list_graph_tag, public virtual edge_list_graph_tag { }; + template<> struct graph_traits { // Concept Graph: typedef int vertex_descriptor; /* vertex number, -1 => none */ @@ -152,7 +153,8 @@ namespace boost { } // Concept VertexListGraph: - inline std::pair vertices(const Graph&) { + inline + std::pair vertices(const Graph&) { return std::make_pair(VertexIterator(0), VertexIterator(N)); } inline unsigned num_vertices(const Graph&) { return N; } @@ -188,7 +190,7 @@ double graph_layout_cost(const Vertices v, const double vertex_areas[N]) { */ static const double d2_epsilon= 1e-6; - double edge_weights[N*V6], vertex_distances[N], total_cost=0; + double edge_weights[V6<