PDF Publication Title:
Text from PDF Page: 163
Using in-place variables allows us to write visitors easily in MatlabBGL. Let us now address the types of visitors in the BGL. Algorithms in the BGL define two types of visitors: vertex visitors and edge visitors. A common vertex visitor is the examine_vertex function. For the BFSVisitor concept, the Boost graph library defines the following prototype for that visitor: void visitor::examine_vertex(Vertex u, Graph& g) The corresponding MatlabBGL function takes only one argument, the vertex index. Here, we illustrate this visitor type by example as Matlab does not have function prototypes: visitor.examine_vertex = @(u) fprintf(’called examine_vertex(%i)!\n’, u); In MatlabBGL, the other vertex visitors follow this same pattern: the only argument is the index of the vertex. Edge visitors in Boost provide a BGL edge type: void visitor::examine_edge(Edge e, Graph& g) MatlabBGL translates the edge type into an edge index, a source vertex, and a target vertex, which are provided to the visitor function (again illustrated with an example visitor): visitor.examine_edge = @(ei,u,v) fprintf(’called examine_edge(%i,%i)!\n’, u); A considerable issue with visitors is that they call back to Matlab from a mex file. This operation is not efficient and visitors are not appropriate for large-scale computations. Nevertheless, they are an important part of the Boost graph library and belong in MatlabBGL. We end this section with two examples that show how visitors are used in the library. watching an algorithm with a visitor Inthisexample,we write a simple visitor that outputs an algorithm’s behavior. The algorithm we examine is dijkstra_sp. To examine the runtime behavior we use a visitor that outputs a string every time a function is called. The dijkstra_sp function supports the following visitors: • initialize_vertex(u) • discover_vertex(u) • examine_vertex(u) • examine_edge(ei,u,v) • edge_relaxed(ei,u,v) 6.3 ⋅ matlabbgl 141PDF Image | Instagram Cheat Sheet
PDF Search Title:
Instagram Cheat SheetOriginal File Name Searched:
pagerank-sensitivity-thesis-online.pdfDIY PDF Search: Google It | Yahoo | Bing
Cruise Ship Reviews | Luxury Resort | Jet | Yacht | and Travel Tech More Info
Cruising Review Topics and Articles More Info
Software based on Filemaker for the travel industry More Info
The Burgenstock Resort: Reviews on CruisingReview website... More Info
Resort Reviews: World Class resorts... More Info
The Riffelalp Resort: Reviews on CruisingReview website... More Info
CONTACT TEL: 608-238-6001 Email: greg@cruisingreview.com (Standard Web Page)