18 #ifndef LATTICEGRAPH_EDGE_H 19 #define LATTICEGRAPH_EDGE_H 34 static unsigned int suid;
36 std::weak_ptr<Node> n1, n2;
61 Edge(std::weak_ptr<Node> n1, std::weak_ptr<Node> n2);
70 Edge(std::weak_ptr<Node> n1, std::weak_ptr<Node> n2,
int dir,
double weight);
138 bool isMember(std::weak_ptr<Node> n);
147 bool operator < (std::shared_ptr<Edge> e)
const{
148 return uid < e->getUid();
152 #endif //LATTICEGRAPH_EDGE_H void setWeight(double weight)
Set the weight of the edge.
bool isMember(std::weak_ptr< Node > n)
Checks to see if vortex/node n is on edge.
Allow vortex to be treated as node in a graph.
void setDirection(int direction)
Set the direction of the edge.
std::weak_ptr< Node > getVortex(int idx)
Returns connected vortices (nodes)
unsigned int & getSuid()
Returns static UID value for use in new edge UID.
double getWeight()
Returns the weight of an edge. 0 if unweighted.
unsigned int getUid()
Returns edge UID.
void updateVortex(int idx, std::weak_ptr< Node > n_new)
Updates the connected vortex at either side of edge.
int getDirection()
Returns direction of edge. 1 n1->n2,;-1 n2->n1; 0 undirected.
~Edge()
Makes stuff anti-exist.