return edges.size();
}
-/**
- * @param i The index of the back edge to return
- * @returns The CycleNode back-edge indexed by i
- */
-CycleNode * CycleNode::getBackEdge(unsigned int i) const
-{
- return back_edges[i];
-}
-
-/** @returns The number of edges entering this CycleNode */
-unsigned int CycleNode::getNumBackEdges() const
-{
- return back_edges.size();
-}
-
/**
* @brief Remove an element from a vector
* @param v The vector
CycleNode *ret = edges.back();
edges.pop_back();
- vector_remove_node(ret->back_edges, this);
- return ret;
-}
-
-/**
- * @brief Remove a (back) edge from this CycleNode
- * @return The CycleNode which was popped, if one exists; otherwise NULL
- */
-CycleNode * CycleNode::removeBackEdge()
-{
- if (back_edges.empty())
- return NULL;
-
- CycleNode *ret = back_edges.back();
- back_edges.pop_back();
- vector_remove_node(ret->edges, this);
return ret;
}
if (edges[i] == node)
return false;
edges.push_back(node);
- node->back_edges.push_back(this);
return true;
}
bool addEdge(CycleNode *node);
CycleNode * getEdge(unsigned int i) const;
unsigned int getNumEdges() const;
- CycleNode * getBackEdge(unsigned int i) const;
- unsigned int getNumBackEdges() const;
CycleNode * removeEdge();
- CycleNode * removeBackEdge();
bool setRMW(CycleNode *);
CycleNode * getRMW() const;
/** @brief The edges leading out from this node */
SnapVector<CycleNode *> edges;
- /** @brief The edges leading into this node */
- SnapVector<CycleNode *> back_edges;
-
/** Pointer to a RMW node that reads from this node, or NULL, if none
* exists */
CycleNode *hasRMW;