filtered_graph_cc.cpp 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //=======================================================================
  2. // Copyright 1997, 1998, 1999, 2000 University of Notre Dame.
  3. // Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek
  4. //
  5. // Distributed under the Boost Software License, Version 1.0. (See
  6. // accompanying file LICENSE_1_0.txt or copy at
  7. // http://www.boost.org/LICENSE_1_0.txt)
  8. //=======================================================================
  9. #include <boost/graph/graph_concepts.hpp>
  10. #include <boost/graph/graph_archetypes.hpp>
  11. #include <boost/graph/adjacency_list.hpp>
  12. #include <boost/graph/filtered_graph.hpp>
  13. #include <boost/concept/assert.hpp>
  14. int main(int,char*[])
  15. {
  16. using namespace boost;
  17. // Check filtered_graph
  18. {
  19. typedef adjacency_list<vecS, vecS, directedS,
  20. no_property, property<edge_residual_capacity_t, long> > Graph;
  21. typedef property_map<Graph, edge_residual_capacity_t>::type ResCapMap;
  22. typedef filtered_graph<Graph, is_residual_edge<ResCapMap> > ResGraph;
  23. typedef graph_traits<ResGraph>::edge_descriptor Edge;
  24. BOOST_CONCEPT_ASSERT(( VertexListGraphConcept<ResGraph> ));
  25. BOOST_CONCEPT_ASSERT(( EdgeListGraphConcept<ResGraph> ));
  26. BOOST_CONCEPT_ASSERT(( IncidenceGraphConcept<ResGraph> ));
  27. BOOST_CONCEPT_ASSERT(( AdjacencyGraphConcept<ResGraph> ));
  28. BOOST_CONCEPT_ASSERT(( PropertyGraphConcept<ResGraph, Edge,
  29. edge_residual_capacity_t> ));
  30. }
  31. // Check filtered_graph with bidirectional adjacency_list
  32. {
  33. typedef adjacency_list<vecS, vecS, bidirectionalS,
  34. no_property, property<edge_residual_capacity_t, long> > Graph;
  35. typedef property_map<Graph, edge_residual_capacity_t>::type ResCapMap;
  36. typedef filtered_graph<Graph, is_residual_edge<ResCapMap> > ResGraph;
  37. BOOST_CONCEPT_ASSERT(( BidirectionalGraphConcept<ResGraph> ));
  38. }
  39. // Check filtered_graph with undirected adjacency_list
  40. {
  41. typedef adjacency_list<vecS, vecS, undirectedS,
  42. no_property, property<edge_residual_capacity_t, long> > Graph;
  43. typedef property_map<Graph, edge_residual_capacity_t>::type ResCapMap;
  44. typedef filtered_graph<Graph, is_residual_edge<ResCapMap> > ResGraph;
  45. BOOST_CONCEPT_ASSERT(( BidirectionalGraphConcept<ResGraph> ));
  46. }
  47. return 0;
  48. }