|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r49070 - in sandbox/SOC/2008/graphs/trunk: boost boost/graphs boost/graphs/adjacency_list boost/graphs/adjacency_matrix boost/graphs/algorithms libs/graphs/test
From: asutton_at_[hidden]
Date: 2008-09-30 13:02:00
Author: asutton
Date: 2008-09-30 13:01:56 EDT (Tue, 30 Sep 2008)
New Revision: 49070
URL: http://svn.boost.org/trac/boost/changeset/49070
Log:
- Big renaming. Changed all properties to labels to reflect the documentation.
- Updated the corresponding test directory.
- Started work on a generic adjacency matrix.
Added:
sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_matrix/basic_matrix.hpp (contents, props changed)
sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_matrix/undirected_edge.hpp (contents, props changed)
sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_matrix/undirected_graph.hpp (contents, props changed)
sandbox/SOC/2008/graphs/trunk/boost/graphs/concepts.hpp (contents, props changed)
sandbox/SOC/2008/graphs/trunk/boost/optional.hpp (contents, props changed)
sandbox/SOC/2008/graphs/trunk/libs/graphs/test/basic_matrix.cpp (contents, props changed)
sandbox/SOC/2008/graphs/trunk/libs/graphs/test/un_matrix.cpp (contents, props changed)
Text files modified:
sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/directed_graph.hpp | 190 ++++++++++++++++++++--------------------
sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/directed_types.hpp | 6
sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/directed_vertex.hpp | 24 ++--
sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/edge_list.hpp | 6
sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/edge_set.hpp | 6
sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/edge_vector.hpp | 10 +-
sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/incidence_list.hpp | 12 +-
sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/incidence_set.hpp | 18 +-
sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/incidence_vector.hpp | 14 +-
sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/out_iterator.hpp | 2
sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/out_list.hpp | 12 +-
sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/out_set.hpp | 12 +-
sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/out_vector.hpp | 10 +-
sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/property_list.hpp | 40 ++++----
sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/property_vector.hpp | 36 +++---
sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/undirected_edge.hpp | 50 +++++-----
sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/undirected_graph.hpp | 180 ++++++++++++++++++------------------
sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/undirected_types.hpp | 10 +-
sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/undirected_vertex.hpp | 52 +++++-----
sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/vertex_list.hpp | 24 ++--
sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/vertex_map.hpp | 18 +-
sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/vertex_set.hpp | 30 +++---
sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/vertex_vector.hpp | 22 ++--
sandbox/SOC/2008/graphs/trunk/boost/graphs/algorithms/breadth_first.hpp | 2
sandbox/SOC/2008/graphs/trunk/boost/graphs/algorithms/depth_first.hpp | 2
sandbox/SOC/2008/graphs/trunk/boost/graphs/properties.hpp | 102 +++++++++++----------
sandbox/SOC/2008/graphs/trunk/boost/graphs/utility.hpp | 31 +++---
sandbox/SOC/2008/graphs/trunk/libs/graphs/test/Jamfile | 5
sandbox/SOC/2008/graphs/trunk/libs/graphs/test/adv_search.cpp | 8
sandbox/SOC/2008/graphs/trunk/libs/graphs/test/propmaps.cpp | 22 ++--
sandbox/SOC/2008/graphs/trunk/libs/graphs/test/test_es.cpp | 4
sandbox/SOC/2008/graphs/trunk/libs/graphs/test/test_props.cpp | 2
sandbox/SOC/2008/graphs/trunk/libs/graphs/test/test_verts.cpp | 8
33 files changed, 487 insertions(+), 483 deletions(-)
Modified: sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/directed_graph.hpp
==============================================================================
--- sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/directed_graph.hpp (original)
+++ sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/directed_graph.hpp 2008-09-30 13:01:56 EDT (Tue, 30 Sep 2008)
@@ -3,8 +3,8 @@
#define DIRECTED_GRAPH_HPP
// Notes on directed graphs... Unlike directed graphs, which are required
-// to globally store edge properties, the vertices directed graphs act as
-// the stores for nested properties. Edge properties are stored with the
+// to globally store edge label, the vertices directed graphs act as
+// the stores for nested label. Edge label are stored with the
// out edges of each vertex.
// To differentiate from the BGL, which separates the basic concepts of half
@@ -18,13 +18,13 @@
// Apparently directed graphs can be challenging - especially when you're
// talking about in and out edges. Let's start with the basics - out edges. Each
-// out edge of a vertex references a target vertex descriptor and the properties
+// out edge of a vertex references a target vertex descriptor and the label
// of that edge. However, there is an additional in edge that needs to be
// accounted for (in another vertex no less). We could augment each out edge
// with an iterator to its corresponding in edge.
//
// Each in edge is similarly defined. Minimally, this could contain only the
-// source vertex and a reference to the properties that define that edge. In
+// source vertex and a reference to the label that define that edge. In
// order to provide quick access to it "other half", it needs a reference to
// the out edge (which could be implemented as an iterator of some kind).
@@ -32,17 +32,17 @@
#include <boost/graphs/adjacency_list/directed_types.hpp>
template <
- typename VertexProps,
- typename EdgeProps,
+ typename VertexLabel,
+ typename EdgeLabel,
typename VertexStore,
typename EdgeStore>
class directed_graph
{
- typedef directed_types<VertexProps, EdgeProps, VertexStore, EdgeStore> types;
- typedef directed_graph<VertexProps, EdgeProps, VertexStore, EdgeStore> this_type;
+ typedef directed_types<VertexLabel, EdgeLabel, VertexStore, EdgeStore> types;
+ typedef directed_graph<VertexLabel, EdgeLabel, VertexStore, EdgeStore> this_type;
public:
- typedef VertexProps vertex_properties;
- typedef EdgeProps edge_properties;
+ typedef VertexLabel vertex_label;
+ typedef EdgeLabel edge_label;
typedef VertexStore vertex_store_selector;
typedef EdgeStore edge_store_selector;
@@ -89,14 +89,14 @@
* modeled by the vertex set.
*
* UnlabeledVertices add_vertex()
- * LabeledVerteces add_vertex(vertex_properties)
- * LabeledUniqueVertices add_vertex(vertex_properties)
+ * LabeledVerteces add_vertex(vertex_label)
+ * LabeledUniqueVertices add_vertex(vertex_label)
* MappedUniqueVertices add_vertex(vertex_key)
*/
//@{
vertex_descriptor add_vertex();
- vertex_descriptor add_vertex(vertex_properties const&);
- vertex_descriptor add_vertex(vertex_key const&, vertex_properties const&);
+ vertex_descriptor add_vertex(vertex_label const&);
+ vertex_descriptor add_vertex(vertex_key const&, vertex_label const&);
//@}
/** @name Find Vertex
@@ -104,11 +104,11 @@
* have UniqueVertices. These functions can also be used to find the first
* vertex of a non-unique vertices.
*
- * LabeledUniqueVertices find_vertex(vertex_properties)
+ * LabeledUniqueVertices find_vertex(vertex_label)
* MappedUniqueVertices find_vertex(vertex_key)
*/
//@{
- vertex_descriptor find_vertex(vertex_properties const&) const;
+ vertex_descriptor find_vertex(vertex_label const&) const;
vertex_descriptor find_vertex(vertex_key const&) const;
//@}
@@ -122,18 +122,18 @@
/** @name Remove Vertex
* Remove a vertex from the graph. These functions only exist for graphs
- * with ReducibleVertexSets. Functions that take properties or keys are
+ * with ReducibleVertexSets. Functions that take label or keys are
* provided for convenience, but have additional requirements and cost.
* These additional functions are equivalent to remove_vertex(find_vertex(x))
- * where x is either a vertex_properties or vertex_key.
+ * where x is either a vertex_label or vertex_key.
*
* ReducibleVertexSet remove_vertex(vertex_descriptor)
- * LabeledUniqueVertices remove_vertex(vertex_properties)
+ * LabeledUniqueVertices remove_vertex(vertex_label)
* MappedUniqueVertices remove_vertex(vertex_key)
*/
//@{
void remove_vertex(vertex_descriptor);
- void remove_vertex(vertex_properties const&);
+ void remove_vertex(vertex_label const&);
void remove_vertex(vertex_key const&);
//@}
@@ -142,27 +142,27 @@
* variations of this function, depending on the type of vertex store and
* whether or not the edges are labeled. Convenience functions are provided
* for graphs with UniqueVertices. Graphs with LabeledEdges can be added
- * with edge properties. Convenience functions are equivalent to the
+ * with edge label. Convenience functions are equivalent to the
* expression add_edge(find_vertex(x), find_vertex(y), p) with x and y
- * eithe vertex proeprties or vertex keys and p optional edge properties.
+ * eithe vertex proeprties or vertex keys and p optional edge label.
*
* ExtendableEdgeSet add_edge(vertex_descriptor, vertex_descriptor)
- * && LabeledEdges add_edge(vertex_descriptor, vertex_descriptor, edge_properties)
+ * && LabeledEdges add_edge(vertex_descriptor, vertex_descriptor, edge_label)
*
- * LabeledUniqueVertices add_edge(vertex_properties, vertex_properties)
- * && LabeledEdges add_edge(vertex_properties, vertex_properties, edge_properties)
+ * LabeledUniqueVertices add_edge(vertex_label, vertex_label)
+ * && LabeledEdges add_edge(vertex_label, vertex_label, edge_label)
*
* MappedUniqueVertices add_edge(vertex_key, vertex_key)
- * & LabeledEdges add_edge(vertex_key, vertex_key, edge_properties)
+ * & LabeledEdges add_edge(vertex_key, vertex_key, edge_label)
*/
//@{
edge_descriptor add_edge(vertex_descriptor, vertex_descriptor);
- edge_descriptor add_edge(vertex_properties const&, vertex_properties const&);
+ edge_descriptor add_edge(vertex_label const&, vertex_label const&);
edge_descriptor add_edge(vertex_key const&, vertex_key const&);
- edge_descriptor add_edge(vertex_descriptor, vertex_descriptor, edge_properties const&);
- edge_descriptor add_edge(vertex_properties const&, vertex_properties const&, edge_properties const&);
- edge_descriptor add_edge(vertex_key const&, vertex_key const&, edge_properties const&);
+ edge_descriptor add_edge(vertex_descriptor, vertex_descriptor, edge_label const&);
+ edge_descriptor add_edge(vertex_label const&, vertex_label const&, edge_label const&);
+ edge_descriptor add_edge(vertex_key const&, vertex_key const&, edge_label const&);
//@}
/** @name Test Edge
@@ -171,7 +171,7 @@
*/
//@{
edge_descriptor edge(vertex_descriptor, vertex_descriptor) const;
- edge_descriptor edge(vertex_properties const&, vertex_properties const&) const;
+ edge_descriptor edge(vertex_label const&, vertex_label const&) const;
edge_descriptor edge(vertex_key const&, vertex_key const&) const;
//@}
@@ -187,19 +187,19 @@
void remove_edge(edge_descriptor e);
void remove_edges(vertex_descriptor);
- void remove_edges(vertex_properties const&);
+ void remove_edges(vertex_label const&);
void remove_edges(vertex_key const&);
void remove_out_edges(vertex_descriptor);
- void remove_out_edges(vertex_properties const&);
+ void remove_out_edges(vertex_label const&);
void remove_out_edges(vertex_key const&);
void remove_in_edges(vertex_descriptor);
- void remove_in_edges(vertex_properties const&);
+ void remove_in_edges(vertex_label const&);
void remove_in_edges(vertex_key const&);
void remove_edges(vertex_descriptor, vertex_descriptor);
- void remove_edges(vertex_properties const&, vertex_properties const&);
+ void remove_edges(vertex_label const&, vertex_label const&);
void remove_edges(vertex_key const&, vertex_key const&);
//@}
@@ -242,13 +242,13 @@
//@}
/** @name Property Accessors
- * Access the properties of the given vertex or edge.
+ * Access the label of the given vertex or edge.
*/
//@{
- vertex_properties& operator[](vertex_descriptor);
- vertex_properties const& operator[](vertex_descriptor) const;
- edge_properties& operator[](edge_descriptor);
- edge_properties const& operator[](edge_descriptor) const;
+ vertex_label& operator[](vertex_descriptor);
+ vertex_label const& operator[](vertex_descriptor) const;
+ edge_label& operator[](edge_descriptor);
+ edge_label const& operator[](edge_descriptor) const;
//@}
private:
@@ -266,7 +266,7 @@
{ }
/**
- * Add a vertex to the graph with no or default graph properties, and return a
+ * Add a vertex to the graph with no or default graph label, and return a
* descriptor to the vertex being returned. This function should not be used
* with graphs that have LabeledUniqueVertices since each addition will return
* the same default-propertied vertex.
@@ -280,43 +280,43 @@
}
/**
- * Add a vertex to the graph with the given properties and return a descriptor
+ * Add a vertex to the graph with the given label and return a descriptor
* for that vertex. If the graph has labeled, unique vertices, and the given
- * properties describe a vertex already in the graph, then a new vertex is not
+ * label describe a vertex already in the graph, then a new vertex is not
* added and the descriptor for the existing vertex is returned.
*/
template <BOOST_GRAPH_DG_PARAMS>
typename directed_graph<VP,EP,VS,ES>::vertex_descriptor
-directed_graph<VP,EP,VS,ES>::add_vertex(vertex_properties const& vp)
+directed_graph<VP,EP,VS,ES>::add_vertex(vertex_label const& vp)
{
return _verts.add(vp);
}
/**
* Add a vertex to the graph that is identified by the given key and with the
- * given properties. If the key identifies a vertex already in the graph, do
+ * given label. If the key identifies a vertex already in the graph, do
* not add a new vertex and return a descriptor to the existing one.
*/
template <BOOST_GRAPH_DG_PARAMS>
typename directed_graph<VP,EP,VS,ES>::vertex_descriptor
-directed_graph<VP,EP,VS,ES>::add_vertex(vertex_key const& k, vertex_properties const& vp)
+directed_graph<VP,EP,VS,ES>::add_vertex(vertex_key const& k, vertex_label const& vp)
{
return _verts.add(k, vp);
}
/**
- * Find the vertex with the given properties, returning a descriptor to it.
+ * Find the vertex with the given label, returning a descriptor to it.
*/
template <BOOST_GRAPH_DG_PARAMS>
typename directed_graph<VP,EP,VS,ES>::vertex_descriptor
-directed_graph<VP,EP,VS,ES>::find_vertex(vertex_properties const& vp) const
+directed_graph<VP,EP,VS,ES>::find_vertex(vertex_label const& vp) const
{
- BOOST_STATIC_ASSERT(is_not_none<vertex_properties>::value);
+ BOOST_STATIC_ASSERT(is_not_none<vertex_label>::value);
return _verts.find(vp);
}
/**
- * Find the vertex with the given properties, returning a descriptor to it.
+ * Find the vertex with the given label, returning a descriptor to it.
*/
template <BOOST_GRAPH_DG_PARAMS>
typename directed_graph<VP,EP,VS,ES>::vertex_descriptor
@@ -338,13 +338,13 @@
}
/**
- * Remove the vertex from the graph identified by the given properties.
+ * Remove the vertex from the graph identified by the given label.
*/
template <BOOST_GRAPH_DG_PARAMS>
void
-directed_graph<VP,EP,VS,ES>::remove_vertex(vertex_properties const& vp)
+directed_graph<VP,EP,VS,ES>::remove_vertex(vertex_label const& vp)
{
- BOOST_STATIC_ASSERT(is_not_none<vertex_properties>::value);
+ BOOST_STATIC_ASSERT(is_not_none<vertex_label>::value);
remove_edges(vp);
_verts.remove(vp);
}
@@ -373,26 +373,26 @@
/**
* Add an edge, connecting the two vertices to the graph with default or no
- * properties. The edge is added to both the in and out edge stores of the
+ * label. The edge is added to both the in and out edge stores of the
* target and source vertices respectively.
*/
template <BOOST_GRAPH_DG_PARAMS>
typename directed_graph<VP,EP,VS,ES>::edge_descriptor
directed_graph<VP,EP,VS,ES>::add_edge(vertex_descriptor u, vertex_descriptor v)
{
- return add_edge(u, v, edge_properties());
+ return add_edge(u, v, edge_label());
}
/**
* Add an edge, connecting the two vertices to the graph with the given
- * properties. The edge is added to both the in and out edge stores of the
+ * label. The edge is added to both the in and out edge stores of the
* target and source vertices respectively.
*/
template <BOOST_GRAPH_DG_PARAMS>
typename directed_graph<VP,EP,VS,ES>::edge_descriptor
directed_graph<VP,EP,VS,ES>::add_edge(vertex_descriptor u,
vertex_descriptor v,
- edge_properties const& ep)
+ edge_label const& ep)
{
vertex_type &src = _verts.vertex(u);
vertex_type &tgt = _verts.vertex(v);
@@ -419,50 +419,50 @@
/**
* Add an edge to the graph that connects the two vertices identified by the
- * given properties. The edge is either unlabeled or has default properties.
+ * given label. The edge is either unlabeled or has default label.
*/
template <BOOST_GRAPH_DG_PARAMS>
typename directed_graph<VP,EP,VS,ES>::edge_descriptor
-directed_graph<VP,EP,VS,ES>::add_edge(vertex_properties const& u,
- vertex_properties const& v)
+directed_graph<VP,EP,VS,ES>::add_edge(vertex_label const& u,
+ vertex_label const& v)
{
- return add_edge(u, v, edge_properties());
+ return add_edge(u, v, edge_label());
}
/**
* Add an edge to the graph that connects the two vertices identified by the
- * given properties and has the given edge properties.
+ * given label and has the given edge label.
*/
template <BOOST_GRAPH_DG_PARAMS>
typename directed_graph<VP,EP,VS,ES>::edge_descriptor
-directed_graph<VP,EP,VS,ES>::add_edge(vertex_properties const& u,
- vertex_properties const& v,
- edge_properties const& ep)
+directed_graph<VP,EP,VS,ES>::add_edge(vertex_label const& u,
+ vertex_label const& v,
+ edge_label const& ep)
{
return add_edge(find_vertex(u), find_vertex(v), ep);
}
/**
* Add an edge to the graph that connects the two vertices identified by the
- * given keys. The edge is either unlabeled or has default properties.
+ * given keys. The edge is either unlabeled or has default label.
*/
template <BOOST_GRAPH_DG_PARAMS>
typename directed_graph<VP,EP,VS,ES>::edge_descriptor
directed_graph<VP,EP,VS,ES>::add_edge(vertex_key const& u,
vertex_key const& v)
{
- return add_edge(u, v, edge_properties());
+ return add_edge(u, v, edge_label());
}
/**
* Add an edge to the graph that connects the two vertices identified by the
- * given keys and has the given edge properties.
+ * given keys and has the given edge label.
*/
template <BOOST_GRAPH_DG_PARAMS>
typename directed_graph<VP,EP,VS,ES>::edge_descriptor
directed_graph<VP,EP,VS,ES>::add_edge(vertex_key const& u,
vertex_key const& v,
- edge_properties const& ep)
+ edge_label const& ep)
{
return add_edge(find_vertex(u), find_vertex(v), ep);
}
@@ -504,14 +504,14 @@
}
/**
- * Remove all edges incident to the vertex identified by the given properties.
+ * Remove all edges incident to the vertex identified by the given label.
* This is equivalent to remove_edges(find_vertex(vp));
*/
template <BOOST_GRAPH_DG_PARAMS>
void
-directed_graph<VP,EP,VS,ES>::remove_edges(vertex_properties const& vp)
+directed_graph<VP,EP,VS,ES>::remove_edges(vertex_label const& vp)
{
- BOOST_STATIC_ASSERT(is_not_none<vertex_properties>::value);
+ BOOST_STATIC_ASSERT(is_not_none<vertex_label>::value);
remove_edges(find_vertex(vp));
}
@@ -554,14 +554,14 @@
}
/**
- * Remove all out edges of the vertex identified by the given properties. This
+ * Remove all out edges of the vertex identified by the given label. This
* is equivalent to remove_out_edges(find_vertex(vp));
*/
template <BOOST_GRAPH_DG_PARAMS>
void
-directed_graph<VP,EP,VS,ES>::remove_out_edges(vertex_properties const& vp)
+directed_graph<VP,EP,VS,ES>::remove_out_edges(vertex_label const& vp)
{
- BOOST_STATIC_ASSERT(is_not_none<vertex_properties>::value);
+ BOOST_STATIC_ASSERT(is_not_none<vertex_label>::value);
remove_out_edges(find_vertex(vp));
}
@@ -601,14 +601,14 @@
}
/**
- * Remove all in edges of the vertex identified by the given properties. This
+ * Remove all in edges of the vertex identified by the given label. This
* is equivalent to remove_in_edges(find_vertex(vp));
*/
template <BOOST_GRAPH_DG_PARAMS>
void
-directed_graph<VP,EP,VS,ES>::remove_in_edges(vertex_properties const& vp)
+directed_graph<VP,EP,VS,ES>::remove_in_edges(vertex_label const& vp)
{
- BOOST_STATIC_ASSERT(is_not_none<vertex_properties>::value);
+ BOOST_STATIC_ASSERT(is_not_none<vertex_label>::value);
remove_in_edges(find_vertex(vp));
}
@@ -664,8 +664,8 @@
template <BOOST_GRAPH_DG_PARAMS>
void
-directed_graph<VP,EP,VS,ES>::remove_edges(vertex_properties const& u,
- vertex_properties const& v)
+directed_graph<VP,EP,VS,ES>::remove_edges(vertex_label const& u,
+ vertex_label const& v)
{
remove_vertices(find_vertex(u), find_vertex(v));
}
@@ -697,14 +697,14 @@
/**
* Test to see if at least one edge connects the two vertices identified by
- * the given properties. Return a pair containing a descriptor to the first such
+ * the given label. Return a pair containing a descriptor to the first such
* edge (if it exists), and a boolean value indicating whether it actually
* exists or not. This is equivalent to edge(find_vertex(u), find_vertex(v)).
*/
template <BOOST_GRAPH_DG_PARAMS>
typename directed_graph<VP,EP,VS,ES>::edge_descriptor
-directed_graph<VP,EP,VS,ES>::edge(vertex_properties const& u,
- vertex_properties const& v) const
+directed_graph<VP,EP,VS,ES>::edge(vertex_label const& u,
+ vertex_label const& v) const
{
return edge(find_vertex(u), find_vertex(v));
}
@@ -917,29 +917,29 @@
directed_graph<VP,EP,VS,ES>::adjacent_vertices(vertex_descriptor v) const
{ return std::make_pair(begin_adjacent_vertices(v), end_adjacent_vertices(v)); }
-/** Return the properties for the given vertex. */
+/** Return the label for the given vertex. */
template <BOOST_GRAPH_DG_PARAMS>
-typename directed_graph<VP,EP,VS,ES>::vertex_properties&
+typename directed_graph<VP,EP,VS,ES>::vertex_label&
directed_graph<VP,EP,VS,ES>::operator[](vertex_descriptor v)
-{ return _verts.properties(v); }
+{ return _verts.label(v); }
-/** Return the properties for the given vertex. */
+/** Return the label for the given vertex. */
template <BOOST_GRAPH_DG_PARAMS>
-typename directed_graph<VP,EP,VS,ES>::vertex_properties const&
+typename directed_graph<VP,EP,VS,ES>::vertex_label const&
directed_graph<VP,EP,VS,ES>::operator[](vertex_descriptor v) const
-{ return _verts.properties(v); }
+{ return _verts.label(v); }
-/** Return the properties for the given edge. */
+/** Return the label for the given edge. */
template <BOOST_GRAPH_DG_PARAMS>
-typename directed_graph<VP,EP,VS,ES>::edge_properties&
+typename directed_graph<VP,EP,VS,ES>::edge_label&
directed_graph<VP,EP,VS,ES>::operator[](edge_descriptor e)
-{ return _verts.vertex(e.source()).get_edge_properties(e.out_edge()); }
+{ return _verts.vertex(e.source()).get_edge_label(e.out_edge()); }
-/** Return the properties for the given edge. */
+/** Return the label for the given edge. */
template <BOOST_GRAPH_DG_PARAMS>
-typename directed_graph<VP,EP,VS,ES>::edge_properties const&
+typename directed_graph<VP,EP,VS,ES>::edge_label const&
directed_graph<VP,EP,VS,ES>::operator[](edge_descriptor e) const
-{ return _verts.vertex(e.source()).get_edge_properties(e.out_edge()); }
+{ return _verts.vertex(e.source()).get_edge_label(e.out_edge()); }
#undef BOOST_GRAPH_DG_PARAMS
Modified: sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/directed_types.hpp
==============================================================================
--- sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/directed_types.hpp (original)
+++ sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/directed_types.hpp 2008-09-30 13:01:56 EDT (Tue, 30 Sep 2008)
@@ -34,7 +34,7 @@
* This class is a metafunction that generates all of the types needed to
* implement a directed graph.
*/
-template <typename VertexProps, typename EdgeProps, typename VertexStore, typename EdgeStore>
+template <typename VertexLabel, typename EdgeLabel, typename VertexStore, typename EdgeStore>
struct directed_types
{
// Start by generating all of the descriptors.
@@ -46,7 +46,7 @@
typedef directed_edge<out_descriptor, in_descriptor> edge_descriptor;
// Generate the out store and related types
- typedef typename EdgeStore::template out_store<vertex_descriptor, EdgeProps>::type out_store;
+ typedef typename EdgeStore::template out_store<vertex_descriptor, EdgeLabel>::type out_store;
typedef typename out_store::size_type out_edges_size_type;
typedef typename out_store::size_type edges_size_type;
@@ -59,7 +59,7 @@
typedef out_edges_size_type incident_edges_size_type;
// Generate the vertex, its store, and related types.
- typedef directed_vertex<VertexProps, out_store, in_store> vertex_type;
+ typedef directed_vertex<VertexLabel, out_store, in_store> vertex_type;
typedef typename VertexStore::template store<vertex_type>::type vertex_store;
typedef typename vertex_store::size_type vertices_size_type;
typedef typename vertex_store::vertex_iterator vertex_iterator;
Modified: sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/directed_vertex.hpp
==============================================================================
--- sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/directed_vertex.hpp (original)
+++ sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/directed_vertex.hpp 2008-09-30 13:01:56 EDT (Tue, 30 Sep 2008)
@@ -13,10 +13,10 @@
typedef OutStore out_store;
typedef InStore in_store;
public:
- typedef VertexProps vertex_properties;
+ typedef VertexProps vertex_label;
typedef typename out_store::vertex_descriptor vertex_descriptor;
- typedef typename out_store::edge_properties edge_properties;
+ typedef typename out_store::edge_label edge_label;
typedef typename out_store::out_descriptor out_descriptor;
typedef typename out_store::iterator out_iterator;
typedef typename out_store::size_type out_size_type;
@@ -33,7 +33,7 @@
: _props(), _out(), _in()
{ }
- inline directed_vertex(vertex_properties const& vp)
+ inline directed_vertex(vertex_label const& vp)
: _props(vp), _out(), _in()
{ }
//@}
@@ -46,7 +46,7 @@
* of the source.
*/
//@{
- insertion_result<out_descriptor> connect_target(vertex_descriptor v, edge_properties const& ep)
+ insertion_result<out_descriptor> connect_target(vertex_descriptor v, edge_label const& ep)
{ return _out.add(v, ep); }
insertion_result<in_descriptor> connect_source(vertex_descriptor v, out_descriptor o)
@@ -68,18 +68,18 @@
/** @name Vertex Property Accessors */
//@{
- inline vertex_properties& properties()
+ inline vertex_label& label()
{ return _props; }
- inline vertex_properties const& properties() const
+ inline vertex_label const& label() const
{ return _props; }
- // Return the edge properties for the given out edge descriptor.
- inline edge_properties& get_edge_properties(out_descriptor o)
- { return _out.properties(o); }
+ // Return the edge label for the given out edge descriptor.
+ inline edge_label& get_edge_label(out_descriptor o)
+ { return _out.label(o); }
- inline edge_properties const& get_edge_properties(out_descriptor o) const
- { return _out.properties(o); }
+ inline edge_label const& get_edge_label(out_descriptor o) const
+ { return _out.label(o); }
//@}
/** Return the reverse out descriptor for the given in edge. */
@@ -157,7 +157,7 @@
//@}
private:
- vertex_properties _props;
+ vertex_label _props;
out_store _out;
in_store _in;
};
Modified: sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/edge_list.hpp
==============================================================================
--- sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/edge_list.hpp (original)
+++ sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/edge_list.hpp 2008-09-30 13:01:56 EDT (Tue, 30 Sep 2008)
@@ -32,10 +32,10 @@
// Descriptor types for undirected graphs.
typedef typename descriptor_traits<first_dummy>::descriptor_type incidence_descriptor;
- typedef typename descriptor_traits<second_dummy>::descriptor_type property_descriptor;
+ typedef typename descriptor_traits<second_dummy>::descriptor_type label_descriptor;
// The property store metafunction generates the underlying global store
- // type for edge properties in undirected graphs.
+ // type for edge label in undirected graphs.
template <typename VertexDesc, typename EdgeProps>
struct property_store
{
@@ -50,7 +50,7 @@
template <typename VertexDesc>
struct incidence_store
{
- typedef std::pair<VertexDesc, property_descriptor> incidence_pair;
+ typedef std::pair<VertexDesc, label_descriptor> incidence_pair;
typedef FirstAlloc<incidence_pair> allocator;
typedef incidence_list<incidence_pair, allocator > type;
};
Modified: sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/edge_set.hpp
==============================================================================
--- sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/edge_set.hpp (original)
+++ sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/edge_set.hpp 2008-09-30 13:01:56 EDT (Tue, 30 Sep 2008)
@@ -21,7 +21,7 @@
*
* @param Compare - A unary template class that compares vertex descriptors.
* @param FirstAlloc - An allocator template for either incident edges or out edges.
- * @param SecondAlloc - An allocator template for either global properties or in edges.
+ * @param SecondAlloc - An allocator template for either global label or in edges.
*/
template <
template <typename> class Compare = std::less,
@@ -40,7 +40,7 @@
// Descriptor types for undirected graphs.
typedef typename descriptor_traits<first_dummy>::descriptor_type incidence_descriptor;
- typedef typename descriptor_traits<prop_dummy>::descriptor_type property_descriptor;
+ typedef typename descriptor_traits<prop_dummy>::descriptor_type label_descriptor;
// The property store metafunnction generates the global store type for
// undirected graphs. The property list only needs to be a list, not a set.
@@ -58,7 +58,7 @@
template <typename VertexDesc>
struct incidence_store
{
- typedef std::pair<VertexDesc, property_descriptor> value;
+ typedef std::pair<VertexDesc, label_descriptor> value;
typedef Compare<VertexDesc> compare;
typedef FirstAlloc<value> allocator;
typedef incidence_set<value, compare, allocator> type;
Modified: sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/edge_vector.hpp
==============================================================================
--- sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/edge_vector.hpp (original)
+++ sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/edge_vector.hpp 2008-09-30 13:01:56 EDT (Tue, 30 Sep 2008)
@@ -14,7 +14,7 @@
// What's in an edge vector? Basically, an edge vector has to specify
// the type of property storage and the type of incidence storage. What
// are the possible parameters to edge storage?
-// 1. The edge properties
+// 1. The edge label
// 2. Allocator for the property store
// 3. Allocator for the incidence store
@@ -32,7 +32,7 @@
* metafunction for both directed and undirected graphs. The meaning of the
* first and second allocator differ depending on the type of graph. For
* undirected graphs, FirstAlloc is the allocator for the per-vertex incidence
- * store and the SecondAlloc is the allocator for properties. For directed
+ * store and the SecondAlloc is the allocator for label. For directed
* graphs, FirstAlloc and SecondAlloc are the per-vertex allocators for
* out- and in-edge stores respectively.
*/
@@ -47,10 +47,10 @@
// Descriptor types for undirected graphs.
typedef typename descriptor_traits<first_dummy>::descriptor_type incidence_descriptor;
- typedef typename descriptor_traits<second_dummy>::descriptor_type property_descriptor;
+ typedef typename descriptor_traits<second_dummy>::descriptor_type label_descriptor;
// The property store metafunction generates the type of vector used to
- // store global properties for undirected graphs.
+ // store global label for undirected graphs.
template <typename VertexDesc, typename EdgeProps>
struct property_store
{
@@ -65,7 +65,7 @@
template <typename VertexDesc>
struct incidence_store
{
- typedef std::pair<VertexDesc, property_descriptor> incidence_pair;
+ typedef std::pair<VertexDesc, label_descriptor> incidence_pair;
typedef FirstAlloc<incidence_pair> incidence_allocator;
typedef incidence_vector<incidence_pair, incidence_allocator> type;
};
Modified: sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/incidence_list.hpp
==============================================================================
--- sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/incidence_list.hpp (original)
+++ sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/incidence_list.hpp 2008-09-30 13:01:56 EDT (Tue, 30 Sep 2008)
@@ -10,7 +10,7 @@
/**
* The incidence vector stores incident "edges" of a vertex. In actuality,
* this stores pairs containing an adjacent vertex descriptor and a property
- * descriptor, that points to the edges global properties. This pair uniquely
+ * descriptor, that points to the edges global label. This pair uniquely
* identifies incident edges of the vertex.
*
* This type allows constant time insertions, and linear search and remove.
@@ -20,7 +20,7 @@
{
public:
typedef typename Edge::first_type vertex_descriptor;
- typedef typename Edge::second_type property_descriptor;
+ typedef typename Edge::second_type label_descriptor;
typedef std::list<Edge, Alloc> store_type;
typedef typename store_type::iterator iterator;
@@ -40,9 +40,9 @@
*/
//@{
inline insertion_result<incidence_descriptor> add(vertex_descriptor v)
- { return add(v, property_descriptor()); }
+ { return add(v, label_descriptor()); }
- insertion_result<incidence_descriptor> add(vertex_descriptor v, property_descriptor p)
+ insertion_result<incidence_descriptor> add(vertex_descriptor v, label_descriptor p)
{
++_size;
iterator i = _edges.insert(_edges.end(), make_pair(v, p));
@@ -95,7 +95,7 @@
//@}
/** Bind this incident edge to the given property descriptor. */
- inline void bind(incidence_descriptor d, property_descriptor p)
+ inline void bind(incidence_descriptor d, label_descriptor p)
{ make_iterator(_edges, d)->second = p; }
/** Return the connected vertex referenced by this edge. */
@@ -103,7 +103,7 @@
{ return make_iterator(_edges, d)->first; }
/** Return the property referenced by this edge. */
- inline property_descriptor properties(incidence_descriptor d) const
+ inline label_descriptor label(incidence_descriptor d) const
{ return make_iterator(_edges, d)->second; }
private:
Modified: sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/incidence_set.hpp
==============================================================================
--- sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/incidence_set.hpp (original)
+++ sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/incidence_set.hpp 2008-09-30 13:01:56 EDT (Tue, 30 Sep 2008)
@@ -9,7 +9,7 @@
/**
* The incidence vector stores incident "edges" of a vertex. In actuality,
* this stores pairs containing an adjacent vertex descriptor and a property
- * descriptor, that points to the edges global properties. This pair uniquely
+ * descriptor, that points to the edges global label. This pair uniquely
* identifies incident edges of the vertex.
*
* This type allows logarithmic time insertions, searches, and removals.
@@ -19,17 +19,17 @@
{
public:
typedef typename Edge::first_type vertex_descriptor;
- typedef typename Edge::second_type property_descriptor;
+ typedef typename Edge::second_type label_descriptor;
// Actually, the incident set, as it fundamentally implements a simple
// graph is based on a map keyed on the adjacenct vertex and mapped to the
- // edge properties that describe it. We're basically undwinding and
+ // edge label that describe it. We're basically undwinding and
// rebuilding the edge pair for this map.
// NOTE: This can impose some difficulties since the vertex (key type) will
// be made const in this map. That means we may have to cast out the const
// aspect of the key at times, but changing that value would be absolutely
// catastrophic.
- typedef std::map<vertex_descriptor, property_descriptor, Compare, Alloc> store_type;
+ typedef std::map<vertex_descriptor, label_descriptor, Compare, Alloc> store_type;
typedef typename store_type::iterator iterator;
typedef typename store_type::size_type size_type;
@@ -48,9 +48,9 @@
*/
//@{
inline insertion_result<incidence_descriptor> add(vertex_descriptor v)
- { return add(v, property_descriptor()); }
+ { return add(v, label_descriptor()); }
- insertion_result<incidence_descriptor> add(vertex_descriptor v, property_descriptor p)
+ insertion_result<incidence_descriptor> add(vertex_descriptor v, label_descriptor p)
{
std::pair<iterator, bool> i = _edges.insert(make_pair(v, p));
return make_result(_edges, i);
@@ -96,15 +96,15 @@
//@}
/** Bind this incident edge to the given property. */
- inline void bind(incidence_descriptor d, property_descriptor p)
+ inline void bind(incidence_descriptor d, label_descriptor p)
{ make_iterator(_edges, d)->second = p; }
/** Return the vertex connected by this edge. */
inline vertex_descriptor vertex(incidence_descriptor d) const
{ return make_iterator(_edges, d)->first; }
- /** Return the properties connected by this edge. */
- inline property_descriptor properties(incidence_descriptor d) const
+ /** Return the label connected by this edge. */
+ inline label_descriptor label(incidence_descriptor d) const
{ return make_iterator(_edges, d)->second; }
private:
Modified: sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/incidence_vector.hpp
==============================================================================
--- sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/incidence_vector.hpp (original)
+++ sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/incidence_vector.hpp 2008-09-30 13:01:56 EDT (Tue, 30 Sep 2008)
@@ -11,7 +11,7 @@
/**
* The incidence vector stores incident "edges" of a vertex. In actuality,
* this stores pairs containing an adjacent vertex descriptor and a property
- * descriptor, that points to the edges global properties. This pair uniquely
+ * descriptor, that points to the edges global label. This pair uniquely
* identifies incident edges of the vertex.
*
* This type allows constant-time edge addition and a linear search. Removal
@@ -22,7 +22,7 @@
{
public:
typedef typename Edge::first_type vertex_descriptor;
- typedef typename Edge::second_type property_descriptor;
+ typedef typename Edge::second_type label_descriptor;
typedef std::vector<Edge, Alloc> store_type;
typedef typename store_type::iterator iterator;
@@ -42,9 +42,9 @@
*/
//@{
inline insertion_result<incidence_descriptor> add(vertex_descriptor v)
- { return add(v, property_descriptor()); }
+ { return add(v, label_descriptor()); }
- insertion_result<incidence_descriptor> add(vertex_descriptor v, property_descriptor p)
+ insertion_result<incidence_descriptor> add(vertex_descriptor v, label_descriptor p)
{
iterator i = _edges.insert(_edges.end(), std::make_pair(v, p));
return make_result(make_descriptor(_edges, i));
@@ -76,15 +76,15 @@
//@}
/** Bind this edge to the given property. */
- inline void bind(incidence_descriptor d, property_descriptor p)
+ inline void bind(incidence_descriptor d, label_descriptor p)
{ make_iterator(_edges, d)->second = p; }
/** Return the vertex connected by this edge. */
inline vertex_descriptor vertex(incidence_descriptor d) const
{ return make_iterator(_edges, d)->first; }
- /** Return the properties of this edge. */
- inline property_descriptor properties(incidence_descriptor d) const
+ /** Return the label of this edge. */
+ inline label_descriptor label(incidence_descriptor d) const
{ return make_iterator(_edges, d)->second; }
private:
Modified: sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/out_iterator.hpp
==============================================================================
--- sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/out_iterator.hpp (original)
+++ sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/out_iterator.hpp 2008-09-30 13:01:56 EDT (Tue, 30 Sep 2008)
@@ -24,7 +24,7 @@
typedef typename iterator::value_type base_value_type;
typedef typename boost::remove_const<typename base_value_type::first_type>::type vertex_descriptor;
typedef typename base_value_type::second_type edge_pair;
- typedef typename edge_pair::first_type edge_properties;
+ typedef typename edge_pair::first_type edge_label;
typedef typename edge_pair::second_type in_descriptor;
// This is a little misleading. This iterator can be either bidi or random.
Modified: sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/out_list.hpp
==============================================================================
--- sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/out_list.hpp (original)
+++ sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/out_list.hpp 2008-09-30 13:01:56 EDT (Tue, 30 Sep 2008)
@@ -15,7 +15,7 @@
* removals.
*
- * @param Edge A tuple describing a vertex descriptor and the edge properties.
+ * @param Edge A tuple describing a vertex descriptor and the edge label.
* @param Alloc The allocator for edge pairs.
*/
template <typename Edge, typename Alloc>
@@ -24,7 +24,7 @@
public:
typedef typename Edge::first_type vertex_descriptor;
typedef typename Edge::second_type edge_pair;
- typedef typename edge_pair::first_type edge_properties;
+ typedef typename edge_pair::first_type edge_label;
typedef typename edge_pair::second_type in_descriptor;
typedef std::list<Edge, Alloc> store_type;
@@ -41,7 +41,7 @@
* Add the edge to the list.
* @complexity O(1)
*/
- insertion_result<out_descriptor> add(vertex_descriptor v, edge_properties const& ep)
+ insertion_result<out_descriptor> add(vertex_descriptor v, edge_label const& ep)
{
++_size;
iterator i = _edges.insert(_edges.end(), std::make_pair(v, std::make_pair(ep, in_descriptor())));
@@ -102,11 +102,11 @@
inline vertex_descriptor target(out_descriptor o) const
{ return make_iterator(_edges, o)->first; }
- /** Return the properties stored with this edge. */
- inline edge_properties& properties(out_descriptor o)
+ /** Return the label stored with this edge. */
+ inline edge_label& label(out_descriptor o)
{ return make_iterator(_edges, o)->second.first; }
- inline edge_properties const& properties(out_descriptor o) const
+ inline edge_label const& label(out_descriptor o) const
{ return make_iterator(_edges, o)->second.first; }
/** Return the in edge descriptor bound to this edge. */
Modified: sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/out_set.hpp
==============================================================================
--- sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/out_set.hpp (original)
+++ sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/out_set.hpp 2008-09-30 13:01:56 EDT (Tue, 30 Sep 2008)
@@ -20,7 +20,7 @@
* The out edge set is actually implemented as a mapping from vertex descriptor
* to stored edge property.
*
- * @param Edge A pair describing a vertex descriptor and the edge properties.
+ * @param Edge A pair describing a vertex descriptor and the edge label.
* @param Alloc The allocator for edge pairs.
*/
template <typename Edge, typename Compare, typename Alloc>
@@ -29,7 +29,7 @@
public:
typedef typename Edge::first_type vertex_descriptor;
typedef typename Edge::second_type edge_pair;
- typedef typename edge_pair::first_type edge_properties;
+ typedef typename edge_pair::first_type edge_label;
typedef typename edge_pair::second_type in_descriptor;
// Reconstruct the edge triple into a key/value type thing for the map.
@@ -48,7 +48,7 @@
* Try to add the given edge to the set.
* @complexity O(log(deg(v)))
*/
- insertion_result<out_descriptor> add(vertex_descriptor v, edge_properties const& ep)
+ insertion_result<out_descriptor> add(vertex_descriptor v, edge_label const& ep)
{
std::pair<iterator, bool> i = _edges.insert(std::make_pair(v, std::make_pair(ep, in_descriptor())));
return make_result(_edges, i);
@@ -97,11 +97,11 @@
inline vertex_descriptor target(out_descriptor o) const
{ return make_iterator(_edges, o)->first; }
- /** Return the properties stored with this edge. */
- inline edge_properties& properties(out_descriptor o)
+ /** Return the label stored with this edge. */
+ inline edge_label& label(out_descriptor o)
{ return make_iterator(_edges, o)->second.first; }
- inline edge_properties const& properties(out_descriptor o) const
+ inline edge_label const& label(out_descriptor o) const
{ return make_iterator(_edges, o)->second.first; }
/** Return the in edge descriptor bound to this edge. */
Modified: sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/out_vector.hpp
==============================================================================
--- sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/out_vector.hpp (original)
+++ sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/out_vector.hpp 2008-09-30 13:01:56 EDT (Tue, 30 Sep 2008)
@@ -23,7 +23,7 @@
public:
typedef typename Edge::first_type vertex_descriptor;
typedef typename Edge::second_type edge_pair;
- typedef typename edge_pair::first_type edge_properties;
+ typedef typename edge_pair::first_type edge_label;
typedef typename edge_pair::second_type in_descriptor;
typedef std::vector<Edge, Alloc> store_type;
@@ -41,7 +41,7 @@
* Add the edge to the vector.
* @complexity O(1)
*/
- insertion_result<out_descriptor> add(vertex_descriptor v, edge_properties const& ep)
+ insertion_result<out_descriptor> add(vertex_descriptor v, edge_label const& ep)
{
iterator i = _edges.insert(_edges.end(), std::make_pair(v, std::make_pair(ep, in_descriptor())));
return make_result(make_descriptor(_edges, i));
@@ -80,11 +80,11 @@
{ return make_iterator(_edges, o)->first; }
- /** Return the properties stored with this edge. */
- inline edge_properties& properties(out_descriptor o)
+ /** Return the label stored with this edge. */
+ inline edge_label& label(out_descriptor o)
{ return make_iterator(_edges, o)->second.first; }
- inline edge_properties const& properties(out_descriptor o) const
+ inline edge_label const& label(out_descriptor o) const
{ return make_iterator(_edges, o)->second.first; }
Modified: sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/property_list.hpp
==============================================================================
--- sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/property_list.hpp (original)
+++ sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/property_list.hpp 2008-09-30 13:01:56 EDT (Tue, 30 Sep 2008)
@@ -9,7 +9,7 @@
#include <boost/graphs/utility.hpp>
/**
- * The property list implements global list of properties for node-based edge
+ * The property list implements global list of label for node-based edge
* storage. Note that we can get away with only a list because the edge
* addition logic is implemented by the incidence list.
*
@@ -28,7 +28,7 @@
typedef std::list<Edge, Alloc> store_type;
typedef Edge edge_type;
- typedef typename Edge::first_type edge_properties;
+ typedef typename Edge::first_type edge_label;
typedef typename Edge::second_type end_pair;
typedef typename end_pair::first_type end_type; // same as second_type
typedef typename end_type::first_type vertex_descriptor;
@@ -37,7 +37,7 @@
typedef typename store_type::iterator iterator;
typedef typename store_type::size_type size_type;
- typedef typename descriptor_traits<store_type>::descriptor_type property_descriptor;
+ typedef typename descriptor_traits<store_type>::descriptor_type label_descriptor;
// Constructors.
inline property_list()
@@ -49,10 +49,10 @@
* empty for the time being.
*/
//@{
- inline property_descriptor add()
- { return add(edge_properties()); }
+ inline label_descriptor add()
+ { return add(edge_label()); }
- inline property_descriptor add(edge_properties const& ep)
+ inline label_descriptor add(edge_label const& ep)
{
++_size;
iterator i = _props.insert(_props.end(), make_pair(ep, end_pair()));
@@ -61,23 +61,23 @@
//@}
/**
- * Find the edge with the given properties. Finding an edge by its
- * properties is guaranteed to be O(E).
+ * Find the edge with the given label. Finding an edge by its
+ * label is guaranteed to be O(E).
*/
- inline property_descriptor find(edge_properties const& ep) const
+ inline label_descriptor find(edge_label const& ep) const
{
iterator i = std::find_if(_props.begin(), _props.end(), find_first(ep));
return make_descriptor(_props, i);
}
/** Remove the described property from the property set. */
- inline void remove(property_descriptor d)
+ inline void remove(label_descriptor d)
{
_props.erase(make_iterator(_props, d));
--_size;
}
- /** Return the number of properties. */
+ /** Return the number of label. */
inline size_type size() const
{ return _size; }
@@ -98,36 +98,36 @@
* Bind vertex descriptors into the incidence lists into the global
* property. This is the last step of edge creation for undirected graphs.
*/
- void bind(property_descriptor d, end_pair const& p)
+ void bind(label_descriptor d, end_pair const& p)
{ make_iterator(_props, d)->second = p; }
/** Return the incidence descriptors bound to the property. */
- inline end_pair const& ends(property_descriptor d) const
+ inline end_pair const& ends(label_descriptor d) const
{ return make_iterator(_props, d)->second; }
- /** Return the properties referenced by the given descriptor. */
- inline edge_properties& properties(property_descriptor d)
+ /** Return the label referenced by the given descriptor. */
+ inline edge_label& label(label_descriptor d)
{ return make_iterator(_props, d)->first; }
/** Return the first vertex of the edge. */
- inline vertex_descriptor first_vertex(property_descriptor d) const
+ inline vertex_descriptor first_vertex(label_descriptor d) const
{ return make_iterator(_props, d)->second.first.first; }
/** Return the second vertex of the edge. */
- inline vertex_descriptor second_vertex(property_descriptor d) const
+ inline vertex_descriptor second_vertex(label_descriptor d) const
{ return make_iterator(_props, d)->second.second.first; }
/** Return the first incidence descriptor of the edge. */
- inline incidence_descriptor first_edge(property_descriptor d) const
+ inline incidence_descriptor first_edge(label_descriptor d) const
{ return make_iterator(_props, d)->second.first.second; }
/** Return the second incidence descriptor of the edge. */
- inline incidence_descriptor second_edge(property_descriptor d) const
+ inline incidence_descriptor second_edge(label_descriptor d) const
{ return make_iterator(_props, d)->second.second.second; }
/** Return a descriptor for the iterator. */
- inline property_descriptor describe(iterator i) const
+ inline label_descriptor describe(iterator i) const
{ return make_descriptor(_props, i); }
private:
Modified: sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/property_vector.hpp
==============================================================================
--- sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/property_vector.hpp (original)
+++ sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/property_vector.hpp 2008-09-30 13:01:56 EDT (Tue, 30 Sep 2008)
@@ -11,7 +11,7 @@
/**
* The property vector implements a vector-based global property store for
* vector-based edge storage. Assuming, of course, that there are actually edge
- * properties.
+ * label.
*/
template <typename Edge, typename Alloc>
class property_vector
@@ -20,7 +20,7 @@
typedef std::vector<Edge, Alloc> store_type;
typedef Edge edge_type;
- typedef typename Edge::first_type edge_properties;
+ typedef typename Edge::first_type edge_label;
typedef typename Edge::second_type end_pair;
typedef typename end_pair::first_type end_type; // same as second_type
typedef typename end_type::first_type vertex_descriptor;
@@ -29,7 +29,7 @@
typedef typename store_type::iterator iterator;
typedef typename store_type::size_type size_type;
- typedef typename descriptor_traits<store_type>::descriptor_type property_descriptor;
+ typedef typename descriptor_traits<store_type>::descriptor_type label_descriptor;
// Constructor
inline property_vector()
@@ -41,10 +41,10 @@
* empty for the time being.
*/
//@{
- property_descriptor add()
- { return add(edge_properties()); }
+ label_descriptor add()
+ { return add(edge_label()); }
- property_descriptor add(edge_properties const& ep)
+ label_descriptor add(edge_label const& ep)
{
iterator i = _props.insert(_props.end(), make_pair(ep, end_pair()));
return make_descriptor(_props, i);
@@ -52,16 +52,16 @@
//@}
/**
- * Find the edge with the given properties. This function is guaranteed to
+ * Find the edge with the given label. This function is guaranteed to
* run in O(E) time.
*/
- property_descriptor find(edge_properties const& ep) const
+ label_descriptor find(edge_label const& ep) const
{
iterator i = std::find_if(_props.begin(), _props.end(), find_first(ep));
return make_descriptor(_props, i);
}
- /** Return the number of properties in the store. */
+ /** Return the number of label in the store. */
inline size_type size() const
{ return _props.size(); }
@@ -82,36 +82,36 @@
* Bind vertex descriptors into the incidence lists into the global
* property. This is the last step of edge creation for undirected graphs.
*/
- void bind(property_descriptor d, end_pair const& p)
+ void bind(label_descriptor d, end_pair const& p)
{ make_iterator(_props, d)->second = p; }
- /** Return the properties referenced by the given descriptor. */
- inline edge_properties& properties(property_descriptor d)
+ /** Return the label referenced by the given descriptor. */
+ inline edge_label& label(label_descriptor d)
{ return make_iterator(_props, d)->first; }
/** Return the ends referened by the given descriptor. */
- inline end_pair const& ends(property_descriptor d) const
+ inline end_pair const& ends(label_descriptor d) const
{ return make_iterator(_props, d)->second; }
/** Return the first vertex of the edge. */
- inline vertex_descriptor first_vertex(property_descriptor d) const
+ inline vertex_descriptor first_vertex(label_descriptor d) const
{ return ends(d).first.first; }
/** Return the second vertex of the edge. */
- inline vertex_descriptor second_vertex(property_descriptor d) const
+ inline vertex_descriptor second_vertex(label_descriptor d) const
{ return ends(d).second.first; }
/** Return the first incidence descriptor of the edge. */
- inline incidence_descriptor first_edge(property_descriptor d) const
+ inline incidence_descriptor first_edge(label_descriptor d) const
{ return ends(d).first.second; }
/** Return the second incidence descriptor of the edge. */
- inline incidence_descriptor second_edge(property_descriptor d) const
+ inline incidence_descriptor second_edge(label_descriptor d) const
{ return ends(d).second.second; }
/** Return a descriptor for the iterator. */
- inline property_descriptor describe(iterator i) const
+ inline label_descriptor describe(iterator i) const
{ return make_descriptor(_props, i); }
private:
Modified: sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/undirected_edge.hpp
==============================================================================
--- sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/undirected_edge.hpp (original)
+++ sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/undirected_edge.hpp 2008-09-30 13:01:56 EDT (Tue, 30 Sep 2008)
@@ -18,59 +18,59 @@
{
public:
typedef VertexDesc vertex_descriptor;
- typedef PropDesc property_descriptor;
+ typedef PropDesc label_descriptor;
typedef unordered_pair<vertex_descriptor> edge_pair;
/** @name Constructors */
//@{
inline undirected_edge()
- : ends(), prop()
+ : _ends(), _label()
{ }
- inline undirected_edge(vertex_descriptor u, vertex_descriptor v, property_descriptor p)
- : ends(u, v), prop(p)
+ inline undirected_edge(vertex_descriptor u, vertex_descriptor v, label_descriptor p)
+ : _ends(u, v), _label(p)
{ }
- inline undirected_edge(std::pair<vertex_descriptor, vertex_descriptor> const& e, property_descriptor p)
- : ends(e.first, e.second), prop(p)
+ inline undirected_edge(std::pair<vertex_descriptor, vertex_descriptor> const& e, label_descriptor p)
+ : _ends(e.first, e.second), _label(p)
{ }
- inline undirected_edge(unordered_pair<vertex_descriptor, vertex_descriptor> const& e, property_descriptor p)
- : ends(e), prop(p)
+ inline undirected_edge(unordered_pair<vertex_descriptor, vertex_descriptor> const& e, label_descriptor p)
+ : _ends(e), _label(p)
{ }
//@}
/** @name Descriptor-like Functions
* These allow you to treat the edge descriptor like a typical descriptor.
- * That is, it can be tested for null status (which defers to the property
+ * That is, it can be tested for null status (which defers to the _labelerty
* descriptor).
*/
//@{
inline bool is_null() const
- { return prop.is_null(); }
+ { return _label.is_null(); }
inline operator bool() const
{ return !is_null(); }
//@}
- inline property_descriptor properties() const
- { return prop; }
+ inline label_descriptor label() const
+ { return _label; }
inline edge_pair const& edge() const
- { return ends; }
+ { return _ends; }
/** @name End Points
* Provide access to the end points of the undirected edge. Because the
- * ends of this edge are unordered, they do not provide a source and target
+ * _ends of this edge are unordered, they do not provide a source and target
* interface. See the rooted_undirected_edge class for a variant of this
* type that imposes a source/target interface on these edges.
*/
//@{
inline vertex_descriptor first() const
- { return ends.first(); }
+ { return _ends.first(); }
inline vertex_descriptor second() const
- { return ends.second(); }
+ { return _ends.second(); }
inline vertex_descriptor opposite(vertex_descriptor v) const
{ return v == first() ? second() : first(); }
@@ -78,13 +78,13 @@
/** Return true if the edge connects the two vertices. */
inline bool connects(vertex_descriptor u, vertex_descriptor v) const
- { return make_unordered_pair(u, v) == ends; }
+ { return make_unordered_pair(u, v) == _ends; }
/** @name Equality Comparable */
//@{
inline bool operator==(undirected_edge const& x) const
- { return (ends == x.ends) && (prop == x.prop); }
+ { return (_ends == x._ends) && (_label == x._label); }
inline bool operator!=(undirected_edge const& x) const
{ return !operator==(x); }
@@ -93,7 +93,7 @@
/** @name Less Than Comparable */
//@{
inline bool operator<(undirected_edge const& x) const
- { return std::make_pair(ends, prop) < std::make_pair(x.ends < x.prop); }
+ { return std::make_pair(_ends, _label) < std::make_pair(x._ends < x._label); }
inline bool operator>(undirected_edge const& x) const
{ return x.operator<(*this); }
@@ -105,8 +105,9 @@
{ return !operator<(x); }
//@}
- edge_pair ends;
- property_descriptor prop;
+private:
+ edge_pair _ends;
+ label_descriptor _label;
};
template <typename V, typename P>
@@ -123,7 +124,7 @@
hash_value(undirected_edge<V,P> const& e)
{
using boost::hash;
- return hash_value(e.prop);
+ return hash_value(e.label());
}
namespace detail
@@ -165,7 +166,7 @@
typedef typename Store::iterator iterator;
typedef typename Store::vertex_descriptor vertex_descriptor;
typedef typename Store::incidence_descriptor incidence_descriptor;
- typedef typename Store::property_descriptor property_descriptor;
+ typedef typename Store::label_descriptor label_descriptor;
typedef typename iterator::iterator_category iterator_category;
typedef typename iterator::difference_type difference_type;
@@ -217,11 +218,10 @@
inline reference operator*() const
{
- property_descriptor p = store->describe(iter);
+ label_descriptor p = store->describe(iter);
return Edge(store->first_vertex(p), store->second_vertex(p), p);
}
-
Store* store;
iterator iter;
};
Modified: sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/undirected_graph.hpp
==============================================================================
--- sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/undirected_graph.hpp (original)
+++ sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/undirected_graph.hpp 2008-09-30 13:01:56 EDT (Tue, 30 Sep 2008)
@@ -9,17 +9,17 @@
#include <boost/graphs/adjacency_list/adjacency_iterator.hpp>
template <
- typename VertexProps,
- typename EdgeProps,
+ typename VertexLabel,
+ typename EdgeLabel,
typename VertexStore,
typename EdgeStore>
class undirected_graph
{
- typedef undirected_types<VertexProps, EdgeProps, VertexStore, EdgeStore> types;
- typedef undirected_graph<VertexProps, EdgeProps, VertexStore, EdgeStore> this_type;
+ typedef undirected_types<VertexLabel, EdgeLabel, VertexStore, EdgeStore> types;
+ typedef undirected_graph<VertexLabel, EdgeLabel, VertexStore, EdgeStore> this_type;
public:
- typedef VertexProps vertex_properties;
- typedef EdgeProps edge_properties;
+ typedef VertexLabel vertex_label;
+ typedef EdgeLabel edge_label;
typedef VertexStore vertex_store_selector;
typedef EdgeStore edge_store_selector;
@@ -33,7 +33,7 @@
// Vertex/Property/Edge descriptors
typedef typename types::vertex_descriptor vertex_descriptor;
typedef typename types::edge_descriptor edge_descriptor;
- typedef typename types::property_descriptor property_descriptor;
+ typedef typename types::label_descriptor label_descriptor;
typedef typename types::incidence_descriptor incidence_descriptor;
// Iterators and ranges
@@ -60,14 +60,14 @@
* modeled by the vertex set.
*
* UnlabeledVertices add_vertex()
- * LabeledVerteces add_vertex(vertex_properties)
- * LabeledUniqueVertices add_vertex(vertex_properties)
+ * LabeledVerteces add_vertex(vertex_label)
+ * LabeledUniqueVertices add_vertex(vertex_label)
* MappedUniqueVertices add_vertex(vertex_key)
*/
//@{
vertex_descriptor add_vertex();
- vertex_descriptor add_vertex(vertex_properties const&);
- vertex_descriptor add_vertex(vertex_key const&, vertex_properties const&);
+ vertex_descriptor add_vertex(vertex_label const&);
+ vertex_descriptor add_vertex(vertex_key const&, vertex_label const&);
//@}
/** @name Find Vertex
@@ -75,11 +75,11 @@
* have UniqueVertices. These functions can also be used to find the first
* vertex of a non-unique vertices.
*
- * LabeledUniqueVertices find_vertex(vertex_properties)
+ * LabeledUniqueVertices find_vertex(vertex_label)
* MappedUniqueVertices find_vertex(vertex_key)
*/
//@{
- vertex_descriptor find_vertex(vertex_properties const&) const;
+ vertex_descriptor find_vertex(vertex_label const&) const;
vertex_descriptor find_vertex(vertex_key const&) const;
//@}
@@ -93,18 +93,18 @@
/** @name Remove Vertex
* Remove a vertex from the graph. These functions only exist for graphs
- * with ReducibleVertexSets. Functions that take properties or keys are
+ * with ReducibleVertexSets. Functions that take label or keys are
* provided for convenience, but have additional requirements and cost.
* These additional functions are equivalent to remove_vertex(find_vertex(x))
- * where x is either a vertex_properties or vertex_key.
+ * where x is either a vertex_label or vertex_key.
*
* ReducibleVertexSet remove_vertex(vertex_descriptor)
- * LabeledUniqueVertices remove_vertex(vertex_properties)
+ * LabeledUniqueVertices remove_vertex(vertex_label)
* MappedUniqueVertices remove_vertex(vertex_key)
*/
//@{
void remove_vertex(vertex_descriptor);
- void remove_vertex(vertex_properties const&);
+ void remove_vertex(vertex_label const&);
void remove_vertex(vertex_key const&);
//@}
@@ -113,29 +113,29 @@
* variations of this function, depending on the type of vertex store and
* whether or not the edges are labeled. Convenience functions are provided
* for graphs with UniqueVertices. Graphs with LabeledEdges can be added
- * with edge properties. Convenience functions are equivalent to the
+ * with edge label. Convenience functions are equivalent to the
* expression add_edge(find_vertex(x), find_vertex(y), p) with x and y
- * eithe vertex proeprties or vertex keys and p optional edge properties.
+ * eithe vertex proeprties or vertex keys and p optional edge label.
*
* ExtendableEdgeSet add_edge(vertex_descriptor, vertex_descriptor)
- * && LabeledEdges add_edge(vertex_descriptor, vertex_descriptor, edge_properties)
+ * && LabeledEdges add_edge(vertex_descriptor, vertex_descriptor, edge_label)
*
- * LabeledUniqueVertices add_edge(vertex_properties, vertex_properties)
- * && LabeledEdges add_edge(vertex_properties, vertex_properties, edge_properties)
+ * LabeledUniqueVertices add_edge(vertex_label, vertex_label)
+ * && LabeledEdges add_edge(vertex_label, vertex_label, edge_label)
*
* MappedUniqueVertices add_edge(vertex_key, vertex_key)
- * & LabeledEdges add_edge(vertex_key, vertex_key, edge_properties)
+ * & LabeledEdges add_edge(vertex_key, vertex_key, edge_label)
*/
//@{
// Unlabeled edge adders.
edge_descriptor add_edge(vertex_descriptor, vertex_descriptor);
- edge_descriptor add_edge(vertex_properties const&, vertex_properties const&);
+ edge_descriptor add_edge(vertex_label const&, vertex_label const&);
edge_descriptor add_edge(vertex_key const&, vertex_key const&);
// Labeled edge adders.
- edge_descriptor add_edge(vertex_descriptor, vertex_descriptor, edge_properties const&);
- edge_descriptor add_edge(vertex_properties const&, vertex_properties const&, edge_properties const&);
- edge_descriptor add_edge(vertex_key const&, vertex_key const&, edge_properties const&);
+ edge_descriptor add_edge(vertex_descriptor, vertex_descriptor, edge_label const&);
+ edge_descriptor add_edge(vertex_label const&, vertex_label const&, edge_label const&);
+ edge_descriptor add_edge(vertex_key const&, vertex_key const&, edge_label const&);
//@}
/** @name Test Edge
@@ -144,7 +144,7 @@
*/
//@{
edge_descriptor edge(vertex_descriptor, vertex_descriptor) const;
- edge_descriptor edge(vertex_properties const&, vertex_properties const&) const;
+ edge_descriptor edge(vertex_label const&, vertex_label const&) const;
edge_descriptor edge(vertex_key const&, vertex_key const&) const;
//@}
@@ -159,11 +159,11 @@
void remove_edge(edge_descriptor);
void remove_edges(vertex_descriptor);
- void remove_edges(vertex_properties const&);
+ void remove_edges(vertex_label const&);
void remove_edges(vertex_key const&);
void remove_edges(vertex_descriptor, vertex_descriptor);
- void remove_edges(vertex_properties const&, vertex_properties const&);
+ void remove_edges(vertex_label const&, vertex_label const&);
void remove_edges(vertex_key const&, vertex_key const&);
//@}
@@ -194,13 +194,13 @@
//@}
/** @name Property Accessors
- * Access the properties of the given vertex or edge.
+ * Access the label of the given vertex or edge.
*/
//@{
- vertex_properties& operator[](vertex_descriptor);
- vertex_properties const& operator[](vertex_descriptor) const;
- edge_properties& operator[](edge_descriptor);
- edge_properties const& operator[](edge_descriptor) const;
+ vertex_label& operator[](vertex_descriptor);
+ vertex_label const& operator[](vertex_descriptor) const;
+ edge_label& operator[](edge_descriptor);
+ edge_label const& operator[](edge_descriptor) const;
//@}
mutable property_store _props;
@@ -217,7 +217,7 @@
{ }
/**
- * Add a vertex to the graph with no or default properties, and return a
+ * Add a vertex to the graph with no or default label, and return a
* descriptor to the vertex. Although supported for all adjacency lists, this
* function should not be used with graphs that have LabeledUniqueVertices
* as it will always return the same default-propertied vertex iterator.
@@ -230,46 +230,46 @@
}
/**
- * Add a vertex to the graph with the given properties, and return a descriptor
+ * Add a vertex to the graph with the given label, and return a descriptor
* to the added vertes. If the graph has LabeledUniqe vertices, and a vertex
- * with the given properties already exists in the graph, then a new vertex
+ * with the given label already exists in the graph, then a new vertex
* is not added and returned descriptor refers to the existing vertex.
*
* @requires LabeledVertices<Graph>
*/
template <BOOST_GRAPH_UG_PARAMS>
typename undirected_graph<VP,EP,VS,ES>::vertex_descriptor
-undirected_graph<VP,EP,VS,ES>::add_vertex(vertex_properties const& vp)
+undirected_graph<VP,EP,VS,ES>::add_vertex(vertex_label const& vp)
{
return _verts.add(vp);
}
/**
- * Add a new vertex with the given properties to the graph and map it to the
+ * Add a new vertex with the given label to the graph and map it to the
* given key.
*
* @requires MappedUniqueVertices<Graph>
*/
template <BOOST_GRAPH_UG_PARAMS>
typename undirected_graph<VP,EP,VS,ES>::vertex_descriptor
-undirected_graph<VP,EP,VS,ES>::add_vertex(vertex_key const& k, vertex_properties const& vp)
+undirected_graph<VP,EP,VS,ES>::add_vertex(vertex_key const& k, vertex_label const& vp)
{
return _verts.add(k, vp);
}
/**
- * Find the vertex with the given properties, returning a descriptor to it.
+ * Find the vertex with the given label, returning a descriptor to it.
*/
template <BOOST_GRAPH_UG_PARAMS>
typename undirected_graph<VP,EP,VS,ES>::vertex_descriptor
-undirected_graph<VP,EP,VS,ES>::find_vertex(vertex_properties const& vp) const
+undirected_graph<VP,EP,VS,ES>::find_vertex(vertex_label const& vp) const
{
- BOOST_STATIC_ASSERT(is_not_none<vertex_properties>::value);
+ BOOST_STATIC_ASSERT(is_not_none<vertex_label>::value);
return _verts.find(vp);
}
/**
- * Find the vertex with the given properties, returning a descriptor to it.
+ * Find the vertex with the given label, returning a descriptor to it.
*/
template <BOOST_GRAPH_UG_PARAMS>
typename undirected_graph<VP,EP,VS,ES>::vertex_descriptor
@@ -291,13 +291,13 @@
}
/**
- * Remove the vertex from the graph identified by the given properties.
+ * Remove the vertex from the graph identified by the given label.
*/
template <BOOST_GRAPH_UG_PARAMS>
void
-undirected_graph<VP,EP,VS,ES>::remove_vertex(vertex_properties const& vp)
+undirected_graph<VP,EP,VS,ES>::remove_vertex(vertex_label const& vp)
{
- BOOST_STATIC_ASSERT(is_not_none<vertex_properties>::value);
+ BOOST_STATIC_ASSERT(is_not_none<vertex_label>::value);
remove_edges(vp);
_verts.remove(vp);
}
@@ -333,17 +333,17 @@
undirected_graph<VP,EP,VS,ES>::add_edge(vertex_descriptor u,
vertex_descriptor v)
{
- return add_edge(u, v, edge_properties());
+ return add_edge(u, v, edge_label());
}
/**
- * Create an edge with the given properties that connects the vertices u and v.
+ * Create an edge with the given label that connects the vertices u and v.
*/
template <BOOST_GRAPH_UG_PARAMS>
typename undirected_graph<VP,EP,VS,ES>::edge_descriptor
undirected_graph<VP,EP,VS,ES>::add_edge(vertex_descriptor u,
vertex_descriptor v,
- edge_properties const& ep)
+ edge_label const& ep)
{
// Get vertices for the descriptors
reorder(u, v);
@@ -361,14 +361,14 @@
BOOST_ASSERT(second.succeeded());
// Add the property and bind everything together.
- property_descriptor p = _props.add(ep);
+ label_descriptor p = _props.add(ep);
src.bind(first.value, p);
tgt.bind(second.value, p);
_props.bind(p,make_pair(make_pair(u, first.value), make_pair(v, second.value)));
return edge_descriptor(u, v, p);
}
else if(first.retained()) {
- property_descriptor p = src.properties(first.value);
+ label_descriptor p = src.label(first.value);
return edge_descriptor(u, v, p);
}
else {
@@ -378,39 +378,39 @@
/**
* Add an edge to the graph that connects the two vertices identified by the
- * given properties. The edge is either unlabeled or has default properties.
+ * given label. The edge is either unlabeled or has default label.
*/
template <BOOST_GRAPH_UG_PARAMS>
typename undirected_graph<VP,EP,VS,ES>::edge_descriptor
-undirected_graph<VP,EP,VS,ES>::add_edge(vertex_properties const& u,
- vertex_properties const& v)
+undirected_graph<VP,EP,VS,ES>::add_edge(vertex_label const& u,
+ vertex_label const& v)
{
- return add_edge(u, v, edge_properties());
+ return add_edge(u, v, edge_label());
}
/**
* Add an edge to the graph that connects the two vertices identified by the
- * given properties and has the given edge properties.
+ * given label and has the given edge label.
*/
template <BOOST_GRAPH_UG_PARAMS>
typename undirected_graph<VP,EP,VS,ES>::edge_descriptor
-undirected_graph<VP,EP,VS,ES>::add_edge(vertex_properties const& u,
- vertex_properties const& v,
- edge_properties const& ep)
+undirected_graph<VP,EP,VS,ES>::add_edge(vertex_label const& u,
+ vertex_label const& v,
+ edge_label const& ep)
{
return add_edge(find_vertex(u), find_vertex(v), ep);
}
/**
* Add an edge to the graph that connects the two vertices identified by the
- * given keys. The edge is either unlabeled or has default properties.
+ * given keys. The edge is either unlabeled or has default label.
*/
template <BOOST_GRAPH_UG_PARAMS>
typename undirected_graph<VP,EP,VS,ES>::edge_descriptor
undirected_graph<VP,EP,VS,ES>::add_edge(vertex_key const& u,
vertex_key const& v)
{
- return add_edge(u, v, edge_properties());
+ return add_edge(u, v, edge_label());
}
/**
@@ -425,19 +425,19 @@
reorder(u, v);
vertex_type const& src = _verts.vertex(u);
incidence_descriptor i = src.find(v);
- return i ? edge_descriptor(u, v, src.properties(i)) : edge_descriptor();
+ return i ? edge_descriptor(u, v, src.label(i)) : edge_descriptor();
}
/**
* Determine if any edge exists connecting the vertices identified by the given
- * properties. Return a pair containing the edge descriptor (if it exists) and
+ * label. Return a pair containing the edge descriptor (if it exists) and
* a bool determining whether or not the edge did exist. This is equivalent to
* edge(find_vertex(u), find_vertex(v)).
*/
template <BOOST_GRAPH_UG_PARAMS>
typename undirected_graph<VP,EP,VS,ES>::edge_descriptor
-undirected_graph<VP,EP,VS,ES>::edge(vertex_properties const& u,
- vertex_properties const& v) const
+undirected_graph<VP,EP,VS,ES>::edge(vertex_label const& u,
+ vertex_label const& v) const
{
return edge(find_vertex(u), find_vertex(v));
}
@@ -465,7 +465,7 @@
undirected_graph<VP,EP,VS,ES>::remove_edge(edge_descriptor e)
{
// Grab descriptors out of the edge.
- property_descriptor p = e.properties();
+ label_descriptor p = e.label();
vertex_descriptor u = e.first(), v = e.second();
vertex_type &src = _verts.vertex(u), &tgt = _verts.vertex(v);
@@ -500,16 +500,16 @@
vertex_type& tgt = _verts.vertex(e.opposite(v));
// Get an incidence descriptor into the target into tgt's edge store,
- // so we can remove the edge record and the properties of the removed
+ // so we can remove the edge record and the label of the removed
// edge.
- property_descriptor p = e.properties();
+ label_descriptor p = e.label();
std::pair<incidence_descriptor, incidence_descriptor> x =
std::make_pair(_props.first_edge(p), _props.second_edge(p));
if(src.opposite(x.first) != v) {
x.first.swap(x.second);
}
tgt.disconnect(x.first);
- _props.remove(e.properties());
+ _props.remove(e.label());
}
// Clear the incident edge set of the vertex. We can't do this in the
@@ -518,13 +518,13 @@
}
/**
- * Disconnect the vertex having the given properties from the graph.
+ * Disconnect the vertex having the given label from the graph.
*/
template <BOOST_GRAPH_UG_PARAMS>
void
-undirected_graph<VP,EP,VS,ES>::remove_edges(vertex_properties const& vp)
+undirected_graph<VP,EP,VS,ES>::remove_edges(vertex_label const& vp)
{
- BOOST_STATIC_ASSERT(is_not_none<vertex_properties>::value);
+ BOOST_STATIC_ASSERT(is_not_none<vertex_label>::value);
remove_edges(find_vertex(vp));
}
@@ -562,7 +562,7 @@
if(o == v) {
// Grab descriptors to the property and the incident edge on the
// target vertex and remove them,
- property_descriptor p = e.properties();
+ label_descriptor p = e.label();
pair<incidence_descriptor, incidence_descriptor> x =
make_pair(_props.first_edge(p), _props.second_edge(p));
if(src.opposite(x.first) == v) {
@@ -584,13 +584,13 @@
}
/**
- * Remove all edges connecting the vertices identified by the given properties.
+ * Remove all edges connecting the vertices identified by the given label.
* This is equivalent to remove_edges(find_vertex(u), find_vertex(v)).
*/
template <BOOST_GRAPH_UG_PARAMS>
void
-undirected_graph<VP,EP,VS,ES>::remove_edges(vertex_properties const& u,
- vertex_properties const& v)
+undirected_graph<VP,EP,VS,ES>::remove_edges(vertex_label const& u,
+ vertex_label const& v)
{
return remove_edges(find_vertex(u), find_vertex(v));
}
@@ -726,29 +726,29 @@
return _verts.vertex(v).degree();
}
-/** Return the properties for the given vertex. */
+/** Return the label for the given vertex. */
template <BOOST_GRAPH_UG_PARAMS>
-typename undirected_graph<VP,EP,VS,ES>::vertex_properties&
+typename undirected_graph<VP,EP,VS,ES>::vertex_label&
undirected_graph<VP,EP,VS,ES>::operator[](vertex_descriptor v)
-{ return _verts.properties(v); }
+{ return _verts.label(v); }
-/** Return the properties for the given vertex. */
+/** Return the label for the given vertex. */
template <BOOST_GRAPH_UG_PARAMS>
-typename undirected_graph<VP,EP,VS,ES>::vertex_properties const&
+typename undirected_graph<VP,EP,VS,ES>::vertex_label const&
undirected_graph<VP,EP,VS,ES>::operator[](vertex_descriptor v) const
-{ return _verts.properties(v); }
+{ return _verts.label(v); }
-/** Return the properties for the given edge. */
+/** Return the label for the given edge. */
template <BOOST_GRAPH_UG_PARAMS>
-typename undirected_graph<VP,EP,VS,ES>::edge_properties&
+typename undirected_graph<VP,EP,VS,ES>::edge_label&
undirected_graph<VP,EP,VS,ES>::operator[](edge_descriptor e)
-{ return _props.properties(e.properties()); }
+{ return _props.label(e.label()); }
-/** Return the properties for the given edge. */
+/** Return the label for the given edge. */
template <BOOST_GRAPH_UG_PARAMS>
-typename undirected_graph<VP,EP,VS,ES>::edge_properties const&
+typename undirected_graph<VP,EP,VS,ES>::edge_label const&
undirected_graph<VP,EP,VS,ES>::operator[](edge_descriptor e) const
-{ return _props.properties(e.properties()); }
+{ return _props.label(e.label()); }
#undef BOOST_GRAPH_UG_PARAMS
Modified: sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/undirected_types.hpp
==============================================================================
--- sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/undirected_types.hpp (original)
+++ sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/undirected_types.hpp 2008-09-30 13:01:56 EDT (Tue, 30 Sep 2008)
@@ -34,20 +34,20 @@
* This class is a giant metafunction that generates the types required to
* implement an undirected gaph.
*/
-template <typename VertexProps, typename EdgeProps, typename VertexStore, typename EdgeStore>
+template <typename VertexLabel, typename EdgeLabel, typename VertexStore, typename EdgeStore>
struct undirected_types
{
// Generate descriptors.
typedef typename VertexStore::vertex_descriptor vertex_descriptor;
- typedef typename EdgeStore::property_descriptor property_descriptor;
+ typedef typename EdgeStore::label_descriptor label_descriptor;
typedef typename EdgeStore::incidence_descriptor incidence_descriptor;
// Generate the property store and related types.
- typedef typename EdgeStore::template property_store<vertex_descriptor, EdgeProps>::type property_store;
+ typedef typename EdgeStore::template property_store<vertex_descriptor, EdgeLabel>::type property_store;
typedef typename property_store::size_type edges_size_type;
// Generate stuff related to edges
- typedef undirected_edge<vertex_descriptor, property_descriptor> edge_descriptor;
+ typedef undirected_edge<vertex_descriptor, label_descriptor> edge_descriptor;
typedef undirected_edge_iterator<property_store, edge_descriptor> edge_iterator;
typedef std::pair<edge_iterator, edge_iterator> edge_range;
@@ -58,7 +58,7 @@
typedef std::pair<incident_edge_iterator, incident_edge_iterator> incident_edge_range;
// Generate the vertex type and its store and key type.
- typedef undirected_vertex<VertexProps, incidence_store> vertex_type;
+ typedef undirected_vertex<VertexLabel, incidence_store> vertex_type;
typedef typename VertexStore::template store<vertex_type>::type vertex_store;
typedef typename vertex_store::size_type vertices_size_type;
typedef typename vertex_store::vertex_iterator vertex_iterator;
Modified: sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/undirected_vertex.hpp
==============================================================================
--- sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/undirected_vertex.hpp (original)
+++ sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/undirected_vertex.hpp 2008-09-30 13:01:56 EDT (Tue, 30 Sep 2008)
@@ -5,39 +5,37 @@
#include <boost/graphs/adjacency_list/incidence_iterator.hpp>
/**
- * A vertex, at least for an undirected graph, is simply an repository
- * for the vertex' properties and an interface for the its incidence
- * list.
+ * A vertex, at least for an undirected graph, is simply an repository for the
+ * vertex's label and an interface for the its incidence list.
*
- * For directed graphs, it's basically the same, but has an out edge
- * list and/or an in edge list, and the edge properties are stored on
- * the out edge list.
- * The default comparison of vertices always delegates the comparison to the
- * stored vertex properties. This allows developers to express custom
- * comparitors with respect to the properties and have the vertex sets or other
- * vertex ordering operations work as they might expect.
+ * For directed graphs, it's basically the same, but has an out edge list and/or
+ * an in edge list, and the edge label are stored on the out edge list. The
+ * default comparison of vertices always delegates the comparison to the stored
+ * vertex label. This allows developers to express custom comparitors with
+ * respect to the label and have the vertex sets or other vertex ordering
+ * operations work as they might expect.
*
- * @requires LessThanComparable<vertex_properties>.
+ * @requires LessThanComparable<vertex_label>.
*/
template <typename VertexProps, typename IncStore>
class undirected_vertex
{
public:
- typedef VertexProps vertex_properties;
+ typedef VertexProps vertex_label;
typedef IncStore incidence_store;
typedef typename incidence_store::incidence_descriptor incidence_descriptor;
typedef typename incidence_store::vertex_descriptor vertex_descriptor;
- typedef typename incidence_store::property_descriptor property_descriptor;
+ typedef typename incidence_store::label_descriptor label_descriptor;
typedef typename incidence_store::iterator iterator;
typedef typename incidence_store::size_type size_type;
inline undirected_vertex()
- : _props(), _edges()
+ : _label(), _edges()
{ }
- inline undirected_vertex(vertex_properties const& vp)
- : _props(vp), _edges()
+ inline undirected_vertex(vertex_label const& vp)
+ : _label(vp), _edges()
{ }
/** @name Edge Connection and Disconnection
@@ -48,7 +46,7 @@
inline insertion_result<incidence_descriptor> connect(vertex_descriptor v)
{ return _edges.add(v); }
- inline void bind(incidence_descriptor i, property_descriptor p)
+ inline void bind(incidence_descriptor i, label_descriptor p)
{ _edges.bind(i, p); }
inline void disconnect(incidence_descriptor i)
@@ -59,9 +57,9 @@
{ return _edges.find(v); }
//@}
- /** Return the properties of the given incident edge. */
- inline property_descriptor properties(incidence_descriptor i) const
- { return _edges.properties(i); }
+ /** Return the label of the given incident edge. */
+ inline label_descriptor label(incidence_descriptor i) const
+ { return _edges.label(i); }
inline vertex_descriptor opposite(incidence_descriptor i) const
{ return _edges.vertex(i) ;}
@@ -69,11 +67,11 @@
/** @name Property Accessors */
//@{
- inline vertex_properties& properties()
- { return _props; }
+ inline vertex_label& label()
+ { return _label; }
- inline vertex_properties const& properties() const
- { return _props; }
+ inline vertex_label const& label() const
+ { return _label; }
//@}
/** @name Iterators */
@@ -92,16 +90,16 @@
{ return _edges.size(); }
inline bool operator==(undirected_vertex const& x) const
- { return _props == x._props; }
+ { return _label == x._label; }
inline bool operator!=(undirected_vertex const& x) const
{ return !this->operator==(x); }
inline bool operator<(undirected_vertex const& x) const
- { return _props < x._props; }
+ { return _label < x._label; }
private:
- vertex_properties _props;
+ vertex_label _label;
incidence_store _edges;
};
Modified: sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/vertex_list.hpp
==============================================================================
--- sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/vertex_list.hpp (original)
+++ sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/vertex_list.hpp 2008-09-30 13:01:56 EDT (Tue, 30 Sep 2008)
@@ -45,7 +45,7 @@
typedef typename store_type::const_iterator const_iterator;
typedef Vertex vertex_type;
- typedef typename Vertex::vertex_properties vertex_properties;
+ typedef typename Vertex::vertex_label vertex_label;
typedef typename descriptor_traits<store_type>::descriptor_type vertex_descriptor;
@@ -58,14 +58,14 @@
{ }
/** @name Add Vertex
- * Add a vertex to the store with the given properties (or none). Return
+ * Add a vertex to the store with the given label (or none). Return
* a descriptor to the vertex that was added to the vector.
*/
//@{
inline vertex_descriptor add()
- { return add(vertex_properties()); }
+ { return add(vertex_label()); }
- inline vertex_descriptor add(vertex_properties const& vp)
+ inline vertex_descriptor add(vertex_label const& vp)
{
++_size;
iterator i = insert(_verts, vertex_type(vp));
@@ -73,10 +73,10 @@
}
//@}
- /** Find the vertex with the given properties. */
- inline vertex_descriptor find(vertex_properties const& vp)
+ /** Find the vertex with the given label. */
+ inline vertex_descriptor find(vertex_label const& vp)
{
- iterator i = std::find_if(_verts.begin(), _verts.end(), find_properties(vp));
+ iterator i = std::find_if(_verts.begin(), _verts.end(), find_label(vp));
return make_descriptor(_verts, i);
}
@@ -91,7 +91,7 @@
--_size;
}
- inline void remove(vertex_properties const& vp)
+ inline void remove(vertex_label const& vp)
{ remove(find(vp)); }
//@}
@@ -131,11 +131,11 @@
/** @name Vertex Properties */
//@{
- vertex_properties& properties(vertex_descriptor v)
- { return vertex(v).properties(); }
+ vertex_label& label(vertex_descriptor v)
+ { return vertex(v).label(); }
- vertex_properties const& properties(vertex_descriptor v) const
- { return vertex(v).properties(); }
+ vertex_label const& label(vertex_descriptor v) const
+ { return vertex(v).label(); }
//@}
private:
Modified: sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/vertex_map.hpp
==============================================================================
--- sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/vertex_map.hpp (original)
+++ sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/vertex_map.hpp 2008-09-30 13:01:56 EDT (Tue, 30 Sep 2008)
@@ -49,7 +49,7 @@
/**
* Implementation of the vertex set. This requires that vertices (actually
- * their properties) are less-than comparable.
+ * their label) are less-than comparable.
*
* @param Vertex The vertex type stored by the class.
* @param Key The type of key mapping to vertices.
@@ -68,7 +68,7 @@
typedef Key key_type;
typedef Vertex vertex_type;
- typedef typename Vertex::vertex_properties vertex_properties;
+ typedef typename Vertex::vertex_label vertex_label;
typedef typename descriptor_traits<store_type>::descriptor_type vertex_descriptor;
@@ -81,9 +81,9 @@
/**
* Add a vertex to the store mapped to the given key, and having the given
- * properties.
+ * label.
*/
- inline vertex_descriptor add(key_type const& k, vertex_properties const& vp)
+ inline vertex_descriptor add(key_type const& k, vertex_label const& vp)
{ return make_descriptor(_verts, _verts.insert(std::make_pair(k, vp)).first); }
/**
@@ -93,7 +93,7 @@
{ return make_descriptor(_verts, _verts.find(k)); }
/** @name Remove Vertex
- * Remove the vertex identified by the descriptor or the its properties.
+ * Remove the vertex identified by the descriptor or the its label.
*/
//@{
inline void remove(vertex_descriptor d)
@@ -139,11 +139,11 @@
/** @name Property Accessors */
//@{
- vertex_properties& properties(vertex_descriptor v)
- { return vertex(v).properties(); }
+ vertex_label& label(vertex_descriptor v)
+ { return vertex(v).label(); }
- vertex_properties const& properties(vertex_descriptor v) const
- { return vertex(v).properties(); }
+ vertex_label const& label(vertex_descriptor v) const
+ { return vertex(v).label(); }
//@}
private:
Modified: sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/vertex_set.hpp
==============================================================================
--- sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/vertex_set.hpp (original)
+++ sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/vertex_set.hpp 2008-09-30 13:01:56 EDT (Tue, 30 Sep 2008)
@@ -24,7 +24,7 @@
* The Alloc parameter is also a unary template class. In this case, the caller
* does not actually know what the final instantiated type is going to be.
*
- * @param Compare A unary template class that compares vertex properties.
+ * @param Compare A unary template class that compares vertex label.
* @param Alloc A unary template class that allocates vertices.
*/
template <
@@ -42,7 +42,7 @@
struct store
{
typedef Alloc<Vertex> allocator;
- typedef property_comparator<Compare<typename Vertex::vertex_properties>> compare;
+ typedef label_comparator<Compare<typename Vertex::vertex_label>> compare;
typedef vertices_set<Vertex, compare, allocator> type;
};
};
@@ -50,10 +50,10 @@
/**
* Implementation of the vertex set. This requires that vertices (actually
- * their properties) are less-than comparable.
+ * their label) are less-than comparable.
*
* @param Vertex The type of vertex stored by the set.
- * @param Compare An ordering of vertices (should delegate to properties).
+ * @param Compare An ordering of vertices (should delegate to label).
* @param Allocator The allocator for stored vertices.
*/
template <typename Vertex, typename Compare, typename Allocator>
@@ -66,7 +66,7 @@
typedef typename store_type::const_iterator const_iterator;
typedef Vertex vertex_type;
- typedef typename Vertex::vertex_properties vertex_properties;
+ typedef typename Vertex::vertex_label vertex_label;
typedef typename descriptor_traits<store_type>::descriptor_type vertex_descriptor;
@@ -78,18 +78,18 @@
{ }
/**
- * Add a vertex to the store with the given properties (or none). Return
+ * Add a vertex to the store with the given label (or none). Return
* a descriptor to the vertex that was added to the vector.
*/
- inline vertex_descriptor add(vertex_properties const& vp)
+ inline vertex_descriptor add(vertex_label const& vp)
{ return make_descriptor(_verts, insert(_verts, vertex_type(vp))); }
- /** Find the vertex with the given properties. */
- inline vertex_descriptor find(vertex_properties const& vp) const
+ /** Find the vertex with the given label. */
+ inline vertex_descriptor find(vertex_label const& vp) const
{ return make_descriptor(_verts, _verts.find(vp)); }
/** @name Remove Vertex
- * Remove the given vertex or the one identified by the given properties.
+ * Remove the given vertex or the one identified by the given label.
*/
//@{
inline void remove(vertex_descriptor v)
@@ -98,7 +98,7 @@
erase(_verts, make_iterator(_verts, v));
}
- inline void remove(vertex_properties const& v)
+ inline void remove(vertex_label const& v)
{ remove(find(v)); }
//@}
@@ -135,11 +135,11 @@
/** @name Property Accessors */
//@{
- vertex_properties& properties(vertex_descriptor v)
- { return vertex(v).properties(); }
+ vertex_label& label(vertex_descriptor v)
+ { return vertex(v).label(); }
- vertex_properties const& properties(vertex_descriptor v) const
- { return vertex(v).properties(); }
+ vertex_label const& label(vertex_descriptor v) const
+ { return vertex(v).label(); }
//@{
private:
Modified: sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/vertex_vector.hpp
==============================================================================
--- sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/vertex_vector.hpp (original)
+++ sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_list/vertex_vector.hpp 2008-09-30 13:01:56 EDT (Tue, 30 Sep 2008)
@@ -62,7 +62,7 @@
typedef typename store_type::iterator iterator;
typedef Vertex vertex_type;
- typedef typename Vertex::vertex_properties vertex_properties;
+ typedef typename Vertex::vertex_label vertex_label;
typedef typename descriptor_traits<store_type>::descriptor_type vertex_descriptor;
@@ -75,14 +75,14 @@
{ }
/** @name Add Vertex
- * Add a vertex to the store with the given properties (or none). Return
+ * Add a vertex to the store with the given label (or none). Return
* a descriptor to the vertex that was added to the vector.
*/
//@{
inline vertex_descriptor add()
- { return add(vertex_properties()); }
+ { return add(vertex_label()); }
- inline vertex_descriptor add(vertex_properties const& vp)
+ inline vertex_descriptor add(vertex_label const& vp)
{
iterator i = insert(_verts, vertex_type(vp));
return make_descriptor(_verts, i);
@@ -90,13 +90,13 @@
//@}
/**
- * Return a descriptor to the vertex with the given properties. If you
+ * Return a descriptor to the vertex with the given label. If you
* end up calling this function, you're probably using the wrong graph
* type.
*/
- vertex_descriptor find(vertex_properties const& vp) const
+ vertex_descriptor find(vertex_label const& vp) const
{
- iterator i = std::find_if(_verts.begin(), _verts.end(), find_properties(vp));
+ iterator i = std::find_if(_verts.begin(), _verts.end(), find_label(vp));
return make_descriptor(_verts, i);
}
@@ -134,11 +134,11 @@
/** @name Property Accessors */
//@{
- vertex_properties& properties(vertex_descriptor v)
- { return vertex(v).properties(); }
+ vertex_label& label(vertex_descriptor v)
+ { return vertex(v).label(); }
- vertex_properties const& properties(vertex_descriptor v) const
- { return vertex(v).properties(); }
+ vertex_label const& label(vertex_descriptor v) const
+ { return vertex(v).label(); }
//@}
private:
Added: sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_matrix/basic_matrix.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_matrix/basic_matrix.hpp 2008-09-30 13:01:56 EDT (Tue, 30 Sep 2008)
@@ -0,0 +1,207 @@
+
+#ifndef BOOST_GRAPHS_ADJMATRIX_BASIC_MATRIX_HPP
+#define BOOST_GRAPHS_ADJMATRIX_BASIC_MATRIX_HPP
+
+#include <vector>
+
+#include <boost/optional.hpp>
+#include <boost/none.hpp>
+#include <boost/triple.hpp>
+
+namespace boost { namespace graphs { namespace adjacency_matrix {
+
+namespace detail
+{
+ // Metafunctions to generate the value type of a basic matrix.
+ // TODO: This facility probably needs to be exposed to other matrix
+ // implementations (e.g., triangular matrix, compressed matrix, etc.).
+ template <typename T>
+ struct matrix_element { typedef optional<T> type; };
+ template <> struct matrix_element<none> { typedef bool type; };
+
+ // Specialize the case of matrix references and various operations on them.
+ // Note that the generic case is empty.
+ template <typename T> struct column_traits { };
+ template <typename T>
+ struct column_traits<std::vector<optional<T>>>
+ {
+ typedef std::vector<optional<T>> container;
+ typedef typename container::size_type size_type;
+ typedef typename container::reference reference;
+ typedef typename container::const_reference const_reference;
+
+ typedef T const& get_result;
+
+ static optional<T> make_value(T const& x)
+ { return optional<T>(x); }
+
+ // This can easily segfault c[i] is not valid.
+ get_result get(container const& c, size_type i)
+ { return c[i].get(); }
+
+ static void set(container& c, size_type i)
+ { c[i] = optional<T>(); }
+
+ static void set(container&c, size_type i, T const& x)
+ { c[i] = x; }
+
+ static void clear(container& c, size_type i)
+ { c[i].reset(); }
+ };
+ template <>
+ struct column_traits<std::vector<bool>>
+ {
+ typedef std::vector<bool> container;
+ typedef container::size_type size_type;
+ typedef container::reference reference;
+ typedef container::const_reference const_reference;
+
+ typedef const_reference get_result;
+
+ static bool make_value(none)
+ { return false; }
+
+ static get_result get(container const& c, size_type i)
+ { return c[i]; }
+
+ static void set(container& c, size_type i)
+ { c[i] = true; }
+
+ static void clear(container& c, size_type i)
+ { c[i] = false; }
+ };
+
+
+ // A little helper function for the template constructor.
+ // TODO Write this for tuples also.
+ template <typename Matrix, typename T1, typename T2>
+ void expand_and_set(Matrix& m, std::pair<T1, T2> const& p)
+ { m.set(p.first, p.second); }
+
+ template <typename Matrix, typename T1, typename T2, typename T3>
+ void expand_and_set(Matrix& m, triple<T1, T2, T3> const& t)
+ { m.set(t.first, t.second, t.third); }
+}
+
+/**
+ * An unoptimized implementation of the basic square matrix that contains
+ * optional elements T. Note that the underlying storage type is specialized
+ * for the type 'none', because this is essentially already a boolean data
+ * structure, and we don't need to store any additional information. Otherwise,
+ * T is made to be optional<T>.
+ *
+ * This is not a basic matrix in the linear algebra sense of things. This is a
+ * legitimate container, albeit arranged in a fairly rigid fashion. This class
+ * cannot be used interchangeably with Matrix interface found in Boost.uBLAS.
+ * The reason for this is that we can return optional values for all non-boolean
+ * value types.
+ *
+ * This is currently implemented using std::vectors, but could potentially be
+ * rewritten to use a simple dynamic array.
+ */
+template <typename T, template <typename> class Allocator = std::allocator>
+struct basic_matrix
+{
+ typedef typename detail::matrix_element<T>::type value_type;
+ typedef std::vector<value_type> columns_type; // contains edges
+ typedef std::vector<columns_type> rows_type; // contains rows
+
+ typedef detail::column_traits<columns_type> ct;
+
+ // The reference type of these vectors may not be the same as value_type&.
+ typedef typename ct::reference reference;
+ typedef typename ct::const_reference const_reference;
+
+ typedef typename rows_type::size_type size_type;
+
+ /** @name Constructors/Destructor */
+ //@{
+ basic_matrix(size_type n, T const& x = T())
+ : _rows(n, columns_type(n, ct::make_value(x)))
+ { }
+
+ basic_matrix(basic_matrix const& x)
+ : _rows(x.rows)
+ { }
+
+ basic_matrix(basic_matrix&& x)
+ : _rows(std::move(x._rows))
+ { }
+
+ template <typename Iter>
+ basic_matrix(size_type n, Iter f, Iter l)
+ : basic_matrix(n)
+ { for( ; f != l; ++f) detail::expand_and_set(*this, *f); }
+
+ ~basic_matrix()
+ { _rows.clear(); }
+ //@}
+
+ /** @name Row Accessors */
+ //@{
+ reference operator()(size_type i, size_type j)
+ { return _rows[i][j]; }
+
+ const_reference const& operator()(size_type i, size_type j) const
+ { return _rows[i][j]; }
+
+ /** Test to see if the element at i, j is set. */
+ bool test(size_type i, size_type j)
+ {
+ // Relies on the optional<T>::operator bool() overload.
+ return _rows[i][j];
+ }
+
+ /**
+ * Get the value held at the index i, j. Note that the gotten result is not
+ * either const or an rvalue.
+ */
+ typename ct::get_result get(size_type i, size_type j) const
+ { return _rows[i][j]; }
+
+ /**
+ * Make this matrix element set to true. This operation is only used if
+ * T is none. Otherwise, the 3-parameter version of set is used. Using this
+ * for non-none types T will probably result in a compiler errror.
+ */
+ void set(size_type i, size_type j)
+ { ct::set(_rows[i], j); }
+
+ /**
+ * Set the value of this element to the given value.
+ */
+ void set(size_type i, size_type j, T const& x)
+ { ct::set(_rows[i], j, x); }
+
+ /**
+ * Clear the value of this element. If T is none, this simply resets the
+ * value to false. Otherwise, it actually clears the optional value.
+ */
+ void clear(size_type i, size_type j)
+ { ct::clear(_rows[i], j); }
+ //@}
+
+ /**
+ * Clear the contents of the matrix. This does not change the dimensions of
+ * the data structure, nore reallocate memory.
+ */
+ void clear()
+ {
+ for(int i = 0; i < _rows.size(); ++i) {
+ for(int j = 0; j < _rows.size(); ++j) {
+ clear(i, j);
+ }
+ }
+ }
+
+ /** Return the square dimension of the matrix. */
+ size_type size() const
+ { return _rows.size(); }
+
+private:
+ rows_type _rows;
+};
+
+} } }
+
+#endif
Added: sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_matrix/undirected_edge.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_matrix/undirected_edge.hpp 2008-09-30 13:01:56 EDT (Tue, 30 Sep 2008)
@@ -0,0 +1,133 @@
+
+#ifndef BOOST_GRAPHS_ADJMATRIX_UNDIRECTED_EDGE_HPP
+#define BOOST_GRAPHS_ADJMATRIX_UNDIRECTED_EDGE_HPP
+
+#include <iosfwd>
+
+#include <boost/unordered_pair.hpp>
+#include <boost/graphs/directional_edge.hpp>
+
+namespace boost { namespace graphs { namespace adjacency_matrix {
+
+/**
+ * This structure implements an undirected edge for an adjacency matrix. The
+ * undirected edge is a combination of unordered endpoints, representing the
+ * two vertices and a (mostly) unused matrix descriptor that defines the
+ * position of the edge label within each matrix element.
+ */
+template <typename VertexDesc, typename LabelDesc>
+class undirected_edge
+{
+public:
+ typedef VertexDesc vertex_descriptor;
+ typedef LabelDesc label_descriptor;
+ typedef unordered_pair<vertex_descriptor> edge_pair;
+
+ /** @name Constructors */
+ //@{
+ inline undirected_edge()
+ : _ends(), _label()
+ { }
+
+ inline undirected_edge(vertex_descriptor u,
+ vertex_descriptor v,
+ label_descriptor l = label_descriptor())
+ : _ends(u, v), _label(l)
+ { }
+
+ inline undirected_edge(std::pair<vertex_descriptor, vertex_descriptor> const& e,
+ label_descriptor l = label_descriptor())
+ : _ends(e.first, e.second), _label(l)
+ { }
+
+ inline undirected_edge(unordered_pair<vertex_descriptor, vertex_descriptor> const& e,
+ label_descriptor l = label_descriptor())
+ : _ends(e), _label(l)
+ { }
+ //@}
+
+ /** @name Descriptor-like Functions
+ * These allow you to treat the edge descriptor like a typical descriptor.
+ * That is, it can be tested for null status (which defers to the _labelerty
+ * descriptor).
+ */
+ //@{
+ inline bool is_null() const
+ { return _ends.first().is_nul() || _ends.second().is_null(); }
+
+ inline operator bool() const
+ { return !is_null(); }
+ //@}
+
+ inline label_descriptor label() const
+ { return _label; }
+
+ inline edge_pair const& edge() const
+ { return _ends; }
+
+ /** @name End Points
+ * Provide access to the end points of the undirected edge. Because the
+ * _ends of this edge are unordered, they do not provide a source and target
+ * interface. See the rooted_undirected_edge class for a variant of this
+ * type that imposes a source/target interface on these edges.
+ */
+ //@{
+ inline vertex_descriptor first() const
+ { return _ends.first(); }
+
+ inline vertex_descriptor second() const
+ { return _ends.second(); }
+
+ inline vertex_descriptor opposite(vertex_descriptor v) const
+ { return v == first() ? second() : first(); }
+ //@}
+
+ /** @name Equality Comparable */
+ //@{
+ inline bool operator==(undirected_edge const& x) const
+ { return (_ends == x._ends) && (_label == x._label); }
+
+ inline bool operator!=(undirected_edge const& x) const
+ { return !operator==(x); }
+ //@}
+
+ /** @name Less Than Comparable */
+ //@{
+ inline bool operator<(undirected_edge const& x) const
+ { return std::make_pair(_ends, _label) < std::make_pair(x._ends < x._label); }
+
+ inline bool operator>(undirected_edge const& x) const
+ { return x.operator<(*this); }
+
+ inline bool operator<=(undirected_edge const& x) const
+ { return !x.operator<(*this); }
+
+ inline bool operator>=(undirected_edge const& x) const
+ { return !operator<(x); }
+ //@}
+
+private:
+ edge_pair _ends;
+ label_descriptor _label;
+};
+
+template <typename V, typename P>
+std::ostream& operator<<(std::ostream& os, undirected_edge<V,P> const& e)
+{ return os << "{" << e.first() << " " << e.second() << "}"; }
+
+/**
+ * The hash value of edges can be computed over the hash value of the property
+ * descriptors. This is because the property descriptor provides a global
+ * context for the edge.
+ */
+template <typename V, typename P>
+inline std::size_t
+hash_value(undirected_edge<V,P> const& e)
+{
+ using boost::hash;
+ return hash_value(e.label());
+}
+
+} } }
+
+#endif
Added: sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_matrix/undirected_graph.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2008/graphs/trunk/boost/graphs/adjacency_matrix/undirected_graph.hpp 2008-09-30 13:01:56 EDT (Tue, 30 Sep 2008)
@@ -0,0 +1,80 @@
+
+#ifndef BOOST_GRAPHS_ADJMATRIX_UNDIRECTED_GRAPH_HPP
+#define BOOST_GRAPHS_ADJMATRIX_UNDIRECTED_GRAPH_HPP
+
+#include <vector>
+
+#include <boost/descriptors.hpp>
+#include <boost/graphs/adjacency_matrix/basic_matrix.hpp>
+#include <boost/graphs/adjacency_matrix/undirected_edge.hpp>
+
+namespace boost { namespace graphs { namespace adjacency_matrix {
+
+/**
+ * We should be able to specialize the hell out of the storage unit contained
+ * in the matrix, based on the EdgeLabel. At the minimum, we have to store a
+ * boolean value indicating whether or not an edge actually exists. If the
+ * EdgeLabel is none, we could store this is as a NxN array of bools, or if you
+ * really want compressed space - as a bitmap. If the EdgeLabel is not none,
+ * then we have to decide how to implement optional storage of that data.
+ * This probably comes down to using Boost.Optional to store the edge labels.
+ *
+ * @todo The undirected graph's underlying matrix should reduce to a triangular
+ * matrix. Otherwise, we're just wasting space.
+ *
+ * @todo Find a way to better parameterize the underlying store for vertex
+ * properties. We can basically require something that provides random access,
+ * and dynamic resizing. Look at the storage selectors for adjacency lists for
+ * inspiration. For now, this is just a vector. Note that whatever the solution
+ * is, there has to be a 1-to-1 correspondence between the descriptor for the
+ * vertex's label and its position on the matrix (which is why vectors work
+ * well).
+ *
+ * @todo Specialize away the storage requirement for VertexLabel == none.
+ */
+template <
+ typename VertexLabel = none,
+ typename EdgeLabel = none,
+ typename EdgeMatrix = basic_matrix<EdgeLabel>>
+struct undirected_graph
+{
+ typedef std::vector<VertexLabel> label_store;
+
+ typedef VertexLabel vertex_label;
+ typedef EdgeLabel edge_label;
+
+ typedef EdgeMatrix edge_matrix;
+ typedef typename edge_matrix::size_type vertices_size_type;
+ typedef typename edge_matrix::size_type edges_size_type;
+
+ // Descriptor types.
+ // The vertex descriptor plays double duty indexing both the label store
+ // and the matrix.
+ // The matrix descriptor hosts a unique location into the matrix. For simple
+ // matrices this is essentially unused because you can only store a single
+ // edge at each (u,v) element of the matrix. For multimatrices, this will
+ // probably represent an iterator into a list of edges.
+ typedef descriptor_traits<label_store> vertex_descriptor;
+ typedef int matrix_descriptor;
+ typedef undirected_edge<vertex_descriptor, matrix_descriptor> edge_descriptor;
+
+ // Construct a graph with n vertices, whose vertex and edge labels are all
+ // initialized to the given value.
+ undirected_graph(vertices_size_type n,
+ vertex_label const& vl = vertex_label(),
+ edge_label const& el = edge_label())
+ : _labels(n, vl), _matrix(n, el)
+ { }
+
+ template <typename VertexIter, typename EdgeIter>
+ undirected_graph(VertexIter fv, VertexIter lv, EdgeIter fe, EdgeIter le)
+ : _labels(fv, le), _matrix(std::distance(fv, lv), fe, le)
+ { }
+
+ label_store _labels;
+ edge_matrix _matrix;
+};
+
+} } }
+
+#endif
Modified: sandbox/SOC/2008/graphs/trunk/boost/graphs/algorithms/breadth_first.hpp
==============================================================================
--- sandbox/SOC/2008/graphs/trunk/boost/graphs/algorithms/breadth_first.hpp (original)
+++ sandbox/SOC/2008/graphs/trunk/boost/graphs/algorithms/breadth_first.hpp 2008-09-30 13:01:56 EDT (Tue, 30 Sep 2008)
@@ -15,7 +15,7 @@
template <
typename Graph,
typename Visitor = default_search_visitor,
- typename ColorMap = optional_vertex_map<Graph, color>>
+ typename ColorMap = optional_vertex_label<Graph, color>>
void
breadth_first_search(Graph const& g,
Visitor vis = Visitor(),
Modified: sandbox/SOC/2008/graphs/trunk/boost/graphs/algorithms/depth_first.hpp
==============================================================================
--- sandbox/SOC/2008/graphs/trunk/boost/graphs/algorithms/depth_first.hpp (original)
+++ sandbox/SOC/2008/graphs/trunk/boost/graphs/algorithms/depth_first.hpp 2008-09-30 13:01:56 EDT (Tue, 30 Sep 2008)
@@ -14,7 +14,7 @@
template <
typename Graph,
typename Visitor = default_search_visitor,
- typename ColorMap = optional_vertex_map<Graph, color>>
+ typename ColorMap = optional_vertex_label<Graph, color>>
void
depth_first_search(Graph const& g,
Visitor vis = Visitor(),
Added: sandbox/SOC/2008/graphs/trunk/boost/graphs/concepts.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2008/graphs/trunk/boost/graphs/concepts.hpp 2008-09-30 13:01:56 EDT (Tue, 30 Sep 2008)
@@ -0,0 +1,296 @@
+
+#ifndef CONCEPTS_HPP
+#define CONCEPTS_HPP
+
+
+concept Graph<typename G>
+{
+ Descriptor vertex_descriptor;
+ Descriptor edge_descriptor;
+};
+
+concept HasUnlabeledVertices<typename G>
+{ };
+
+concept HasLabeledVertices<typename G> : Graph<G>
+{
+ ObjectType vertex_label;
+
+ vertex_label& operator[](G&, vertex_descriptor v);
+ vertex_label const& operator[](G const&, vertex_descriptor v);
+
+ vertex_descriptor G::vertex(vertex_label const& l) const;
+};
+
+concept HasMappedVertices<typename G> : Graph<G>
+{
+ ObjectType vertex_label;
+ ObjectType vertex_key;
+
+ vertex_label& operator[](G&, vertex_descriptor v);
+ vertex_label const& operator[](G const&, vertex_descriptor v);
+
+ vertex_descriptor G::vertex(vertex_key const& k) const;
+ vertex_key const& G::key(vertex_descriptor v) const;
+};
+
+concept HasUniqueLabeledVertices<typename G> : HasLabeledVertices<G>
+{ };
+
+concept HasUniqueMappedVertices<typename G> : HasMappedVertices<G>
+{ };
+
+concept HasSortedLabels<typename G> : HasLabeledVertices<G>
+{
+ StrictWeakOrder<auto, vertex_label> vertex_compare;
+
+ vertex_compare G::vertex_compare_function() const;
+};
+
+concept HasSortedKeys<typename G> : HasMappedVertices<G>
+{
+ StrictWeakOrder<auto, vertex_key> vertex_compare;
+
+ vertex_compare G::vertex_compare_function() const;
+};
+
+concept HasHashedLabels<typename G> : HasLabeledVertices<G>
+{
+ HashFunction<auto, vertex_label> vertex_hash;
+
+ vertex_hash G::vertex_hash_function() const;
+};
+
+concept HasHashedKeys<typename G> : HasMappedVertices<G>
+{
+ HashFunction<auto, vertex_key> vertex_hash;
+
+ vertex_hash G::vertex_hash_function() const;
+};
+
+concept HasUnlabeledEdges<typename G>
+{ };
+
+concept HasLabeledEdges : Graph<G>
+{
+ typename edge_label;
+ edge_label& operator[](G&, edge_descriptor);
+ edge_label const& operator[](G const&, edge_descriptor);
+};
+
+concept HasUniqueEdges<typename G> { };
+
+concept HasLoopEdges<typename G> { };
+
+concept HasUndirectedEdges<typename G> : Graph<G>
+{
+ vertex_descriptor first(edge_descriptor e);
+ vertex_descriptor second(edge_descriptor e);
+ edge_descriptor make_endpoints(vertex_descriptor u, vertex_descriptor v);
+
+ axiom EndpointEquivalence(vertex_descriptor v, vertex_descriptor u)
+ {
+ make_edge(u, v) == make_edge(v, u);
+ }
+};
+
+concept HasDirectedEdges<typename G> : Graph<G>
+{
+ vertex_descriptor source(edge_descriptor e);
+ vertex_descriptor target(edge_descriptor e);
+ edge_descriptor make_endpoints(vertex_descriptor u, vertex_descriptor v);
+
+ axiom EndpointInequivalence(vertex_descriptor v, vertex_descriptor u)
+ {
+ if(u != v) {
+ make_edge(u, v) != make_edge(v, u);
+ }
+ }
+};
+
+
+concept HasFindEdge<typename G> : Graph<G>
+{
+ edge_descriptor G::edge(vertex_descriptor u, vertex_descriptor v);
+};
+
+concept HasFindEdge<typename G> : Graph<G>
+{
+ requires !HasUniqueEdges<G>;
+ ??? edges(vertex_descriptor u, vertex_descriptor v);
+};
+
+concept HasAddEdge<typename G> : Graph<G> { };
+
+concept HasAddUnlabeledEdge<typename G> : HasAddEdge<G>
+{
+ requires HasUnlabeledEdges<G>;
+ edge_descriptor add_edge(vertex_descriptor u, vertex_descriptor v)
+}
+
+
+concept HasAddLabeledEdge<typename G> : HasLabeledEdges<G>, HasAddEdge<G>
+{
+ edge_descriptor G::add_edge(vertex_descriptor u, vertex_descriptor v, edge_label const& l)
+}
+
+concept HasAddUniqueUnlabeledEdge : HasUniqueEdges<G>, HasAddUnlabeledEdge<G>
+{
+ std::pair<edge_descriptor, bool> G::insert_edge(vertex_descriptor u, vertex_descriptor v);
+};
+
+concept HasAddUniqueLabeledEdge<typename G> : HasUniqueEdges<G>, HasAddLabeledEdge<G>
+{
+ std::pair<edge_descriptor, bool> G::insert_edge(vertex_descriptor u,
+ vertex_descriptor v,
+ edge_label const& l);
+};
+
+concept HasRemoveEdge<typename G> : HasAddEdge<G>
+{
+ void G::remove_edge(edge_descriptor e);
+ void G::remove_edges(vertex_descriptor u, vertex_descriptor v);
+ void G::remove_edges(vertex_descriptor v);
+};
+
+concept HasAddVertex<typename G> { };
+
+cocnept HasAddUnlabeledVertex<typename G> : HasAddVertex<G>
+{
+ requires HasUnlabeledVertices<G>;
+ vertex_descriptor G::add_vertex();
+};
+
+concept HasAddLabeledVertex<typename G> : HasLabeledVertices<G>, HasAddVertex<G>
+{
+ vertex_descriptor G::add_vertex(vertex_label const& l);
+};
+
+concept HasAddMappedVertex<typename G> : HasMappedVertices<G>, HasAddVertex<G>
+{
+ vertex_descriptor G::add_vertex(vertex_key const& k, vertex_label const& l);
+};
+
+
+concept HasAddUniqueLabeledVertex<typename G> : HasAddLabeledVertex<G>
+{
+ std::pair<vertex_descriptor, bool> G::insert_vertex(vertex_label const& l);
+};
+
+concept HasAddUniqueMappedVertex<typename G> : HasAddMappedVertex<G>
+{
+ std::pair<vertex_descriptor, bool> G::insert_vertex(vertex_key const& k,
+ vertex_label const& l);
+};
+
+concept HasRemoveVertex<typename G> : HasAddVertex<G>
+{
+ void G::remove_vertex(vertex_descriptor v);
+};
+
+concept VertexListGraph<typename G> : Graph<G>
+{
+ ForwardIterator vertex_iterator;
+ ForwardRange vertex_range;
+ UnsignedIntegralLike vertices_size_type;
+
+ vertex_iterator begin_vertices() const;
+ vertex_iterator end_vertices() const;
+ vertex_range vertices() const;
+
+ vertices_size_type num_vertices() const;
+};
+
+concept EdgeListGraph : <typename G> : Graph<G>
+{
+ ForwardIterator edge_iterator;
+ ForwardRange edge_range;
+ UnsignedIntegralLike edges_size_type;
+
+ edge_iterator begin_edges() const;
+ edge_iterator end_edges() const;
+ edge_range edges() const;
+
+ edges_size_type num_edges() const;
+};
+
+concept UndirectedGraph<typename G> : Graph<G>
+{
+ requires HasUndirectedEdges<G>;
+
+ ForwardIterator incident_edge_iterator;
+ ForwardRange incident_edge_range;
+ UnsignedIntegralLike incident_edges_size_type;
+
+ incident_edge_iterator G::begin_incident_edges(vertex_descriptor v) const;
+ incident_edge_iterator G::end_incident_edges(vertex_descriptor v) const;
+ incident_edge_range G::incident_edges(vertex_descriptor v);
+
+ incident_edges_size_type degree(vertex_descriptor v);
+};
+
+concept OutDirectedGraph<typename G> : Graph<G>
+{
+ requires HasDirectedEdges<G>;
+
+ ForwardIterator out_edge_iterator;
+ ForwardRange out_edge_range;
+ UnsignedIntegralLike out_edges_size_type;
+
+ out_edge_iterator G::begin_out_edges(vertex_descriptor v) const;
+ out_edge_iterator G::end_out_edges(vertex_descriptor v) const;
+ out_edge_range G::out_edges(vertex_descriptor v);
+
+ out_edges_size_type out_degree(vertex_descriptor v);
+};
+
+concept InDirectedGraph<typename G> : Graph<G>
+{
+ requires HasDirectedEdges<G>;
+
+ ForwardIterator in_edge_iterator;
+ ForwardRange in_edge_range;
+ UnsignedIntegralLike in_edges_size_type;
+
+ in_edge_iterator G::begin_in_edges(vertex_descriptor v) const;
+ in_edge_iterator G::end_in_edges(vertex_descriptor v) const;
+ in_edge_range G::in_edges(vertex_descriptor v);
+
+ in_edges_size_type in_degree(vertex_descriptor v);
+};
+
+concept DirectedGraph<typename G> : OutDirectedGraph<G>, InDirectedGraph<G>
+{
+ out_edges_size_type degree(vertex_descriptor v);
+};
+
+concept IncidenceGraph<typename G>
+{
+ typename incident_edge_iterator;
+ typename incident_edge_range;
+ typename incident_edge_size;
+
+ incident_edge_iterator begin_incident_edges(G const& g, vertex_descriptor v);
+ incident_edge_interator end_incident_edges(G const& g, vertex_descriptor v);
+ incident_edge_rnage incident_edges(G const& g, vertex_descriptor v);
+};
+
+concept AdjacencyGraph<typename G> : IncidenceGraph<G>
+{
+ typename adjacent_vertex_iterator;
+ typename adjacent_vertex_range;
+ typename adjacent_vertex_size;
+
+ adjacent_vertex_iterator begin_adjacent_vertices(G const& g, vertex_descriptor v);
+ adjacent_vertex_interator end_adjacent_vertices(G const& g, vertex_descriptor v);
+ adjacent_vertex_rnage adjacent_vertices(G const& g, vertex_descriptor v);
+};
+
+concept AdjacencyMatrix<typename G> : HasFindEdge<G>
+{ };
+
+concept IncidenceMatrix<typename G>
+{ };
+
+
+#endif
Modified: sandbox/SOC/2008/graphs/trunk/boost/graphs/properties.hpp
==============================================================================
--- sandbox/SOC/2008/graphs/trunk/boost/graphs/properties.hpp (original)
+++ sandbox/SOC/2008/graphs/trunk/boost/graphs/properties.hpp 2008-09-30 13:01:56 EDT (Tue, 30 Sep 2008)
@@ -46,36 +46,38 @@
}
/**
- * Used to cotnain exterior vertex properties.
+ * Used to contain exterior vertex properties.
*/
-template <typename Graph, typename Property>
-struct exterior_vertex_property
- : detail::choose_container<typename Graph::vertex_descriptor, Property>::type
+template <typename Graph, typename Label>
+struct exterior_vertex_label
+ : detail::choose_container<typename Graph::vertex_descriptor, Label>::type
{
typedef typename detail::choose_container<
- typename Graph::vertex_descriptor, Property
+ typename Graph::vertex_descriptor, Label
>::type base_type;
- exterior_vertex_property(Graph const& g, Property const& p = Property())
- : base_type(g.begin_vertices(), g.end_vertices(), p)
+ exterior_vertex_label(Graph const& g, Label const& l = Label())
+ : base_type(g.begin_vertices(), g.end_vertices(), l)
{ }
};
/**
- * Used to contain exterior edge properties.
+ * Used to contain exterior edge properties. Unlike exterior vertex labels, the
+ * edge label must use a hashtable since edge descriptors are not integers.
*
* @todo It turns out that undirected edge_vectors can use vectors to store
* properties. This is because the edge descriptor is basically just returning
- * the index into the vector as a key.
+ * the index into the vector as a key. It might be worthwhile specializing this
+ * template along those lines. For now, this is not done.
*/
-template <typename Graph, typename Property>
-struct exterior_edge_property
- : hashed_property_container<typename Graph::edge_descriptor, Property>
+template <typename Graph, typename Label>
+struct exterior_edge_label
+ : hashed_property_container<typename Graph::edge_descriptor, Label>
{
- typedef hashed_property_container<typename Graph::edge_descriptor, Property> base_type;
+ typedef hashed_property_container<typename Graph::edge_descriptor, Label> base_type;
- exterior_edge_property(Graph const& g, Property const& p = Property())
- : base_type(g.begin_edges(), g.end_edges(), p)
+ exterior_edge_label(Graph const& g, Label const& l = Label())
+ : base_type(g.begin_edges(), g.end_edges(), l)
{ }
};
@@ -101,7 +103,7 @@
* value of the 3rd parameter. The Key parameter must either be the vertex
* or edge descriptor type of the graph.
*/
-template <typename Graph, typename Key, typename Property = typename Graph::vertex_properties>
+template <typename Graph, typename Key, typename Property = typename Graph::vertex_label>
struct interior_property_map
: simple_property_map<Graph, Key, Property>
{
@@ -120,7 +122,6 @@
{ }
};
-
// The following is a solution to require/supply problem present in a number
// of generic graph algorithms with respect to the external data. Essentially,
// we can choose to require the user to give us a property map, or we can
@@ -153,30 +154,32 @@
* The use of this type incurs a slight overhead due to an additional level of
* indirection.
*/
-template <typename Graph, typename Descriptor, typename Property>
-struct property_wrapper
+template <typename Graph, typename Descriptor, typename Label>
+struct optional_label
{
// Select the container and map type for the self-wrapping property.
- typedef typename detail::choose_container<Descriptor, Property>::type container_type;
+ typedef typename detail::choose_container<Descriptor, Label>::type container_type;
typedef container_property_map<container_type> map_type;
typedef typename map_type::value_type value_type;
typedef typename map_type::key_type key_type;
typedef typename map_type::reference reference;
- // Delay initialization...
- inline property_wrapper()
+ // By default, the optional property contains no property. This should
+ // probably never be used.
+ inline optional_label()
: container(), map()
{ }
- // Construct an underlying store over the map.
- inline property_wrapper(Graph const& g, value_type const& x = value_type())
+ // Allocate an exterior label and build a property map over it.
+ inline optional_label(Graph const& g, value_type const& x = value_type())
: container(new container_type(detail::get_range(g, Descriptor()), x))
, map(*container)
{ }
- // Construct the map over a user-provided property map. No container needed.
- inline property_wrapper(map_type map)
+ // Construct the optional property over the given map, without allocating
+ // an exterior label.
+ inline optional_label(map_type map)
: container(), map(map)
{ }
@@ -186,11 +189,12 @@
inline void operator()(key_type const& key, value_type const& value) const
{ return map(key, value); }
- inline void swap(property_wrapper& x)
+ inline optional_label& swap(optional_label&& x)
{
using std::swap;
- container.swap(x.container);
+ swap(container, x.container); // Should overload to constant time op.
swap(map, x.map);
+ return *this;
}
boost::shared_ptr<container_type> container;
@@ -203,22 +207,22 @@
* provided property map is not required to be constructed over an exterior
* property.
*/
-template <typename Graph, typename Property>
-struct optional_vertex_map
- : property_wrapper<Graph, typename Graph::vertex_descriptor, Property>
+template <typename Graph, typename Label>
+struct optional_vertex_label
+ : optional_label<Graph, typename Graph::vertex_descriptor, Label>
{
- typedef property_wrapper<Graph, typename Graph::vertex_descriptor, Property> base_type;
+ typedef optional_label<Graph, typename Graph::vertex_descriptor, Label> base_type;
typedef typename base_type::map_type map_type;
- inline optional_vertex_map()
+ inline optional_vertex_label()
: base_type()
{ }
- inline optional_vertex_map(Graph const& g, Property const& x = Property())
+ inline optional_vertex_label(Graph const& g, Label const& x = Label())
: base_type(g, x)
{ }
- inline optional_vertex_map(map_type map)
+ inline optional_vertex_label(map_type map)
: base_type(map)
{ }
};
@@ -229,22 +233,22 @@
* provided property map is not required to be constructed over an exterior
* property.
*/
-template <typename Graph, typename Property>
-struct optional_edge_map
- : property_wrapper<Graph, typename Graph::edge_descriptor, Property>
+template <typename Graph, typename Label>
+struct optional_edge_label
+ : optional_label<Graph, typename Graph::edge_descriptor, Label>
{
- typedef property_wrapper<Graph, typename Graph::vertex_descriptor, Property> base_type;
+ typedef optional_label<Graph, typename Graph::vertex_descriptor, Label> base_type;
typedef typename base_type::map_type map_type;
- inline optional_edge_map()
+ inline optional_edge_label()
: base_type()
{ }
- inline optional_edge_map(Graph const& g, Property const& x = Property())
+ inline optional_edge_label(Graph const& g, Label const& x = Label())
: base_type(g, x)
{ }
- inline optional_edge_map(map_type map)
+ inline optional_edge_label(map_type map)
: base_type(map)
{ }
};
@@ -269,18 +273,18 @@
* is to do nothing (i.e,. the map is already initialized). Specialized
* variants simply swap the given map with one that's actually initialized.
*/
+/*
template <typename Graph, typename Map>
void initialize(Graph const&, Map&, typename Map::value_type)
-{ }
+{ throw 0; }'
+*/
-template <typename Graph, typename Prop>
-void initialize(Graph const& g, optional_vertex_map<Graph, Prop>& map, Prop x)
+template <typename Graph, typename Label>
+void initialize(Graph const& g, optional_vertex_label<Graph, Label>& map, Label const& x)
{ detail::optional_init(g, map, x); }
-template <typename Graph, typename Prop>
-void initialize(Graph const g, optional_edge_map<Graph, Prop>& map, Prop x)
+template <typename Graph, typename Label>
+void initialize(Graph const g, optional_edge_label<Graph, Label>& map, Label const& x)
{ detail::optional_init(g, map, x); }
-
-
#endif
Modified: sandbox/SOC/2008/graphs/trunk/boost/graphs/utility.hpp
==============================================================================
--- sandbox/SOC/2008/graphs/trunk/boost/graphs/utility.hpp (original)
+++ sandbox/SOC/2008/graphs/trunk/boost/graphs/utility.hpp 2008-09-30 13:01:56 EDT (Tue, 30 Sep 2008)
@@ -89,21 +89,21 @@
* @internal
* A forwarding comparator for proeprties objects that forwards the comparison
* to the configured comparator. This type is used internally to forward
- * comparisons of vertices to the property comparison provided by the edge set
+ * comparisons of vertices to the label comparison provided by the edge set
* parameter.
* @param Vertex The type of vertex being compared
- * @param Compare An ordering over vertex properties.
+ * @param Compare An ordering over vertex labels.
*/
template <typename Compare>
-struct property_comparator
+struct label_comparator
{
- inline property_comparator()
+ inline label_comparator()
: comp(Compare())
{ }
template <typename Object>
inline bool operator()(Object const& a, Object const& b) const
- { return comp(a.properties(), b.properties()); }
+ { return comp(a.label(), b.label()); }
Compare comp;
};
@@ -116,25 +116,24 @@
* @param Properties The type of properties being compared.
* @todo This goes away with lambda expressions. Used in vertex_[v|l]::find().
*/
-template <typename Properties>
-struct property_finder
+template <typename Label>
+struct label_finder
{
- inline property_finder(Properties const& p)
- : props(p)
+ inline label_finder(Label const& l)
+ : label(l)
{ }
template <typename Object>
inline bool operator()(Object const& o) const
- { return o.properties() == props; }
+ { return o.label() == label; }
- Properties const& props;
+ Label const& label;
};
-template <typename Properties>
-inline property_finder<Properties>
-find_properties(Properties const& props)
-{ return property_finder<Properties>(props); }
-
+template <typename Label>
+inline label_finder<Label>
+find_label(Label const& l)
+{ return label_finder<Label>(l); }
/**
* @internal
Added: sandbox/SOC/2008/graphs/trunk/boost/optional.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2008/graphs/trunk/boost/optional.hpp 2008-09-30 13:01:56 EDT (Tue, 30 Sep 2008)
@@ -0,0 +1,120 @@
+
+#ifndef BOOST_WEAK_OPTIONAL_HPP
+#define BOOST_WEAK_OPTIONAL_HPP
+
+#include <utility>
+
+namespace boost {
+
+/**
+ * This is purely a work-around for the boost::optional<T> class, which does
+ * not seem to work with GCC-4.4. This works basically the same way as optional,
+ * but isn't quite as aggressive about some of its exception guarantees and
+ * isn't nearly as graceful.
+ */
+template <typename T>
+struct optional
+{
+ // Does not initialize the optional.
+ optional()
+ : _ptr(0)
+ { }
+
+ // Copy the information held by the other optional value.
+ optional(optional const& x)
+ : optional()
+ { if(x._ptr) copy_construct(*x._ptr); }
+
+ // Move constructor initializes the otional with x.
+ optional(optional&& x)
+ : optional()
+ { swap(x); }
+
+ // Value constructor initalizes the optional with a copy of the value of x.
+ optional(T const& x)
+ : optional()
+ { copy_construct(x); }
+
+ ~optional()
+ { destruct(); }
+
+ // Assignment operators
+ optional& operator=(optional const& x)
+ { return swap(optional(x)); }
+
+ optional& operator=(optional&& x)
+ { return swap(optional().swap(x)); }
+
+ optional& operator=(T const& x)
+ { return swap(optional(x)); }
+
+ T& operator*()
+ { return get(); }
+
+ T const& operator*() const
+ { return get(); }
+
+ T* operator->()
+ { return _ptr; }
+
+ T const* operator->() const
+ { return _ptr; }
+
+ operator bool() const
+ { return _ptr != 0; }
+
+ bool valid() const
+ { return _ptr != 0; }
+
+ T& get()
+ { return *_ptr; }
+
+ T const& get() const
+ { return *_ptr; }
+
+ // Make sure that the pointer is local.
+ void reify()
+ { _ptr = reinterpret_cast<T*>(_buf); }
+
+ // Reset the internal pointer to indicate uninitialized.
+ void reset()
+ { _ptr = 0; }
+
+
+ optional& swap(optional&& x)
+ {
+ using std::swap;
+ swap(_buf, x._buf);
+
+ // Swapping the state of these pointers is a little weird. If they're
+ // both set or both null, then we don't have to do anything. If one
+ // is set and the other null, then we have to emulate a swap by reifying
+ // the pointer that was null and resetting the one that wasn't.
+ if(!_ptr && x._ptr) {
+ reify();
+ x.reset();
+ }
+ else if(_ptr && !x._ptr) {
+ reset();
+ x.reify();
+ }
+
+ return *this;
+ }
+
+ void default_construct()
+ { _ptr = new(_buf) T(); }
+
+ void copy_construct(T const& x)
+ { _ptr = new(_buf) T(x); }
+
+ void destruct()
+ { if(_ptr) _ptr->~T(); }
+
+ unsigned char _buf[sizeof(T)];
+ T* _ptr;
+};
+
+}
+
+#endif
Modified: sandbox/SOC/2008/graphs/trunk/libs/graphs/test/Jamfile
==============================================================================
--- sandbox/SOC/2008/graphs/trunk/libs/graphs/test/Jamfile (original)
+++ sandbox/SOC/2008/graphs/trunk/libs/graphs/test/Jamfile 2008-09-30 13:01:56 EDT (Tue, 30 Sep 2008)
@@ -34,4 +34,7 @@
# exe dfs : dfs.cpp ;
# exe search : search.cpp ;
exe adv_search : adv_search.cpp ;
-exe vis : visitors.cpp ;
\ No newline at end of file
+exe vis : visitors.cpp ;
+
+exe basic_matrix : basic_matrix.cpp ;
+exe un_matrix : un_matrix.cpp ;
\ No newline at end of file
Modified: sandbox/SOC/2008/graphs/trunk/libs/graphs/test/adv_search.cpp
==============================================================================
--- sandbox/SOC/2008/graphs/trunk/libs/graphs/test/adv_search.cpp (original)
+++ sandbox/SOC/2008/graphs/trunk/libs/graphs/test/adv_search.cpp 2008-09-30 13:01:56 EDT (Tue, 30 Sep 2008)
@@ -145,10 +145,10 @@
void test(string const& module)
{
typedef typename Graph::vertex_descriptor Vertex;
- typedef exterior_vertex_property<Graph, color> ColorProp;
- typedef exterior_vertex_property<Graph, bool> RootProp;
- typedef exterior_edge_property<Graph, bool> TreeProp;
- typedef exterior_edge_property<Graph, int> TreeOrderProp;
+ typedef exterior_vertex_label<Graph, color> ColorProp;
+ typedef exterior_vertex_label<Graph, bool> RootProp;
+ typedef exterior_edge_label<Graph, bool> TreeProp;
+ typedef exterior_edge_label<Graph, int> TreeOrderProp;
typedef exterior_property_map<ColorProp> ColorMap;
typedef exterior_property_map<RootProp> RootMap;
typedef exterior_property_map<TreeProp> TreeMap;
Added: sandbox/SOC/2008/graphs/trunk/libs/graphs/test/basic_matrix.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2008/graphs/trunk/libs/graphs/test/basic_matrix.cpp 2008-09-30 13:01:56 EDT (Tue, 30 Sep 2008)
@@ -0,0 +1,26 @@
+
+#include <iostream>
+
+#include "typestr.hpp"
+
+#include <boost/graphs/adjacency_matrix/basic_matrix.hpp>
+
+using namespace std;
+using namespace boost;
+using namespace boost::graphs::adjacency_matrix;
+
+int main()
+{
+ basic_matrix<none> a(10);
+ a(1, 1) = true;
+ cout << "(1, 1) -> " << (a.test(1, 1) ? "on" : "off") << endl;
+ cout << "(2, 2) -> " << (a.test(2, 2) ? "on" : "off") << endl;
+ cout << endl;
+
+ basic_matrix<double> b(10);
+ b(1, 1) = 3.14;
+ cout << "(1, 1) -> " << (b.test(1, 1) ? "on" : "off") << endl;
+ cout << "(2, 2) -> " << (b.test(2, 2) ? "on" : "off") << endl;
+ optional<double>& d = b(1, 1);
+ cout << d.get() << endl;
+}
Modified: sandbox/SOC/2008/graphs/trunk/libs/graphs/test/propmaps.cpp
==============================================================================
--- sandbox/SOC/2008/graphs/trunk/libs/graphs/test/propmaps.cpp (original)
+++ sandbox/SOC/2008/graphs/trunk/libs/graphs/test/propmaps.cpp 2008-09-30 13:01:56 EDT (Tue, 30 Sep 2008)
@@ -16,9 +16,9 @@
void test_props()
{
typedef typename Graph::vertex_descriptor Vertex;
- typedef typename Graph::vertex_properties VertexProps;
+ typedef typename Graph::vertex_label VertexLabel;
typedef typename Graph::edge_descriptor Edge;
- typedef typename Graph::edge_properties EdgeProps;
+ typedef typename Graph::edge_label EdgeLabel;
Graph g;
cout << "--- " << typestr(g) << " ---" << endl;
@@ -38,12 +38,12 @@
}
cout << g.num_vertices() << " x " << g.num_edges() << endl;
- typedef exterior_vertex_property<Graph, double> VertexWeightProp;
+ typedef exterior_vertex_label<Graph, double> VertexWeightProp;
typedef exterior_property_map<VertexWeightProp> VertexWeightMap;
VertexWeightProp vertex_weights(g, 6.28);
VertexWeightMap vw(vertex_weights);
- typedef exterior_edge_property<Graph, double> EdgeWeightProp;
+ typedef exterior_edge_label<Graph, double> EdgeWeightProp;
typedef exterior_property_map<EdgeWeightProp> EdgeWeightMap;
EdgeWeightProp edge_weights(g, 3.14);
EdgeWeightMap ew(edge_weights);
@@ -66,9 +66,9 @@
{
typedef interior_property_map<Graph, Vertex> PropMap;
- typedef interior_property_map<Graph, Vertex, string VertexProps::*> NameMap;
+ typedef interior_property_map<Graph, Vertex, string VertexLabel::*> NameMap;
PropMap props(g);
- NameMap names(g, &VertexProps::name);
+ NameMap names(g, &VertexLabel::name);
for(vr.first = g.begin_vertices(); vr.first != vr.second; ++vr.first) {
Vertex v = *vr.first;
names(v) = "City " + lexical_cast<string>(props(v).id);
@@ -78,9 +78,9 @@
{
typedef interior_property_map<Graph, Edge> PropMap;
- typedef interior_property_map<Graph, Edge, string EdgeProps::*> NameMap;
+ typedef interior_property_map<Graph, Edge, string EdgeLabel::*> NameMap;
PropMap props(g);
- NameMap names(g, &EdgeProps::name);
+ NameMap names(g, &EdgeLabel::name);
for(er.first = g.begin_edges(); er.first != er.second; ++er.first) {
Edge e = *er.first;
names(e) = "Road " + lexical_cast<string>(props(e).id);
@@ -90,10 +90,10 @@
{
// Generic stuff?
- exterior_vertex_property<Graph, double> these_weights(g, 6.28);
+ exterior_vertex_label<Graph, double> these_weights(g, 6.28);
- optional_vertex_map<Graph, double> my_weights(g, 3.14);
- optional_vertex_map<Graph, double> your_weights(these_weights);
+ optional_vertex_label<Graph, double> my_weights(g, 3.14);
+ optional_vertex_label<Graph, double> your_weights(these_weights);
for(vr.first = g.begin_vertices(); vr.first != vr.second; ++vr.first) {
Vertex v = *vr.first;
Modified: sandbox/SOC/2008/graphs/trunk/libs/graphs/test/test_es.cpp
==============================================================================
--- sandbox/SOC/2008/graphs/trunk/libs/graphs/test/test_es.cpp (original)
+++ sandbox/SOC/2008/graphs/trunk/libs/graphs/test/test_es.cpp 2008-09-30 13:01:56 EDT (Tue, 30 Sep 2008)
@@ -97,10 +97,10 @@
BOOST_ASSERT(outs.size() == m + 1);
BOOST_ASSERT(ins.size() == 1);
- cout << " * added " << u << "," << v << " -> " << outs.properties(o.value) << endl;
+ cout << " * added " << u << "," << v << " -> " << outs.label(o.value) << endl;
}
else if(o.retained()) {
- cout << " * exists " << u << "," << v << " -> " << outs.properties(o.value) << endl;
+ cout << " * exists " << u << "," << v << " -> " << outs.label(o.value) << endl;
}
}
Modified: sandbox/SOC/2008/graphs/trunk/libs/graphs/test/test_props.cpp
==============================================================================
--- sandbox/SOC/2008/graphs/trunk/libs/graphs/test/test_props.cpp (original)
+++ sandbox/SOC/2008/graphs/trunk/libs/graphs/test/test_props.cpp 2008-09-30 13:01:56 EDT (Tue, 30 Sep 2008)
@@ -31,7 +31,7 @@
template <typename PropSet>
void test()
{
- typedef typename PropSet::property_descriptor PropDesc;
+ typedef typename PropSet::label_descriptor PropDesc;
cout << "--- " << typestr<PropSet>() << " ---" << endl;
Modified: sandbox/SOC/2008/graphs/trunk/libs/graphs/test/test_verts.cpp
==============================================================================
--- sandbox/SOC/2008/graphs/trunk/libs/graphs/test/test_verts.cpp (original)
+++ sandbox/SOC/2008/graphs/trunk/libs/graphs/test/test_verts.cpp 2008-09-30 13:01:56 EDT (Tue, 30 Sep 2008)
@@ -18,16 +18,16 @@
// A fake vertex type.
struct Vertex
{
- typedef int vertex_properties;
+ typedef int vertex_label;
Vertex(int x)
: value(x)
{ }
- int& properties()
+ int& label()
{ return value; }
- int const& properties() const
+ int const& label() const
{ return value; }
int value;
@@ -72,7 +72,7 @@
cout << "num verts after building: " << verts.size() << endl;
Descriptor d = verts.find(3);
- cout << "value of vertex properties: " << verts.properties(d) << endl;
+ cout << "value of vertex properties: " << verts.label(d) << endl;
test_remove(verts, vertices_category(verts));
}
Added: sandbox/SOC/2008/graphs/trunk/libs/graphs/test/un_matrix.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2008/graphs/trunk/libs/graphs/test/un_matrix.cpp 2008-09-30 13:01:56 EDT (Tue, 30 Sep 2008)
@@ -0,0 +1,13 @@
+
+#include <iostream>
+
+#include <boost/graphs/adjacency_matrix/undirected_graph.hpp>
+
+using namespace std;
+using namespace boost;
+using namespace boost::graphs::adjacency_matrix;
+
+int main()
+{
+ undirected_graph<> g(10);
+}
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk