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 |
using namespace Rcpp; |
|
3 |
|
|
4 |
// [[Rcpp::export]]
|
|
5 | 1 |
int preserve(IntegerMatrix P, NumericVector s,int n) { |
6 | 1 |
int test=0; |
7 | 1 |
for(int i=0;i<n;++i){ |
8 | 1 |
for(int j=0;j<n;++j){ |
9 | 1 |
if(P(i,j)==1){ |
10 | 1 |
if(s[i]>s[j]){ |
11 | 1 |
test=1; |
12 | 1 |
return test; |
13 |
}
|
|
14 |
}
|
|
15 |
}
|
|
16 |
}
|
|
17 | 1 |
return test; |
18 |
}
|
|
19 |
|
|
20 |
|
Read our documentation on viewing source code .