Example #1
0
//
// rooting of tree at edge e
node StaticSPQRTree::rootTreeAt(edge e)
{
	m_rootEdge = e;
	m_rootNode = m_skOf[e]->treeNode();

	m_sk[m_rootNode]->m_referenceEdge = m_copyOf[e];
	rootRec(m_rootNode,nullptr);

	return m_rootNode;
}
Example #2
0
node StaticSPQRTree::rootTreeAt(node v)
{
	m_rootEdge = nullptr;
	m_rootNode = v;

	m_sk[m_rootNode]->m_referenceEdge = nullptr;
	rootRec(m_rootNode,nullptr);

	return m_rootNode;
}
Example #3
0
void StaticSPQRTree::rootRec(node v, edge eFather)
{
	edge e;
	forall_adj_edges(e,v)
	{
		if (e == eFather) continue;

		node w = e->target();
		if (w == v) {
			m_tree.reverseEdge(e);
			swap(m_skEdgeSrc[e],m_skEdgeTgt[e]);
			w = e->target();
		}

		m_sk[w]->m_referenceEdge = m_skEdgeTgt[e];
		rootRec(w,e);
	}
}
Example #4
0
void StaticSPQRTree::rootRec(node v, edge eFather)
{
	for(adjEntry adj : v->adjEntries) {
		edge e = adj->theEdge();

		if (e == eFather) continue;

		node w = e->target();
		if (w == v) {
			m_tree.reverseEdge(e);
			swap(m_skEdgeSrc[e],m_skEdgeTgt[e]);
			w = e->target();
		}

		m_sk[w]->m_referenceEdge = m_skEdgeTgt[e];
		rootRec(w,e);
	}
}