41 #ifndef UNDIRECTEDVERTEX_H_
42 #define UNDIRECTEDVERTEX_H_
54 template<
typename V,
typename E>
84 virtual void adjacent(std::vector<V*>& out);
87 virtual void edges(
EdgeType type , std::vector<boost::shared_ptr<E> >& out);
96 template<
typename V,
typename E>
98 adjMap =
new AdjListMap();
101 template<
typename V,
typename E>
102 UndirectedVertex<V,E>::~UndirectedVertex() {
106 template<
typename V,
typename E>
111 template<
typename V,
typename E>
113 boost::shared_ptr<E> ret;
114 AdjListMapIterator iter = adjMap->find(other);
115 return (iter != adjMap->end() ? iter->second : ret);
118 template<
typename V,
typename E>
120 (*adjMap)[other] = edge;
123 template<
typename V,
typename E>
125 this->getItems(adjMap, out);
128 template<
typename V,
typename E>
130 this->getItems(adjMap, out);
133 template<
typename V,
typename E>
135 this->getItems(adjMap, out);
138 template<
typename V,
typename E>
140 return adjMap->size();
143 template<
typename V,
typename E>
145 return adjMap->size();
148 template<
typename V,
typename E>
virtual boost::shared_ptr< E > removeEdge(Vertex *other, EdgeType type)=0
Removes the edge of the specified type between this Vertex and the specified Vertex.
virtual void edges(EdgeType type, std::vector< boost::shared_ptr< E > > &out)=0
Gets all the edges of the specified type in which this Vertex participates and return them in out.
virtual boost::shared_ptr< E > findEdge(Vertex< V, E > *other, EdgeType type)
Finds the edge of the specified type between this Vertex and the specified vertex.
Definition: UndirectedVertex.h:112
virtual void addEdge(Vertex< V, E > *other, boost::shared_ptr< E > edge, EdgeType type)
Adds an edge of the specified type between this Vertex and the specified vertex.
Definition: UndirectedVertex.h:119
virtual void adjacent(std::vector< V * > &out)
Gets the Vertices adjacent to this Vertex.
Definition: UndirectedVertex.h:134
virtual void predecessors(std::vector< V * > &out)
Gets the predecessors of this Vertex.
Definition: UndirectedVertex.h:129
virtual void successors(std::vector< V * > &out)
Gets the successors of this Vertex.
Definition: UndirectedVertex.h:124
Used internally by repast graphs / networks to encapsulate Vertices.
Definition: Vertex.h:52
A vertex in an undirected network.
Definition: UndirectedVertex.h:55
boost::unordered_map< Vertex< V, E > *, boost::shared_ptr< E >, HashVertex< V, E > > AdjListMap
Typedef for the adjacency list map that contains the other Vertices that this Vertex links to.
Definition: Vertex.h:92
virtual void edges(EdgeType type, std::vector< boost::shared_ptr< E > > &out)
Gets all the edges of the specified type in which this Vertex participates and return them in out.
Definition: UndirectedVertex.h:149
int inDegree()
Gets the in degree of this Vertex.
Definition: UndirectedVertex.h:139
int outDegree()
Gets the out degree of this Vertex.
Definition: UndirectedVertex.h:144
boost::shared_ptr< V > item() const
Gets the item that this Vertex contains.
Definition: Vertex.h:192
EdgeType
Enum the identifies whether an edge is incoming or outgoing.
Definition: Vertex.h:98
virtual boost::shared_ptr< E > removeEdge(Vertex< V, E > *other, EdgeType type)
Removes the edge of the specified type between this Vertex and the specified Vertex.
Definition: UndirectedVertex.h:107