#include <edge.h>
Definition at line 30 of file edge.h.
◆ Edge() [1/3]
LatticeGraph::Edge::Edge |
( |
| ) |
|
◆ ~Edge()
LatticeGraph::Edge::~Edge |
( |
| ) |
|
◆ Edge() [2/3]
LatticeGraph::Edge::Edge |
( |
std::weak_ptr< Node > |
n1, |
|
|
std::weak_ptr< Node > |
n2 |
|
) |
| |
Makes stuff exist between vortices n1 and n2.
- Parameters
-
n1 | Vortex (node) 1 to connect to edge |
n2 | Vortex (node) 2 to connect to edge |
◆ Edge() [3/3]
LatticeGraph::Edge::Edge |
( |
std::weak_ptr< Node > |
n1, |
|
|
std::weak_ptr< Node > |
n2, |
|
|
int |
dir, |
|
|
double |
weight |
|
) |
| |
Makes stuff exist between n1 and n2, with direction and weight.
- Parameters
-
n1 | Vortex (node) 1 to connect to edge |
n2 | Vortex (node) 2 to connect to edge |
dir | Direction of edge. 1 n1->n2; -1 n2->n1; 0 undirected |
weight | Edge weight. 0.0 if not required |
◆ getDirection()
int LatticeGraph::Edge::getDirection |
( |
| ) |
|
Returns direction of edge. 1 n1->n2,;-1 n2->n1; 0 undirected.
- Returns
- Integer for edge direction.
◆ getSuid()
unsigned int& LatticeGraph::Edge::getSuid |
( |
| ) |
|
Returns static UID value for use in new edge UID.
- Returns
- Static unsigned int, incremeneted with creation of new edge
◆ getUid()
unsigned int LatticeGraph::Edge::getUid |
( |
| ) |
|
Returns edge UID.
- Returns
- Edge UID
◆ getVortex()
std::weak_ptr<Node> LatticeGraph::Edge::getVortex |
( |
int |
idx | ) |
|
Returns connected vortices (nodes)
- Parameters
-
idx | 0 gets n1, others get node 2 |
- Returns
- Returns weak_ptr to vortices; if exception, returns empty weak_ptr
◆ getWeight()
double LatticeGraph::Edge::getWeight |
( |
| ) |
|
Returns the weight of an edge. 0 if unweighted.
- Returns
- Double of edge weight
◆ isMember()
bool LatticeGraph::Edge::isMember |
( |
std::weak_ptr< Node > |
n | ) |
|
Checks to see if vortex/node n is on edge.
- Returns
- Returns true if connected, otherwise false
◆ operator<()
bool LatticeGraph::Edge::operator< |
( |
std::shared_ptr< Edge > |
e | ) |
const |
|
inline |
Operator overloading for comparing UIDs between edges.
- Returns
- Returns true if self is smaller, otherwise false
Definition at line 147 of file edge.h.
References uid.
148 return uid < e->getUid();
◆ setDirection()
void LatticeGraph::Edge::setDirection |
( |
int |
direction | ) |
|
Set the direction of the edge.
- Parameters
-
direction | 1 for n1->n2; -1 for n2->n1; 0 for undirected |
◆ setWeight()
void LatticeGraph::Edge::setWeight |
( |
double |
weight | ) |
|
Set the weight of the edge.
- Parameters
-
weight | 0.0 if not used; +/- double otherwise |
◆ updateVortex()
void LatticeGraph::Edge::updateVortex |
( |
int |
idx, |
|
|
std::weak_ptr< Node > |
n_new |
|
) |
| |
Updates the connected vortex at either side of edge.
- Parameters
-
idx | Selects connected vortex. 0 for n1, others for n2 |
n_new | New vortex at the specified position |
◆ uid
unsigned int LatticeGraph::Edge::uid |
The documentation for this class was generated from the following files: