Graph | The graph type in which the path is. |
This implementation is a just back insertable and erasable path type. It can be indexed in O(1) time. The back insertion and erasure is amortized O(1) time. This implementation is faster then the Path
type because it use just one vector for the edges. #include <lemon/path.h>
Classes | |
class | EdgeIt |
Iterator class to iterate on the edges of the paths. More... | |
Public Member Functions | |
SimplePath () | |
Default constructor. | |
template<typename CPath > | |
SimplePath (const CPath &cpath) | |
Template copy constructor. | |
template<typename CPath > | |
SimplePath & | operator= (const CPath &cpath) |
Template copy assignment. | |
int | length () const |
Length of the path. | |
bool | empty () const |
Returns whether the path is empty. | |
void | clear () |
Resets the path to an empty path. | |
const Edge & | nth (int n) const |
Gives back the nth edge. | |
EdgeIt | nthIt (int n) const |
Initializes edge iterator to point to the nth edge. | |
const Edge & | front () const |
Gives back the first edge of the path. | |
const Edge & | back () const |
Gives back the last edge of the path. | |
void | addBack (const Edge &edge) |
Add a new edge behind the current path. | |
void | eraseBack () |
Erase the last edge of the path. |
SimplePath | ( | ) | [inline] |
Default constructor
SimplePath | ( | const CPath & | cpath | ) | [inline] |
This path can be initialized with any other path type. It just makes a copy of the given path.
SimplePath& operator= | ( | const CPath & | cpath | ) | [inline] |
This path can be initialized with any other path type. It just makes a copy of the given path.
const Edge& nth | ( | int | n | ) | const [inline] |