template<typename GR>
class lemon::ListPath< GR >
A structure for representing directed path in a digraph.
- Template Parameters
-
GR | The digraph type in which the path is. |
In a sense, the path can be treated as a list of arcs. The lemon path type stores just this list. As a consequence it cannot enumerate the nodes in the path and the zero length paths cannot store the source.
This implementation is a back and front insertable and erasable path type. It can be indexed in O(k) time, where k is the rank of the arc in the path. The length can be computed in O(n) time. The front and back insertion and erasure is O(1) time and it can be splited and spliced in O(1) time.
|
| ListPath () |
| Default constructor.
|
|
| ListPath (const ListPath &cpath) |
| Copy constructor.
|
|
template<typename CPath > |
| ListPath (const CPath &cpath) |
| Template copy constructor.
|
|
| ~ListPath () |
| Destructor of the path.
|
|
ListPath & | operator= (const ListPath &cpath) |
| Copy assignment.
|
|
template<typename CPath > |
ListPath & | operator= (const CPath &cpath) |
| Template copy assignment.
|
|
const Arc & | nth (int n) const |
| The nth arc.
|
|
ArcIt | nthIt (int n) const |
| Initializes arc iterator to point to the nth arc.
|
|
int | length () const |
| Length of the path.
|
|
bool | empty () const |
| Return true if the path is empty.
|
|
void | clear () |
| Reset the path to an empty one.
|
|
const Arc & | front () const |
| The first arc of the path.
|
|
void | addFront (const Arc &arc) |
| Add a new arc before the current path.
|
|
void | eraseFront () |
| Erase the first arc of the path.
|
|
const Arc & | back () const |
| The last arc of the path.
|
|
void | addBack (const Arc &arc) |
| Add a new arc behind the current path.
|
|
void | eraseBack () |
| Erase the last arc of the path.
|
|
void | spliceBack (ListPath &tpath) |
| Splice a path to the back of the current path.
|
|
void | spliceFront (ListPath &tpath) |
| Splice a path to the front of the current path.
|
|
void | splice (ArcIt it, ListPath &tpath) |
| Splice a path into the current path.
|
|
void | split (ArcIt it, ListPath &tpath) |
| Split the current path.
|
|