当前位置: 首页>>代码示例>>C++>>正文


C++ TVec::GetVal方法代码示例

本文整理汇总了C++中TVec::GetVal方法的典型用法代码示例。如果您正苦于以下问题:C++ TVec::GetVal方法的具体用法?C++ TVec::GetVal怎么用?C++ TVec::GetVal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TVec的用法示例。


在下文中一共展示了TVec::GetVal方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: if

void TIndex::TQmGixSumMerger<TQmGixItem>::Intrs(TVec<TQmGixItem>& MainV, const TVec<TQmGixItem>& JoinV) const {
    TVec<TQmGixItem> ResV; int ValN1 = 0; int ValN2 = 0;
    while ((ValN1 < MainV.Len()) && (ValN2 < JoinV.Len())) {
        const TQmGixItem& Val1 = MainV.GetVal(ValN1);
        const TQmGixItem& Val2 = JoinV.GetVal(ValN2);
        if (Val1 < Val2) { ValN1++; }
        else if (Val1 > Val2) { ValN2++; }
        else { ResV.Add(TQmGixItem(Val1.Key, Val1.Dat + Val2.Dat)); ValN1++; ValN2++; }
    }
    MainV = ResV;
}
开发者ID:gregorleban,项目名称:Qminer,代码行数:11,代码来源:qminer_core.hpp

示例2: BFSTraversalOneHop

int TMultimodalGraphImplB::BFSTraversalOneHop(const TVec< TPair<TInt,TInt> >& StartingVertices) const {
  int NumVerticesAndEdges = 0;
  for (int i = 0; i < StartingVertices.Len(); i++) {
    TNodeI NI = GetNI(StartingVertices.GetVal(i));
    TIntV AdjacentModes = TIntV(); NI.GetAdjacentModes(AdjacentModes);
    for (int ModeIdx = 0; ModeIdx < AdjacentModes.Len(); ModeIdx++) {
      int ModeId = AdjacentModes.GetVal(ModeIdx);
      for (int e = 0; e < NI.GetOutDeg(ModeId); e++) {
        NumVerticesAndEdges += NI.GetOutNId(e, ModeId);
      }
    }
  }
  return NumVerticesAndEdges;
}
开发者ID:deepakn94,项目名称:snap-dev,代码行数:14,代码来源:multimodalGraphImplB.cpp

示例3: ConvertToImplC

PMultimodalGraphImplC TMultimodalGraphImplB::ConvertToImplC() const {
  PMultimodalGraphImplC G = TMultimodalGraphImplC::New();
  for (TNodeI NI = BegNI(); NI < EndNI(); NI++) {
    G->AddNode(TPair<TInt,TInt>(NI.GetModeId(), NI.GetId()));
  }

  for (TNodeI NI = BegNI(); NI < EndNI(); NI++) {
    int OutDeg = NI.GetOutDeg();
    int InDeg = NI.GetInDeg();
    G->ReserveInAndOutNIdV(TPair<TInt,TInt>(NI.GetModeId(), NI.GetId()), OutDeg, InDeg);
    TVec<TInt> AdjacentModes = TVec<TInt>(); NI.GetAdjacentModes(AdjacentModes);
    for (int i = 0; i < AdjacentModes.Len(); i++) {
      int AdjacentMode = AdjacentModes.GetVal(i);
      TPair<TInt,TInt> ModeIdsKey = GetModeIdsKey(NI.GetModeId(), AdjacentMode);
      G->AddOutNIds(TPair<TInt,TInt>(NI.GetModeId(),NI.GetId()), Graphs.GetDat(ModeIdsKey).GetOutNId(NI.GetId()), AdjacentMode);
      G->AddInNIds(TPair<TInt,TInt>(NI.GetModeId(),NI.GetId()), Graphs.GetDat(ModeIdsKey).GetInNId(NI.GetId()), AdjacentMode);
    }
  }
  return G;
}
开发者ID:deepakn94,项目名称:snap-dev,代码行数:20,代码来源:multimodalGraphImplB.cpp

示例4: GetSmallGraph

PMultimodalGraphImplB TMultimodalGraphImplB::GetSmallGraph() {
  PMultimodalGraphImplB G = TMultimodalGraphImplB::New();
  TVec< TPair<TInt,TInt> > Nodes = TVec< TPair<TInt,TInt> >();
  for (int i = 0; i < 5; i++) { Nodes.Add(G->AddNode(0)); }
  for (int i = 0; i < 5; i++) { Nodes.Add(G->AddNode(1)); }
  G->AddEdge(Nodes.GetVal(0),Nodes.GetVal(1)); G->AddEdge(Nodes.GetVal(1),Nodes.GetVal(2));
  G->AddEdge(Nodes.GetVal(0),Nodes.GetVal(2)); G->AddEdge(Nodes.GetVal(1),Nodes.GetVal(3));
  G->AddEdge(Nodes.GetVal(3),Nodes.GetVal(4)); G->AddEdge(Nodes.GetVal(2),Nodes.GetVal(3));
  G->AddEdge(Nodes.GetVal(2),Nodes.GetVal(6)); G->AddEdge(Nodes.GetVal(4), Nodes.GetVal(8));
  G->AddEdge(Nodes.GetVal(5),Nodes.GetVal(6)); G->AddEdge(Nodes.GetVal(5),Nodes.GetVal(7));
  G->AddEdge(Nodes.GetVal(6),Nodes.GetVal(7)); G->AddEdge(Nodes.GetVal(6),Nodes.GetVal(9));
  G->AddEdge(Nodes.GetVal(6),Nodes.GetVal(8)); G->AddEdge(Nodes.GetVal(8),Nodes.GetVal(9));
  G->AddEdge(Nodes.GetVal(9),Nodes.GetVal(2)); G->AddEdge(Nodes.GetVal(5),Nodes.GetVal(0));
  G->DelNode(Nodes.GetVal(0));
  return G;
}
开发者ID:deepakn94,项目名称:snap-dev,代码行数:16,代码来源:multimodalGraphImplB.cpp


注:本文中的TVec::GetVal方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。