GPUE  v1.0
GPU Gross-Pitaevskii Equation numerical solver for Bose-Einstein condensates
LatticeGraph::Edge Class Reference

#include <edge.h>

Public Member Functions

 Edge ()
 Makes stuff exist. More...
 
 ~Edge ()
 Makes stuff anti-exist. More...
 
 Edge (std::weak_ptr< Node > n1, std::weak_ptr< Node > n2)
 Makes stuff exist between vortices n1 and n2. More...
 
 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. More...
 
unsigned int getUid ()
 Returns edge UID. More...
 
unsigned int & getSuid ()
 Returns static UID value for use in new edge UID. More...
 
int getDirection ()
 Returns direction of edge. 1 n1->n2,;-1 n2->n1; 0 undirected. More...
 
double getWeight ()
 Returns the weight of an edge. 0 if unweighted. More...
 
std::weak_ptr< NodegetVortex (int idx)
 Returns connected vortices (nodes) More...
 
void setDirection (int direction)
 Set the direction of the edge. More...
 
void setWeight (double weight)
 Set the weight of the edge. More...
 
void updateVortex (int idx, std::weak_ptr< Node > n_new)
 Updates the connected vortex at either side of edge. More...
 
bool isMember (std::weak_ptr< Node > n)
 Checks to see if vortex/node n is on edge. More...
 
bool operator< (std::shared_ptr< Edge > e) const
 Operator overloading for comparing UIDs between edges. More...
 

Public Attributes

unsigned int uid
 

Detailed Description

Definition at line 30 of file edge.h.

Constructor & Destructor Documentation

◆ Edge() [1/3]

LatticeGraph::Edge::Edge ( )

Makes stuff exist.

◆ ~Edge()

LatticeGraph::Edge::~Edge ( )

Makes stuff anti-exist.

◆ 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
n1Vortex (node) 1 to connect to edge
n2Vortex (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
n1Vortex (node) 1 to connect to edge
n2Vortex (node) 2 to connect to edge
dirDirection of edge. 1 n1->n2; -1 n2->n1; 0 undirected
weightEdge weight. 0.0 if not required

Member Function Documentation

◆ 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
idx0 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.

147  {
148  return uid < e->getUid();
149  }
unsigned int uid
Definition: edge.h:43

◆ setDirection()

void LatticeGraph::Edge::setDirection ( int  direction)

Set the direction of the edge.

Parameters
direction1 for n1->n2; -1 for n2->n1; 0 for undirected

◆ setWeight()

void LatticeGraph::Edge::setWeight ( double  weight)

Set the weight of the edge.

Parameters
weight0.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
idxSelects connected vortex. 0 for n1, others for n2
n_newNew vortex at the specified position

Member Data Documentation

◆ uid

unsigned int LatticeGraph::Edge::uid

Definition at line 43 of file edge.h.

Referenced by operator<().


The documentation for this class was generated from the following files: