| 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>MutablePropertyGraph</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> |
|---|
| 25 | <A NAME="sec:MutablePropertyGraph"></A> |
|---|
| 26 | MutablePropertyGraph |
|---|
| 27 | </H2> |
|---|
| 28 | |
|---|
| 29 | A MutablePropertyGraph is a <a |
|---|
| 30 | href="./MutableGraph.html">MutableGraph</a> with properties attached |
|---|
| 31 | internally to the vertices and edges. When adding vertices and edges |
|---|
| 32 | the value of the properties can be given. |
|---|
| 33 | |
|---|
| 34 | |
|---|
| 35 | <H3>Refinement of</H3> |
|---|
| 36 | |
|---|
| 37 | <a href="./MutableGraph.html">MutableGraph</a> and |
|---|
| 38 | <a href="./PropertyGraph.html">PropertyGraph</a> |
|---|
| 39 | |
|---|
| 40 | <H3>Notation</H3> |
|---|
| 41 | |
|---|
| 42 | |
|---|
| 43 | <TABLE> |
|---|
| 44 | |
|---|
| 45 | <TR> |
|---|
| 46 | <TD><tt>G</tt></TD> |
|---|
| 47 | <TD>A type that is a model of Graph.</TD> |
|---|
| 48 | </TR> |
|---|
| 49 | |
|---|
| 50 | <TR> |
|---|
| 51 | <TD><tt>g</tt></TD> |
|---|
| 52 | <TD>An object of type <tt>G</tt>.</TD> |
|---|
| 53 | </TR> |
|---|
| 54 | |
|---|
| 55 | <TR> |
|---|
| 56 | <TD><tt>e</tt></TD> |
|---|
| 57 | <TD>An object of type <tt>boost::graph_traits<G>::edge_descriptor</tt>.</TD> |
|---|
| 58 | </TR> |
|---|
| 59 | |
|---|
| 60 | <TR> |
|---|
| 61 | <TD><tt>u,v</tt></TD> |
|---|
| 62 | <TD>are objects of type <tt>boost::graph_traits<G>::vertex_descriptor</tt>.</TD> |
|---|
| 63 | </TR> |
|---|
| 64 | |
|---|
| 65 | <TR> |
|---|
| 66 | <TD><TT>ep</TT></TD><TD>is an object of type <TT>G::edge_property_type</TT></TD> |
|---|
| 67 | </TR> |
|---|
| 68 | |
|---|
| 69 | <TR> |
|---|
| 70 | <TD><TT>vp</TT></TD><TD>is an object of type <TT>G::vertex_property_type</TT></TD> |
|---|
| 71 | </TR> |
|---|
| 72 | |
|---|
| 73 | </TABLE> |
|---|
| 74 | |
|---|
| 75 | <P> |
|---|
| 76 | |
|---|
| 77 | <H3>Associated Types</H3> |
|---|
| 78 | |
|---|
| 79 | <table border> |
|---|
| 80 | |
|---|
| 81 | <tr> |
|---|
| 82 | <td>Edge Property Type </td> |
|---|
| 83 | <td><TT>graph_traits<G>::edge_property_type</TT></td> |
|---|
| 84 | </tr> |
|---|
| 85 | |
|---|
| 86 | <tr> |
|---|
| 87 | <td>Vertex Property Type </td> |
|---|
| 88 | <td><TT>graph_traits<G>::vertex_property_type</TT> </td> |
|---|
| 89 | </tr> |
|---|
| 90 | |
|---|
| 91 | </table> |
|---|
| 92 | |
|---|
| 93 | <H3>Valid Expressions</h3> |
|---|
| 94 | |
|---|
| 95 | <table border> |
|---|
| 96 | |
|---|
| 97 | <tr> |
|---|
| 98 | <TD><TT>add_edge(u, v, ep, g)</TT></TD> |
|---|
| 99 | <TD>Inserts the edge <i>(u,v)</i> into the graph, and |
|---|
| 100 | copies object <TT>ep</TT> into the property for that edge.<br> |
|---|
| 101 | Return type: <TT>std::pair<edge_descriptor, bool></TT></TD> |
|---|
| 102 | </TR> |
|---|
| 103 | |
|---|
| 104 | <tr> |
|---|
| 105 | <TD><TT>add_vertex(vp, g)</TT></TD> |
|---|
| 106 | <TD> |
|---|
| 107 | Add a new vertex to the graph and copy <TT>vp</TT> into the |
|---|
| 108 | property for the new vertex. The <TT>vertex_descriptor</TT> for the new |
|---|
| 109 | vertex is returned.<br> |
|---|
| 110 | Return type: <TT>vertex_descriptor</TT> |
|---|
| 111 | </TD> |
|---|
| 112 | </TR> |
|---|
| 113 | |
|---|
| 114 | </TABLE> |
|---|
| 115 | |
|---|
| 116 | |
|---|
| 117 | <H3>Models</H3> |
|---|
| 118 | |
|---|
| 119 | <UL> |
|---|
| 120 | <LI><TT>adjacency_list</TT></LI> |
|---|
| 121 | </UL> |
|---|
| 122 | |
|---|
| 123 | <H3>Concept Checking Class</H3> |
|---|
| 124 | |
|---|
| 125 | <P> |
|---|
| 126 | <PRE> |
|---|
| 127 | template <class G> |
|---|
| 128 | struct MutablePropertyGraphConcept |
|---|
| 129 | { |
|---|
| 130 | typedef typename boost::graph_traits<G>::edge_descriptor edge_descriptor; |
|---|
| 131 | void constraints() { |
|---|
| 132 | function_requires< MutableGraphConcept<G> >(); |
|---|
| 133 | v = add_vertex(vp, g); |
|---|
| 134 | p = add_edge(u, v, ep, g); |
|---|
| 135 | } |
|---|
| 136 | G g; |
|---|
| 137 | std::pair<edge_descriptor, bool> p; |
|---|
| 138 | typename boost::graph_traits<G>::vertex_descriptor u, v; |
|---|
| 139 | typename boost::graph_traits<G>::vertex_property_type vp; |
|---|
| 140 | typename boost::graph_traits<G>::edge_property_type ep; |
|---|
| 141 | }; |
|---|
| 142 | </PRE> |
|---|
| 143 | |
|---|
| 144 | |
|---|
| 145 | <br> |
|---|
| 146 | <HR> |
|---|
| 147 | <TABLE> |
|---|
| 148 | <TR valign=top> |
|---|
| 149 | <TD nowrap>Copyright © 2000-2001</TD><TD> |
|---|
| 150 | <A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Indiana University (<A HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>) |
|---|
| 151 | </TD></TR></TABLE> |
|---|
| 152 | |
|---|
| 153 | </BODY> |
|---|
| 154 | </HTML> |
|---|