本文整理汇总了C++中adjEntry::cyclicPred方法的典型用法代码示例。如果您正苦于以下问题:C++ adjEntry::cyclicPred方法的具体用法?C++ adjEntry::cyclicPred怎么用?C++ adjEntry::cyclicPred使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类adjEntry
的用法示例。
在下文中一共展示了adjEntry::cyclicPred方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: call
// computes the leftist canonical order. Requires that G is simple, triconnected and embedded.
// adj_v1n is the adjEntry at v_1 looking towards v_n, the outerface is choosen such that v_2 is the cyclic pred
// of v_n. the result is saved in result, a list of list of nodes, first set is v_1, v_2, last one is v_n.
bool LeftistOrdering::call(const Graph& G, adjEntry adj_v1n, List<List<node> >& result)
{
// init the is marked array for all adj entries
m_marked.init(G, false);
// v1 -> v_n edge
adjEntry adj_v12 = adj_v1n->cyclicPred();
// the node v_n
node v_n = adj_v1n->twinNode();
// init all the node related arrays
m_cutFaces.init(G, 0);
m_cutEdges.init(G, 0);
m_cutFaces[v_n] = 1;
// mark v_1 -> v_n
m_marked[adj_v12] = true;
m_marked[adj_v12->twin()] = true;
// initial candidate for the belt
Candidate v12_candidate;
v12_candidate.chain.pushBack(adj_v12->twin()); // edge 2->1
v12_candidate.chain.pushBack(adj_v12); // edge 1->2
v12_candidate.chain.pushBack(adj_v12->twin()); // edge 2->1
v12_candidate.stopper = nullptr;
// init the belt
m_belt.pushBack(v12_candidate);
// init the candidate variable
// we us an iterator here to keep things simple
m_currCandidateIt = m_belt.begin();
// while the belt contains some candidates
while (!m_belt.empty())
{
// the next partition
List<node> P_k;
// get the next leftmost feasible candidate
if (!leftmostFeasibleCandidate(P_k))
return false;
// update the belt
updateBelt();
// save the result.
result.pushBack(P_k);
}
// thats it we are done
return true;
}
示例2: splitNode
node CombinatorialEmbedding::splitNode(adjEntry adjStartLeft, adjEntry adjStartRight)
{
face fL = leftFace(adjStartLeft);
face fR = leftFace(adjStartRight);
node u = m_pGraph->splitNode(adjStartLeft,adjStartRight);
adjEntry adj = adjStartLeft->cyclicPred();
m_rightFace[adj] = fL;
++fL->m_size;
m_rightFace[adj->twin()] = fR;
++fR->m_size;
OGDF_ASSERT_IF(dlConsistencyChecks, consistencyCheck());
return u;
}