boost::graph_traits<G>::traversal_category 此标签类型必须可转换为vertex_list_graph_tag. |
boost::graph_traits<G>::vertex_iterator 顶点迭代器(通过vertices(g)获取)提供对图中所有顶点的访问。顶点迭代器类型必须满足 MultiPassInputIterator 的要求。顶点迭代器的值类型必须是图的顶点描述符。 |
boost::graph_traits<G>::vertices_size_type 用于表示图中顶点数量的无符号整数类型。 |
名称 | 表达式 | 返回类型 | 描述 |
---|---|---|---|
图的顶点集合 | vertices(g) | std::pair<vertex_iterator, vertex_iterator> | 返回一个迭代器范围,提供对图中所有顶点的访问g. |
图中顶点的数量 | num_vertices(g) | vertices_size_type | 返回图中顶点的数量g. |
vertices()函数必须在常数时间内返回。
template <class G> struct VertexListGraphConcept { typedef typename boost::graph_traits<G>::vertex_iterator vertex_iterator; void constraints() { BOOST_CONCEPT_ASSERT(( IncidenceGraphConcept<G> )); BOOST_CONCEPT_ASSERT(( AdjacencyGraphConcept<G> )); BOOST_CONCEPT_ASSERT(( MultiPassInputIteratorConcept<vertex_iterator> )); p = vertices(g); V = num_vertices(g); v = *p.first; const_constraints(g); } void const_constraints(const G& g) { p = vertices(g); V = num_vertices(g); v = *p.first; } std::pair<vertex_iterator, vertex_iterator> p; typename boost::graph_traits<G>::vertex_descriptor v; typename boost::graph_traits<G>::vertices_size_type V; G g; };
版权所有 © 2000-2001 | Jeremy Siek, 印第安纳大学 (jsiek@osl.iu.edu) |