/////////////////////////////// // XDemo_main.cc // C interaction file #include "XDemo.h" #include "R.h" // R functions #include "Rmath.h" // R math // Functions Passed to C++ from R must be passed in C extern format // All variables are passed to C by reference (pointers); // All output of functions is "void" (adjustments made via reference change) extern "C" { void DemoAutoCor(double *RetV, int *pLwant, double *InputVec, int *pLengthInput) { double *AutoOutput = XDemo(InputVec, pLengthInput[0]); int ii; int MaxTake = pLwant[0]; if ( (int) floor(pLengthInput[0] / 4) < MaxTake) { MaxTake = (int) floor(pLengthInput[0] / 4); } for (ii = 0; ii