本文整理汇总了C++中TIntSet::AddKeyV方法的典型用法代码示例。如果您正苦于以下问题:C++ TIntSet::AddKeyV方法的具体用法?C++ TIntSet::AddKeyV怎么用?C++ TIntSet::AddKeyV使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TIntSet
的用法示例。
在下文中一共展示了TIntSet::AddKeyV方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetCPMCommunities
/// Clique Percolation method communities
void TCliqueOverlap::GetCPMCommunities(const PUNGraph& G, int MinMaxCliqueSize, TVec<TIntV>& NIdCmtyVV) {
printf("Clique Percolation Method\n");
TExeTm ExeTm;
TVec<TIntV> MaxCliques;
TCliqueOverlap::GetMaxCliques(G, MinMaxCliqueSize, MaxCliques);
// op RS 2012/05/15, commented out next line, a parameter is missing,
// creating a warning on OS X
// printf("...%d cliques found\n");
// get clique overlap matrix (graph)
PUNGraph OverlapGraph = TCliqueOverlap::CalculateOverlapMtx(MaxCliques, MinMaxCliqueSize-1);
printf("...overlap matrix (%d, %d)\n", G->GetNodes(), G->GetEdges());
// connected components are communities
TCnComV CnComV;
TSnap::GetWccs(OverlapGraph, CnComV);
NIdCmtyVV.Clr(false);
TIntSet CmtySet;
for (int c = 0; c < CnComV.Len(); c++) {
CmtySet.Clr(false);
for (int i = 0; i <CnComV[c].Len(); i++) {
const TIntV& CliqueNIdV = MaxCliques[CnComV[c][i]];
CmtySet.AddKeyV(CliqueNIdV);
}
NIdCmtyVV.Add();
CmtySet.GetKeyV(NIdCmtyVV.Last());
NIdCmtyVV.Last().Sort();
}
printf("done [%s].\n", ExeTm.GetStr());
}