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