diff --git a/DESCRIPTION b/DESCRIPTION index 347be2c..3c32724 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: philentropy Type: Package Title: Similarity and Distance Quantification Between Probability Functions -Version: 0.10.0 +Version: 0.10.1 Authors@R: c(person("Hajk-Georg", "Drost", role = c("aut", "cre"), email = "hajk-georg.drost@tuebingen.mpg.de", diff --git a/inst/include/philentropy_RcppExports.h b/inst/include/philentropy_RcppExports.h index 11b6bd7..c7934fc 100644 --- a/inst/include/philentropy_RcppExports.h +++ b/inst/include/philentropy_RcppExports.h @@ -24,6 +24,90 @@ namespace philentropy { } } + inline double dist_one_one(const Rcpp::NumericVector& P, const Rcpp::NumericVector& Q, const Rcpp::String& method, Rcpp::Nullable p = R_NilValue, const bool& testNA = true, const Rcpp::String& unit = "log", const double& epsilon = 0.00001) { + typedef SEXP(*Ptr_dist_one_one)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP); + static Ptr_dist_one_one p_dist_one_one = NULL; + if (p_dist_one_one == NULL) { + validateSignature("double(*dist_one_one)(const Rcpp::NumericVector&,const Rcpp::NumericVector&,const Rcpp::String&,Rcpp::Nullable,const bool&,const Rcpp::String&,const double&)"); + p_dist_one_one = (Ptr_dist_one_one)R_GetCCallable("philentropy", "_philentropy_dist_one_one"); + } + RObject rcpp_result_gen; + { + RNGScope RCPP_rngScope_gen; + rcpp_result_gen = p_dist_one_one(Shield(Rcpp::wrap(P)), Shield(Rcpp::wrap(Q)), Shield(Rcpp::wrap(method)), Shield(Rcpp::wrap(p)), Shield(Rcpp::wrap(testNA)), Shield(Rcpp::wrap(unit)), Shield(Rcpp::wrap(epsilon))); + } + if (rcpp_result_gen.inherits("interrupted-error")) + throw Rcpp::internal::InterruptedException(); + if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen)) + throw Rcpp::LongjumpException(rcpp_result_gen); + if (rcpp_result_gen.inherits("try-error")) + throw Rcpp::exception(Rcpp::as(rcpp_result_gen).c_str()); + return Rcpp::as(rcpp_result_gen); + } + + inline Rcpp::NumericVector dist_one_many(const Rcpp::NumericVector& P, Rcpp::NumericMatrix dists, Rcpp::String method, Rcpp::Nullable p = R_NilValue, bool testNA = true, Rcpp::String unit = "log", double epsilon = 0.00001, Rcpp::Nullable num_threads = R_NilValue) { + typedef SEXP(*Ptr_dist_one_many)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP); + static Ptr_dist_one_many p_dist_one_many = NULL; + if (p_dist_one_many == NULL) { + validateSignature("Rcpp::NumericVector(*dist_one_many)(const Rcpp::NumericVector&,Rcpp::NumericMatrix,Rcpp::String,Rcpp::Nullable,bool,Rcpp::String,double,Rcpp::Nullable)"); + p_dist_one_many = (Ptr_dist_one_many)R_GetCCallable("philentropy", "_philentropy_dist_one_many"); + } + RObject rcpp_result_gen; + { + RNGScope RCPP_rngScope_gen; + rcpp_result_gen = p_dist_one_many(Shield(Rcpp::wrap(P)), Shield(Rcpp::wrap(dists)), Shield(Rcpp::wrap(method)), Shield(Rcpp::wrap(p)), Shield(Rcpp::wrap(testNA)), Shield(Rcpp::wrap(unit)), Shield(Rcpp::wrap(epsilon)), Shield(Rcpp::wrap(num_threads))); + } + if (rcpp_result_gen.inherits("interrupted-error")) + throw Rcpp::internal::InterruptedException(); + if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen)) + throw Rcpp::LongjumpException(rcpp_result_gen); + if (rcpp_result_gen.inherits("try-error")) + throw Rcpp::exception(Rcpp::as(rcpp_result_gen).c_str()); + return Rcpp::as(rcpp_result_gen); + } + + inline Rcpp::NumericMatrix dist_many_many(Rcpp::NumericMatrix& dists1, Rcpp::NumericMatrix& dists2, Rcpp::String method, Rcpp::Nullable p = R_NilValue, bool testNA = true, Rcpp::String unit = "log", double epsilon = 0.00001, Rcpp::Nullable num_threads = R_NilValue) { + typedef SEXP(*Ptr_dist_many_many)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP); + static Ptr_dist_many_many p_dist_many_many = NULL; + if (p_dist_many_many == NULL) { + validateSignature("Rcpp::NumericMatrix(*dist_many_many)(Rcpp::NumericMatrix&,Rcpp::NumericMatrix&,Rcpp::String,Rcpp::Nullable,bool,Rcpp::String,double,Rcpp::Nullable)"); + p_dist_many_many = (Ptr_dist_many_many)R_GetCCallable("philentropy", "_philentropy_dist_many_many"); + } + RObject rcpp_result_gen; + { + RNGScope RCPP_rngScope_gen; + rcpp_result_gen = p_dist_many_many(Shield(Rcpp::wrap(dists1)), Shield(Rcpp::wrap(dists2)), Shield(Rcpp::wrap(method)), Shield(Rcpp::wrap(p)), Shield(Rcpp::wrap(testNA)), Shield(Rcpp::wrap(unit)), Shield(Rcpp::wrap(epsilon)), Shield(Rcpp::wrap(num_threads))); + } + if (rcpp_result_gen.inherits("interrupted-error")) + throw Rcpp::internal::InterruptedException(); + if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen)) + throw Rcpp::LongjumpException(rcpp_result_gen); + if (rcpp_result_gen.inherits("try-error")) + throw Rcpp::exception(Rcpp::as(rcpp_result_gen).c_str()); + return Rcpp::as(rcpp_result_gen); + } + + inline Rcpp::NumericMatrix distance_cpp(Rcpp::NumericMatrix x, std::string method, Rcpp::Nullable p, bool test_na, std::string unit, double epsilon, Rcpp::Nullable num_threads) { + typedef SEXP(*Ptr_distance_cpp)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP); + static Ptr_distance_cpp p_distance_cpp = NULL; + if (p_distance_cpp == NULL) { + validateSignature("Rcpp::NumericMatrix(*distance_cpp)(Rcpp::NumericMatrix,std::string,Rcpp::Nullable,bool,std::string,double,Rcpp::Nullable)"); + p_distance_cpp = (Ptr_distance_cpp)R_GetCCallable("philentropy", "_philentropy_distance_cpp"); + } + RObject rcpp_result_gen; + { + RNGScope RCPP_rngScope_gen; + rcpp_result_gen = p_distance_cpp(Shield(Rcpp::wrap(x)), Shield(Rcpp::wrap(method)), Shield(Rcpp::wrap(p)), Shield(Rcpp::wrap(test_na)), Shield(Rcpp::wrap(unit)), Shield(Rcpp::wrap(epsilon)), Shield(Rcpp::wrap(num_threads))); + } + if (rcpp_result_gen.inherits("interrupted-error")) + throw Rcpp::internal::InterruptedException(); + if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen)) + throw Rcpp::LongjumpException(rcpp_result_gen); + if (rcpp_result_gen.inherits("try-error")) + throw Rcpp::exception(Rcpp::as(rcpp_result_gen).c_str()); + return Rcpp::as(rcpp_result_gen); + } + inline Rcpp::NumericMatrix as_matrix(Rcpp::DataFrame x) { typedef SEXP(*Ptr_as_matrix)(SEXP); static Ptr_as_matrix p_as_matrix = NULL; diff --git a/src/RcppExports.cpp b/src/RcppExports.cpp index dbc419e..0f940b2 100644 --- a/src/RcppExports.cpp +++ b/src/RcppExports.cpp @@ -105,10 +105,9 @@ END_RCPP } // dist_one_one double dist_one_one(const Rcpp::NumericVector& P, const Rcpp::NumericVector& Q, const Rcpp::String& method, Rcpp::Nullable p, const bool& testNA, const Rcpp::String& unit, const double& epsilon); -RcppExport SEXP _philentropy_dist_one_one(SEXP PSEXP, SEXP QSEXP, SEXP methodSEXP, SEXP pSEXP, SEXP testNASEXP, SEXP unitSEXP, SEXP epsilonSEXP) { +static SEXP _philentropy_dist_one_one_try(SEXP PSEXP, SEXP QSEXP, SEXP methodSEXP, SEXP pSEXP, SEXP testNASEXP, SEXP unitSEXP, SEXP epsilonSEXP) { BEGIN_RCPP Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type P(PSEXP); Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type Q(QSEXP); Rcpp::traits::input_parameter< const Rcpp::String& >::type method(methodSEXP); @@ -118,14 +117,37 @@ BEGIN_RCPP Rcpp::traits::input_parameter< const double& >::type epsilon(epsilonSEXP); rcpp_result_gen = Rcpp::wrap(dist_one_one(P, Q, method, p, testNA, unit, epsilon)); return rcpp_result_gen; -END_RCPP +END_RCPP_RETURN_ERROR +} +RcppExport SEXP _philentropy_dist_one_one(SEXP PSEXP, SEXP QSEXP, SEXP methodSEXP, SEXP pSEXP, SEXP testNASEXP, SEXP unitSEXP, SEXP epsilonSEXP) { + SEXP rcpp_result_gen; + { + Rcpp::RNGScope rcpp_rngScope_gen; + rcpp_result_gen = PROTECT(_philentropy_dist_one_one_try(PSEXP, QSEXP, methodSEXP, pSEXP, testNASEXP, unitSEXP, epsilonSEXP)); + } + Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error"); + if (rcpp_isInterrupt_gen) { + UNPROTECT(1); + Rf_onintr(); + } + bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen); + if (rcpp_isLongjump_gen) { + Rcpp::internal::resumeJump(rcpp_result_gen); + } + Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error"); + if (rcpp_isError_gen) { + SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen); + UNPROTECT(1); + (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen)); + } + UNPROTECT(1); + return rcpp_result_gen; } // dist_one_many_cpp Rcpp::NumericVector dist_one_many_cpp(const Rcpp::NumericVector& P, Rcpp::NumericMatrix dists, Rcpp::String method, Rcpp::Nullable p, bool testNA, Rcpp::String unit, double epsilon, Rcpp::Nullable num_threads); -RcppExport SEXP _philentropy_dist_one_many_cpp(SEXP PSEXP, SEXP distsSEXP, SEXP methodSEXP, SEXP pSEXP, SEXP testNASEXP, SEXP unitSEXP, SEXP epsilonSEXP, SEXP num_threadsSEXP) { +static SEXP _philentropy_dist_one_many_cpp_try(SEXP PSEXP, SEXP distsSEXP, SEXP methodSEXP, SEXP pSEXP, SEXP testNASEXP, SEXP unitSEXP, SEXP epsilonSEXP, SEXP num_threadsSEXP) { BEGIN_RCPP Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type P(PSEXP); Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type dists(distsSEXP); Rcpp::traits::input_parameter< Rcpp::String >::type method(methodSEXP); @@ -136,14 +158,37 @@ BEGIN_RCPP Rcpp::traits::input_parameter< Rcpp::Nullable >::type num_threads(num_threadsSEXP); rcpp_result_gen = Rcpp::wrap(dist_one_many_cpp(P, dists, method, p, testNA, unit, epsilon, num_threads)); return rcpp_result_gen; -END_RCPP +END_RCPP_RETURN_ERROR +} +RcppExport SEXP _philentropy_dist_one_many_cpp(SEXP PSEXP, SEXP distsSEXP, SEXP methodSEXP, SEXP pSEXP, SEXP testNASEXP, SEXP unitSEXP, SEXP epsilonSEXP, SEXP num_threadsSEXP) { + SEXP rcpp_result_gen; + { + Rcpp::RNGScope rcpp_rngScope_gen; + rcpp_result_gen = PROTECT(_philentropy_dist_one_many_cpp_try(PSEXP, distsSEXP, methodSEXP, pSEXP, testNASEXP, unitSEXP, epsilonSEXP, num_threadsSEXP)); + } + Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error"); + if (rcpp_isInterrupt_gen) { + UNPROTECT(1); + Rf_onintr(); + } + bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen); + if (rcpp_isLongjump_gen) { + Rcpp::internal::resumeJump(rcpp_result_gen); + } + Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error"); + if (rcpp_isError_gen) { + SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen); + UNPROTECT(1); + (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen)); + } + UNPROTECT(1); + return rcpp_result_gen; } // dist_many_many_cpp Rcpp::NumericMatrix dist_many_many_cpp(Rcpp::NumericMatrix& dists1, Rcpp::NumericMatrix& dists2, Rcpp::String method, Rcpp::Nullable p, bool testNA, Rcpp::String unit, double epsilon, Rcpp::Nullable num_threads); -RcppExport SEXP _philentropy_dist_many_many_cpp(SEXP dists1SEXP, SEXP dists2SEXP, SEXP methodSEXP, SEXP pSEXP, SEXP testNASEXP, SEXP unitSEXP, SEXP epsilonSEXP, SEXP num_threadsSEXP) { +static SEXP _philentropy_dist_many_many_cpp_try(SEXP dists1SEXP, SEXP dists2SEXP, SEXP methodSEXP, SEXP pSEXP, SEXP testNASEXP, SEXP unitSEXP, SEXP epsilonSEXP, SEXP num_threadsSEXP) { BEGIN_RCPP Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; Rcpp::traits::input_parameter< Rcpp::NumericMatrix& >::type dists1(dists1SEXP); Rcpp::traits::input_parameter< Rcpp::NumericMatrix& >::type dists2(dists2SEXP); Rcpp::traits::input_parameter< Rcpp::String >::type method(methodSEXP); @@ -154,14 +199,37 @@ BEGIN_RCPP Rcpp::traits::input_parameter< Rcpp::Nullable >::type num_threads(num_threadsSEXP); rcpp_result_gen = Rcpp::wrap(dist_many_many_cpp(dists1, dists2, method, p, testNA, unit, epsilon, num_threads)); return rcpp_result_gen; -END_RCPP +END_RCPP_RETURN_ERROR +} +RcppExport SEXP _philentropy_dist_many_many_cpp(SEXP dists1SEXP, SEXP dists2SEXP, SEXP methodSEXP, SEXP pSEXP, SEXP testNASEXP, SEXP unitSEXP, SEXP epsilonSEXP, SEXP num_threadsSEXP) { + SEXP rcpp_result_gen; + { + Rcpp::RNGScope rcpp_rngScope_gen; + rcpp_result_gen = PROTECT(_philentropy_dist_many_many_cpp_try(dists1SEXP, dists2SEXP, methodSEXP, pSEXP, testNASEXP, unitSEXP, epsilonSEXP, num_threadsSEXP)); + } + Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error"); + if (rcpp_isInterrupt_gen) { + UNPROTECT(1); + Rf_onintr(); + } + bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen); + if (rcpp_isLongjump_gen) { + Rcpp::internal::resumeJump(rcpp_result_gen); + } + Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error"); + if (rcpp_isError_gen) { + SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen); + UNPROTECT(1); + (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen)); + } + UNPROTECT(1); + return rcpp_result_gen; } // distance_cpp Rcpp::NumericMatrix distance_cpp(Rcpp::NumericMatrix x, std::string method, Rcpp::Nullable p, bool test_na, std::string unit, double epsilon, Rcpp::Nullable num_threads); -RcppExport SEXP _philentropy_distance_cpp(SEXP xSEXP, SEXP methodSEXP, SEXP pSEXP, SEXP test_naSEXP, SEXP unitSEXP, SEXP epsilonSEXP, SEXP num_threadsSEXP) { +static SEXP _philentropy_distance_cpp_try(SEXP xSEXP, SEXP methodSEXP, SEXP pSEXP, SEXP test_naSEXP, SEXP unitSEXP, SEXP epsilonSEXP, SEXP num_threadsSEXP) { BEGIN_RCPP Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type x(xSEXP); Rcpp::traits::input_parameter< std::string >::type method(methodSEXP); Rcpp::traits::input_parameter< Rcpp::Nullable >::type p(pSEXP); @@ -171,7 +239,31 @@ BEGIN_RCPP Rcpp::traits::input_parameter< Rcpp::Nullable >::type num_threads(num_threadsSEXP); rcpp_result_gen = Rcpp::wrap(distance_cpp(x, method, p, test_na, unit, epsilon, num_threads)); return rcpp_result_gen; -END_RCPP +END_RCPP_RETURN_ERROR +} +RcppExport SEXP _philentropy_distance_cpp(SEXP xSEXP, SEXP methodSEXP, SEXP pSEXP, SEXP test_naSEXP, SEXP unitSEXP, SEXP epsilonSEXP, SEXP num_threadsSEXP) { + SEXP rcpp_result_gen; + { + Rcpp::RNGScope rcpp_rngScope_gen; + rcpp_result_gen = PROTECT(_philentropy_distance_cpp_try(xSEXP, methodSEXP, pSEXP, test_naSEXP, unitSEXP, epsilonSEXP, num_threadsSEXP)); + } + Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error"); + if (rcpp_isInterrupt_gen) { + UNPROTECT(1); + Rf_onintr(); + } + bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen); + if (rcpp_isLongjump_gen) { + Rcpp::internal::resumeJump(rcpp_result_gen); + } + Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error"); + if (rcpp_isError_gen) { + SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen); + UNPROTECT(1); + (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen)); + } + UNPROTECT(1); + return rcpp_result_gen; } // custom_log2 double custom_log2(const double& x); @@ -814,7 +906,7 @@ RcppExport SEXP _philentropy_as_matrix(SEXP xSEXP) { if (rcpp_isError_gen) { SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen); UNPROTECT(1); - Rf_error("%s", CHAR(rcpp_msgSEXP_gen)); + (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen)); } UNPROTECT(1); return rcpp_result_gen; @@ -848,7 +940,7 @@ RcppExport SEXP _philentropy_as_data_frame(SEXP matSEXP) { if (rcpp_isError_gen) { SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen); UNPROTECT(1); - Rf_error("%s", CHAR(rcpp_msgSEXP_gen)); + (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen)); } UNPROTECT(1); return rcpp_result_gen; @@ -882,7 +974,7 @@ RcppExport SEXP _philentropy_sum_rcpp(SEXP vecSEXP) { if (rcpp_isError_gen) { SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen); UNPROTECT(1); - Rf_error("%s", CHAR(rcpp_msgSEXP_gen)); + (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen)); } UNPROTECT(1); return rcpp_result_gen; @@ -916,7 +1008,7 @@ RcppExport SEXP _philentropy_est_prob_empirical(SEXP CountVecSEXP) { if (rcpp_isError_gen) { SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen); UNPROTECT(1); - Rf_error("%s", CHAR(rcpp_msgSEXP_gen)); + (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen)); } UNPROTECT(1); return rcpp_result_gen; @@ -926,6 +1018,10 @@ RcppExport SEXP _philentropy_est_prob_empirical(SEXP CountVecSEXP) { static int _philentropy_RcppExport_validate(const char* sig) { static std::set signatures; if (signatures.empty()) { + signatures.insert("double(*dist_one_one)(const Rcpp::NumericVector&,const Rcpp::NumericVector&,const Rcpp::String&,Rcpp::Nullable,const bool&,const Rcpp::String&,const double&)"); + signatures.insert("Rcpp::NumericVector(*dist_one_many)(const Rcpp::NumericVector&,Rcpp::NumericMatrix,Rcpp::String,Rcpp::Nullable,bool,Rcpp::String,double,Rcpp::Nullable)"); + signatures.insert("Rcpp::NumericMatrix(*dist_many_many)(Rcpp::NumericMatrix&,Rcpp::NumericMatrix&,Rcpp::String,Rcpp::Nullable,bool,Rcpp::String,double,Rcpp::Nullable)"); + signatures.insert("Rcpp::NumericMatrix(*distance_cpp)(Rcpp::NumericMatrix,std::string,Rcpp::Nullable,bool,std::string,double,Rcpp::Nullable)"); signatures.insert("Rcpp::NumericMatrix(*as_matrix)(Rcpp::DataFrame)"); signatures.insert("Rcpp::DataFrame(*as_data_frame)(Rcpp::NumericMatrix)"); signatures.insert("SEXP(*sum_rcpp)(SEXP)"); @@ -936,6 +1032,10 @@ static int _philentropy_RcppExport_validate(const char* sig) { // registerCCallable (register entry points for exported C++ functions) RcppExport SEXP _philentropy_RcppExport_registerCCallable() { + R_RegisterCCallable("philentropy", "_philentropy_dist_one_one", (DL_FUNC)_philentropy_dist_one_one_try); + R_RegisterCCallable("philentropy", "_philentropy_dist_one_many", (DL_FUNC)_philentropy_dist_one_many_cpp_try); + R_RegisterCCallable("philentropy", "_philentropy_dist_many_many", (DL_FUNC)_philentropy_dist_many_many_cpp_try); + R_RegisterCCallable("philentropy", "_philentropy_distance_cpp", (DL_FUNC)_philentropy_distance_cpp_try); R_RegisterCCallable("philentropy", "_philentropy_as_matrix", (DL_FUNC)_philentropy_as_matrix_try); R_RegisterCCallable("philentropy", "_philentropy_as_data_frame", (DL_FUNC)_philentropy_as_data_frame_try); R_RegisterCCallable("philentropy", "_philentropy_sum_rcpp", (DL_FUNC)_philentropy_sum_rcpp_try); diff --git a/src/dist_matrix.cpp b/src/dist_matrix.cpp index fb60323..5368e39 100644 --- a/src/dist_matrix.cpp +++ b/src/dist_matrix.cpp @@ -1,5 +1,6 @@ // [[Rcpp::plugins(cpp11)]] // [[Rcpp::depends(RcppParallel)]] +// [[Rcpp::interfaces(r, cpp)]] #include #include "utils.h"