R Under development (unstable) (2024-02-21 r85967 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > if ( requireNamespace("tinytest", quietly=TRUE) ){ + tinytest::test_package("paropt") + } SUNDIALS - Copyright (c) 2002-2015, Lawrence Livermore National Laboratory. Produced at the Lawrence Livermore National Laboratory. See - https://computation.llnl.gov/projects/sundials Attaching package: 'paropt' The following object is masked from 'package:stats': optimize The following object is masked from 'package:base': solve test_all.R.................... 0 tests test_all.R.................... 0 tests test_all.R.................... 0 tests test_all.R.................... 0 tests test_all.R.................... 0 tests // [[Rcpp::depends(ast2ast)]] // [[Rcpp::depends(RcppArmadillo)]] // [[Rcpp::plugins(cpp17)]] #include "etr.hpp" // [[Rcpp::export]] SEXP getXPtr(); sexp ode ( double& t , sexp& y , sexp& ydot , sexp& parameter ) {double a_db ; double b_db ; double c_db ; double d_db ; double predator_db ; double prey_db ;a_db = etr::at(parameter, etr::i2d(1)); b_db = etr::at(parameter, etr::i2d(2)); c_db = etr::at(parameter, etr::i2d(3)); d_db = etr::at(parameter, etr::i2d(4)); predator_db = etr::at(y, etr::i2d(1)); prey_db = etr::at(y, etr::i2d(2)); etr::subassign(ydot, 1) = predator_db * prey_db * c_db - predator_db * d_db; etr::subassign(ydot, 2) = prey_db * a_db - prey_db * predator_db * b_db; return(ydot); } SEXP getXPtr() { typedef sexp (*fct_ptr) ( double& t , sexp& y , sexp& ydot , sexp& parameter ); ; return Rcpp::XPtr(new fct_ptr(& ode )); } Generated extern "C" functions -------------------------------------------------------- #include #ifdef RCPP_USE_GLOBAL_ROSTREAM Rcpp::Rostream& Rcpp::Rcout = Rcpp::Rcpp_cout_get(); Rcpp::Rostream& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get(); #endif // getXPtr SEXP getXPtr(); RcppExport SEXP sourceCpp_1_getXPtr() { BEGIN_RCPP Rcpp::RObject rcpp_result_gen; Rcpp::RNGScope rcpp_rngScope_gen; rcpp_result_gen = Rcpp::wrap(getXPtr()); return rcpp_result_gen; END_RCPP } Generated R functions ------------------------------------------------------- `.sourceCpp_1_DLLInfo` <- dyn.load('D:/temp/RtmpM5lsio/sourceCpp-x86_64-w64-mingw32-1.0.12/sourcecpp_5190723319b7/sourceCpp_2.dll') getXPtr <- Rcpp:::sourceCppFunction(function() {}, FALSE, `.sourceCpp_1_DLLInfo`, 'sourceCpp_1_getXPtr') rm(`.sourceCpp_1_DLLInfo`) Building shared library -------------------------------------------------------- DIR: D:/temp/RtmpM5lsio/sourceCpp-x86_64-w64-mingw32-1.0.12/sourcecpp_5190723319b7 D:/RCompile/recent/R/bin/x64/R CMD SHLIB -o "sourceCpp_2.dll" "file519023037047.cpp" using C++ compiler: 'g++.exe (GCC) 12.3.0' using C++17 make[1]: Entering directory '/d/temp/RtmpM5lsio/sourceCpp-x86_64-w64-mingw32-1.0.12/sourcecpp_5190723319b7' g++ -std=gnu++17 -I"D:/RCompile/recent/R/include" -DNDEBUG -I../inst/include -fopenmp -I"D:/RCompile/CRANpkg/lib/4.4/Rcpp/include" -I"D:/RCompile/CRANpkg/lib/4.4/ast2ast/include" -I"D:/RCompile/CRANpkg/lib/4.4/RcppArmadillo/include" -I"D:/temp/RtmpM5lsio/sourceCpp-x86_64-w64-mingw32-1.0.12" -I"d:/rtools43/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c file519023037047.cpp -o file519023037047.o g++ -shared -s -static-libgcc -o sourceCpp_2.dll tmp.def file519023037047.o -fopenmp -LD:/RCompile/recent/R/bin/x64 -lRlapack -LD:/RCompile/recent/R/bin/x64 -lRblas -lgfortran -lm -lquadmath -Ld:/rtools43/x86_64-w64-mingw32.static.posix/lib/x64 -Ld:/rtools43/x86_64-w64-mingw32.static.posix/lib -LD:/RCompile/recent/R/bin/x64 -lR make[1]: Leaving directory '/d/temp/RtmpM5lsio/sourceCpp-x86_64-w64-mingw32-1.0.12/sourcecpp_5190723319b7' make[1]: Entering directory '/d/temp/RtmpM5lsio/sourceCpp-x86_64-w64-mingw32-1.0.12/sourcecpp_5190723319b7' make[1]: Leaving directory '/d/temp/RtmpM5lsio/sourceCpp-x86_64-w64-mingw32-1.0.12/sourcecpp_5190723319b7' test_all.R.................... 0 tests test_all.R.................... 0 tests test_all.R.................... 1 tests OK 8.6s All ok, 1 results (8.6s) > > proc.time() user system elapsed 0.71 0.12 9.10