In R we can use Rcpp to call a cpp function as the one below:
#include <Rcpp.h>
using namespace Rcpp;
// [[Rcpp::export]]
SEXP critcpp(SEXP a, SEXP b){
NumericMatrix X(a);
NumericVector crit(b);
int p = XtX.ncol();
NumericMatrix critstep(p,p);
NumericMatrix deltamin(p,p);
List lst(2);
for (int i = 0; i < (p-1); i++){
for (int j = i+1; j < p; j++){
--some calculations
}
}
lst[0] = critstep;
lst[1] = deltamin;
return lst;
}
I want to do the same thing in python. I have gone through Boost,SWIG etc but it seems complicated to my newbie Python eyes. Can the python wizards here kindly point me in the right direction. I need to call this C++ function from inside a Python function.
Rcpptypes, that are not available for python right out of the box. This function must be completely rewritten to be used with python AFAIK.