#include <lemon/path.h>
You can push new edges to the front and to the back of the path in arbitrary order then you should commit these changes to the graph.
Fundamentally, for most "Paths" (classes fulfilling the PathConcept) while the builder is active (after the first modifying operation and until the commit()) the original Path is in a "transitional" state (operations on it have undefined result). But in the case of Path the original path remains unchanged until the commit. However we don't recomend that you use this feature.
Public Member Functions | |
Builder (Path &_path) | |
Constructor. | |
~Builder () | |
Destructor. | |
void | setStartNode (const Node &_start) |
Sets the starting node of the path. | |
void | pushFront (const Edge &e) |
Push a new edge to the front of the path. | |
void | pushBack (const Edge &e) |
Push a new edge to the back of the path. | |
void | commit () |
Commit the changes to the path. | |
void | reserveFront (size_t r) |
Reserve storage for the builder in advance. | |
void | reserveBack (size_t r) |
Reserve storage for the builder in advance. |
~Builder | ( | ) | [inline] |
Destructor
void setStartNode | ( | const Node & | _start | ) | [inline] |
Sets the starting node of the path. Edge added to the path afterwards have to be incident to this node. It should be called if and only if the path is empty and before any call to pushFront() or pushBack()
void pushFront | ( | const Edge & | e | ) | [inline] |
Push a new edge to the front of the path.
void pushBack | ( | const Edge & | e | ) | [inline] |
Push a new edge to the back of the path.
void commit | ( | ) | [inline] |
Commit the changes to the path.
void reserveFront | ( | size_t | r | ) | [inline] |
If you know a reasonable upper bound of the number of the edges to add to the front, using this function you can speed up the building.
void reserveBack | ( | size_t | r | ) | [inline] |
If you know a reasonable upper bound of the number of the edges to add to the back, using this function you can speed up the building.