本文整理汇总了C++中Flow::deleteEdges方法的典型用法代码示例。如果您正苦于以下问题:C++ Flow::deleteEdges方法的具体用法?C++ Flow::deleteEdges怎么用?C++ Flow::deleteEdges使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Flow
的用法示例。
在下文中一共展示了Flow::deleteEdges方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: reduceNode
int CFAnalysis::reduceNode(Flow& flow, Label lab) {
Flow inFlow=flow.inEdges(lab);
Flow outFlow=flow.outEdges(lab);
/* description of essential operations:
* inedges: (n_i,b)
* outedge: (b,n2)
* remove(n_i,b)
* remove(b,n2)
* insert(n1,n2)
*/
if(inFlow.size()==0 && outFlow.size()==0)
return 0;
if(inFlow.size()==0 || outFlow.size()==0) {
Flow edges=inFlow+outFlow;
flow.deleteEdges(edges);
return 1;
}
for(Flow::iterator initer=inFlow.begin();initer!=inFlow.end();++initer) {
for(Flow::iterator outiter=outFlow.begin();outiter!=outFlow.end();++outiter) {
Edge e1=*initer;
Edge e2=*outiter;
Edge newEdge=Edge(e1.source,e1.types(),e2.target);
flow.erase(e1);
flow.erase(e2);
flow.insert(newEdge);
}
}
return 1;
}
示例2: deleteFunctionCallLocalEdges
size_t CFAnalysis::deleteFunctionCallLocalEdges(Flow& flow) {
return flow.deleteEdges(EDGE_LOCAL);
}