Example #1
0
// add a node with a list of neighbors
// (use TNGraphMP::IsOk to check whether the graph is consistent)
void TNEANetMP::AddNodeWithEdges(const TInt& NId, TIntV& InEIdV, TIntV& OutEIdV) {
    int NodeIdx = abs((NId.GetPrimHashCd()) % Reserved());
    int NodeKeyId = NodeH.AddKey13(NodeIdx, NId);
    NodeH[NodeKeyId] = TNode(NId);
    NodeH[NodeKeyId].InEIdV.MoveFrom(InEIdV);
    NodeH[NodeKeyId].OutEIdV.MoveFrom(OutEIdV);
}
Example #2
0
void TNEANetMP::AddEdgeUnchecked(const TInt& EId, const int SrcNId, const int DstNId) {
    int Idx = abs((EId.GetPrimHashCd()) % ReservedE());
    int KeyId = EdgeH.AddKey13(Idx, EId);
    EdgeH[KeyId] = TEdge(EId, SrcNId, DstNId);
}
Example #3
0
void TUStr::UpdateHashCd(const TInt& UnicodeChar){
	this->PrimHash  = (this->PrimHash * 37) + UnicodeChar.GetPrimHashCd();
	this->SecondHash  = (this->SecondHash * 37) + UnicodeChar.GetSecHashCd();
}