adj_matrix_cc.cpp 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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_matrix.hpp>
  12. #include <boost/concept/assert.hpp>
  13. int main(int,char*[])
  14. {
  15. using namespace boost;
  16. // Check adjacency_matrix without properties
  17. {
  18. typedef adjacency_matrix<directedS> Graph;
  19. BOOST_CONCEPT_ASSERT(( VertexListGraphConcept<Graph> ));
  20. BOOST_CONCEPT_ASSERT(( EdgeListGraphConcept<Graph> ));
  21. BOOST_CONCEPT_ASSERT(( IncidenceGraphConcept<Graph> ));
  22. BOOST_CONCEPT_ASSERT(( AdjacencyGraphConcept<Graph> ));
  23. BOOST_CONCEPT_ASSERT(( MutableGraphConcept<Graph> ));
  24. BOOST_CONCEPT_ASSERT(( AdjacencyMatrixConcept<Graph> ));
  25. }
  26. {
  27. typedef adjacency_matrix<undirectedS> Graph;
  28. BOOST_CONCEPT_ASSERT(( VertexListGraphConcept<Graph> ));
  29. BOOST_CONCEPT_ASSERT(( EdgeListGraphConcept<Graph> ));
  30. BOOST_CONCEPT_ASSERT(( IncidenceGraphConcept<Graph> ));
  31. BOOST_CONCEPT_ASSERT(( AdjacencyGraphConcept<Graph> ));
  32. BOOST_CONCEPT_ASSERT(( MutableGraphConcept<Graph> ));
  33. BOOST_CONCEPT_ASSERT(( AdjacencyMatrixConcept<Graph> ));
  34. }
  35. // Check adjacency_matrix with properties
  36. {
  37. typedef adjacency_matrix<directedS,
  38. property<vertex_color_t, int>,
  39. property<edge_weight_t, float> > Graph;
  40. typedef graph_traits<Graph>::vertex_descriptor Vertex;
  41. typedef graph_traits<Graph>::edge_descriptor Edge;
  42. BOOST_CONCEPT_ASSERT(( VertexListGraphConcept<Graph> ));
  43. BOOST_CONCEPT_ASSERT(( EdgeListGraphConcept<Graph> ));
  44. BOOST_CONCEPT_ASSERT(( IncidenceGraphConcept<Graph> ));
  45. BOOST_CONCEPT_ASSERT(( AdjacencyGraphConcept<Graph> ));
  46. BOOST_CONCEPT_ASSERT(( AdjacencyMatrixConcept<Graph> ));
  47. BOOST_CONCEPT_ASSERT(( VertexMutablePropertyGraphConcept<Graph> ));
  48. BOOST_CONCEPT_ASSERT(( EdgeMutablePropertyGraphConcept<Graph> ));
  49. BOOST_CONCEPT_ASSERT(( ReadablePropertyGraphConcept<Graph,
  50. Vertex, vertex_index_t> ));
  51. BOOST_CONCEPT_ASSERT(( PropertyGraphConcept<Graph, Vertex, vertex_color_t> ));
  52. BOOST_CONCEPT_ASSERT(( PropertyGraphConcept<Graph, Edge, edge_weight_t> ));
  53. }
  54. {
  55. typedef adjacency_matrix<undirectedS,
  56. property<vertex_color_t, int>,
  57. property<edge_weight_t, float> > Graph;
  58. typedef graph_traits<Graph>::vertex_descriptor Vertex;
  59. typedef graph_traits<Graph>::edge_descriptor Edge;
  60. BOOST_CONCEPT_ASSERT(( VertexListGraphConcept<Graph> ));
  61. BOOST_CONCEPT_ASSERT(( EdgeListGraphConcept<Graph> ));
  62. BOOST_CONCEPT_ASSERT(( IncidenceGraphConcept<Graph> ));
  63. BOOST_CONCEPT_ASSERT(( AdjacencyGraphConcept<Graph> ));
  64. BOOST_CONCEPT_ASSERT(( AdjacencyMatrixConcept<Graph> ));
  65. BOOST_CONCEPT_ASSERT(( VertexMutablePropertyGraphConcept<Graph> ));
  66. BOOST_CONCEPT_ASSERT(( EdgeMutablePropertyGraphConcept<Graph> ));
  67. BOOST_CONCEPT_ASSERT(( ReadablePropertyGraphConcept<Graph,
  68. Vertex, vertex_index_t> ));
  69. BOOST_CONCEPT_ASSERT(( PropertyGraphConcept<Graph, Vertex, vertex_color_t> ));
  70. BOOST_CONCEPT_ASSERT(( PropertyGraphConcept<Graph, Edge, edge_weight_t> ));
  71. }
  72. return 0;
  73. }