diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 00000000..9355b90d Binary files /dev/null and b/.DS_Store differ diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..979ab8a2 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "files.associations": { + "*.rmd": "markdown", + "dn_outlierinclude.h": "c" + } +} \ No newline at end of file diff --git a/C/.DS_Store b/C/.DS_Store new file mode 100644 index 00000000..cf004a38 Binary files /dev/null and b/C/.DS_Store differ diff --git a/C/CO_AutoCorr.c b/C/CO_AutoCorr.c index 1d9f6239..8f73976d 100644 --- a/C/CO_AutoCorr.c +++ b/C/CO_AutoCorr.c @@ -176,7 +176,7 @@ int co_firstzero(const double y[], const int size, const int maxtau) } -int CO_f1ecac(const double y[], const int size) +double CO_f1ecac(const double y[], const int size) { // NaN check @@ -190,17 +190,19 @@ int CO_f1ecac(const double y[], const int size) // compute autocorrelations double * autocorrs = co_autocorrs(y, size); - + // threshold to cross double thresh = 1.0/exp(1); - int out = size; - for(int i = 0; i < size-1; i++){ - - // printf("autocorrs_i: %1.3f autocorrs_i+1: %1.3f\n", autocorrs[i], autocorrs[i+1]); - - if ((autocorrs[i] - thresh)*(autocorrs[i+1] - thresh) < 0){ - out = i + 1; + double out = (double)size; + for(int i = 1; i < size-1; i++){ + // printf("i=%d autocorrs_i=%1.3f\n", i, autocorrs[i]); + if ( autocorrs[i] < thresh ){ + double m = autocorrs[i] - autocorrs[i-1]; + double dy = thresh - autocorrs[i-1]; + double dx = dy/m; + out = ((double)i) + dx; + // printf("thresh=%1.3f AC(i)=%1.3f AC(i-1)=%1.3f m=%1.3f dy=%1.3f dx=%1.3f out=%1.3f\n", thresh, autocorrs[i], autocorrs[i-1], m, dy, dx, out); free(autocorrs); return out; } diff --git a/C/CO_AutoCorr.h b/C/CO_AutoCorr.h index b061224e..34bbd280 100644 --- a/C/CO_AutoCorr.h +++ b/C/CO_AutoCorr.h @@ -29,7 +29,7 @@ extern double CO_Embed2_Basic_tau_incircle(const double y[], const int size, con extern double CO_Embed2_Dist_tau_d_expfit_meandiff(const double y[], const int size); extern int CO_FirstMin_ac(const double y[], const int size); extern double CO_trev_1_num(const double y[], const int size); -extern int CO_f1ecac(const double y[], const int size); +extern double CO_f1ecac(const double y[], const int size); extern double CO_HistogramAMI_even_2_5(const double y[], const int size); #endif diff --git a/C/DN_Mean.c b/C/DN_Mean.c new file mode 100644 index 00000000..f2e75eaf --- /dev/null +++ b/C/DN_Mean.c @@ -0,0 +1,11 @@ +#include + +double DN_Mean(const double a[], const int size) +{ + double m = 0.0; + for (int i = 0; i < size; i++) { + m += a[i]; + } + m /= size; + return m; +} diff --git a/C/DN_Mean.h b/C/DN_Mean.h new file mode 100644 index 00000000..a39d1351 --- /dev/null +++ b/C/DN_Mean.h @@ -0,0 +1,12 @@ +// +// Created by Trent Henderson 27 September 2021 +// + +#ifndef DN_MEAN +#define DN_MEAN + +#include + +extern double DN_Mean(const double a[], const int size); + +#endif /* DN_MEAN */ \ No newline at end of file diff --git a/C/DN_Spread_Std.c b/C/DN_Spread_Std.c new file mode 100644 index 00000000..5f5f0351 --- /dev/null +++ b/C/DN_Spread_Std.c @@ -0,0 +1,13 @@ +#include +#include "stats.h" + +double DN_Spread_Std(const double a[], const int size) +{ + double m = mean(a, size); + double sd = 0.0; + for (int i = 0; i < size; i++) { + sd += pow(a[i] - m, 2); + } + sd = sqrt(sd / (size - 1)); + return sd; +} diff --git a/C/DN_Spread_Std.h b/C/DN_Spread_Std.h new file mode 100644 index 00000000..c150e143 --- /dev/null +++ b/C/DN_Spread_Std.h @@ -0,0 +1,12 @@ +// +// Created by Trent Henderson 27 September 2021 +// + +#ifndef DN_SPREADSTD +#define DN_SPREADSTD + +#include + +extern double DN_Spread_Std(const double a[], const int size); + +#endif /* DN_SPREADSTD */ \ No newline at end of file diff --git a/C/main.c b/C/main.c index d694f668..781733e8 100644 --- a/C/main.c +++ b/C/main.c @@ -3,10 +3,13 @@ #include #include #include +#include //#include #include "DN_HistogramMode_5.h" #include "DN_HistogramMode_10.h" +#include "DN_Mean.h" +#include "DN_Spread_Std.h" #include "CO_AutoCorr.h" #include "DN_OutlierInclude.h" #include "FC_LocalSimple.h" @@ -45,7 +48,7 @@ int quality_check(const double y[], const int size) return 0; } -void run_features(double y[], int size, FILE * outfile) +void run_features(double y[], int size, FILE * outfile, bool catch24) { int quality = quality_check(y, size); if(quality != 0) @@ -66,6 +69,18 @@ void run_features(double y[], int size, FILE * outfile) // z-score first for all. zscore_norm2(y, size, y_zscored); + // GOOD + begin = clock(); + result = DN_OutlierInclude_n_001_mdrmd(y_zscored, size); + timeTaken = (double)(clock()-begin)*1000/CLOCKS_PER_SEC; + fprintf(outfile, "%.14f, %s, %f\n", result, "DN_OutlierInclude_n_001_mdrmd", timeTaken); + + // GOOD + begin = clock(); + result = DN_OutlierInclude_p_001_mdrmd(y_zscored, size); + timeTaken = (double)(clock()-begin)*1000/CLOCKS_PER_SEC; + fprintf(outfile, "%.14f, %s, %f\n", result, "DN_OutlierInclude_p_001_mdrmd", timeTaken); + // GOOD begin = clock(); result = DN_HistogramMode_5(y_zscored, size); @@ -108,18 +123,6 @@ void run_features(double y[], int size, FILE * outfile) timeTaken = (double)(clock()-begin)*1000/CLOCKS_PER_SEC; fprintf(outfile, "%.14f, %s, %f\n", result, "CO_trev_1_num", timeTaken); - // GOOD - begin = clock(); - result = DN_OutlierInclude_p_001_mdrmd(y_zscored, size); - timeTaken = (double)(clock()-begin)*1000/CLOCKS_PER_SEC; - fprintf(outfile, "%.14f, %s, %f\n", result, "DN_OutlierInclude_p_001_mdrmd", timeTaken); - - // GOOD - begin = clock(); - result = DN_OutlierInclude_n_001_mdrmd(y_zscored, size); - timeTaken = (double)(clock()-begin)*1000/CLOCKS_PER_SEC; - fprintf(outfile, "%.14f, %s, %f\n", result, "DN_OutlierInclude_n_001_mdrmd", timeTaken); - //GOOD begin = clock(); result = FC_LocalSimple_mean1_tauresrat(y_zscored, size); @@ -198,6 +201,23 @@ void run_features(double y[], int size, FILE * outfile) timeTaken = (double)(clock()-begin)*1000/CLOCKS_PER_SEC; fprintf(outfile, "%.14f, %s, %f\n", result, "PD_PeriodicityWang_th0_01", timeTaken); + if (catch24) { + + // GOOD + begin = clock(); + result = DN_Mean(y, size); + timeTaken = (double)(clock()-begin)*1000/CLOCKS_PER_SEC; + fprintf(outfile, "%.14f, %s, %f\n", result, "DN_Mean", timeTaken); + + // GOOD + begin = clock(); + result = DN_Spread_Std(y, size); + timeTaken = (double)(clock()-begin)*1000/CLOCKS_PER_SEC; + fprintf(outfile, "%.14f, %s, %f\n", result, "DN_Spread_Std", timeTaken); + } else { + + } + fprintf(outfile, "\n"); free(y_zscored); @@ -282,7 +302,19 @@ int main(int argc, char * argv[]) fclose(infile); y = realloc(y, size * sizeof *y); //printf("size=%i\n", size); - run_features(y, size, outfile); + + // catch24 specification + + int catch24; + printf("Do you want to run catch24? Enter 0 for catch22 or 1 for catch24."); + scanf("%d", &catch24); + + if (catch24 == 1) { + run_features(y, size, outfile, true); + } else { + run_features(y, size, outfile, false); + } + fclose(outfile); free(y); @@ -325,52 +357,63 @@ int main(int argc, char * argv[]) zscore_norm(y, size); double result; - + + result = DN_OutlierInclude_n_001_mdrmd(y, size); + printf("DN_OutlierInclude_n_001_mdrmd: %1.5f\n", result); + result = DN_OutlierInclude_p_001_mdrmd(y, size); + printf("DN_OutlierInclude_p_001_mdrmd: %1.5f\n", result); result = DN_HistogramMode_5(y, size); printf("DN_HistogramMode_5: %1.3f\n", result); result = DN_HistogramMode_10(y, size); printf("DN_HistogramMode_10: %1.3f\n", result); - result = CO_Embed2_Dist_tau_d_expfit_meandiff(y, size); - printf("CO_Embed2_Dist_tau_d_expfit_meandiff: %1.3f\n", result); - result = CO_f1ecac(y, size); - printf("CO_f1ecac: %1.f\n", result); - result = CO_FirstMin_ac(y, size); - printf("CO_FirstMin_ac: %1.f\n", result); - result = CO_HistogramAMI_even_2_5(y, size); - printf("CO_HistogramAMI_even_2_5: %1.3f\n", result); - result = CO_trev_1_num(y, size); - printf("CO_trev_1_num: %1.5f\n", result); - result = DN_OutlierInclude_p_001_mdrmd(y, size); - printf("DN_OutlierInclude_p_001_mdrmd: %1.5f\n", result); - result = DN_OutlierInclude_n_001_mdrmd(y, size); - printf("DN_OutlierInclude_n_001_mdrmd: %1.5f\n", result); + result = SC_FluctAnal_2_dfa_50_1_2_logi_prop_r1(y, size); + printf("SC_FluctAnal_2_dfa_50_1_2_logi_prop_r1: %1.5f\n", result); + result = SB_TransitionMatrix_3ac_sumdiagcov(y, size); + printf("SB_TransitionMatrix_3ac_sumdiagcov: %1.5f\n", result); result = FC_LocalSimple_mean1_tauresrat(y, size); printf("FC_LocalSimple_mean1_tauresrat: %1.5f\n", result); - result = FC_LocalSimple_mean3_stderr(y, size); - printf("FC_LocalSimple_mean3_stderr: %1.5f\n", result); - result = IN_AutoMutualInfoStats_40_gaussian_fmmi(y, size); - printf("IN_AutoMutualInfoStats_40_gaussian_fmmi: %1.5f\n", result); - result = MD_hrv_classic_pnn40(y, size); - printf("MD_hrv_classic_pnn40: %1.5f\n", result); + result = SB_MotifThree_quantile_hh(y, size); + printf("SB_MotifThree_quantile_hh: %1.5f\n", result); + result = CO_HistogramAMI_even_2_5(y, size); + printf("CO_HistogramAMI_even_2_5: %1.3f\n", result); + result = CO_Embed2_Dist_tau_d_expfit_meandiff(y, size); + printf("CO_Embed2_Dist_tau_d_expfit_meandiff: %1.3f\n", result); result = SB_BinaryStats_diff_longstretch0(y, size); printf("SB_BinaryStats_diff_longstretch0: %1.5f\n", result); + result = MD_hrv_classic_pnn40(y, size); + printf("MD_hrv_classic_pnn40: %1.5f\n", result); result = SB_BinaryStats_mean_longstretch1(y, size); printf("SB_BinaryStats_mean_longstretch1: %1.5f\n", result); - result = SB_MotifThree_quantile_hh(y, size); - printf("SB_MotifThree_quantile_hh: %1.5f\n", result); - result = SC_FluctAnal_2_rsrangefit_50_1_logi_prop_r1(y, size); - printf("SC_FluctAnal_2_rsrangefit_50_1_logi_prop_r1: %1.5f\n", result); - result = SC_FluctAnal_2_dfa_50_1_2_logi_prop_r1(y, size); - printf("SC_FluctAnal_2_dfa_50_1_2_logi_prop_r1: %1.5f\n", result); + result = FC_LocalSimple_mean3_stderr(y, size); + printf("FC_LocalSimple_mean3_stderr: %1.5f\n", result); result = SP_Summaries_welch_rect_area_5_1(y, size); printf("SP_Summaries_welch_rect_area_5_1: %1.5f\n", result); result = SP_Summaries_welch_rect_centroid(y, size); printf("SP_Summaries_welch_rect_centroid: %1.5f\n", result); - result = SB_TransitionMatrix_3ac_sumdiagcov(y, size); - printf("SB_TransitionMatrix_3ac_sumdiagcov: %1.5f\n", result); + result = CO_f1ecac(y, size); + printf("CO_f1ecac: %1.f\n", result); + result = CO_FirstMin_ac(y, size); + printf("CO_FirstMin_ac: %1.f\n", result); + result = IN_AutoMutualInfoStats_40_gaussian_fmmi(y, size); + printf("IN_AutoMutualInfoStats_40_gaussian_fmmi: %1.5f\n", result); result = PD_PeriodicityWang_th0_01(y, size); printf("PD_PeriodicityWang_th0_01: %1.f\n", result); + result = SC_FluctAnal_2_rsrangefit_50_1_logi_prop_r1(y, size); + printf("SC_FluctAnal_2_rsrangefit_50_1_logi_prop_r1: %1.5f\n", result); + result = CO_trev_1_num(y, size); + printf("CO_trev_1_num: %1.5f\n", result); + int catch24; + printf("Do you want to run catch24? Enter 0 for catch22 or 1 for catch24."); + scanf("%d", &catch24); + + if (catch24 == 1) { + result = DN_Mean(y, size); + printf("DN_Mean: %1.5f\n", result); + result = DN_Spread_Std(y, size); + printf("DN_Spread_Std: %1.5f\n", result); + } else { + } return 0; } diff --git a/Matlab/DN_Mean.m b/Matlab/DN_Mean.m new file mode 100644 index 00000000..14bb42ed --- /dev/null +++ b/Matlab/DN_Mean.m @@ -0,0 +1,6 @@ +function out = DN_Mean(y) + + % no combination of single functions + coder.inline('never'); + + out = DN_Mean(y, 5); \ No newline at end of file diff --git a/Matlab/DN_Spread_Std.m b/Matlab/DN_Spread_Std.m new file mode 100644 index 00000000..ff9c6e8e --- /dev/null +++ b/Matlab/DN_Spread_Std.m @@ -0,0 +1,6 @@ +function out = DN_Spread_Std(y) + + % no combination of single functions + coder.inline('never'); + + out = DN_Spread_Std(y, 5); \ No newline at end of file diff --git a/README.md b/README.md index e1c5cb1b..72f35857 100644 --- a/README.md +++ b/README.md @@ -33,5 +33,5 @@ And Julia users can use [this Julia package](https://github.com/brendanjohnharri - See language-specific usage information in the [wiki](https://github.com/chlubba/catch22/wiki/Installation-and-Testing). - __Important Note:__ _catch22_ features only evaluate _dynamical_ properties of time series and do not respond to basic differences in the location (e.g., mean) or spread (e.g., variance). - - If you think features of the raw distribution may be important for your application, we suggest you add them (in the simplest case, two additional features: the mean and standard deviation) to this feature set. + - If you think features of the raw distribution may be important for your application, we suggest you apply the function argument `catch24 = true` (`TRUE` in R, `True` in Python) to your call to the _catch22_ function in the language of your choice. - Note that time series are _z_-scored internally which means e.g., constant time series will lead to `NaN` outputs. diff --git a/featureList.txt b/featureList.txt index 0e2703d7..f940c389 100644 --- a/featureList.txt +++ b/featureList.txt @@ -1,5 +1,7 @@ DN_HistogramMode_5 DN_HistogramMode_10 +DN_Mean +DN_Spread_Std CO_f1ecac CO_FirstMin_ac CO_HistogramAMI_even_2_5 diff --git a/wrap_Matlab/M_wrapper.c b/wrap_Matlab/M_wrapper.c index 09494e4d..eff6d5c3 100644 --- a/wrap_Matlab/M_wrapper.c +++ b/wrap_Matlab/M_wrapper.c @@ -3,6 +3,8 @@ #include "CO_AutoCorr.h" #include "DN_HistogramMode_10.h" #include "DN_HistogramMode_5.h" +#include "DN_Mean.h" +#include "DN_Spread_Std.h" #include "DN_OutlierInclude.h" #include "FC_LocalSimple.h" #include "IN_AutoMutualInfoStats.h" diff --git a/wrap_Matlab/catch22_CO_Embed2_Dist_tau_d_expfit_meandiff.c b/wrap_Matlab/catch22_CO_Embed2_Dist_tau_d_expfit_meandiff.c index aa17c51e..e19e4f86 100644 --- a/wrap_Matlab/catch22_CO_Embed2_Dist_tau_d_expfit_meandiff.c +++ b/wrap_Matlab/catch22_CO_Embed2_Dist_tau_d_expfit_meandiff.c @@ -10,6 +10,8 @@ #include "CO_AutoCorr.h" #include "DN_HistogramMode_10.h" #include "DN_HistogramMode_5.h" +#include "DN_Mean.h" +#include "DN_Spread_Std.h" #include "DN_OutlierInclude.h" #include "FC_LocalSimple.h" #include "IN_AutoMutualInfoStats.h" diff --git a/wrap_Matlab/catch22_CO_FirstMin_ac.c b/wrap_Matlab/catch22_CO_FirstMin_ac.c index 8a7b480d..fdd46997 100644 --- a/wrap_Matlab/catch22_CO_FirstMin_ac.c +++ b/wrap_Matlab/catch22_CO_FirstMin_ac.c @@ -10,6 +10,8 @@ #include "CO_AutoCorr.h" #include "DN_HistogramMode_10.h" #include "DN_HistogramMode_5.h" +#include "DN_Mean.h" +#include "DN_Spread_Std.h" #include "DN_OutlierInclude.h" #include "FC_LocalSimple.h" #include "IN_AutoMutualInfoStats.h" diff --git a/wrap_Matlab/catch22_CO_HistogramAMI_even_2_5.c b/wrap_Matlab/catch22_CO_HistogramAMI_even_2_5.c index e423b6f1..348f9334 100644 --- a/wrap_Matlab/catch22_CO_HistogramAMI_even_2_5.c +++ b/wrap_Matlab/catch22_CO_HistogramAMI_even_2_5.c @@ -10,6 +10,8 @@ #include "CO_AutoCorr.h" #include "DN_HistogramMode_10.h" #include "DN_HistogramMode_5.h" +#include "DN_Mean.h" +#include "DN_Spread_Std.h" #include "DN_OutlierInclude.h" #include "FC_LocalSimple.h" #include "IN_AutoMutualInfoStats.h" diff --git a/wrap_Matlab/catch22_CO_f1ecac.c b/wrap_Matlab/catch22_CO_f1ecac.c index ddf60bf0..e46887c9 100644 --- a/wrap_Matlab/catch22_CO_f1ecac.c +++ b/wrap_Matlab/catch22_CO_f1ecac.c @@ -10,6 +10,8 @@ #include "CO_AutoCorr.h" #include "DN_HistogramMode_10.h" #include "DN_HistogramMode_5.h" +#include "DN_Mean.h" +#include "DN_Spread_Std.h" #include "DN_OutlierInclude.h" #include "FC_LocalSimple.h" #include "IN_AutoMutualInfoStats.h" diff --git a/wrap_Matlab/catch22_CO_trev_1_num.c b/wrap_Matlab/catch22_CO_trev_1_num.c index d851f6e0..48542d81 100644 --- a/wrap_Matlab/catch22_CO_trev_1_num.c +++ b/wrap_Matlab/catch22_CO_trev_1_num.c @@ -10,6 +10,8 @@ #include "CO_AutoCorr.h" #include "DN_HistogramMode_10.h" #include "DN_HistogramMode_5.h" +#include "DN_Mean.h" +#include "DN_Spread_Std.h" #include "DN_OutlierInclude.h" #include "FC_LocalSimple.h" #include "IN_AutoMutualInfoStats.h" diff --git a/wrap_Matlab/catch22_DN_HistogramMode_10.c b/wrap_Matlab/catch22_DN_HistogramMode_10.c index 3453af45..1d54f5d3 100644 --- a/wrap_Matlab/catch22_DN_HistogramMode_10.c +++ b/wrap_Matlab/catch22_DN_HistogramMode_10.c @@ -10,6 +10,8 @@ #include "CO_AutoCorr.h" #include "DN_HistogramMode_10.h" #include "DN_HistogramMode_5.h" +#include "DN_Mean.h" +#include "DN_Spread_Std.h" #include "DN_OutlierInclude.h" #include "FC_LocalSimple.h" #include "IN_AutoMutualInfoStats.h" diff --git a/wrap_Matlab/catch22_DN_HistogramMode_5.c b/wrap_Matlab/catch22_DN_HistogramMode_5.c index a5b16617..be537418 100644 --- a/wrap_Matlab/catch22_DN_HistogramMode_5.c +++ b/wrap_Matlab/catch22_DN_HistogramMode_5.c @@ -10,6 +10,8 @@ #include "CO_AutoCorr.h" #include "DN_HistogramMode_10.h" #include "DN_HistogramMode_5.h" +#include "DN_Mean.h" +#include "DN_Spread_Std.h" #include "DN_OutlierInclude.h" #include "FC_LocalSimple.h" #include "IN_AutoMutualInfoStats.h" diff --git a/wrap_Matlab/catch22_DN_Mean.c b/wrap_Matlab/catch22_DN_Mean.c new file mode 100644 index 00000000..4ed970a0 --- /dev/null +++ b/wrap_Matlab/catch22_DN_Mean.c @@ -0,0 +1,43 @@ +/*================================================================= + * + * + *=================================================================*/ +#include +#include "mex.h" + +#include "M_wrapper.h" + +#include "CO_AutoCorr.h" +#include "DN_HistogramMode_10.h" +#include "DN_HistogramMode_5.h" +#include "DN_Mean.h" +#include "DN_Spread_Std.h" +#include "DN_OutlierInclude.h" +#include "FC_LocalSimple.h" +#include "IN_AutoMutualInfoStats.h" +#include "MD_hrv.h" +#include "PD_PeriodicityWang.h" +#include "SB_BinaryStats.h" +#include "SB_CoarseGrain.h" +#include "SB_MotifThree.h" +#include "SB_TransitionMatrix.h" +#include "SC_FluctAnal.h" +#include "SP_Summaries.h" +#include "butterworth.h" +#include "fft.h" +#include "helper_functions.h" +#include "histcounts.h" +#include "splinefit.h" +#include "stats.h" + +void mexFunction( int nlhs, mxArray *plhs[], + int nrhs, const mxArray*prhs[] ) + +{ + + // check inputs and call feature C-function +M_wrapper_double( nlhs, plhs, nrhs, prhs, &DN_Mean, 1); + + return; + +} \ No newline at end of file diff --git a/wrap_Matlab/catch22_DN_OutlierInclude_n_001_mdrmd.c b/wrap_Matlab/catch22_DN_OutlierInclude_n_001_mdrmd.c index e48a18e9..cf9cc439 100644 --- a/wrap_Matlab/catch22_DN_OutlierInclude_n_001_mdrmd.c +++ b/wrap_Matlab/catch22_DN_OutlierInclude_n_001_mdrmd.c @@ -10,6 +10,8 @@ #include "CO_AutoCorr.h" #include "DN_HistogramMode_10.h" #include "DN_HistogramMode_5.h" +#include "DN_Mean.h" +#include "DN_Spread_Std.h" #include "DN_OutlierInclude.h" #include "FC_LocalSimple.h" #include "IN_AutoMutualInfoStats.h" diff --git a/wrap_Matlab/catch22_DN_OutlierInclude_p_001_mdrmd.c b/wrap_Matlab/catch22_DN_OutlierInclude_p_001_mdrmd.c index 828a0dee..5c489172 100644 --- a/wrap_Matlab/catch22_DN_OutlierInclude_p_001_mdrmd.c +++ b/wrap_Matlab/catch22_DN_OutlierInclude_p_001_mdrmd.c @@ -10,6 +10,8 @@ #include "CO_AutoCorr.h" #include "DN_HistogramMode_10.h" #include "DN_HistogramMode_5.h" +#include "DN_Mean.h" +#include "DN_Spread_Std.h" #include "DN_OutlierInclude.h" #include "FC_LocalSimple.h" #include "IN_AutoMutualInfoStats.h" diff --git a/wrap_Matlab/catch22_DN_Spread_Std.c b/wrap_Matlab/catch22_DN_Spread_Std.c new file mode 100644 index 00000000..d766c2ad --- /dev/null +++ b/wrap_Matlab/catch22_DN_Spread_Std.c @@ -0,0 +1,43 @@ +/*================================================================= + * + * + *=================================================================*/ +#include +#include "mex.h" + +#include "M_wrapper.h" + +#include "CO_AutoCorr.h" +#include "DN_HistogramMode_10.h" +#include "DN_HistogramMode_5.h" +#include "DN_Mean.h" +#include "DN_Spread_Std.h" +#include "DN_OutlierInclude.h" +#include "FC_LocalSimple.h" +#include "IN_AutoMutualInfoStats.h" +#include "MD_hrv.h" +#include "PD_PeriodicityWang.h" +#include "SB_BinaryStats.h" +#include "SB_CoarseGrain.h" +#include "SB_MotifThree.h" +#include "SB_TransitionMatrix.h" +#include "SC_FluctAnal.h" +#include "SP_Summaries.h" +#include "butterworth.h" +#include "fft.h" +#include "helper_functions.h" +#include "histcounts.h" +#include "splinefit.h" +#include "stats.h" + +void mexFunction( int nlhs, mxArray *plhs[], + int nrhs, const mxArray*prhs[] ) + +{ + + // check inputs and call feature C-function +M_wrapper_double( nlhs, plhs, nrhs, prhs, &DN_Spread_Std, 1); + + return; + +} \ No newline at end of file diff --git a/wrap_Matlab/catch22_FC_LocalSimple_mean1_tauresrat.c b/wrap_Matlab/catch22_FC_LocalSimple_mean1_tauresrat.c index b35fc4aa..db929ee8 100644 --- a/wrap_Matlab/catch22_FC_LocalSimple_mean1_tauresrat.c +++ b/wrap_Matlab/catch22_FC_LocalSimple_mean1_tauresrat.c @@ -10,6 +10,8 @@ #include "CO_AutoCorr.h" #include "DN_HistogramMode_10.h" #include "DN_HistogramMode_5.h" +#include "DN_Mean.h" +#include "DN_Spread_Std.h" #include "DN_OutlierInclude.h" #include "FC_LocalSimple.h" #include "IN_AutoMutualInfoStats.h" diff --git a/wrap_Matlab/catch22_FC_LocalSimple_mean3_stderr.c b/wrap_Matlab/catch22_FC_LocalSimple_mean3_stderr.c index 6defde11..22c5442f 100644 --- a/wrap_Matlab/catch22_FC_LocalSimple_mean3_stderr.c +++ b/wrap_Matlab/catch22_FC_LocalSimple_mean3_stderr.c @@ -10,6 +10,8 @@ #include "CO_AutoCorr.h" #include "DN_HistogramMode_10.h" #include "DN_HistogramMode_5.h" +#include "DN_Mean.h" +#include "DN_Spread_Std.h" #include "DN_OutlierInclude.h" #include "FC_LocalSimple.h" #include "IN_AutoMutualInfoStats.h" diff --git a/wrap_Matlab/catch22_IN_AutoMutualInfoStats_40_gaussian_fmmi.c b/wrap_Matlab/catch22_IN_AutoMutualInfoStats_40_gaussian_fmmi.c index 52737453..f6349345 100644 --- a/wrap_Matlab/catch22_IN_AutoMutualInfoStats_40_gaussian_fmmi.c +++ b/wrap_Matlab/catch22_IN_AutoMutualInfoStats_40_gaussian_fmmi.c @@ -10,6 +10,8 @@ #include "CO_AutoCorr.h" #include "DN_HistogramMode_10.h" #include "DN_HistogramMode_5.h" +#include "DN_Mean.h" +#include "DN_Spread_Std.h" #include "DN_OutlierInclude.h" #include "FC_LocalSimple.h" #include "IN_AutoMutualInfoStats.h" diff --git a/wrap_Matlab/catch22_MD_hrv_classic_pnn40.c b/wrap_Matlab/catch22_MD_hrv_classic_pnn40.c index 2582c487..44e58cc8 100644 --- a/wrap_Matlab/catch22_MD_hrv_classic_pnn40.c +++ b/wrap_Matlab/catch22_MD_hrv_classic_pnn40.c @@ -10,6 +10,8 @@ #include "CO_AutoCorr.h" #include "DN_HistogramMode_10.h" #include "DN_HistogramMode_5.h" +#include "DN_Mean.h" +#include "DN_Spread_Std.h" #include "DN_OutlierInclude.h" #include "FC_LocalSimple.h" #include "IN_AutoMutualInfoStats.h" diff --git a/wrap_Matlab/catch22_PD_PeriodicityWang_th0_01.c b/wrap_Matlab/catch22_PD_PeriodicityWang_th0_01.c index b6f430fe..81649be5 100644 --- a/wrap_Matlab/catch22_PD_PeriodicityWang_th0_01.c +++ b/wrap_Matlab/catch22_PD_PeriodicityWang_th0_01.c @@ -10,6 +10,8 @@ #include "CO_AutoCorr.h" #include "DN_HistogramMode_10.h" #include "DN_HistogramMode_5.h" +#include "DN_Mean.h" +#include "DN_Spread_Std.h" #include "DN_OutlierInclude.h" #include "FC_LocalSimple.h" #include "IN_AutoMutualInfoStats.h" diff --git a/wrap_Matlab/catch22_SB_BinaryStats_diff_longstretch0.c b/wrap_Matlab/catch22_SB_BinaryStats_diff_longstretch0.c index 1cc324e8..549eb7f4 100644 --- a/wrap_Matlab/catch22_SB_BinaryStats_diff_longstretch0.c +++ b/wrap_Matlab/catch22_SB_BinaryStats_diff_longstretch0.c @@ -10,6 +10,8 @@ #include "CO_AutoCorr.h" #include "DN_HistogramMode_10.h" #include "DN_HistogramMode_5.h" +#include "DN_Mean.h" +#include "DN_Spread_Std.h" #include "DN_OutlierInclude.h" #include "FC_LocalSimple.h" #include "IN_AutoMutualInfoStats.h" diff --git a/wrap_Matlab/catch22_SB_BinaryStats_mean_longstretch1.c b/wrap_Matlab/catch22_SB_BinaryStats_mean_longstretch1.c index c51ea19c..58660ec7 100644 --- a/wrap_Matlab/catch22_SB_BinaryStats_mean_longstretch1.c +++ b/wrap_Matlab/catch22_SB_BinaryStats_mean_longstretch1.c @@ -10,6 +10,8 @@ #include "CO_AutoCorr.h" #include "DN_HistogramMode_10.h" #include "DN_HistogramMode_5.h" +#include "DN_Mean.h" +#include "DN_Spread_Std.h" #include "DN_OutlierInclude.h" #include "FC_LocalSimple.h" #include "IN_AutoMutualInfoStats.h" diff --git a/wrap_Matlab/catch22_SB_MotifThree_quantile_hh.c b/wrap_Matlab/catch22_SB_MotifThree_quantile_hh.c index 21b47d4d..2643a1f4 100644 --- a/wrap_Matlab/catch22_SB_MotifThree_quantile_hh.c +++ b/wrap_Matlab/catch22_SB_MotifThree_quantile_hh.c @@ -10,6 +10,8 @@ #include "CO_AutoCorr.h" #include "DN_HistogramMode_10.h" #include "DN_HistogramMode_5.h" +#include "DN_Mean.h" +#include "DN_Spread_Std.h" #include "DN_OutlierInclude.h" #include "FC_LocalSimple.h" #include "IN_AutoMutualInfoStats.h" diff --git a/wrap_Matlab/catch22_SB_TransitionMatrix_3ac_sumdiagcov.c b/wrap_Matlab/catch22_SB_TransitionMatrix_3ac_sumdiagcov.c index d2a60360..10192276 100644 --- a/wrap_Matlab/catch22_SB_TransitionMatrix_3ac_sumdiagcov.c +++ b/wrap_Matlab/catch22_SB_TransitionMatrix_3ac_sumdiagcov.c @@ -10,6 +10,8 @@ #include "CO_AutoCorr.h" #include "DN_HistogramMode_10.h" #include "DN_HistogramMode_5.h" +#include "DN_Mean.h" +#include "DN_Spread_Std.h" #include "DN_OutlierInclude.h" #include "FC_LocalSimple.h" #include "IN_AutoMutualInfoStats.h" diff --git a/wrap_Matlab/catch22_SC_FluctAnal_2_dfa_50_1_2_logi_prop_r1.c b/wrap_Matlab/catch22_SC_FluctAnal_2_dfa_50_1_2_logi_prop_r1.c index 33d8da30..760faf17 100644 --- a/wrap_Matlab/catch22_SC_FluctAnal_2_dfa_50_1_2_logi_prop_r1.c +++ b/wrap_Matlab/catch22_SC_FluctAnal_2_dfa_50_1_2_logi_prop_r1.c @@ -10,6 +10,8 @@ #include "CO_AutoCorr.h" #include "DN_HistogramMode_10.h" #include "DN_HistogramMode_5.h" +#include "DN_Mean.h" +#include "DN_Spread_Std.h" #include "DN_OutlierInclude.h" #include "FC_LocalSimple.h" #include "IN_AutoMutualInfoStats.h" diff --git a/wrap_Matlab/catch22_SC_FluctAnal_2_rsrangefit_50_1_logi_prop_r1.c b/wrap_Matlab/catch22_SC_FluctAnal_2_rsrangefit_50_1_logi_prop_r1.c index c754aea0..2c5c123b 100644 --- a/wrap_Matlab/catch22_SC_FluctAnal_2_rsrangefit_50_1_logi_prop_r1.c +++ b/wrap_Matlab/catch22_SC_FluctAnal_2_rsrangefit_50_1_logi_prop_r1.c @@ -10,6 +10,8 @@ #include "CO_AutoCorr.h" #include "DN_HistogramMode_10.h" #include "DN_HistogramMode_5.h" +#include "DN_Mean.h" +#include "DN_Spread_Std.h" #include "DN_OutlierInclude.h" #include "FC_LocalSimple.h" #include "IN_AutoMutualInfoStats.h" diff --git a/wrap_Matlab/catch22_SP_Summaries_welch_rect_area_5_1.c b/wrap_Matlab/catch22_SP_Summaries_welch_rect_area_5_1.c index d9395a89..df2df80a 100644 --- a/wrap_Matlab/catch22_SP_Summaries_welch_rect_area_5_1.c +++ b/wrap_Matlab/catch22_SP_Summaries_welch_rect_area_5_1.c @@ -10,6 +10,8 @@ #include "CO_AutoCorr.h" #include "DN_HistogramMode_10.h" #include "DN_HistogramMode_5.h" +#include "DN_Mean.h" +#include "DN_Spread_Std.h" #include "DN_OutlierInclude.h" #include "FC_LocalSimple.h" #include "IN_AutoMutualInfoStats.h" diff --git a/wrap_Matlab/catch22_SP_Summaries_welch_rect_centroid.c b/wrap_Matlab/catch22_SP_Summaries_welch_rect_centroid.c index b2f7eef1..116c0a88 100644 --- a/wrap_Matlab/catch22_SP_Summaries_welch_rect_centroid.c +++ b/wrap_Matlab/catch22_SP_Summaries_welch_rect_centroid.c @@ -10,6 +10,8 @@ #include "CO_AutoCorr.h" #include "DN_HistogramMode_10.h" #include "DN_HistogramMode_5.h" +#include "DN_Mean.h" +#include "DN_Spread_Std.h" #include "DN_OutlierInclude.h" #include "FC_LocalSimple.h" #include "IN_AutoMutualInfoStats.h" diff --git a/wrap_Matlab/catch22_all.m b/wrap_Matlab/catch22_all.m index ab63a0fa..b84e2b53 100644 --- a/wrap_Matlab/catch22_all.m +++ b/wrap_Matlab/catch22_all.m @@ -1,8 +1,12 @@ -function [featureValues, featureNames] = catch22_all(data) +function [featureValues, featureNames] = catch22_all(data, catch24) -featureNames = ... - { ... - 'DN_HistogramMode_5', ... + if nargin < 2 + catch24 = false; + end + + featureNames = ... + { ... + 'DN_HistogramMode_5', ... 'DN_HistogramMode_10', ... 'CO_f1ecac', ... 'CO_FirstMin_ac', ... @@ -12,7 +16,7 @@ 'SB_BinaryStats_mean_longstretch1', ... 'SB_TransitionMatrix_3ac_sumdiagcov', ... 'PD_PeriodicityWang_th0_01', ... - 'CO_Embed2_Dist_tau_d_expfit_meandiff', ... + 'CO_Embed2_Dist_tau_d_expfit_meandiff', ... 'IN_AutoMutualInfoStats_40_gaussian_fmmi', ... 'FC_LocalSimple_mean1_tauresrat', ... 'DN_OutlierInclude_p_001_mdrmd', ... @@ -24,17 +28,19 @@ 'SC_FluctAnal_2_dfa_50_1_2_logi_prop_r1', ... 'SP_Summaries_welch_rect_centroid', ... 'FC_LocalSimple_mean3_stderr' - }; - -featureValues = zeros(length(featureNames),1); -for featureInd = 1:length(featureNames) - - featureName = featureNames{featureInd}; + }; - fh = str2func(['catch22_', featureName]); - - featureValues(featureInd) = fh(data'); - -end - + if catch24 + additionals = {'DN_Mean' 'DN_Spread_Std'}; + featureNames = [featureNames, additionals]; + else + end + + featureValues = zeros(length(featureNames),1); + + for featureInd = 1:length(featureNames) + featureName = featureNames{featureInd}; + fh = str2func(['catch22_', featureName]); + featureValues(featureInd) = fh(data'); + end end diff --git a/wrap_Python/.DS_Store b/wrap_Python/.DS_Store new file mode 100644 index 00000000..04462afe Binary files /dev/null and b/wrap_Python/.DS_Store differ diff --git a/wrap_Python/catch22/.DS_Store b/wrap_Python/catch22/.DS_Store new file mode 100644 index 00000000..7859f671 Binary files /dev/null and b/wrap_Python/catch22/.DS_Store differ diff --git a/wrap_Python/catch22/catch22.py b/wrap_Python/catch22/catch22.py index 205f6c16..ac961579 100644 --- a/wrap_Python/catch22/catch22.py +++ b/wrap_Python/catch22/catch22.py @@ -1,37 +1,41 @@ -import catch22_C - -def catch22_all(data): - - features = [ - 'DN_HistogramMode_5', - 'DN_HistogramMode_10', - 'CO_f1ecac', - 'CO_FirstMin_ac', - 'CO_HistogramAMI_even_2_5', - 'CO_trev_1_num', - 'MD_hrv_classic_pnn40', - 'SB_BinaryStats_mean_longstretch1', - 'SB_TransitionMatrix_3ac_sumdiagcov', - 'PD_PeriodicityWang_th0_01', - 'CO_Embed2_Dist_tau_d_expfit_meandiff', - 'IN_AutoMutualInfoStats_40_gaussian_fmmi', - 'FC_LocalSimple_mean1_tauresrat', - 'DN_OutlierInclude_p_001_mdrmd', - 'DN_OutlierInclude_n_001_mdrmd', - 'SP_Summaries_welch_rect_area_5_1', - 'SB_BinaryStats_diff_longstretch0', - 'SB_MotifThree_quantile_hh', - 'SC_FluctAnal_2_rsrangefit_50_1_logi_prop_r1', - 'SC_FluctAnal_2_dfa_50_1_2_logi_prop_r1', - 'SP_Summaries_welch_rect_centroid', - 'FC_LocalSimple_mean3_stderr' - ] - - data = list(data) - - featureOut = [] - for f in features: - featureFun = getattr(catch22_C, f) - featureOut.append(featureFun(data)) - - return {'names': features, 'values': featureOut} \ No newline at end of file +import catch22_C + + +def catch22_all(data, catch24=False): + + features = [ + 'DN_HistogramMode_5', + 'DN_HistogramMode_10', + 'CO_f1ecac', + 'CO_FirstMin_ac', + 'CO_HistogramAMI_even_2_5', + 'CO_trev_1_num', + 'MD_hrv_classic_pnn40', + 'SB_BinaryStats_mean_longstretch1', + 'SB_TransitionMatrix_3ac_sumdiagcov', + 'PD_PeriodicityWang_th0_01', + 'CO_Embed2_Dist_tau_d_expfit_meandiff', + 'IN_AutoMutualInfoStats_40_gaussian_fmmi', + 'FC_LocalSimple_mean1_tauresrat', + 'DN_OutlierInclude_p_001_mdrmd', + 'DN_OutlierInclude_n_001_mdrmd', + 'SP_Summaries_welch_rect_area_5_1', + 'SB_BinaryStats_diff_longstretch0', + 'SB_MotifThree_quantile_hh', + 'SC_FluctAnal_2_rsrangefit_50_1_logi_prop_r1', + 'SC_FluctAnal_2_dfa_50_1_2_logi_prop_r1', + 'SP_Summaries_welch_rect_centroid', + 'FC_LocalSimple_mean3_stderr' + ] + + if catch24 is True: + features.append('DN_Mean') + features.append('DN_Spread_Std') + + data = list(data) + featureOut = [] + for f in features: + featureFun = getattr(catch22_C, f) + featureOut.append(featureFun(data)) + + return {'names': features, 'values': featureOut} diff --git a/wrap_Python/catch22_wrap.c b/wrap_Python/catch22_wrap.c index 0456f0d3..9ba3252a 100644 --- a/wrap_Python/catch22_wrap.c +++ b/wrap_Python/catch22_wrap.c @@ -4,6 +4,8 @@ #include "../C/CO_AutoCorr.h" #include "../C/DN_HistogramMode_10.h" #include "../C/DN_HistogramMode_5.h" +#include "../C/DN_Mean.h" +#include "../C/DN_Spread_Std.h" #include "../C/DN_OutlierInclude.h" #include "../C/FC_LocalSimple.h" #include "../C/IN_AutoMutualInfoStats.h" @@ -196,6 +198,16 @@ static PyObject * DN_HistogramMode_10_wrapper(PyObject * self, PyObject * args) return python_wrapper_double(args, &DN_HistogramMode_10, 1); } +static PyObject * DN_Mean_wrapper(PyObject * self, PyObject * args) +{ + return python_wrapper_double(args, &DN_Mean, 1); +} + +static PyObject * DN_Spread_Std_wrapper(PyObject * self, PyObject * args) +{ + return python_wrapper_double(args, &DN_Spread_Std, 1); +} + static PyObject * CO_f1ecac_wrapper(PyObject * self, PyObject * args) { return python_wrapper_int(args, &CO_f1ecac, 1); @@ -304,6 +316,8 @@ static PyObject * FC_LocalSimple_mean3_stderr_wrapper(PyObject * self, PyObject static PyMethodDef catch22Methods[] = { { "DN_HistogramMode_5", DN_HistogramMode_5_wrapper, METH_VARARGS, "bla" }, { "DN_HistogramMode_10", DN_HistogramMode_10_wrapper, METH_VARARGS, "bla" }, + { "DN_Mean", DN_Mean_wrapper, METH_VARARGS, "bla" }, + { "DN_Spread_Std", DN_Spread_Std_wrapper, METH_VARARGS, "bla" }, { "CO_f1ecac", CO_f1ecac_wrapper, METH_VARARGS, "bla" }, { "CO_FirstMin_ac", CO_FirstMin_ac_wrapper, METH_VARARGS, "bla" }, { "CO_HistogramAMI_even_2_5", CO_HistogramAMI_even_2_5_wrapper, METH_VARARGS, "bla" }, diff --git a/wrap_Python/catch22_wrap_P3.c b/wrap_Python/catch22_wrap_P3.c index 0f7c4492..981307fa 100644 --- a/wrap_Python/catch22_wrap_P3.c +++ b/wrap_Python/catch22_wrap_P3.c @@ -4,6 +4,8 @@ #include "../C/CO_AutoCorr.h" #include "../C/DN_HistogramMode_10.h" #include "../C/DN_HistogramMode_5.h" +#include "../C/DN_Mean.h" +#include "../C/DN_Spread_Std.h" #include "../C/DN_OutlierInclude.h" #include "../C/FC_LocalSimple.h" #include "../C/IN_AutoMutualInfoStats.h" @@ -198,6 +200,16 @@ static PyObject * DN_HistogramMode_10_wrapper(PyObject * self, PyObject * args) return python_wrapper_double(args, &DN_HistogramMode_10, 1); } +static PyObject * DN_Mean_wrapper(PyObject * self, PyObject * args) +{ + return python_wrapper_double(args, &DN_Mean, 1); +} + +static PyObject * DN_Spread_Std_wrapper(PyObject * self, PyObject * args) +{ + return python_wrapper_double(args, &DN_Spread_Std, 1); +} + static PyObject * CO_f1ecac_wrapper(PyObject * self, PyObject * args) { return python_wrapper_int(args, &CO_f1ecac, 1); @@ -306,6 +318,8 @@ static PyObject * FC_LocalSimple_mean3_stderr_wrapper(PyObject * self, PyObject static PyMethodDef catch22Methods[] = { { "DN_HistogramMode_5", DN_HistogramMode_5_wrapper, METH_VARARGS, "bla" }, { "DN_HistogramMode_10", DN_HistogramMode_10_wrapper, METH_VARARGS, "bla" }, + { "DN_Mean", DN_Mean_wrapper, METH_VARARGS, "bla" }, + { "DN_Spread_Std", DN_Spread_Std_wrapper, METH_VARARGS, "bla" }, { "CO_f1ecac", CO_f1ecac_wrapper, METH_VARARGS, "bla" }, { "CO_FirstMin_ac", CO_FirstMin_ac_wrapper, METH_VARARGS, "bla" }, { "CO_HistogramAMI_even_2_5", CO_HistogramAMI_even_2_5_wrapper, METH_VARARGS, "bla" }, diff --git a/wrap_Python/testing.py b/wrap_Python/testing.py index 7969c694..40bff482 100644 --- a/wrap_Python/testing.py +++ b/wrap_Python/testing.py @@ -12,5 +12,20 @@ featureNames = catchOut['names'] featureValues = catchOut['values'] + for featureName, featureValue in zip(featureNames, featureValues): + print('%s : %1.6f' % (featureName, featureValue)) + +for dataFile in ['../testData/test.txt', '../testData/test2.txt']: + + print ('\n'), dataFile + + data = [line.rstrip().split(' ') for line in open(dataFile)] + flat_data = [float(item) for sublist in data for item in sublist] + + catchOut = catch22.catch22_all(flat_data, True) + + featureNames = catchOut['names'] + featureValues = catchOut['values'] + for featureName, featureValue in zip(featureNames, featureValues): print('%s : %1.6f' % (featureName, featureValue)) \ No newline at end of file diff --git a/wrap_R/.gitignore b/wrap_R/.gitignore deleted file mode 100644 index 7579b1b6..00000000 --- a/wrap_R/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -.RData -.Rhistory -codegen -*.tar.gz \ No newline at end of file diff --git a/wrap_R/catch22/.gitignore b/wrap_R/catch22/.gitignore deleted file mode 100644 index 795fe840..00000000 --- a/wrap_R/catch22/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -.RData -.Rhistory -*.c -*.h -inst -man \ No newline at end of file diff --git a/wrap_R/catch22/DESCRIPTION b/wrap_R/catch22/DESCRIPTION deleted file mode 100644 index f04635e2..00000000 --- a/wrap_R/catch22/DESCRIPTION +++ /dev/null @@ -1,11 +0,0 @@ -Package: catch22 -Type: Package -Title: Subset of hctsa-features -Version: 0.1 -Date: 2018-09-29 -Author: Carl H. Lubba -Maintainer: Carl H. Lubba -Description: blabla -License: GPL (>= 2) -Imports: Rcpp (>= 0.12.15) -LinkingTo: Rcpp diff --git a/wrap_R/catch22/NAMESPACE b/wrap_R/catch22/NAMESPACE deleted file mode 100644 index a0537e62..00000000 --- a/wrap_R/catch22/NAMESPACE +++ /dev/null @@ -1,4 +0,0 @@ -useDynLib(catch22, .registration=TRUE) -exportPattern("^[[:alpha:]]+") -export("catch22_all") -importFrom(Rcpp, evalCpp) diff --git a/wrap_R/catch22/R/RcppExports.R b/wrap_R/catch22/R/RcppExports.R deleted file mode 100644 index e1f135dd..00000000 --- a/wrap_R/catch22/R/RcppExports.R +++ /dev/null @@ -1,91 +0,0 @@ -# Generated by using Rcpp::compileAttributes() -> do not edit by hand -# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 - -DN_HistogramMode_5 <- function(x) { - .Call(`_catch22_DN_HistogramMode_5`, x) -} - -DN_HistogramMode_10 <- function(x) { - .Call(`_catch22_DN_HistogramMode_10`, x) -} - -CO_f1ecac <- function(x) { - .Call(`_catch22_CO_f1ecac`, x) -} - -CO_FirstMin_ac <- function(x) { - .Call(`_catch22_CO_FirstMin_ac`, x) -} - -CO_HistogramAMI_even_2_5 <- function(x) { - .Call(`_catch22_CO_HistogramAMI_even_2_5`, x) -} - -CO_trev_1_num <- function(x) { - .Call(`_catch22_CO_trev_1_num`, x) -} - -MD_hrv_classic_pnn40 <- function(x) { - .Call(`_catch22_MD_hrv_classic_pnn40`, x) -} - -SB_BinaryStats_mean_longstretch1 <- function(x) { - .Call(`_catch22_SB_BinaryStats_mean_longstretch1`, x) -} - -SB_TransitionMatrix_3ac_sumdiagcov <- function(x) { - .Call(`_catch22_SB_TransitionMatrix_3ac_sumdiagcov`, x) -} - -PD_PeriodicityWang_th0_01 <- function(x) { - .Call(`_catch22_PD_PeriodicityWang_th0_01`, x) -} - -CO_Embed2_Dist_tau_d_expfit_meandiff <- function(x) { - .Call(`_catch22_CO_Embed2_Dist_tau_d_expfit_meandiff`, x) -} - -IN_AutoMutualInfoStats_40_gaussian_fmmi <- function(x) { - .Call(`_catch22_IN_AutoMutualInfoStats_40_gaussian_fmmi`, x) -} - -FC_LocalSimple_mean1_tauresrat <- function(x) { - .Call(`_catch22_FC_LocalSimple_mean1_tauresrat`, x) -} - -DN_OutlierInclude_p_001_mdrmd <- function(x) { - .Call(`_catch22_DN_OutlierInclude_p_001_mdrmd`, x) -} - -DN_OutlierInclude_n_001_mdrmd <- function(x) { - .Call(`_catch22_DN_OutlierInclude_n_001_mdrmd`, x) -} - -SP_Summaries_welch_rect_area_5_1 <- function(x) { - .Call(`_catch22_SP_Summaries_welch_rect_area_5_1`, x) -} - -SB_BinaryStats_diff_longstretch0 <- function(x) { - .Call(`_catch22_SB_BinaryStats_diff_longstretch0`, x) -} - -SB_MotifThree_quantile_hh <- function(x) { - .Call(`_catch22_SB_MotifThree_quantile_hh`, x) -} - -SC_FluctAnal_2_rsrangefit_50_1_logi_prop_r1 <- function(x) { - .Call(`_catch22_SC_FluctAnal_2_rsrangefit_50_1_logi_prop_r1`, x) -} - -SC_FluctAnal_2_dfa_50_1_2_logi_prop_r1 <- function(x) { - .Call(`_catch22_SC_FluctAnal_2_dfa_50_1_2_logi_prop_r1`, x) -} - -SP_Summaries_welch_rect_centroid <- function(x) { - .Call(`_catch22_SP_Summaries_welch_rect_centroid`, x) -} - -FC_LocalSimple_mean3_stderr <- function(x) { - .Call(`_catch22_FC_LocalSimple_mean3_stderr`, x) -} - diff --git a/wrap_R/catch22/R/catch22_all.R b/wrap_R/catch22/R/catch22_all.R deleted file mode 100644 index 9c6890a6..00000000 --- a/wrap_R/catch22/R/catch22_all.R +++ /dev/null @@ -1,37 +0,0 @@ -catch22_all <- function(data){ - -names <- c('DN_HistogramMode_5', - 'DN_HistogramMode_10', - 'CO_f1ecac', - 'CO_FirstMin_ac', - 'CO_HistogramAMI_even_2_5', - 'CO_trev_1_num', - 'MD_hrv_classic_pnn40', - 'SB_BinaryStats_mean_longstretch1', - 'SB_TransitionMatrix_3ac_sumdiagcov', - 'PD_PeriodicityWang_th0_01', - 'CO_Embed2_Dist_tau_d_expfit_meandiff', - 'IN_AutoMutualInfoStats_40_gaussian_fmmi', - 'FC_LocalSimple_mean1_tauresrat', - 'DN_OutlierInclude_p_001_mdrmd', - 'DN_OutlierInclude_n_001_mdrmd', - 'SP_Summaries_welch_rect_area_5_1', - 'SB_BinaryStats_diff_longstretch0', - 'SB_MotifThree_quantile_hh', - 'SC_FluctAnal_2_rsrangefit_50_1_logi_prop_r1', - 'SC_FluctAnal_2_dfa_50_1_2_logi_prop_r1', - 'SP_Summaries_welch_rect_centroid', - 'FC_LocalSimple_mean3_stderr'); - -values = c(); - -for (feature in names){ - fh = get(feature); - values = append(values, fh(data)); -} - -outData = data.frame(names = names, values = values); - -return(outData) - -} \ No newline at end of file diff --git a/wrap_R/catch22/src/Makevars b/wrap_R/catch22/src/Makevars deleted file mode 100644 index 745d6db8..00000000 --- a/wrap_R/catch22/src/Makevars +++ /dev/null @@ -1 +0,0 @@ -PKG_CPPFLAGS = -I../inst/include \ No newline at end of file diff --git a/wrap_R/catch22/src/Makevars.win.in b/wrap_R/catch22/src/Makevars.win.in deleted file mode 100644 index 745d6db8..00000000 --- a/wrap_R/catch22/src/Makevars.win.in +++ /dev/null @@ -1 +0,0 @@ -PKG_CPPFLAGS = -I../inst/include \ No newline at end of file diff --git a/wrap_R/catch22/src/RcppExports.cpp b/wrap_R/catch22/src/RcppExports.cpp deleted file mode 100644 index f6e49264..00000000 --- a/wrap_R/catch22/src/RcppExports.cpp +++ /dev/null @@ -1,280 +0,0 @@ -// Generated by using Rcpp::compileAttributes() -> do not edit by hand -// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 - -#include - -using namespace Rcpp; - -// DN_HistogramMode_5 -NumericVector DN_HistogramMode_5(NumericVector x); -RcppExport SEXP _catch22_DN_HistogramMode_5(SEXP xSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP); - rcpp_result_gen = Rcpp::wrap(DN_HistogramMode_5(x)); - return rcpp_result_gen; -END_RCPP -} -// DN_HistogramMode_10 -NumericVector DN_HistogramMode_10(NumericVector x); -RcppExport SEXP _catch22_DN_HistogramMode_10(SEXP xSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP); - rcpp_result_gen = Rcpp::wrap(DN_HistogramMode_10(x)); - return rcpp_result_gen; -END_RCPP -} -// CO_f1ecac -NumericVector CO_f1ecac(NumericVector x); -RcppExport SEXP _catch22_CO_f1ecac(SEXP xSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP); - rcpp_result_gen = Rcpp::wrap(CO_f1ecac(x)); - return rcpp_result_gen; -END_RCPP -} -// CO_FirstMin_ac -NumericVector CO_FirstMin_ac(NumericVector x); -RcppExport SEXP _catch22_CO_FirstMin_ac(SEXP xSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP); - rcpp_result_gen = Rcpp::wrap(CO_FirstMin_ac(x)); - return rcpp_result_gen; -END_RCPP -} -// CO_HistogramAMI_even_2_5 -NumericVector CO_HistogramAMI_even_2_5(NumericVector x); -RcppExport SEXP _catch22_CO_HistogramAMI_even_2_5(SEXP xSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP); - rcpp_result_gen = Rcpp::wrap(CO_HistogramAMI_even_2_5(x)); - return rcpp_result_gen; -END_RCPP -} -// CO_trev_1_num -NumericVector CO_trev_1_num(NumericVector x); -RcppExport SEXP _catch22_CO_trev_1_num(SEXP xSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP); - rcpp_result_gen = Rcpp::wrap(CO_trev_1_num(x)); - return rcpp_result_gen; -END_RCPP -} -// MD_hrv_classic_pnn40 -NumericVector MD_hrv_classic_pnn40(NumericVector x); -RcppExport SEXP _catch22_MD_hrv_classic_pnn40(SEXP xSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP); - rcpp_result_gen = Rcpp::wrap(MD_hrv_classic_pnn40(x)); - return rcpp_result_gen; -END_RCPP -} -// SB_BinaryStats_mean_longstretch1 -NumericVector SB_BinaryStats_mean_longstretch1(NumericVector x); -RcppExport SEXP _catch22_SB_BinaryStats_mean_longstretch1(SEXP xSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP); - rcpp_result_gen = Rcpp::wrap(SB_BinaryStats_mean_longstretch1(x)); - return rcpp_result_gen; -END_RCPP -} -// SB_TransitionMatrix_3ac_sumdiagcov -NumericVector SB_TransitionMatrix_3ac_sumdiagcov(NumericVector x); -RcppExport SEXP _catch22_SB_TransitionMatrix_3ac_sumdiagcov(SEXP xSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP); - rcpp_result_gen = Rcpp::wrap(SB_TransitionMatrix_3ac_sumdiagcov(x)); - return rcpp_result_gen; -END_RCPP -} -// PD_PeriodicityWang_th0_01 -NumericVector PD_PeriodicityWang_th0_01(NumericVector x); -RcppExport SEXP _catch22_PD_PeriodicityWang_th0_01(SEXP xSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP); - rcpp_result_gen = Rcpp::wrap(PD_PeriodicityWang_th0_01(x)); - return rcpp_result_gen; -END_RCPP -} -// CO_Embed2_Dist_tau_d_expfit_meandiff -NumericVector CO_Embed2_Dist_tau_d_expfit_meandiff(NumericVector x); -RcppExport SEXP _catch22_CO_Embed2_Dist_tau_d_expfit_meandiff(SEXP xSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP); - rcpp_result_gen = Rcpp::wrap(CO_Embed2_Dist_tau_d_expfit_meandiff(x)); - return rcpp_result_gen; -END_RCPP -} -// IN_AutoMutualInfoStats_40_gaussian_fmmi -NumericVector IN_AutoMutualInfoStats_40_gaussian_fmmi(NumericVector x); -RcppExport SEXP _catch22_IN_AutoMutualInfoStats_40_gaussian_fmmi(SEXP xSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP); - rcpp_result_gen = Rcpp::wrap(IN_AutoMutualInfoStats_40_gaussian_fmmi(x)); - return rcpp_result_gen; -END_RCPP -} -// FC_LocalSimple_mean1_tauresrat -NumericVector FC_LocalSimple_mean1_tauresrat(NumericVector x); -RcppExport SEXP _catch22_FC_LocalSimple_mean1_tauresrat(SEXP xSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP); - rcpp_result_gen = Rcpp::wrap(FC_LocalSimple_mean1_tauresrat(x)); - return rcpp_result_gen; -END_RCPP -} -// DN_OutlierInclude_p_001_mdrmd -NumericVector DN_OutlierInclude_p_001_mdrmd(NumericVector x); -RcppExport SEXP _catch22_DN_OutlierInclude_p_001_mdrmd(SEXP xSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP); - rcpp_result_gen = Rcpp::wrap(DN_OutlierInclude_p_001_mdrmd(x)); - return rcpp_result_gen; -END_RCPP -} -// DN_OutlierInclude_n_001_mdrmd -NumericVector DN_OutlierInclude_n_001_mdrmd(NumericVector x); -RcppExport SEXP _catch22_DN_OutlierInclude_n_001_mdrmd(SEXP xSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP); - rcpp_result_gen = Rcpp::wrap(DN_OutlierInclude_n_001_mdrmd(x)); - return rcpp_result_gen; -END_RCPP -} -// SP_Summaries_welch_rect_area_5_1 -NumericVector SP_Summaries_welch_rect_area_5_1(NumericVector x); -RcppExport SEXP _catch22_SP_Summaries_welch_rect_area_5_1(SEXP xSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP); - rcpp_result_gen = Rcpp::wrap(SP_Summaries_welch_rect_area_5_1(x)); - return rcpp_result_gen; -END_RCPP -} -// SB_BinaryStats_diff_longstretch0 -NumericVector SB_BinaryStats_diff_longstretch0(NumericVector x); -RcppExport SEXP _catch22_SB_BinaryStats_diff_longstretch0(SEXP xSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP); - rcpp_result_gen = Rcpp::wrap(SB_BinaryStats_diff_longstretch0(x)); - return rcpp_result_gen; -END_RCPP -} -// SB_MotifThree_quantile_hh -NumericVector SB_MotifThree_quantile_hh(NumericVector x); -RcppExport SEXP _catch22_SB_MotifThree_quantile_hh(SEXP xSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP); - rcpp_result_gen = Rcpp::wrap(SB_MotifThree_quantile_hh(x)); - return rcpp_result_gen; -END_RCPP -} -// SC_FluctAnal_2_rsrangefit_50_1_logi_prop_r1 -NumericVector SC_FluctAnal_2_rsrangefit_50_1_logi_prop_r1(NumericVector x); -RcppExport SEXP _catch22_SC_FluctAnal_2_rsrangefit_50_1_logi_prop_r1(SEXP xSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP); - rcpp_result_gen = Rcpp::wrap(SC_FluctAnal_2_rsrangefit_50_1_logi_prop_r1(x)); - return rcpp_result_gen; -END_RCPP -} -// SC_FluctAnal_2_dfa_50_1_2_logi_prop_r1 -NumericVector SC_FluctAnal_2_dfa_50_1_2_logi_prop_r1(NumericVector x); -RcppExport SEXP _catch22_SC_FluctAnal_2_dfa_50_1_2_logi_prop_r1(SEXP xSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP); - rcpp_result_gen = Rcpp::wrap(SC_FluctAnal_2_dfa_50_1_2_logi_prop_r1(x)); - return rcpp_result_gen; -END_RCPP -} -// SP_Summaries_welch_rect_centroid -NumericVector SP_Summaries_welch_rect_centroid(NumericVector x); -RcppExport SEXP _catch22_SP_Summaries_welch_rect_centroid(SEXP xSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP); - rcpp_result_gen = Rcpp::wrap(SP_Summaries_welch_rect_centroid(x)); - return rcpp_result_gen; -END_RCPP -} -// FC_LocalSimple_mean3_stderr -NumericVector FC_LocalSimple_mean3_stderr(NumericVector x); -RcppExport SEXP _catch22_FC_LocalSimple_mean3_stderr(SEXP xSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP); - rcpp_result_gen = Rcpp::wrap(FC_LocalSimple_mean3_stderr(x)); - return rcpp_result_gen; -END_RCPP -} - -static const R_CallMethodDef CallEntries[] = { - {"_catch22_DN_HistogramMode_5", (DL_FUNC) &_catch22_DN_HistogramMode_5, 1}, - {"_catch22_DN_HistogramMode_10", (DL_FUNC) &_catch22_DN_HistogramMode_10, 1}, - {"_catch22_CO_f1ecac", (DL_FUNC) &_catch22_CO_f1ecac, 1}, - {"_catch22_CO_FirstMin_ac", (DL_FUNC) &_catch22_CO_FirstMin_ac, 1}, - {"_catch22_CO_HistogramAMI_even_2_5", (DL_FUNC) &_catch22_CO_HistogramAMI_even_2_5, 1}, - {"_catch22_CO_trev_1_num", (DL_FUNC) &_catch22_CO_trev_1_num, 1}, - {"_catch22_MD_hrv_classic_pnn40", (DL_FUNC) &_catch22_MD_hrv_classic_pnn40, 1}, - {"_catch22_SB_BinaryStats_mean_longstretch1", (DL_FUNC) &_catch22_SB_BinaryStats_mean_longstretch1, 1}, - {"_catch22_SB_TransitionMatrix_3ac_sumdiagcov", (DL_FUNC) &_catch22_SB_TransitionMatrix_3ac_sumdiagcov, 1}, - {"_catch22_PD_PeriodicityWang_th0_01", (DL_FUNC) &_catch22_PD_PeriodicityWang_th0_01, 1}, - {"_catch22_CO_Embed2_Dist_tau_d_expfit_meandiff", (DL_FUNC) &_catch22_CO_Embed2_Dist_tau_d_expfit_meandiff, 1}, - {"_catch22_IN_AutoMutualInfoStats_40_gaussian_fmmi", (DL_FUNC) &_catch22_IN_AutoMutualInfoStats_40_gaussian_fmmi, 1}, - {"_catch22_FC_LocalSimple_mean1_tauresrat", (DL_FUNC) &_catch22_FC_LocalSimple_mean1_tauresrat, 1}, - {"_catch22_DN_OutlierInclude_p_001_mdrmd", (DL_FUNC) &_catch22_DN_OutlierInclude_p_001_mdrmd, 1}, - {"_catch22_DN_OutlierInclude_n_001_mdrmd", (DL_FUNC) &_catch22_DN_OutlierInclude_n_001_mdrmd, 1}, - {"_catch22_SP_Summaries_welch_rect_area_5_1", (DL_FUNC) &_catch22_SP_Summaries_welch_rect_area_5_1, 1}, - {"_catch22_SB_BinaryStats_diff_longstretch0", (DL_FUNC) &_catch22_SB_BinaryStats_diff_longstretch0, 1}, - {"_catch22_SB_MotifThree_quantile_hh", (DL_FUNC) &_catch22_SB_MotifThree_quantile_hh, 1}, - {"_catch22_SC_FluctAnal_2_rsrangefit_50_1_logi_prop_r1", (DL_FUNC) &_catch22_SC_FluctAnal_2_rsrangefit_50_1_logi_prop_r1, 1}, - {"_catch22_SC_FluctAnal_2_dfa_50_1_2_logi_prop_r1", (DL_FUNC) &_catch22_SC_FluctAnal_2_dfa_50_1_2_logi_prop_r1, 1}, - {"_catch22_SP_Summaries_welch_rect_centroid", (DL_FUNC) &_catch22_SP_Summaries_welch_rect_centroid, 1}, - {"_catch22_FC_LocalSimple_mean3_stderr", (DL_FUNC) &_catch22_FC_LocalSimple_mean3_stderr, 1}, - {NULL, NULL, 0} -}; - -RcppExport void R_init_catch22(DllInfo *dll) { - R_registerRoutines(dll, NULL, CallEntries, NULL, NULL); - R_useDynamicSymbols(dll, FALSE); -} diff --git a/wrap_R/catch22/src/catch22_wrap.cpp b/wrap_R/catch22/src/catch22_wrap.cpp deleted file mode 100644 index cf2aa074..00000000 --- a/wrap_R/catch22/src/catch22_wrap.cpp +++ /dev/null @@ -1,266 +0,0 @@ -#include - -// include functions -extern "C" { -#include "CO_AutoCorr.h" -#include "DN_HistogramMode_10.h" -#include "DN_HistogramMode_5.h" -#include "DN_OutlierInclude.h" -#include "FC_LocalSimple.h" -#include "IN_AutoMutualInfoStats.h" -#include "MD_hrv.h" -#include "PD_PeriodicityWang.h" -#include "SB_BinaryStats.h" -#include "SB_CoarseGrain.h" -#include "SB_MotifThree.h" -#include "SB_TransitionMatrix.h" -#include "SC_FluctAnal.h" -#include "SP_Summaries.h" -#include "butterworth.h" -#include "fft.h" -#include "helper_functions.h" -#include "histcounts.h" -#include "splinefit.h" -#include "stats.h" -} - -using namespace Rcpp; - -// Learn more about Rcpp at: -// -// http://www.rcpp.org/ -// http://adv-r.had.co.nz/Rcpp.html -// http://gallery.rcpp.org/ -// - - -// universal wrapper for a function that takes a double array and its length -// and outputs a scalar double -NumericVector R_wrapper_double(NumericVector x, double (*f) (const double*, const int), int normalize) { - - int n = x.size(); - double * arrayC = new double[n]; - double out; - - int i; - for (i=0; i