SNAP Library 6.0, Developer Reference  2020-12-09 16:24:20
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
ThreeTEdgeStarCounter Class Reference

#include <temporalmotifs.h>

Inheritance diagram for ThreeTEdgeStarCounter:
Collaboration diagram for ThreeTEdgeStarCounter:

Public Member Functions

 ThreeTEdgeStarCounter (int max_nodes)
 
int PreCount (int dir1, int dir2, int dir3)
 
int PosCount (int dir1, int dir2, int dir3)
 
int MidCount (int dir1, int dir2, int dir3)
 
- Public Member Functions inherited from StarTriad3TEdgeCounter< StarEdgeData >
 StarTriad3TEdgeCounter ()
 
void Count (const TVec< StarEdgeData > &events, const TIntV &timestamps, double delta)
 

Protected Member Functions

void InitializeCounters ()
 
void PopPre (const StarEdgeData &event)
 
void PopPos (const StarEdgeData &event)
 
void PushPre (const StarEdgeData &event)
 
void PushPos (const StarEdgeData &event)
 
void ProcessCurrent (const StarEdgeData &event)
 

Private Attributes

int max_nodes_
 
Counter2D pre_sum_
 
Counter2D pos_sum_
 
Counter2D mid_sum_
 
Counter3D pre_counts_
 
Counter3D pos_counts_
 
Counter3D mid_counts_
 
Counter2D pre_nodes_
 
Counter2D pos_nodes_
 

Detailed Description

Definition at line 235 of file temporalmotifs.h.

Constructor & Destructor Documentation

ThreeTEdgeStarCounter::ThreeTEdgeStarCounter ( int  max_nodes)
inline

Definition at line 240 of file temporalmotifs.h.

240 : max_nodes_(max_nodes) {}

Member Function Documentation

void ThreeTEdgeStarCounter::InitializeCounters ( )
protectedvirtual
int ThreeTEdgeStarCounter::MidCount ( int  dir1,
int  dir2,
int  dir3 
)
inline

Definition at line 245 of file temporalmotifs.h.

References mid_counts_.

Referenced by TempMotifCounter::Count3TEdge3NodeStars().

245 { return mid_counts_(dir1, dir2, dir3); }

Here is the caller graph for this function:

void ThreeTEdgeStarCounter::PopPos ( const StarEdgeData event)
protectedvirtual

Implements StarTriad3TEdgeCounter< StarEdgeData >.

Definition at line 653 of file temporalmotifs.cpp.

References pos_nodes_, and pos_sum_.

653  {
654  int nbr = event.nbr;
655  int dir = event.dir;
656  pos_nodes_(dir, nbr) -= 1;
657  for (int i = 0; i < 2; i++) { pos_sum_(dir, i) -= pos_nodes_(i, nbr); }
658 }
void ThreeTEdgeStarCounter::PopPre ( const StarEdgeData event)
protectedvirtual

Implements StarTriad3TEdgeCounter< StarEdgeData >.

Definition at line 646 of file temporalmotifs.cpp.

References pre_nodes_, and pre_sum_.

646  {
647  int nbr = event.nbr;
648  int dir = event.dir;
649  pre_nodes_(dir, nbr) -= 1;
650  for (int i = 0; i < 2; i++) { pre_sum_(dir, i) -= pre_nodes_(i, nbr); }
651 }
int ThreeTEdgeStarCounter::PosCount ( int  dir1,
int  dir2,
int  dir3 
)
inline

Definition at line 244 of file temporalmotifs.h.

References pos_counts_.

Referenced by TempMotifCounter::Count3TEdge3NodeStars().

244 { return pos_counts_(dir1, dir2, dir3); }

Here is the caller graph for this function:

int ThreeTEdgeStarCounter::PreCount ( int  dir1,
int  dir2,
int  dir3 
)
inline

Definition at line 243 of file temporalmotifs.h.

References pre_counts_.

Referenced by TempMotifCounter::Count3TEdge3NodeStars().

243 { return pre_counts_(dir1, dir2, dir3); }

Here is the caller graph for this function:

