5   TInt SIdx = P->GetColIdx(C1); 
 
    6   TInt DIdx = P->GetColIdx(C2); 
 
    7   TInt StIdx = P->GetColIdx(C3); 
 
    8   TInt DuIdx = P->GetColIdx(C4); 
 
   14   P->ReadIntCol(C1,Source);
 
   17   for (
TRowIterator RI = P->BegRI(); RI < P-> EndRI(); RI++) {
 
   18     Graph->AddNode(RI.GetRowIdx().Val);
 
   19     MapV.
Add(RI.GetRowIdx());
 
   22   for (
TRowIterator OI = P->BegRI(); OI < P->EndRI(); OI++) {
 
   23     int OIdx = OI.GetRowIdx().Val;
 
   24     int ODest = P->GetIntValAtRowIdx(DIdx,OIdx).Val;
 
   25     int OStart = P->GetIntValAtRowIdx(StIdx,OIdx).Val;
 
   26     int ODur = P->GetIntValAtRowIdx(DuIdx,OIdx).Val;
 
   30     int hi = Source.
Len() - 1;
 
   33       int mid = lo + (hi - lo)/2;
 
   34       if (Source.
GetVal(mid) > val) { hi = mid - 1;}
 
   35       else if (Source.
GetVal(mid) < val) { lo = mid + 1;}
 
   36       else { index = mid; hi = mid - 1;}
 
   43     for(
int i = BIdx; i < Source.
Len(); i++) {
 
   44       int InIdx = MapV.
GetVal(i).Val;
 
   45       if (InIdx == OIdx) {
continue;}
 
   46       int InSource = P->GetIntValAtRowIdx(SIdx,InIdx).Val;
 
   47       int InStart = P->GetIntValAtRowIdx(StIdx,InIdx).Val;
 
   48       if (InSource != ODest) { 
break;}
 
   49       if (InStart >= (ODur + OStart) && InStart - (ODur + OStart) <= W.
Val) {
 
   50         if (!Graph->IsEdge(OIdx,InIdx)) {
 
   51           Graph->AddEdge(OIdx,InIdx);
 
   61   TInt SIdx = P->GetColIdx(C1); 
 
   62   TInt DIdx = P->GetColIdx(C2); 
 
   63   TInt StIdx = P->GetColIdx(C3); 
 
   64   TInt DuIdx = P->GetColIdx(C4); 
 
   70   P->ReadIntCol(C3,Start);
 
   73   for (
TRowIterator RI = P->BegRI(); RI < P-> EndRI(); RI++) {
 
   74     Graph->AddNode(RI.GetRowIdx().Val);
 
   75     MapV.
Add(RI.GetRowIdx());
 
   78   for (
TRowIterator OI = P->BegRI(); OI < P->EndRI(); OI++) {
 
   79     int OIdx = OI.GetRowIdx().Val;
 
   80     int ODest = P->GetIntValAtRowIdx(DIdx,OIdx).Val;
 
   81     int OStart = P->GetIntValAtRowIdx(StIdx,OIdx).Val;
 
   82     int ODur = P->GetIntValAtRowIdx(DuIdx,OIdx).Val;
 
   84     int val = OStart + ODur;
 
   86     int hi = Start.
Len() - 1;
 
   90       int mid = lo + (hi - lo)/2;
 
   91       if (Start.
GetVal(mid) > val) {
 
   92         if ((mid-1) >= lo  &&  Start.
GetVal(mid - 1) < val) {
 
   93           index = mid - 1;
break;
 
   97       else if (Start.
GetVal(mid) < val) {
 
   98         if (mid + 1 <= hi  &&  Start.
GetVal(mid + 1) > val) {
 
  103       else { index = mid; hi = mid - 1;}
 
  110     for(
int i = BIdx; i < Start.
Len(); i++) {
 
  111       int InIdx = MapV.
GetVal(i).Val;
 
  112       if (InIdx == OIdx) {
continue;}
 
  113       int InSource = P->GetIntValAtRowIdx(SIdx,InIdx).Val;
 
  114       int InStart = P->GetIntValAtRowIdx(StIdx,InIdx).Val;
 
  115       if (InStart - (ODur + OStart) > W.
Val) { 
break;}
 
  116       if (InSource == ODest && InStart >= (ODur + OStart)) {
 
  117         if (!Graph->IsEdge(OIdx,InIdx)) {
 
  118           Graph->AddEdge(OIdx,InIdx);
 
  137   TInt SIdx = P->GetColIdx(C1);
 
  138   TInt DIdx = P->GetColIdx(C2);
 
  139   TInt StIdx = P->GetColIdx(C3);
 
  140   TInt DuIdx = P->GetColIdx(C4);
 
  146   for (
TRowIterator RI = P->BegRI(); RI < P-> EndRI(); RI++) {
 
  147     MapV.
Add(RI.GetRowIdx());
 
  151   P->StoreIntCol(
"Physical",PhyV);
 
  152   TInt PIdx = P->GetColIdx(
"Physical");
 
  155     if (NI.GetInDeg() != 0) { 
continue;}
 
  159     TInt NId = NI.GetId();
 
  162     CurCasc.
Add(P->GetIntValAtRowIdx(PIdx,NId));
 
  163     while (! EventQ.
Empty()) {
 
  167       for (
int e = 0; e < CNI.
GetOutDeg(); e++) {
 
  169         if ( !VisitedH.
IsKey(CId)) {
 
  172           CurCasc.
Add(P->GetIntValAtRowIdx(PIdx,CId));
 
  178     if (Print && VisitedH.
Len() > 1) {
 
  179       printf(
"__casacade__\t%d\n",VisitedH.
Len());
 
  183       if (Print && VisitedH.
Len() > 1) {
 
  184         int PIdx = MapV.
GetVal(VI->Val).Val;
 
  185         int PSource = P->GetIntValAtRowIdx(SIdx,PIdx).Val;
 
  186         int PDest = P->GetIntValAtRowIdx(DIdx,PIdx).Val;
 
  187         int PStart = P->GetIntValAtRowIdx(StIdx,PIdx).Val;    
 
  188         int PDur = P->GetIntValAtRowIdx(DuIdx,PIdx).Val;
 
  189         printf(
"%d\t%d\t%d\t%d\t%d\n",PIdx,PSource,PDest,PStart,PDur);
 
  192     if (ToAddV.
Len() > 1) {
 
  193       TopCascVV.
Add(ToAddV);
 
  202   TInt SIdx = P->GetColIdx(C1);
 
  203   TInt DIdx = P->GetColIdx(C2);
 
  204   TInt StIdx = P->GetColIdx(C3);
 
  205   TInt DuIdx = P->GetColIdx(C4);
 
  211   for (
TRowIterator RI = P->BegRI(); RI < P-> EndRI(); RI++) {
 
  212     MapV.
Add(RI.GetRowIdx());
 
  215   P->StoreIntCol(
"Physical",PhyV);
 
  216   TInt PIdx = P->GetColIdx(
"Physical");
 
  219     if (NI.GetInDeg() == 0) { GNodeV.
Add(NI.GetId()); }
 
  222   #pragma omp parallel private(ThTopCascVV) num_threads(10) 
  224     #pragma omp for schedule(dynamic,1000) 
  225     for (
int i = 0; i < GNodeV.
Len(); i++) {
 
  229       TInt NId = GNodeV[i];
 
  232       CurCasc.
Add(P->GetIntValAtRowIdx(PIdx,NId));
 
  233       while (! EventQ.
Empty()) {
 
  237         for (
int e = 0; e < CNI.
GetOutDeg(); e++) {
 
  239           if ( !VisitedH.
IsKey(CId)) {
 
  242             CurCasc.
Add(P->GetIntValAtRowIdx(PIdx,CId));
 
  251       if (ToAddV.
Len() > 1) { ThTopCascVV.
Add(ToAddV);}  
 
  255       for (
int j = 0; j < ThTopCascVV.
Len(); j++) {
 
  256         TopCascVV.
Add(ThTopCascVV[j]);
 
Main namespace for all the Snap global entities. 
 
TIter EndI() const 
Returns an iterator referring to the past-the-end element in the vector. 
 
static PNGraph New()
Static constructor that returns a pointer to the graph. Call: PNGraph Graph = TNGraph::New(). 
 
void CascFind(PNGraph Graph, PTable P, const TStr C1, const TStr C2, const TStr C3, const TStr C4, TVec< TIntV > &TopCascVV, bool Print)
Takes as input a directed graph and returns all the top cascades in TopCascVV. 
 
TSizeTy Len() const 
Returns the number of elements in the vector. 
 
bool IsKey(const TKey &Key) const 
 
void Pop()
Removes the first element from the queue. 
 
bool Empty() const 
Tests whether the queue is empty (contains no elements). 
 
Iterator class for TTable rows. 
 
PNGraph CascGraphSource(PTable P, const TStr C1, const TStr C2, const TStr C3, const TStr C4, const TInt W)
Takes as input the column names of the PTable P as C1, C2,C3 and C4 and returns a directed graph of W...
 
const TVal & GetVal(const TSizeTy &ValN) const 
Returns a reference to the element at position ValN in the vector. 
 
void Sort(const bool &Asc=true)
Sorts the elements of the vector. 
 
int AddKey(const TKey &Key)
 
PNGraph CascGraphTime(PTable P, const TStr C1, const TStr C2, const TStr C3, const TStr C4, const TInt W)
Takes as input the column names of the PTable P as C1, C2,C3 and C4 and returns a directed graph of W...
 
PNGraph CascGraph(PTable P, const TStr C1, const TStr C2, const TStr C3, const TStr C4, const TInt W, bool SortParam)
Takes as input the column names of the PTable P as C1, C2, C3 and C4 and returns a directed graph of ...
 
int GetOutDeg() const 
Returns out-degree of the current node. 
 
void CascFindMP(PNGraph Graph, PTable P, const TStr C1, const TStr C2, const TStr C3, const TStr C4, TVec< TIntV > &TopCascVV)
Parallel implementaion of CascFind takes as input a directed graph and returns all the top cascades i...
 
TIter BegI() const 
Returns an iterator pointing to the first element in the vector. 
 
void Push(const TVal &Val)
Adds an element at the end of the queue. 
 
Node iterator. Only forward iteration (operator++) is supported. 
 
Fast Queue used by the TBreathFS (uses memcpy to move objects TVal around). 
 
const TVal & Top() const 
Returns the value of the first element in the queue, but does not remove the element. 
 
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element. 
 
int GetOutNId(const int &NodeN) const 
Returns ID of NodeN-th out-node (the node the current node points to). 
 
Vector is a sequence TVal objects representing an array that can change in size.