9 else if (b.
w==a.
w){ b.
m+=a.
m; }
22 if (a.
w>b.
w){ b.
c=a.
c; b.
w=a.
w; }
23 else if (b.
w == a.
w){ b.
c+=a.
c; }
40 #pragma omp parallel for 41 for (
int i=0; i<n; i++){
45 }
else if (a[i].w == b[i].w) b[i].
m += a[i].
m;
55 [](
void *
a,
void *
b,
int * n, MPI_Datatype*){
70 if (a.
w<b.
w){ return a; }
71 else if (b.
w<a.
w){ return b; }
72 else { return mpath(a.w, a.m+b.m); }
85 #pragma omp parallel for 86 for (
int i=0; i<n; i++){
91 }
else if (a[i].w == b[i].w){
104 [](
void *
a,
void *
b,
int * n, MPI_Datatype*){
119 if (a.
w>b.
w){ return a; }
120 else if (b.
w>a.
w){ return b; }
121 else { return cpath(a.w, a.m, a.c+b.c); }
DEVICE HOST void cfunc(cpath a, cpath &b)
Semiring is a Monoid with an addition multiplicaton function addition must have an identity and be as...
custom bivariate function on two tensors: e.g. C["ij"] = f(A["ik"],B["kj"])
Semiring< mpath > get_mpath_semiring()
void mpath_red(mpath const *a, mpath *b, int n)
void cpath_red(cpath const *a, cpath *b, int n)
Bivar_Function< int, cpath, cpath > * get_Brandes_kernel()
DEVICE HOST void mfunc(mpath a, mpath &b)
A Monoid is a Set equipped with a binary addition operator '+' or a custom function addition must hav...
Bivar_Function< int, mpath, mpath > * get_Bellman_kernel()
DEVICE HOST cpath subw(int w, cpath p)
DEVICE HOST mpath addw(int w, mpath p)
Monoid< cpath > get_cpath_monoid()