void ThreeTEdgeStarCounter::ProcessCurrent ( const StarEdgeData event)
protectedvirtual

Implements StarTriad3TEdgeCounter< StarEdgeData >.

Definition at line 674 of file temporalmotifs.cpp.

References mid_counts_, mid_sum_, pos_counts_, pos_nodes_, pos_sum_, pre_counts_, pre_nodes_, and pre_sum_.

674  {
675  int nbr = event.nbr;
676  int dir = event.dir;
677  // Decrement middle sum
678  for (int i = 0; i < 2; i++) { mid_sum_(i, dir) -= pre_nodes_(i, nbr); }
679  // Update counts
680  for (int i = 0; i < 2; i++) {
681  for (int j = 0; j < 2; j++) {
682  pre_counts_(i, j, dir) += pre_sum_(i, j);
683  pos_counts_(dir, i, j) += pos_sum_(i, j);
684  mid_counts_(i, dir, j) += mid_sum_(i, j);
685  }
686  }
687  // Increment middle sum
688  for (int i = 0; i < 2; i++) { mid_sum_(dir, i) += pos_nodes_(i, nbr); }
689 }
void ThreeTEdgeStarCounter::PushPos ( const StarEdgeData event)
protectedvirtual

Implements StarTriad3TEdgeCounter< StarEdgeData >.

Definition at line 667 of file temporalmotifs.cpp.

References pos_nodes_, and pos_sum_.

667  {
668  int nbr = event.nbr;
669  int dir = event.dir;
670  for (int i = 0; i < 2; i++) { pos_sum_(i, dir) += pos_nodes_(i, nbr); }
671  pos_nodes_(dir, nbr) += 1;
672 }
void ThreeTEdgeStarCounter::PushPre ( const StarEdgeData event)
protectedvirtual

Implements StarTriad3TEdgeCounter< StarEdgeData >.

Definition at line 660 of file temporalmotifs.cpp.

References pre_nodes_, and pre_sum_.

660  {
661  int nbr = event.nbr;
662  int dir = event.dir;
663  for (int i = 0; i < 2; i++) { pre_sum_(i, dir) += pre_nodes_(i, nbr); }
664  pre_nodes_(dir, nbr) += 1;
665 }

Member Data Documentation

int ThreeTEdgeStarCounter::max_nodes_
private

Definition at line 256 of file temporalmotifs.h.

Referenced by InitializeCounters().

Counter3D ThreeTEdgeStarCounter::mid_counts_
private

Definition at line 262 of file temporalmotifs.h.

Referenced by InitializeCounters(), MidCount(), and ProcessCurrent().

Counter2D ThreeTEdgeStarCounter::mid_sum_
private

Definition at line 259 of file temporalmotifs.h.

Referenced by InitializeCounters(), and ProcessCurrent().

Counter3D ThreeTEdgeStarCounter::pos_counts_
private

Definition at line 261 of file temporalmotifs.h.

Referenced by InitializeCounters(), PosCount(), and ProcessCurrent().

Counter2D ThreeTEdgeStarCounter::pos_nodes_
private

Definition at line 264 of file temporalmotifs.h.

Referenced by InitializeCounters(), PopPos(), ProcessCurrent(), and PushPos().

Counter2D ThreeTEdgeStarCounter::pos_sum_
private

Definition at line 258 of file temporalmotifs.h.

Referenced by InitializeCounters(), PopPos(), ProcessCurrent(), and PushPos().

Counter3D ThreeTEdgeStarCounter::pre_counts_
private

Definition at line 260 of file temporalmotifs.h.

Referenced by InitializeCounters(), PreCount(), and ProcessCurrent().

Counter2D ThreeTEdgeStarCounter::pre_nodes_
private

Definition at line 263 of file temporalmotifs.h.

Referenced by InitializeCounters(), PopPre(), ProcessCurrent(), and PushPre().

Counter2D ThreeTEdgeStarCounter::pre_sum_
private

Definition at line 257 of file temporalmotifs.h.

Referenced by InitializeCounters(), PopPre(), ProcessCurrent(), and PushPre().


The documentation for this class was generated from the following files: