Generic Edge. More...
#include <rgenericvertex.h>
Public Member Functions | |
int | Compare (const RGenericEdge &e) const |
V * | GetFrom (void) const |
V * | GetTo (void) const |
double | GetWeight (void) const |
bool | IsConnect (size_t id) const |
RGenericEdge (V *f, V *t, double w) | |
void | SetWeight (double weight) |
virtual | ~RGenericEdge (void) |
Private Attributes | |
V * | From |
V * | To |
double | Weight |
Detailed Description
template<class V, class E>
singleton R::RGenericEdge< V, E >
Generic Edge.
The RGenericVertex class provides a representation for a generic edge from one vertex to another one in a given graph. The edge is directed but may be considered as undirected in some situations.
Constructor & Destructor Documentation
RGenericEdge | ( | V * | f, |
V * | t, | ||
double | w | ||
) |
Constructor of the edge.
- Parameters
-
f Vertex starting the edge. t Vertex ending the edge. w Weight
|
virtual |
Destruct the edge. It is eventually removed from the corresponding vertices.
Member Function Documentation
int Compare | ( | const RGenericEdge< V, E > & | e | ) | const |
The methods used to compare two edges. The function returns the same type of information than the strcmp function from the standard C library.
- See also
- R::RContainer.
- Parameters
-
e Edge used for the comparison.
V* GetFrom | ( | void | ) | const |
Get the starting vertex of the edge.
- Returns
- a pointer.
V* GetTo | ( | void | ) | const |
Get the ending vertex of the edge.
- Returns
- a pointer.
bool IsConnect | ( | size_t | id | ) | const |
Look if the edge connects the node given by the identifier.
- Parameters
-
id Identifier.
- Returns
- true if the connects a node.
double GetWeight | ( | void | ) | const |
Get the weight of the edge.
void SetWeight | ( | double | weight | ) |
Set the weight of the edge.
- Parameters
-
weight Weight to assign.
Member Data Documentation
|
private |
Origin of the edge.
|
private |
Destination of the edge.
|
private |
Weight of the edge.