SNAP Library 4.0, Developer Reference  2017-07-27 13:18:06
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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 651 of file temporalmotifs.cpp.

References pos_nodes_, and pos_sum_.

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

Implements StarTriad3TEdgeCounter< StarEdgeData >.

Definition at line 644 of file temporalmotifs.cpp.

References pre_nodes_, and pre_sum_.

644  {
645  int nbr = event.nbr;
646  int dir = event.dir;
647  pre_nodes_(dir, nbr) -= 1;
648  for (int i = 0; i < 2; i++) { pre_sum_(dir, i) -= pre_nodes_(i, nbr); }
649 }
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 672 of file temporalmotifs.cpp.

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

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

Implements StarTriad3TEdgeCounter< StarEdgeData >.

Definition at line 665 of file temporalmotifs.cpp.

References pos_nodes_, and pos_sum_.

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

Implements StarTriad3TEdgeCounter< StarEdgeData >.

Definition at line 658 of file temporalmotifs.cpp.

References pre_nodes_, and pre_sum_.

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

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: