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

Boost Graph Library: distance_recorder

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

distance_recorder<DistanceMap, EventTag>

This is an EventVisitor that records the distance of a vertex (using a property map) from some source vertex during a graph search. When applied to edge e = (u,v), the distance of v is recorded to be one more than the distance of u. The distance recorder is typically used with the on_tree_edge or on_relax_edge events and cannot be used with vertex events.

distance_recorder can be used with graph algorithms by wrapping it with the algorithm specific adaptor, such as bfs_visitor and dfs_visitor. Also, this event visitor can be combined with other event visitors using std::pair to form an EventVisitorList.

Example

See the example for bfs_visitor.

Model of

EventVisitor

Where Defined

boost/graph/visitors.hpp

Template Parameters

ParameterDescriptionDefault
Дистанционная карта AWritablePropertyMap, где ключевым типом и типом значения является тип дескриптора вершины графика.  
Тег события Тег, указывающий, когдадистанционный регистратордолжен быть применен во время алгоритма графа.Тег событиядолжен быть краевым событием.  

Associated Types

TypeDescription
distance_recorder::event_filter Это будет тот же тип, что и параметр шаблонаEventTag.

Member Functions

MemberDescription
distance_recorder (DistanceMap pa); Постройте дистанционный регистратор с картой свойств расстоянияpa.
шаблон
void operator()(Edge e, const Graph&g);
При этом расстояние между нимиe = (u,v), это расстояниеvкак один плюс расстояниеu.

Non-Member Functions

FunctionDescription
template
distance_recorder
record_distances (DistanceMap pa, Tag);
Удобный способ созданиядистанционной записи.

See Also

Visitor concepts

The following are other event visitors: predecessor_recorder, time_stamper, and property_writer.


Copyright © 2000-2001Джереми Сик, Университет Индианыjsiek@osl.iu.edu]
Ли-Куан Ли, Университет Индианыllee@cs.indiana.edu]
Эндрю Лумсдейн, Университет Индианыlums@osl.iu.edu

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




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



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


реклама


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

Время компиляции файла: 2024-08-30 11:47:00
2025-05-20 07:06:35/0.0075831413269043/1