Карта сайта Kansoftware
НОВОСТИУСЛУГИРЕШЕНИЯКОНТАКТЫ
Разработка программного обеспечения

VertexListGraph

Boost , ,

Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

C++ Boost

VertexListGraph

The VertexListGraph concept refines the Graph concept, and adds the requirement for efficient traversal of all the vertices in the graph.

Refinement of

Graph

Associated Types

boost::graph_traits::traversal_category

Этот тип тегов должен быть конвертируемым в vertex_list_graph_tag.
Загрузок::graph_traits< ;G>::vertex_iterator

Итератор вершин (полученный через вершины g)) обеспечивает доступ ко всем вершинам в графе. Тип итератора вершин должен соответствовать требованиям MultiPassInputIterator. Тип значения итератора вершины должен быть вершинным дескриптором графа.
Загрузок::graph_traits< ;G>::vertices_size_type

Неподписанный интегер-тип, используемый для представления числа вершин в графе.

Valid Expressions

NameExpressionReturn TypeDescription
Vertex Набор Графика вершины g) std::pair< vertex_iterator, vertex_iterator> Description.
Количество вертиков в графе num_vertices(g) vertices_size_type Возвращает количество вершин в графе g.

Complexity guarantees

The vertices() function must return in constant time.

See Also

Graph concepts

Design Rationale

One issue in the design of this concept is whether to include the refinement from the IncidenceGraph and AdjacencyGraph concepts. The ability to traverse the vertices of a graph is orthogonal to traversing out-edges, so it would make sense to have a VertexListGraph concept that only includes vertex traversal. However, such a concept would no longer really be a graph, but would just be a set, and the STL already has concepts for dealing with such things. However, there are many BGL algorithms that need to traverse the vertices and out-edges of a graph, so for convenience a concept is needed that groups these requirements together, hence the VertexListGraph concept.

Concept Checking Class

  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;
  };


Copyright © 2000-2001Jeremy Siek, Indiana University (jsiek@osl.iu.edu)

Статья VertexListGraph раздела может быть полезна для разработчиков на c++ и boost.




Материалы статей собраны из открытых источников, владелец сайта не претендует на авторство. Там где авторство установить не удалось, материал подаётся без имени автора. В случае если Вы считаете, что Ваши права нарушены, пожалуйста, свяжитесь с владельцем сайта.



:: Главная :: ::


реклама


©KANSoftWare (разработка программного обеспечения, создание программ, создание интерактивных сайтов), 2007
Top.Mail.Ru

Время компиляции файла: 2024-08-30 11:47:00
2025-05-19 19:02:08/0.022243976593018/1