| [12] | 1 | <HTML> | 
|---|
 | 2 | <!-- | 
|---|
 | 3 |   -- Copyright (c) Jeremy Siek 2000 | 
|---|
 | 4 |   -- | 
|---|
 | 5 |   -- Permission to use, copy, modify, distribute and sell this software | 
|---|
 | 6 |   -- and its documentation for any purpose is hereby granted without fee, | 
|---|
 | 7 |   -- provided that the above copyright notice appears in all copies and | 
|---|
 | 8 |   -- that both that copyright notice and this permission notice appear | 
|---|
 | 9 |   -- in supporting documentation.  Silicon Graphics makes no | 
|---|
 | 10 |   -- representations about the suitability of this software for any | 
|---|
 | 11 |   -- purpose.  It is provided "as is" without express or implied warranty. | 
|---|
 | 12 |   --> | 
|---|
 | 13 | <Head> | 
|---|
 | 14 | <Title>AdjacencyMatrix</Title> | 
|---|
 | 15 | <BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"  | 
|---|
 | 16 |         ALINK="#ff0000">  | 
|---|
 | 17 | <IMG SRC="../../../boost.png"  | 
|---|
 | 18 |      ALT="C++ Boost" width="277" height="86">  | 
|---|
 | 19 |  | 
|---|
 | 20 | <BR Clear> | 
|---|
 | 21 |  | 
|---|
 | 22 |  | 
|---|
 | 23 |  | 
|---|
 | 24 | <H2><A NAME="concept:AdjacencyMatrix"></A> | 
|---|
 | 25 | AdjacencyMatrix | 
|---|
 | 26 | </H2> | 
|---|
 | 27 |  | 
|---|
 | 28 | <P> | 
|---|
 | 29 | The AdjacencyMatrix concept refines <a href="./Graph.html">Graph</a> | 
|---|
 | 30 | concept and adds the requirement for efficient access to any edge in | 
|---|
 | 31 | the graph given the source and target vertices. No Boost Graph Library | 
|---|
 | 32 | algorithms currently use this concept. However there are algorithms | 
|---|
 | 33 | not yet implemented such as Floyd-Warshall that would require this | 
|---|
 | 34 | concept. | 
|---|
 | 35 |  | 
|---|
 | 36 | <H3>Refinement of</H3> | 
|---|
 | 37 |  | 
|---|
 | 38 | <a href="./Graph.html">Graph</a> | 
|---|
 | 39 |  | 
|---|
 | 40 | <H3>Associated Types</H3> | 
|---|
 | 41 |  | 
|---|
 | 42 | <Table border> | 
|---|
 | 43 |  | 
|---|
 | 44 | <tr> | 
|---|
 | 45 | <td><tt>boost::graph_traits<G>::traversal_category</tt><br><br> | 
|---|
 | 46 |  This tag type must be convertible to <tt>adjacency_matrix_tag</tt>. | 
|---|
 | 47 | </td> | 
|---|
 | 48 | </tr> | 
|---|
 | 49 |  | 
|---|
 | 50 | </table> | 
|---|
 | 51 |  | 
|---|
 | 52 | <H3>Valid Expressions</H3> | 
|---|
 | 53 |  | 
|---|
 | 54 | <table border> | 
|---|
 | 55 |  | 
|---|
 | 56 | <tr> | 
|---|
 | 57 | <th>Name</th><th>Expression</th><th>Return Type</th><th>Description</th> | 
|---|
 | 58 | </tr> | 
|---|
 | 59 |  | 
|---|
 | 60 | <tr> | 
|---|
 | 61 | <td>Direct Edge Access</td> | 
|---|
 | 62 | <TD><TT>edge(u,v,g)</TT></TD> | 
|---|
 | 63 | <TD><TT>std::pair<edge_descriptor, bool></TT></TD> | 
|---|
 | 64 | <TD> | 
|---|
 | 65 | Returns a pair consisting of a flag saying whether there exists an | 
|---|
 | 66 | edge between <TT>u</TT> and <TT>v</TT> in graph <TT>g</TT>, and | 
|---|
 | 67 | consisting of the edge descriptor if the edge was found. | 
|---|
 | 68 | </TD> | 
|---|
 | 69 | </TR> | 
|---|
 | 70 | </TABLE> | 
|---|
 | 71 |  | 
|---|
 | 72 | <H3>Complexity guarantees</H3> | 
|---|
 | 73 |  | 
|---|
 | 74 | The <TT>edge()</TT> function must return in constant time. | 
|---|
 | 75 |  | 
|---|
 | 76 |  | 
|---|
 | 77 | <H3>Models</H3> | 
|---|
 | 78 |  | 
|---|
 | 79 | <a href="./adjacency_matrix.html"><tt>adjacency_matrix</tt></a> | 
|---|
 | 80 |  | 
|---|
 | 81 | <H3>Concept Checking Class</H3> | 
|---|
 | 82 |  | 
|---|
 | 83 | <PRE> | 
|---|
 | 84 |   template <class G> | 
|---|
 | 85 |   struct AdjacencyMatrix | 
|---|
 | 86 |   { | 
|---|
 | 87 |     typedef typename boost::graph_traits<G>::edge_descriptor edge_descriptor; | 
|---|
 | 88 |     void constraints() { | 
|---|
 | 89 |       p = edge(u, v, g); | 
|---|
 | 90 |     } | 
|---|
 | 91 |     typename boost::graph_traits<G>::vertex_descriptor u, v; | 
|---|
 | 92 |     std::pair<bool, edge_descriptor> p; | 
|---|
 | 93 |     G g; | 
|---|
 | 94 |   }; | 
|---|
 | 95 | </PRE> | 
|---|
 | 96 |  | 
|---|
 | 97 |  | 
|---|
 | 98 | <br> | 
|---|
 | 99 | <HR> | 
|---|
 | 100 | <TABLE> | 
|---|
 | 101 | <TR valign=top> | 
|---|
 | 102 | <TD nowrap>Copyright © 2000-2001</TD><TD> | 
|---|
 | 103 | <A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Indiana University (<A HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>) | 
|---|
 | 104 | </TD></TR></TABLE> | 
|---|
 | 105 |  | 
|---|
 | 106 | </BODY> | 
|---|
 | 107 | </HTML>  | 
|---|