tlp::EdgeProperty< TYPE > Class Template Reference
That class enables to define a property/attribute on edges on a VectorGraph.
More...
#include <vectorgraphproperty.h>
List of all members.
Public Member Functions
Friends
Detailed Description
template<typename TYPE>
class tlp::EdgeProperty< TYPE >
That class enables to define a property/attribute on edges on a VectorGraph.
Using EdgeProperty you can assign any kind of attribute to edges. To use that class you must first create an instance of EdgeProperty and then connect it to your graph. NodeProperty can be copied in another EdgeProperty, however the to NodeProperty will share the same content. You can consider that EdgeProperty is just a pointer on a stl:vector. to free memory used by a EdgeProperty connected to a graph you must use the free function.
- Warning:
- After the call to free all The copy of the orignal EdgeProperty are no more valid
Using EdgeProperty you can store and access to values with the same efficiency as if you created manually a vector. EdgeProperty manage for you the resize, etc... when the graph is modified.
Furthemrore, in DEBUG mode, operator[] check if one try to access outside of the Array Bound. in DEBUG mode, the validy of the Property is also checked (if it has been free/alloc etc...)
VectorGraph g;
EdgeProperty<double> weight;
g.alloc(weight);
edge e;
forEach(e, g.getEdges()) {
weight[n] = g.deg(g.target(e)) + g.deg(g.source(e));
}
EdgeProperty<double> weight2 = weight;
weight2[g[0]] = 3;
cout << weight[g[0]];
g.free(weight2);
- See also:
- VectorGraph alloc(EdgeProperty)
-
VectorGraph free(EdgeProperty)
-
VectorGraph
Constructor & Destructor Documentation
Member Function Documentation
Friends And Related Function Documentation