Navigation | Overlay |
---|---|
t Navigate files | h Toggle hits |
y Change url to tip of branch | m Toggle misses |
b / v Jump to prev/next hit line | p Toggle partial |
z / x Jump to prev/next missed or partial line | 1..9 Toggle flags |
shift + o Open current page in GitHub | a Toggle all on |
/ or ? Show keyboard shortcuts dialog | c Toggle context lines or commits |
1 |
#include <Rcpp.h> |
|
2 |
|
|
3 |
using namespace Rcpp; |
|
4 |
|
|
5 |
// [[Rcpp::export]]
|
|
6 | 1 |
NumericMatrix dependCurFlow(NumericMatrix Tmat,IntegerMatrix el, int m, int n) { |
7 | 1 |
NumericMatrix betmat(n,n); |
8 | 1 |
for(int e=0; e<m; ++e){ |
9 | 1 |
int i = el(e,0); |
10 | 1 |
int j = el(e,1); |
11 | 1 |
for(int s=0;s<n;++s){ |
12 | 1 |
for(int t=0;t<n;++t){ |
13 | 1 |
if((i!=s) & (i!=t) & (s!=t)){ |
14 | 1 |
betmat(i,s) += 0.5*std::abs(Tmat(i,s)-Tmat(i,t)-Tmat(j,s)+Tmat(j,t)); |
15 |
}
|
|
16 | 1 |
if((j!=s) & (j!=t) & (s!=t)){ |
17 | 1 |
betmat(j,s) += 0.5*std::abs(Tmat(j,s)-Tmat(j,t)-Tmat(i,s)+Tmat(i,t)); |
18 |
}
|
|
19 |
}
|
|
20 |
}
|
|
21 |
}
|
|
22 | 1 |
return betmat; |
23 |
}
|
|
24 |
|
Read our documentation on viewing source code .