diff --git a/R/RcppExports.R b/R/RcppExports.R index 6b502ce..b12b3b4 100644 --- a/R/RcppExports.R +++ b/R/RcppExports.R @@ -61,22 +61,6 @@ create_file_h5 <- function(filename) { invisible(.Call(`_EigenH5_create_file_h5`, filename)) } -par_path <- function(filename) { - .Call(`_EigenH5_par_path`, filename) -} - -par_iter_path <- function(filename) { - .Call(`_EigenH5_par_iter_path`, filename) -} - -exp_par_iter_path <- function(filename) { - .Call(`_EigenH5_exp_par_iter_path`, filename) -} - -exp_par_path <- function(filename) { - .Call(`_EigenH5_exp_par_path`, filename) -} - dataset_chunks <- function(filename, datapath) { .Call(`_EigenH5_dataset_chunks`, filename, datapath) } diff --git a/inst/include/EigenH5_RcppExports.h b/inst/include/EigenH5_RcppExports.h index ac6630a..233b263 100644 --- a/inst/include/EigenH5_RcppExports.h +++ b/inst/include/EigenH5_RcppExports.h @@ -316,90 +316,6 @@ namespace EigenH5 { throw Rcpp::exception(Rcpp::as(rcpp_result_gen).c_str()); } - inline Rcpp::StringVector par_path(const std::string filename) { - typedef SEXP(*Ptr_par_path)(SEXP); - static Ptr_par_path p_par_path = NULL; - if (p_par_path == NULL) { - validateSignature("Rcpp::StringVector(*par_path)(const std::string)"); - p_par_path = (Ptr_par_path)R_GetCCallable("EigenH5", "_EigenH5_par_path"); - } - RObject rcpp_result_gen; - { - RNGScope RCPP_rngScope_gen; - rcpp_result_gen = p_par_path(Shield(Rcpp::wrap(filename))); - } - 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::StringVector par_iter_path(const std::string filename) { - typedef SEXP(*Ptr_par_iter_path)(SEXP); - static Ptr_par_iter_path p_par_iter_path = NULL; - if (p_par_iter_path == NULL) { - validateSignature("Rcpp::StringVector(*par_iter_path)(const std::string)"); - p_par_iter_path = (Ptr_par_iter_path)R_GetCCallable("EigenH5", "_EigenH5_par_iter_path"); - } - RObject rcpp_result_gen; - { - RNGScope RCPP_rngScope_gen; - rcpp_result_gen = p_par_iter_path(Shield(Rcpp::wrap(filename))); - } - 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::StringVector exp_par_iter_path(const std::string filename) { - typedef SEXP(*Ptr_exp_par_iter_path)(SEXP); - static Ptr_exp_par_iter_path p_exp_par_iter_path = NULL; - if (p_exp_par_iter_path == NULL) { - validateSignature("Rcpp::StringVector(*exp_par_iter_path)(const std::string)"); - p_exp_par_iter_path = (Ptr_exp_par_iter_path)R_GetCCallable("EigenH5", "_EigenH5_exp_par_iter_path"); - } - RObject rcpp_result_gen; - { - RNGScope RCPP_rngScope_gen; - rcpp_result_gen = p_exp_par_iter_path(Shield(Rcpp::wrap(filename))); - } - 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::StringVector exp_par_path(const std::string filename) { - typedef SEXP(*Ptr_exp_par_path)(SEXP); - static Ptr_exp_par_path p_exp_par_path = NULL; - if (p_exp_par_path == NULL) { - validateSignature("Rcpp::StringVector(*exp_par_path)(const std::string)"); - p_exp_par_path = (Ptr_exp_par_path)R_GetCCallable("EigenH5", "_EigenH5_exp_par_path"); - } - RObject rcpp_result_gen; - { - RNGScope RCPP_rngScope_gen; - rcpp_result_gen = p_exp_par_path(Shield(Rcpp::wrap(filename))); - } - 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::IntegerVector dataset_chunks(const std::string filename, const std::string datapath) { typedef SEXP(*Ptr_dataset_chunks)(SEXP,SEXP); static Ptr_dataset_chunks p_dataset_chunks = NULL; diff --git a/src/RcppExports.cpp b/src/RcppExports.cpp index 13bad42..d9c1851 100644 --- a/src/RcppExports.cpp +++ b/src/RcppExports.cpp @@ -516,142 +516,6 @@ RcppExport SEXP _EigenH5_create_file_h5(SEXP filenameSEXP) { UNPROTECT(1); return rcpp_result_gen; } -// par_path -Rcpp::StringVector par_path(const std::string filename); -static SEXP _EigenH5_par_path_try(SEXP filenameSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::traits::input_parameter< const std::string >::type filename(filenameSEXP); - rcpp_result_gen = Rcpp::wrap(par_path(filename)); - return rcpp_result_gen; -END_RCPP_RETURN_ERROR -} -RcppExport SEXP _EigenH5_par_path(SEXP filenameSEXP) { - SEXP rcpp_result_gen; - { - Rcpp::RNGScope rcpp_rngScope_gen; - rcpp_result_gen = PROTECT(_EigenH5_par_path_try(filenameSEXP)); - } - 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(CHAR(rcpp_msgSEXP_gen)); - } - UNPROTECT(1); - return rcpp_result_gen; -} -// par_iter_path -Rcpp::StringVector par_iter_path(const std::string filename); -static SEXP _EigenH5_par_iter_path_try(SEXP filenameSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::traits::input_parameter< const std::string >::type filename(filenameSEXP); - rcpp_result_gen = Rcpp::wrap(par_iter_path(filename)); - return rcpp_result_gen; -END_RCPP_RETURN_ERROR -} -RcppExport SEXP _EigenH5_par_iter_path(SEXP filenameSEXP) { - SEXP rcpp_result_gen; - { - Rcpp::RNGScope rcpp_rngScope_gen; - rcpp_result_gen = PROTECT(_EigenH5_par_iter_path_try(filenameSEXP)); - } - 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(CHAR(rcpp_msgSEXP_gen)); - } - UNPROTECT(1); - return rcpp_result_gen; -} -// exp_par_iter_path -Rcpp::StringVector exp_par_iter_path(const std::string filename); -static SEXP _EigenH5_exp_par_iter_path_try(SEXP filenameSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::traits::input_parameter< const std::string >::type filename(filenameSEXP); - rcpp_result_gen = Rcpp::wrap(exp_par_iter_path(filename)); - return rcpp_result_gen; -END_RCPP_RETURN_ERROR -} -RcppExport SEXP _EigenH5_exp_par_iter_path(SEXP filenameSEXP) { - SEXP rcpp_result_gen; - { - Rcpp::RNGScope rcpp_rngScope_gen; - rcpp_result_gen = PROTECT(_EigenH5_exp_par_iter_path_try(filenameSEXP)); - } - 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(CHAR(rcpp_msgSEXP_gen)); - } - UNPROTECT(1); - return rcpp_result_gen; -} -// exp_par_path -Rcpp::StringVector exp_par_path(const std::string filename); -static SEXP _EigenH5_exp_par_path_try(SEXP filenameSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::traits::input_parameter< const std::string >::type filename(filenameSEXP); - rcpp_result_gen = Rcpp::wrap(exp_par_path(filename)); - return rcpp_result_gen; -END_RCPP_RETURN_ERROR -} -RcppExport SEXP _EigenH5_exp_par_path(SEXP filenameSEXP) { - SEXP rcpp_result_gen; - { - Rcpp::RNGScope rcpp_rngScope_gen; - rcpp_result_gen = PROTECT(_EigenH5_exp_par_path_try(filenameSEXP)); - } - 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(CHAR(rcpp_msgSEXP_gen)); - } - UNPROTECT(1); - return rcpp_result_gen; -} // dataset_chunks Rcpp::IntegerVector dataset_chunks(const std::string filename, const std::string datapath); static SEXP _EigenH5_dataset_chunks_try(SEXP filenameSEXP, SEXP datapathSEXP) { @@ -1162,10 +1026,6 @@ static int _EigenH5_RcppExport_validate(const char* sig) { signatures.insert("SEXP(*read_attribute_h5)(const std::string&,std::string)"); signatures.insert("bool(*create_dataset_h5)(const std::string&,std::string,const RObject&,Rcpp::List)"); signatures.insert("void(*create_file_h5)(const std::string)"); - signatures.insert("Rcpp::StringVector(*par_path)(const std::string)"); - signatures.insert("Rcpp::StringVector(*par_iter_path)(const std::string)"); - signatures.insert("Rcpp::StringVector(*exp_par_iter_path)(const std::string)"); - signatures.insert("Rcpp::StringVector(*exp_par_path)(const std::string)"); signatures.insert("Rcpp::IntegerVector(*dataset_chunks)(const std::string,const std::string)"); signatures.insert("void(*extend_dataset)(const std::string,const std::string,Rcpp::IntegerVector)"); signatures.insert("void(*extend_dataset_by)(const std::string,const std::string,Rcpp::IntegerVector)"); @@ -1200,10 +1060,6 @@ RcppExport SEXP _EigenH5_RcppExport_registerCCallable() { R_RegisterCCallable("EigenH5", "_EigenH5_read_attribute_h5", (DL_FUNC)_EigenH5_read_attribute_h5_try); R_RegisterCCallable("EigenH5", "_EigenH5_create_dataset_h5", (DL_FUNC)_EigenH5_create_dataset_h5_try); R_RegisterCCallable("EigenH5", "_EigenH5_create_file_h5", (DL_FUNC)_EigenH5_create_file_h5_try); - R_RegisterCCallable("EigenH5", "_EigenH5_par_path", (DL_FUNC)_EigenH5_par_path_try); - R_RegisterCCallable("EigenH5", "_EigenH5_par_iter_path", (DL_FUNC)_EigenH5_par_iter_path_try); - R_RegisterCCallable("EigenH5", "_EigenH5_exp_par_iter_path", (DL_FUNC)_EigenH5_exp_par_iter_path_try); - R_RegisterCCallable("EigenH5", "_EigenH5_exp_par_path", (DL_FUNC)_EigenH5_exp_par_path_try); R_RegisterCCallable("EigenH5", "_EigenH5_dataset_chunks", (DL_FUNC)_EigenH5_dataset_chunks_try); R_RegisterCCallable("EigenH5", "_EigenH5_extend_dataset", (DL_FUNC)_EigenH5_extend_dataset_try); R_RegisterCCallable("EigenH5", "_EigenH5_extend_dataset_by", (DL_FUNC)_EigenH5_extend_dataset_by_try); @@ -1222,6 +1078,10 @@ RcppExport SEXP _EigenH5_RcppExport_registerCCallable() { return R_NilValue; } +RcppExport SEXP _EigenH5_exp_par_iter_path(SEXP); +RcppExport SEXP _EigenH5_exp_par_path(SEXP); +RcppExport SEXP _EigenH5_par_iter_path(SEXP); +RcppExport SEXP _EigenH5_par_path(SEXP); RcppExport SEXP run_testthat_tests(); static const R_CallMethodDef CallEntries[] = { @@ -1240,10 +1100,6 @@ static const R_CallMethodDef CallEntries[] = { {"_EigenH5_create_dataset_h5", (DL_FUNC) &_EigenH5_create_dataset_h5, 4}, {"_EigenH5_split_ldd", (DL_FUNC) &_EigenH5_split_ldd, 1}, {"_EigenH5_create_file_h5", (DL_FUNC) &_EigenH5_create_file_h5, 1}, - {"_EigenH5_par_path", (DL_FUNC) &_EigenH5_par_path, 1}, - {"_EigenH5_par_iter_path", (DL_FUNC) &_EigenH5_par_iter_path, 1}, - {"_EigenH5_exp_par_iter_path", (DL_FUNC) &_EigenH5_exp_par_iter_path, 1}, - {"_EigenH5_exp_par_path", (DL_FUNC) &_EigenH5_exp_par_path, 1}, {"_EigenH5_dataset_chunks", (DL_FUNC) &_EigenH5_dataset_chunks, 2}, {"_EigenH5_extend_dataset", (DL_FUNC) &_EigenH5_extend_dataset, 3}, {"_EigenH5_extend_dataset_by", (DL_FUNC) &_EigenH5_extend_dataset_by, 3}, @@ -1259,6 +1115,10 @@ static const R_CallMethodDef CallEntries[] = { {"_EigenH5_dim_h5", (DL_FUNC) &_EigenH5_dim_h5, 2}, {"_EigenH5_concat_mats", (DL_FUNC) &_EigenH5_concat_mats, 4}, {"_EigenH5_RcppExport_registerCCallable", (DL_FUNC) &_EigenH5_RcppExport_registerCCallable, 0}, + {"_EigenH5_exp_par_iter_path", (DL_FUNC) &_EigenH5_exp_par_iter_path, 1}, + {"_EigenH5_exp_par_path", (DL_FUNC) &_EigenH5_exp_par_path, 1}, + {"_EigenH5_par_iter_path", (DL_FUNC) &_EigenH5_par_iter_path, 1}, + {"_EigenH5_par_path", (DL_FUNC) &_EigenH5_par_path, 1}, {"run_testthat_tests", (DL_FUNC) &run_testthat_tests, 0}, {NULL, NULL, 0} }; diff --git a/src/utils.cpp b/src/utils.cpp index b1138ce..d854cfd 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -13,42 +13,8 @@ void create_file_h5(const std::string filename){ HighFive::File file(filename,HighFive::File::Create); } -//[[Rcpp::export]] -Rcpp::StringVector par_path(const std::string filename){ - std::filesystem::path pt(filename); - - return(Rcpp::wrap(pt.parent_path().string())); -} -//[[Rcpp::export]] -Rcpp::StringVector par_iter_path(const std::string filename){ - std::filesystem::path pt(filename); - std::vector retvec; - for(auto it = pt.begin(); it!=pt.end();it++){ - retvec.push_back(it->string()); - } - return(Rcpp::wrap(retvec)); -} -//[[Rcpp::export]] -Rcpp::StringVector exp_par_iter_path(const std::string filename){ - std::experimental::filesystem::path pt(filename); - std::vector retvec; - for(auto it = pt.begin(); it!=pt.end();it++){ - retvec.push_back(it->string()); - } - return(Rcpp::wrap(retvec)); -} - - - - -//[[Rcpp::export]] -Rcpp::StringVector exp_par_path(const std::string filename){ - std::experimental::filesystem::path pt(filename); - - return(Rcpp::wrap(pt.parent_path().string())); -} //[[Rcpp::export]] Rcpp::IntegerVector dataset_chunks(const std::string filename,