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 .

Loading