Cyclops Tensor Framework
parallel arithmetic on multidimensional arrays
btwn_central.h
Go to the documentation of this file.
1 #ifndef __BTWN_CENTRAL_H__
2 #define __BTWN_CENTRAL_H__
3 
4 #include <ctf.hpp>
5 
6 #ifdef __CUDACC__
7 #define DEVICE __device__
8 #define HOST __host__
9 #else
10 #define DEVICE
11 #define HOST
12 #endif
13 
14 
15 //structure for regular path that keeps track of the multiplicity of paths
16 class mpath {
17  public:
18  int w; // weighted distance
19  int m; // multiplictiy
20  DEVICE HOST
21  mpath(int w_, int m_){ w=w_; m=m_; }
22  DEVICE HOST
23  mpath(mpath const & p){ w=p.w; m=p.m; }
24  DEVICE HOST
25  mpath(){ w=0; m=0;};
26 };
27 
28 //path with a centrality score
29 class cpath {
30  public:
31  double c; // centrality score
32  float m;
33  int w;
34  DEVICE HOST
35  cpath(int w_, float m_, double c_){ w=w_; m=m_; c=c_;}
36  DEVICE HOST
37  cpath(cpath const & p){ w=p.w; m=p.m; c=p.c; }
38  cpath(){ c=0.0; m=0.0; w=0;};
39 };
40 
41 
42 // min Monoid for cpath structure
44 
45 //(min, +) tropical semiring for mpath structure
47 
49 
51 #endif
DEVICE HOST mpath(int w_, int m_)
Definition: btwn_central.h:21
#define DEVICE
Definition: btwn_central.h:10
Semiring is a Monoid with an addition multiplicaton function addition must have an identity and be as...
Definition: semiring.h:359
custom bivariate function on two tensors: e.g. C["ij"] = f(A["ik"],B["kj"])
Definition: functions.h:137
CTF::Monoid< cpath > get_cpath_monoid()
double c
Definition: btwn_central.h:31
int m
Definition: btwn_central.h:19
float m
Definition: btwn_central.h:32
CTF::Bivar_Function< int, cpath, cpath > * get_Brandes_kernel()
DEVICE HOST cpath(int w_, float m_, double c_)
Definition: btwn_central.h:35
DEVICE HOST mpath(mpath const &p)
Definition: btwn_central.h:23
DEVICE HOST mpath()
Definition: btwn_central.h:25
A Monoid is a Set equipped with a binary addition operator &#39;+&#39; or a custom function addition must hav...
Definition: monoid.h:69
int w
Definition: btwn_central.h:18
int w
Definition: btwn_central.h:33
CTF::Bivar_Function< int, mpath, mpath > * get_Bellman_kernel()
DEVICE HOST cpath(cpath const &p)
Definition: btwn_central.h:37
#define HOST
Definition: btwn_central.h:11
CTF::Semiring< mpath > get_mpath_semiring()