18 #ifndef LATTICEGRAPH_LATTICE_H 19 #define LATTICEGRAPH_LATTICE_H 34 std::vector <std::shared_ptr <Node> > vortices;
35 std::vector <std::shared_ptr <Edge> > edges;
56 std::vector <std::shared_ptr <Node> > &
getVortices();
62 std::vector <std::shared_ptr <Edge> > &
getEdges();
144 void setVortex(
unsigned int idx, std::shared_ptr<Node> n);
151 void setEdge(
unsigned int idx, std::shared_ptr<Edge> e);
166 void addEdge(std::shared_ptr<Edge> e);
173 void addEdge(std::shared_ptr<Node> n1, std::shared_ptr<Node> n2);
181 void addEdge(std::shared_ptr<Edge> e, std::shared_ptr<Node> n1, std::shared_ptr<Node> n2);
212 void removeEdge(std::shared_ptr<Node> n1, std::shared_ptr<Node> n2);
247 void createVortex(
double posx,
double posy,
int winding);
305 void swapIdxUid(
unsigned int uid1,
unsigned int uid2);
312 void swapIdx(
unsigned int idx1,
unsigned int idx2);
323 std::weak_ptr<Edge>
isConnected(std::shared_ptr<Node> n1, std::shared_ptr<Node> n2);
326 #endif //LATTICEGRAPH_LATTICE_H void createVortex(double posx, double posy, int winding)
Create a vortex at specified location with given winding.
Allow vortex to be treated as node in a graph.
std::vector< std::shared_ptr< Node > > & getVortices()
Returns the vectors for vortices.
void removeEdgeIdx(unsigned int idx)
Remove edge from the lattice based index idx.
unsigned int getEdgeIdxUid(unsigned int uid)
Returns edge index based on UID.
void swapIdxUid(unsigned int uid1, unsigned int uid2)
Swap the elements at indices based on UID uid1 and uid2.
~Lattice()
Makes stuff anti-exist.
void genAdjMat(unsigned int *mat)
Output adjacency matrix.
std::shared_ptr< Node > getVortexIdx(unsigned int idx)
Returns vortex specified at index idx.
Lattice()
Makes stuff exist.
void removeEdgeUid(unsigned int uid)
Remove edge from the lattice based on UID uid.
Vortex lattice position, orientation, and tracking.
void removeEdges(std::shared_ptr< Node > n1)
Remove all edges from vortex.
void removeVortex(std::shared_ptr< Node > n)
Remove vortex n from the lattice.
void removeVortexUid(unsigned int uid)
Remove vortex from the lattice based on UID uid.
void addVortex(std::shared_ptr< Node > n)
Add vortex (node) to the lattice (graph).
unsigned int getVortexIdxUid(unsigned int uid)
Returns vortex index based on UID.
std::vector< std::shared_ptr< Edge > > & getEdges()
Returns the edges for edges.
void setVortex(unsigned int idx, std::shared_ptr< Node > n)
Set vortex (node) at a specific position.
void removeVortexIdx(unsigned int idx)
Remove vortex from the lattice based on index idx.
std::shared_ptr< Edge > getEdgeUid(unsigned int uid)
Returns edge based on UID.
void adjMatMtca(unsigned int *mat)
Format adjacency matrix with Mathematica-friendly output.
void swapIdx(unsigned int idx1, unsigned int idx2)
Swap the elements at indices idx1 and idx2.
std::shared_ptr< Edge > getEdgeIdx(unsigned int idx)
Returns edge specified at index idx.
void createEdges(unsigned int radius)
Generate edges between vortices closer than int radius.
void removeEdge(std::shared_ptr< Node > n1, std::shared_ptr< Node > n2)
Remove edge between n1 and n2 from the lattice.
double getVortexDistance(std::shared_ptr< Node > n1, std::shared_ptr< Node > n2)
Calculates distance between vortices.
std::weak_ptr< Edge > isConnected(std::shared_ptr< Node > n1, std::shared_ptr< Node > n2)
Checks if vortex n1 and n2 are connected.
Y Y range of points % radius
void addEdge(std::shared_ptr< Edge > e)
Add edge e to the lattice (graph). Assumes edge has nodes already.
double getVortexDistanceD(std::shared_ptr< Node > n1, std::shared_ptr< Node > n2)
Calculates distance between vortices.
% Prealloc may improve speed here end save Ek mat
std::shared_ptr< Node > getVortexUid(unsigned int uid)
Returns vortex based on UID.
void destroyVortex(unsigned int uid)
Destroy a vortex with UID uid.
Class for creating edges between adjacent vortices in graph.
void setEdge(unsigned int idx, std::shared_ptr< Edge > e)
Set edge at a specific position.