How to Create Calculated Internal Properties?
I wish to create an internal calculated property that is derived from existing properties in a vertex or edge. Id also like to be able to access it like any other internal property. For instance, I want a vertex property called weight_sum that would sum the weights for all the out edges and return the answer. I want to be able to use a statement "get(vertex_weight_sum,G,v)" to get the value. Later on, I may decide that I want to cache the value on the vertex (like a normal property) and existing code should work without change. I have been unable to figure out any template class specializations to do this. Additionally, if I try to define the property using the property<> template in the graph declaration it reserves storage for the property, which is undesired. Am I missing something? Is there a way to define a calculated internal property that doesnt reserve storage?
participants (1)
-
Phillip Ratzloff