本文整理汇总了C++中THash::DelKey方法的典型用法代码示例。如果您正苦于以下问题:C++ THash::DelKey方法的具体用法?C++ THash::DelKey怎么用?C++ THash::DelKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类THash
的用法示例。
在下文中一共展示了THash::DelKey方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DelIfSockTimer
void TSockSys::DelIfSockTimer(const uint64& SockId) {
if (SockIdToTimerHndH.IsKey(SockId)) {
// get timer handle
uv_timer_t* TimerHnd = SockIdToTimerHndH.GetDat(SockId);
// stop the timer
uv_timer_stop(TimerHnd);
// remove shortcuts
SockIdToTimerHndH.DelKey(SockId);
TimerHndToSockIdH.DelKey((uint64)TimerHnd);
// remove shortcuts
}
}
示例2: MergeBestQ
bool MergeBestQ() {
const TFltIntIntTr TopQ = FindMxQEdge();
if (TopQ.Val1 <= 0.0) { return false; }
// joint communities
const int I = TopQ.Val3;
const int J = TopQ.Val2;
CmtyIdUF.Union(I, J); // join
Q += TopQ.Val1;
TCmtyDat& DatJ = CmtyQH.GetDat(J);
{ TCmtyDat& DatI = CmtyQH.GetDat(I);
DatI.DelLink(J); DatJ.DelLink(I);
for (int i = -1; DatJ.NIdQH.FNextKeyId(i); ) {
const int K = DatJ.NIdQH.GetKey(i);
TCmtyDat& DatK = CmtyQH.GetDat(K);
double NewQ = DatJ.NIdQH[i];
if (DatI.NIdQH.IsKey(K)) { NewQ = NewQ+DatI.NIdQH.GetDat(K); DatK.DelLink(I); } // K connected to I and J
else { NewQ = NewQ-2*DatI.DegFrac*DatK.DegFrac; } // K connected to J not I
DatJ.AddQ(K, NewQ);
DatK.AddQ(J, NewQ);
MxQHeap.PushHeap(TFltIntIntTr(NewQ, TMath::Mn(J,K), TMath::Mx(J,K)));
}
for (int i = -1; DatI.NIdQH.FNextKeyId(i); ) {
const int K = DatI.NIdQH.GetKey(i);
if (! DatJ.NIdQH.IsKey(K)) { // K connected to I not J
TCmtyDat& DatK = CmtyQH.GetDat(K);
const double NewQ = DatI.NIdQH[i]-2*DatJ.DegFrac*DatK.DegFrac;
DatJ.AddQ(K, NewQ);
DatK.DelLink(I);
DatK.AddQ(J, NewQ);
MxQHeap.PushHeap(TFltIntIntTr(NewQ, TMath::Mn(J,K), TMath::Mx(J,K)));
}
}
DatJ.DegFrac += DatI.DegFrac; }
if (DatJ.NIdQH.Empty()) { CmtyQH.DelKey(J); } // isolated community (done)
CmtyQH.DelKey(I);
return true;
}