dictionary - BGL: How do I get direct access to data of nodes and edges? -


i have problem regarding boost graphic library not answer myself googling nor reading documentation. it's not directly related other questions thought i'd better start new thread.

i have graph adjacency layout , use bundled properties access data of nodes , edges. use typedef graph convenience. can access data stored, e.g. vertex_descriptor, typing this:

graph[my_vertex_descriptor].setx(4); graph[my_vertex_descriptor].sety(10); 

now define reference data-storing object able type that:

typedef graph[vertex_descriptor]::type vertex; vertex v = graph[my_vertex_descriptor]; v.setx(4); v.sety(10); 

by or similar approach seek avoid unnecessary recalculations of mapped value accessed using []operator of map , specific descriptor object. vertices , edges contain lots of data in situations current code produces many recalculations of same value deal data. seems ugly.

does know if possibly achieve i'm trying do?

i used bundled properties and:

bundled_vertex_property prop_v = get(vertex_bundle, my_graph) // or get(vertex_bundle, v, my_graph) bundled_edge_property prop_e = get(edge_bundle, my_graph) // or get(edge_bundle, v, my_graph) 

to bundled property directly.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -