diff --git a/doc/AStarHeuristic.html b/doc/AStarHeuristic.html
index 5d0c1aeb..62257be8 100644
--- a/doc/AStarHeuristic.html
+++ b/doc/AStarHeuristic.html
@@ -116,7 +116,7 @@ Called for the target of every out edge of a vertex being examined.
struct AStarHeuristicConcept {
void constraints()
{
- function_requires< CopyConstructibleConcept<Heuristic> >();
+ BOOST_CONCEPT_ASSERT(( CopyConstructibleConcept<Heuristic> ));
h(u);
}
Heuristic h;
diff --git a/doc/AdjacencyGraph.html b/doc/AdjacencyGraph.html
index 0764b29b..b72031b1 100644
--- a/doc/AdjacencyGraph.html
+++ b/doc/AdjacencyGraph.html
@@ -112,8 +112,8 @@ The adjacent_vertices() function must return in constant time.
typedef typename boost::graph_traits<G>::adjacency_iterator
adjacency_iterator;
void constraints() {
- function_requires< IncidenceGraphConcept<G> >();
- function_requires< MultiPassInputIteratorConcept<adjacency_iterator> >();
+ BOOST_CONCEPT_ASSERT(( IncidenceGraphConcept<G> ));
+ BOOST_CONCEPT_ASSERT(( MultiPassInputIteratorConcept<adjacency_iterator> ));
p = adjacent_vertices(v, g);
v = *p.first;
diff --git a/doc/BidirectionalGraph.html b/doc/BidirectionalGraph.html
index f67a92a4..e5a92215 100644
--- a/doc/BidirectionalGraph.html
+++ b/doc/BidirectionalGraph.html
@@ -145,8 +145,8 @@ undirected graphs).
typedef typename boost::graph_traits<G>::in_edge_iterator
in_edge_iterator;
void constraints() {
- function_requires< IncidenceGraphConcept<G> >();
- function_requires< MultiPassInputIteratorConcept<in_edge_iterator> >();
+ BOOST_CONCEPT_ASSERT(( IncidenceGraphConcept<G> ));
+ BOOST_CONCEPT_ASSERT(( MultiPassInputIteratorConcept<in_edge_iterator> ));
p = in_edges(v, g);
e = *p.first;
diff --git a/doc/EdgeListGraph.html b/doc/EdgeListGraph.html
index cb87cdb0..fc62539c 100644
--- a/doc/EdgeListGraph.html
+++ b/doc/EdgeListGraph.html
@@ -146,8 +146,8 @@ must all return in constant time.
typedef typename boost::graph_traits<G>::edge_iterator
edge_iterator;
void constraints() {
- function_requires< GraphConcept<G> >();
- function_requires< MultiPassInputIteratorConcept<edge_iterator> >();
+ BOOST_CONCEPT_ASSERT(( GraphConcept<G> ));
+ BOOST_CONCEPT_ASSERT(( MultiPassInputIteratorConcept<edge_iterator> ));
p = edges(g);
E = num_edges(g);
diff --git a/doc/Graph.html b/doc/Graph.html
index 08423b10..fabae1a4 100644
--- a/doc/Graph.html
+++ b/doc/Graph.html
@@ -121,12 +121,12 @@ any vertex of graph object which type is G.
typedef typename boost::graph_traits<G>::traversal_category traversal_category;
void constraints() {
- function_requires< DefaultConstructibleConcept<vertex_descriptor> >();
- function_requires< EqualityComparableConcept<vertex_descriptor> >();
- function_requires< AssignableConcept<vertex_descriptor> >();
- function_requires< DefaultConstructibleConcept<edge_descriptor> >();
- function_requires< EqualityComparableConcept<edge_descriptor> >();
- function_requires< AssignableConcept<edge_descriptor> >();
+ BOOST_CONCEPT_ASSERT(( DefaultConstructibleConcept<vertex_descriptor> ));
+ BOOST_CONCEPT_ASSERT(( EqualityComparableConcept<vertex_descriptor> ));
+ BOOST_CONCEPT_ASSERT(( AssignableConcept<vertex_descriptor> ));
+ BOOST_CONCEPT_ASSERT(( DefaultConstructibleConcept<edge_descriptor> ));
+ BOOST_CONCEPT_ASSERT(( EqualityComparableConcept<edge_descriptor> ));
+ BOOST_CONCEPT_ASSERT(( AssignableConcept<edge_descriptor> ));
}
G g;
};
diff --git a/doc/IncidenceGraph.html b/doc/IncidenceGraph.html
index 29db1946..228cbfc8 100644
--- a/doc/IncidenceGraph.html
+++ b/doc/IncidenceGraph.html
@@ -162,8 +162,8 @@ Therefore, the extra requirement is added that the out-edge connecting
{
typedef typename boost::graph_traits<G>::out_edge_iterator out_edge_iterator;
void constraints() {
- function_requires< GraphConcept<G> >();
- function_requires< MultiPassInputIteratorConcept<out_edge_iterator> >();
+ BOOST_CONCEPT_ASSERT(( GraphConcept<G> ));
+ BOOST_CONCEPT_ASSERT(( MultiPassInputIteratorConcept<out_edge_iterator> ));
p = out_edges(u, g);
e = *p.first;
diff --git a/doc/KeyedUpdatableQueue.html b/doc/KeyedUpdatableQueue.html
index 6d5ecaf0..81141a72 100644
--- a/doc/KeyedUpdatableQueue.html
+++ b/doc/KeyedUpdatableQueue.html
@@ -63,8 +63,8 @@ in addition to the members that are required of types that model
diff --git a/doc/VertexListGraph.html b/doc/VertexListGraph.html
index ee546fea..b108353a 100644
--- a/doc/VertexListGraph.html
+++ b/doc/VertexListGraph.html
@@ -121,9 +121,9 @@ groups these requirements together, hence the VertexListGraph concept.
typedef typename boost::graph_traits<G>::vertex_iterator
vertex_iterator;
void constraints() {
- function_requires< IncidenceGraphConcept<G> >();
- function_requires< AdjacencyGraphConcept<G> >();
- function_requires< MultiPassInputIteratorConcept<vertex_iterator> >();
+ BOOST_CONCEPT_ASSERT(( IncidenceGraphConcept<G> ));
+ BOOST_CONCEPT_ASSERT(( AdjacencyGraphConcept<G> ));
+ BOOST_CONCEPT_ASSERT(( MultiPassInputIteratorConcept<vertex_iterator> ));
p = vertices(g);
V = num_vertices(g);
diff --git a/doc/biconnected_components.w b/doc/biconnected_components.w
index 97ba5dc8..d2eb21ff 100644
--- a/doc/biconnected_components.w
+++ b/doc/biconnected_components.w
@@ -156,11 +156,11 @@ template.
@d Concept checking of type parameters
@{
-function_requires< VertexListGraphConcept
+property_map<reverse_graph, edge_underlying_t>::const_type +get(PropertyTag, const reverse_graph& g) ++Returns a property map object that converts from edge descriptors in the +reverse_graph to edge descriptors in the underlying +BidirectionalGraph object. + +
template <class PropertyTag, class X> typename property_traits<property_map<reverse_graph, PropertyTag>::const_type>::value_type @@ -367,6 +387,13 @@ This returns the property value for x, which is either a vertex or edge descriptor.
++typename graph_traits<BidirectionalGraph>::edge_descriptor +get(edge_underlying_t, const reverse_graph& g, edge_descriptor e) ++This returns the underlying edge descriptor for the edge e in the reverse_graph. +
+template <class PropertyTag, class X, class Value> void diff --git a/doc/transitive_closure.w b/doc/transitive_closure.w index c8db56dc..136eab68 100644 --- a/doc/transitive_closure.w +++ b/doc/transitive_closure.w @@ -160,11 +160,11 @@ algorithm. @d Concept checking @{ -function_requires< VertexListGraphConcept>(); -function_requires< AdjacencyGraphConcept >(); -function_requires< VertexMutableGraphConcept >(); -function_requires< EdgeMutableGraphConcept >(); -function_requires< ReadablePropertyMapConcept >(); +BOOST_CONCEPT_ASSERT(( VertexListGraphConcept )); +BOOST_CONCEPT_ASSERT(( AdjacencyGraphConcept )); +BOOST_CONCEPT_ASSERT(( VertexMutableGraphConcept )); +BOOST_CONCEPT_ASSERT(( EdgeMutableGraphConcept )); +BOOST_CONCEPT_ASSERT(( ReadablePropertyMapConcept )); @} \noindent To simplify the code in the rest of the function we make the @@ -566,8 +566,8 @@ void warshall_transitive_closure(G& g) typedef typename graph_traits ::vertex_descriptor vertex; typedef typename graph_traits ::vertex_iterator vertex_iterator; - function_requires< AdjacencyMatrixConcept >(); - function_requires< EdgeMutableGraphConcept >(); + BOOST_CONCEPT_ASSERT(( AdjacencyMatrixConcept )); + BOOST_CONCEPT_ASSERT(( EdgeMutableGraphConcept )); // Matrix form: // for k @@ -597,8 +597,8 @@ void warren_transitive_closure(G& g) typedef typename graph_traits ::vertex_descriptor vertex; typedef typename graph_traits ::vertex_iterator vertex_iterator; - function_requires< AdjacencyMatrixConcept >(); - function_requires< EdgeMutableGraphConcept >(); + BOOST_CONCEPT_ASSERT(( AdjacencyMatrixConcept )); + BOOST_CONCEPT_ASSERT(( EdgeMutableGraphConcept )); // Make sure second loop will work if (num_vertices(g) == 0) @@ -671,6 +671,7 @@ indent -nut -npcs -i2 -br -cdw -ce transitive_closure.hpp #include #include #include +#include namespace boost { diff --git a/example/implicit_graph.cpp b/example/implicit_graph.cpp index 7b0c0fc2..b93bc8b7 100644 --- a/example/implicit_graph.cpp +++ b/example/implicit_graph.cpp @@ -4,7 +4,7 @@ // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) - +#include #include #include #include @@ -444,15 +444,15 @@ int main (int argc, char const *argv[]) { // Check the concepts that graph models. This is included to demonstrate // how concept checking works, but is not required for a working program // since Boost algorithms do their own concept checking. - function_requires< BidirectionalGraphConcept >(); - function_requires< AdjacencyGraphConcept >(); - function_requires< VertexListGraphConcept >(); - function_requires< EdgeListGraphConcept >(); - function_requires< AdjacencyMatrixConcept >(); - function_requires< - ReadablePropertyMapConcept >(); - function_requires< - ReadablePropertyGraphConcept >(); + BOOST_CONCEPT_ASSERT(( BidirectionalGraphConcept )); + BOOST_CONCEPT_ASSERT(( AdjacencyGraphConcept )); + BOOST_CONCEPT_ASSERT(( VertexListGraphConcept )); + BOOST_CONCEPT_ASSERT(( EdgeListGraphConcept )); + BOOST_CONCEPT_ASSERT(( AdjacencyMatrixConcept )); + BOOST_CONCEPT_ASSERT(( + ReadablePropertyMapConcept )); + BOOST_CONCEPT_ASSERT(( + ReadablePropertyGraphConcept )); // Specify the size of the graph on the command line, or use a default size // of 5. diff --git a/example/leda-concept-check.cpp b/example/leda-concept-check.cpp index 21fc1606..f5720e7d 100644 --- a/example/leda-concept-check.cpp +++ b/example/leda-concept-check.cpp @@ -7,15 +7,16 @@ //======================================================================= #include #include +#include int main() { using namespace boost; - typedef leda::GRAPH < int, int >Graph; - function_requires < VertexListGraphConcept < Graph > >(); - function_requires < BidirectionalGraphConcept < Graph > >(); - function_requires < VertexMutableGraphConcept < Graph > >(); - function_requires < EdgeMutableGraphConcept < Graph > >(); + typedef leda::GRAPH Graph; + BOOST_CONCEPT_ASSERT(( VertexListGraphConcept )); + BOOST_CONCEPT_ASSERT(( BidirectionalGraphConcept< Graph> )); + BOOST_CONCEPT_ASSERT(( VertexMutableGraphConcept< Graph> )); + BOOST_CONCEPT_ASSERT(( EdgeMutableGraphConcept )); return EXIT_SUCCESS; } diff --git a/example/loops_dfs.cpp b/example/loops_dfs.cpp index c6babb1e..9536701b 100644 --- a/example/loops_dfs.cpp +++ b/example/loops_dfs.cpp @@ -6,6 +6,7 @@ // http://www.boost.org/LICENSE_1_0.txt) //======================================================================= #include +#include #include #include #include @@ -47,7 +48,7 @@ find_loops(typename graph_traits < Graph >::vertex_descriptor entry, const Graph & g, Loops & loops) // A container of sets of vertices { - function_requires < BidirectionalGraphConcept < Graph > >(); + BOOST_CONCEPT_ASSERT(( BidirectionalGraphConcept )); typedef typename graph_traits < Graph >::edge_descriptor Edge; typedef typename graph_traits < Graph >::vertex_descriptor Vertex; std::vector < Edge > back_edges; @@ -69,7 +70,7 @@ compute_loop_extent(typename graph_traits < Graph >::edge_descriptor back_edge, const Graph & g, Set & loop_set) { - function_requires < BidirectionalGraphConcept < Graph > >(); + BOOST_CONCEPT_ASSERT(( BidirectionalGraphConcept )); typedef typename graph_traits < Graph >::vertex_descriptor Vertex; typedef color_traits < default_color_type > Color; diff --git a/example/put-get-helper-eg.cpp b/example/put-get-helper-eg.cpp index 1134c029..9c14e1b9 100644 --- a/example/put-get-helper-eg.cpp +++ b/example/put-get-helper-eg.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #ifdef BOOST_NO_STD_ITERATOR_TRAITS #error This examples requires a compiler that provides a working std::iterator_traits @@ -53,6 +54,6 @@ main() typedef foo::iterator_property_map < vec_t::iterator, boost::identity_property_map > pmap_t; using namespace boost; - function_requires < Mutable_LvaluePropertyMapConcept < pmap_t, int > >(); + BOOST_CONCEPT_ASSERT(( Mutable_LvaluePropertyMapConcept )); return 0; } diff --git a/include/boost/graph/astar_search.hpp b/include/boost/graph/astar_search.hpp index 042ffec4..316e7063 100644 --- a/include/boost/graph/astar_search.hpp +++ b/include/boost/graph/astar_search.hpp @@ -25,7 +25,7 @@ #include #include #include - +#include namespace boost { @@ -34,7 +34,7 @@ namespace boost { struct AStarHeuristicConcept { void constraints() { - function_requires< CopyConstructibleConcept >(); + BOOST_CONCEPT_ASSERT(( CopyConstructibleConcept )); h(u); } Heuristic h; @@ -58,7 +58,7 @@ namespace boost { struct AStarVisitorConcept { void constraints() { - function_requires< CopyConstructibleConcept >(); + BOOST_CONCEPT_ASSERT(( CopyConstructibleConcept )); vis.initialize_vertex(u, g); vis.discover_vertex(u, g); vis.examine_vertex(u, g); diff --git a/include/boost/graph/bellman_ford_shortest_paths.hpp b/include/boost/graph/bellman_ford_shortest_paths.hpp index 8fc02529..c80ebe7c 100644 --- a/include/boost/graph/bellman_ford_shortest_paths.hpp +++ b/include/boost/graph/bellman_ford_shortest_paths.hpp @@ -29,13 +29,14 @@ #include #include #include +#include namespace boost { template struct BellmanFordVisitorConcept { void constraints() { - function_requires< CopyConstructibleConcept >(); + BOOST_CONCEPT_ASSERT(( CopyConstructibleConcept )); vis.examine_edge(e, g); vis.edge_relaxed(e, g); vis.edge_not_relaxed(e, g); @@ -95,12 +96,12 @@ namespace boost { BinaryPredicate compare, BellmanFordVisitor v) { - function_requires >(); + BOOST_CONCEPT_ASSERT(( EdgeListGraphConcept )); typedef graph_traits GTraits; typedef typename GTraits::edge_descriptor Edge; typedef typename GTraits::vertex_descriptor Vertex; - function_requires >(); - function_requires >(); + BOOST_CONCEPT_ASSERT(( ReadWritePropertyMapConcept )); + BOOST_CONCEPT_ASSERT(( ReadablePropertyMapConcept )); typedef typename property_traits ::value_type D_value; typedef typename property_traits ::value_type W_value; @@ -229,7 +230,7 @@ namespace boost { (VertexAndEdgeListGraph& g, const bgl_named_params & params) { - function_requires
>(); + BOOST_CONCEPT_ASSERT(( VertexListGraphConcept )); return detail::bellman_dispatch (g, num_vertices(g), choose_const_pmap(get_param(params, edge_weight), g, edge_weight), diff --git a/include/boost/graph/biconnected_components.hpp b/include/boost/graph/biconnected_components.hpp index 03459636..418da06f 100644 --- a/include/boost/graph/biconnected_components.hpp +++ b/include/boost/graph/biconnected_components.hpp @@ -20,6 +20,7 @@ #include #include #include +#include namespace boost { @@ -160,14 +161,14 @@ namespace boost { typedef typename graph_traits ::vertex_descriptor vertex_t; typedef typename graph_traits ::edge_descriptor edge_t; - function_requires >(); - function_requires >(); - function_requires >(); - function_requires >(); - function_requires >(); - function_requires >(); + BOOST_CONCEPT_ASSERT(( VertexListGraphConcept )); + BOOST_CONCEPT_ASSERT(( IncidenceGraphConcept )); + BOOST_CONCEPT_ASSERT(( WritablePropertyMapConcept )); + BOOST_CONCEPT_ASSERT(( ReadWritePropertyMapConcept )); + BOOST_CONCEPT_ASSERT(( ReadWritePropertyMapConcept )); + BOOST_CONCEPT_ASSERT(( ReadWritePropertyMapConcept )); std::size_t num_components = 0; std::size_t dfs_time = 0; diff --git a/include/boost/graph/boykov_kolmogorov_max_flow.hpp b/include/boost/graph/boykov_kolmogorov_max_flow.hpp index 89bcfff2..0834c631 100644 --- a/include/boost/graph/boykov_kolmogorov_max_flow.hpp +++ b/include/boost/graph/boykov_kolmogorov_max_flow.hpp @@ -47,6 +47,7 @@ #include #include #include +#include // The algorithm impelemented here is described in: // @@ -743,16 +744,16 @@ boykov_kolmogorov_max_flow(Graph& g, typedef typename graph_traits ::edge_descriptor edge_descriptor; //as this method is the last one before we instantiate the solver, we do the concept checks here - function_requires >(); //to have vertices(), num_vertices(), - function_requires >(); //to have edges() - function_requires >(); //to have source(), target() and out_edges() - function_requires >(); //read flow-values from edges - function_requires >(); //write flow-values to residuals - function_requires >(); //read out reverse edges - function_requires >(); //store predecessor there - function_requires >(); //write corresponding tree - function_requires >(); //write distance to source/sink - function_requires >(); //get index 0...|V|-1 + BOOST_CONCEPT_ASSERT(( VertexListGraphConcept )); //to have vertices(), num_vertices(), + BOOST_CONCEPT_ASSERT(( EdgeListGraphConcept )); //to have edges() + BOOST_CONCEPT_ASSERT(( IncidenceGraphConcept )); //to have source(), target() and out_edges() + BOOST_CONCEPT_ASSERT(( ReadablePropertyMapConcept )); //read flow-values from edges + BOOST_CONCEPT_ASSERT(( ReadWritePropertyMapConcept )); //write flow-values to residuals + BOOST_CONCEPT_ASSERT(( ReadablePropertyMapConcept )); //read out reverse edges + BOOST_CONCEPT_ASSERT(( ReadWritePropertyMapConcept )); //store predecessor there + BOOST_CONCEPT_ASSERT(( ReadWritePropertyMapConcept )); //write corresponding tree + BOOST_CONCEPT_ASSERT(( ReadWritePropertyMapConcept )); //write distance to source/sink + BOOST_CONCEPT_ASSERT(( ReadablePropertyMapConcept )); //get index 0...|V|-1 BOOST_ASSERT(num_vertices(g) >= 2 && src != sink); detail::bk_max_flow< diff --git a/include/boost/graph/breadth_first_search.hpp b/include/boost/graph/breadth_first_search.hpp index 79fde8cd..f65e4757 100644 --- a/include/boost/graph/breadth_first_search.hpp +++ b/include/boost/graph/breadth_first_search.hpp @@ -24,6 +24,7 @@ #include #include #include +#include #ifdef BOOST_GRAPH_USE_MPI #include @@ -34,7 +35,7 @@ namespace boost { template struct BFSVisitorConcept { void constraints() { - function_requires< CopyConstructibleConcept >(); + BOOST_CONCEPT_ASSERT(( CopyConstructibleConcept )); vis.initialize_vertex(u, g); vis.discover_vertex(u, g); vis.examine_vertex(u, g); @@ -59,12 +60,12 @@ namespace boost { typename graph_traits ::vertex_descriptor s, Buffer& Q, BFSVisitor vis, ColorMap color) { - function_requires< IncidenceGraphConcept >(); + BOOST_CONCEPT_ASSERT(( IncidenceGraphConcept )); typedef graph_traits GTraits; typedef typename GTraits::vertex_descriptor Vertex; typedef typename GTraits::edge_descriptor Edge; - function_requires< BFSVisitorConcept >(); - function_requires< ReadWritePropertyMapConcept >(); + BOOST_CONCEPT_ASSERT(( BFSVisitorConcept )); + BOOST_CONCEPT_ASSERT(( ReadWritePropertyMapConcept )); typedef typename property_traits ::value_type ColorValue; typedef color_traits Color; typename GTraits::out_edge_iterator ei, ei_end; diff --git a/include/boost/graph/bron_kerbosch_all_cliques.hpp b/include/boost/graph/bron_kerbosch_all_cliques.hpp index 35479316..1466dfe5 100644 --- a/include/boost/graph/bron_kerbosch_all_cliques.hpp +++ b/include/boost/graph/bron_kerbosch_all_cliques.hpp @@ -11,6 +11,8 @@ #include #include +#include + #include #include @@ -151,7 +153,7 @@ namespace detail const Container& in, Container& out) { - function_requires< GraphConcept >(); + BOOST_CONCEPT_ASSERT(( GraphConcept )); typename graph_traits ::directed_category cat; typename Container::const_iterator i, end = in.end(); @@ -174,8 +176,8 @@ namespace detail Visitor vis, std::size_t min) { - function_requires< GraphConcept >(); - function_requires< CliqueVisitorConcept >(); + BOOST_CONCEPT_ASSERT(( GraphConcept )); + BOOST_CONCEPT_ASSERT(( CliqueVisitorConcept )); typedef typename graph_traits ::vertex_descriptor Vertex; // Is there vertex in nots that is connected to all vertices @@ -266,15 +268,15 @@ template inline void bron_kerbosch_all_cliques(const Graph& g, Visitor vis, std::size_t min) { - function_requires< IncidenceGraphConcept >(); - function_requires< VertexListGraphConcept >(); - function_requires< VertexIndexGraphConcept >(); - function_requires< AdjacencyMatrixConcept >(); // Structural requirement only + BOOST_CONCEPT_ASSERT(( IncidenceGraphConcept )); + BOOST_CONCEPT_ASSERT(( VertexListGraphConcept )); + BOOST_CONCEPT_ASSERT(( VertexIndexGraphConcept )); + BOOST_CONCEPT_ASSERT(( AdjacencyMatrixConcept )); // Structural requirement only typedef typename graph_traits ::vertex_descriptor Vertex; typedef typename graph_traits ::vertex_iterator VertexIterator; typedef std::vector VertexSet; typedef std::deque Clique; - function_requires< CliqueVisitorConcept >(); + BOOST_CONCEPT_ASSERT(( CliqueVisitorConcept )); // NOTE: We're using a deque to implement the clique, because it provides // constant inserts and removals at the end and also a constant size. diff --git a/include/boost/graph/closeness_centrality.hpp b/include/boost/graph/closeness_centrality.hpp index d0dcabe1..44d478ab 100644 --- a/include/boost/graph/closeness_centrality.hpp +++ b/include/boost/graph/closeness_centrality.hpp @@ -9,6 +9,7 @@ #include #include +#include namespace boost { @@ -25,9 +26,9 @@ struct closeness_measure result_type operator ()(distance_type d, const Graph&) { - function_requires< NumericValueConcept >(); - function_requires< NumericValueConcept >(); - function_requires< AdaptableUnaryFunctionConcept >(); + BOOST_CONCEPT_ASSERT(( NumericValueConcept )); + BOOST_CONCEPT_ASSERT(( NumericValueConcept )); + BOOST_CONCEPT_ASSERT(( AdaptableUnaryFunctionConcept )); return (d == base_type::infinite_distance()) ? base_type::zero_result() : rec(result_type(d)); @@ -75,12 +76,12 @@ closeness_centrality(const Graph& g, Measure measure, Combinator combine) { - function_requires< VertexListGraphConcept >(); + BOOST_CONCEPT_ASSERT(( VertexListGraphConcept )); typedef typename graph_traits ::vertex_descriptor Vertex; - function_requires< ReadablePropertyMapConcept >(); + BOOST_CONCEPT_ASSERT(( ReadablePropertyMapConcept )); typedef typename property_traits ::value_type Distance; - function_requires< NumericValueConcept >(); - function_requires< DistanceMeasureConcept >(); + BOOST_CONCEPT_ASSERT(( NumericValueConcept )); + BOOST_CONCEPT_ASSERT(( DistanceMeasureConcept )); Distance n = detail::combine_distances(g, dist, combine, Distance(0)); return measure(n, g); @@ -90,9 +91,9 @@ template inline typename Measure::result_type closeness_centrality(const Graph& g, DistanceMap dist, Measure measure) { - function_requires< GraphConcept >(); + BOOST_CONCEPT_ASSERT(( GraphConcept )); typedef typename graph_traits ::vertex_descriptor Vertex; - function_requires< ReadablePropertyMapConcept >(); + BOOST_CONCEPT_ASSERT(( ReadablePropertyMapConcept )); typedef typename property_traits ::value_type Distance; return closeness_centrality(g, dist, measure, std::plus ()); @@ -116,12 +117,12 @@ all_closeness_centralities(const Graph& g, CentralityMap cent, Measure measure) { - function_requires< VertexListGraphConcept >(); + BOOST_CONCEPT_ASSERT(( VertexListGraphConcept )); typedef typename graph_traits ::vertex_descriptor Vertex; - function_requires< ReadablePropertyMapConcept >(); + BOOST_CONCEPT_ASSERT(( ReadablePropertyMapConcept )); typedef typename property_traits ::value_type DistanceMap; - function_requires< ReadablePropertyMapConcept >(); - function_requires< WritablePropertyMapConcept >(); + BOOST_CONCEPT_ASSERT(( ReadablePropertyMapConcept )); + BOOST_CONCEPT_ASSERT(( WritablePropertyMapConcept )); typedef typename property_traits ::value_type Distance; typedef typename property_traits ::value_type Centrality; @@ -141,11 +142,11 @@ all_closeness_centralities(const Graph& g, DistanceMatrixMap dist, CentralityMap cent) { - function_requires< GraphConcept >(); + BOOST_CONCEPT_ASSERT(( GraphConcept )); typedef typename graph_traits ::vertex_descriptor Vertex; - function_requires< ReadablePropertyMapConcept >(); + BOOST_CONCEPT_ASSERT(( ReadablePropertyMapConcept )); typedef typename property_traits ::value_type DistanceMap; - function_requires< ReadablePropertyMapConcept >(); + BOOST_CONCEPT_ASSERT(( ReadablePropertyMapConcept )); typedef typename property_traits ::value_type Distance; typedef typename property_traits ::value_type Result; diff --git a/include/boost/graph/clustering_coefficient.hpp b/include/boost/graph/clustering_coefficient.hpp index d897d94b..dad4695a 100644 --- a/include/boost/graph/clustering_coefficient.hpp +++ b/include/boost/graph/clustering_coefficient.hpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace boost { @@ -20,7 +21,7 @@ namespace detail inline typename graph_traits ::degree_size_type possible_edges(const Graph& g, std::size_t k, directed_tag) { - function_requires< GraphConcept >(); + BOOST_CONCEPT_ASSERT(( GraphConcept )); typedef typename graph_traits ::degree_size_type T; return T(k) * (T(k) - 1); } @@ -42,7 +43,7 @@ namespace detail directed_tag) { - function_requires< AdjacencyMatrixConcept >(); + BOOST_CONCEPT_ASSERT(( AdjacencyMatrixConcept )); return (lookup_edge(u, v, g).second ? 1 : 0) + (lookup_edge(v, u, g).second ? 1 : 0); } @@ -55,7 +56,7 @@ namespace detail typename graph_traits ::vertex_descriptor v, undirected_tag) { - function_requires< AdjacencyMatrixConcept >(); + BOOST_CONCEPT_ASSERT(( AdjacencyMatrixConcept )); return lookup_edge(u, v, g).second ? 1 : 0; } } @@ -64,7 +65,7 @@ template inline typename graph_traits ::degree_size_type num_paths_through_vertex(const Graph& g, Vertex v) { - function_requires< AdjacencyGraphConcept >(); + BOOST_CONCEPT_ASSERT(( AdjacencyGraphConcept )); typedef typename graph_traits ::directed_category Directed; typedef typename graph_traits ::adjacency_iterator AdjacencyIterator; @@ -81,8 +82,8 @@ template inline typename graph_traits ::degree_size_type num_triangles_on_vertex(const Graph& g, Vertex v) { - function_requires< IncidenceGraphConcept >(); - function_requires< AdjacencyGraphConcept >(); + BOOST_CONCEPT_ASSERT(( IncidenceGraphConcept )); + BOOST_CONCEPT_ASSERT(( AdjacencyGraphConcept )); typedef typename graph_traits ::degree_size_type Degree; typedef typename graph_traits