Rcpp/ 0000755 0001762 0000144 00000000000 15031260342 011152 5 ustar ligges users Rcpp/tests/ 0000755 0001762 0000144 00000000000 15014017044 012314 5 ustar ligges users Rcpp/tests/tinytest.R 0000644 0001762 0000144 00000003770 15014017044 014331 0 ustar ligges users
if (requireNamespace("tinytest", quietly=TRUE)) {
## Force tests to be executed if in dev release which we define as
## having a sub-release, eg 0.9.15.5 is one whereas 0.9.16 is not
if (length(strsplit(format(packageVersion("Rcpp")), "\\.")[[1]]) > 3) { # dev rel, and
if (Sys.getenv("RunAllRcppTests") != "no") { # if env.var not yet set
message("Setting \"RunAllRcppTests\"=\"yes\" for development release")
Sys.setenv("RunAllRcppTests"="yes")
}
if (Sys.getenv("RunVerboseRcppTests") != "no") { # if env.var not yet set
message("Setting \"RunVerboseRcppTests\"=\"yes\" for development release")
Sys.setenv("RunVerboseRcppTests"="yes")
}
}
## On Travis also always set tests; see
## https://docs.travis-ci.com/user/environment-variables/#default-environment-variables
## GitHub Action also set CI variable; see
## https://docs.github.com/en/actions/reference/environment-variables
## And we set it in 'docker run' call
## Ensure Codecov runs full tests too
if ((Sys.getenv("CI") == "true") ||
(Sys.getenv("TRAVIS") == "true") ||
(Sys.getenv("CONTINUOUS_INTEGRATION") == "true") ||
(Sys.getenv("CODECOV_TOKEN") != "")) {
if (Sys.getenv("RunAllRcppTests") != "no") { # if env.var not yet set
message("Always enabling \"RunAllRcppTests\"=\"yes\" in CI\n")
Sys.setenv("RunAllRcppTests"="yes")
}
if (Sys.getenv("RunVerboseRcppTests") != "no") { # if env.var not yet set
message("Always enabling \"RunVerboseRcppTests\"=\"yes\" in CI\n")
Sys.setenv("RunVerboseRcppTests"="yes")
}
}
## there are several more granular ways to test files in a tinytest directory,
## see its package vignette; tests can also run once the package is installed
## using the same command `test_package(pkgName)`, or by director or file
tinytest::test_package("Rcpp")
}
Rcpp/.Rinstignore 0000644 0001762 0000144 00000000114 12754425121 013461 0 ustar ligges users inst/doc/Makefile
inst/doc/jss.bst
inst/doc/RJournal.sty
inst/unitTests/src
Rcpp/MD5 0000644 0001762 0000144 00000137615 15031260342 011477 0 ustar ligges users 80fbd04e384005533ef2e12729c8e1c0 *ChangeLog
de2e0d17dcab5cd23a7d4bcad894d2ff *DESCRIPTION
f53ecd48407d7485920c4f3caaf187e0 *NAMESPACE
ad57518c2d1d3d66fc26b6c214ed13e1 *R/00_classes.R
f9a4ffb4d0fcec3eec6ef6c229ff1bba *R/01_show.R
5ad59a1671fd934a15f614a96331c56a *R/02_completion.R
3eafac927ff4e744b84675639ff48078 *R/03_prompt.R
0142821b76acdc0b8fa2bcd4c834aeae *R/Attributes.R
92c604e80679db2563fed5acc0b7cc37 *R/Module.R
460f7e14f458e5d0a061738d08878b13 *R/Rcpp.package.skeleton.R
ac2a0d66a4892308a3a23eaedc726f84 *R/RcppClass.R
7f9f504712b646a7af30a962f481a3fe *R/RcppLdpath.R
87bff7adced70c835fbbbbb25fbc2199 *R/bib.R
0cb7766cf185c3c786b2b9db5c205959 *R/compilerCheck.R
37b16d5ad05cc80baaf047c77d53aeec *R/exceptions.R
7e3a5dfefbb7c092bf34b7ad06e761b0 *R/exposeClass.R
9ed2c17bf29e61836bac1eaa78fbf0b7 *R/inline.R
c1f6e22d805062693ca441a313a798c7 *R/loadModule.R
410e549661c436dd77eba6814eb0f5d4 *R/loadRcppModules.R
02c1cb554af89184c6c5c46e1ee49e17 *R/populate.R
66c49e653c7fcbcefb611cc8aef5e61c *R/tools.R
e82268e95d8f2d3a1759620eb1bc6664 *R/zzz.R
ca3834ec7bf955e94f30cf1546bb65bc *README.md
dcfe968628d24168fc5bb54a66631158 *TODO
1bf18d9c216b8d95033f0bd2fe2906b2 *build/partial.rdb
415cbc6cba35195a22e169feb4f211da *build/vignette.rds
d8edc63de3343fcf14ee46cb692249db *cleanup
7599bada89d38a2474389682f552755e *inst/CITATION
b2245c0987b29aa08c926fa21f761140 *inst/NEWS.Rd
7a9967333ad85931cc6d2051f4dff76e *inst/announce/ANNOUNCE-0.10.0.txt
734d037a2ac31af4659fb3b2e1a778ad *inst/announce/ANNOUNCE-0.11.0.txt
7d85af8d096e473821a3f001d3128b01 *inst/announce/ANNOUNCE-0.6.0.txt
f61c7e9e1460eac25702b24c1af30442 *inst/announce/ANNOUNCE-0.7.0.txt
a198e05a9b004dfc1f8ea67629f2f6c7 *inst/announce/ANNOUNCE-0.8.0.txt
3e8a171f22548f5da208b58e66b48e6c *inst/announce/ANNOUNCE-0.9.0.txt
ce5e91d9544242ec9616a8f81da6ff46 *inst/bib/Rcpp.bib
6f1e3b1f4f75e04af65bb9daf94e9630 *inst/discovery/cxx0x.R
2baf167ce452976b0fcb43e44f566af7 *inst/doc/Rcpp-FAQ.Rnw
6fb164a8ca01fd9b715a6020e800effe *inst/doc/Rcpp-FAQ.pdf
887250b7e0675b4a70d6eb1a4689080c *inst/doc/Rcpp-attributes.Rnw
90d568b2b5a944a027148b1e0d40a7b7 *inst/doc/Rcpp-attributes.pdf
37f50a136d1350e8e864c9265cc88ad8 *inst/doc/Rcpp-extending.Rnw
bb2cecfd8441fec7b0ebcbe6d92fe9dd *inst/doc/Rcpp-extending.pdf
90eade7bfffa82f250510759bc9a7f36 *inst/doc/Rcpp-introduction.Rnw
d9c213eb7301e96b1672e65ff5028cfd *inst/doc/Rcpp-introduction.pdf
e6cf1d12ce4e3a2fed6eddf6290d393f *inst/doc/Rcpp-jss-2011.Rnw
7d2e56484a77bb46ca2d2d5cfb11ec6e *inst/doc/Rcpp-jss-2011.pdf
4524c2761e07e170f681181c2e62eb05 *inst/doc/Rcpp-libraries.Rnw
5ea210343e614a155a170738527090c6 *inst/doc/Rcpp-libraries.pdf
a96bcf4153b795bff19ddc36a17ca435 *inst/doc/Rcpp-modules.Rnw
cb0d241d6ca433fa85e09ee4cc682d04 *inst/doc/Rcpp-modules.pdf
835d0e2dd365e4621663bd03ae219758 *inst/doc/Rcpp-package.Rnw
bdcd995b3462eabe8d49a816d544cbfc *inst/doc/Rcpp-package.pdf
d76adfdc4e68c69c5ff632e234db6a85 *inst/doc/Rcpp-quickref.Rnw
34b648a5d49eecb091a88c953aa1763d *inst/doc/Rcpp-quickref.pdf
929a1aad762b7354b6875a35093ec477 *inst/doc/Rcpp-sugar.Rnw
433471f598bf6b8c54005444393cdeb6 *inst/doc/Rcpp-sugar.pdf
35fa971232b8c9fb0bbb9dfc2ad3de7a *inst/examples/Attributes/Depends.cpp
a9aa3aceea0b49525155a2c43296318b *inst/examples/Attributes/Export.cpp
c6c9969e0067a1321827369cba1cc566 *inst/examples/Attributes/cppFunction.R
ae6383cbe35d7fd9f03a47b16fe084e4 *inst/examples/Attributes/sourceCpp.R
d8ad7f81287bfb38184962408e21dc4b *inst/examples/ConvolveBenchmarks/GNUmakefile
4e5da9b0fe573983765dacbdd4888f71 *inst/examples/ConvolveBenchmarks/buildAndRun.sh
3b726172d475beb1a950a60c963abdd6 *inst/examples/ConvolveBenchmarks/convolve10_cpp.cpp
7b5f52647bb1401e5ca51ae24a99d9ab *inst/examples/ConvolveBenchmarks/convolve10_cpp.h
198737bb5588686872b7bf92c575b44d *inst/examples/ConvolveBenchmarks/convolve11_cpp.cpp
c2326ac51bb20278c7d200c0217af192 *inst/examples/ConvolveBenchmarks/convolve12_cpp.cpp
ec15a3f27dda294c1ba0e85bc7975001 *inst/examples/ConvolveBenchmarks/convolve13_cpp.cpp
c2934f803727f1f9145f2eaacf7fb783 *inst/examples/ConvolveBenchmarks/convolve14_cpp.cpp
02ae1ae1c668a0037f228a316a9b9717 *inst/examples/ConvolveBenchmarks/convolve2_c.c
41c3477fb3c135e372f7dcee7a00b1fe *inst/examples/ConvolveBenchmarks/convolve3_cpp.cpp
6094f474b9bada3d489b5e9e1eed40db *inst/examples/ConvolveBenchmarks/convolve4_cpp.cpp
570d28eceab6c8e21061abaa932a57b7 *inst/examples/ConvolveBenchmarks/convolve5_cpp.cpp
160f9ca0f7a5e8ce599d5a731e33a302 *inst/examples/ConvolveBenchmarks/convolve7_c.c
feac91b32652ac87f9fca99cb65babef *inst/examples/ConvolveBenchmarks/convolve8_cpp.cpp
b653d0cab1e9c200527c631486b21b22 *inst/examples/ConvolveBenchmarks/convolve9_cpp.cpp
e211fa941ea87850f28aafd93dbaea01 *inst/examples/ConvolveBenchmarks/exampleRCode.r
83e612c4f034144d20769da6a98ab430 *inst/examples/ConvolveBenchmarks/loopmacro.h
a39297262c26fcf0016a007c8729f7ed *inst/examples/ConvolveBenchmarks/overhead.r
695db9645074a40edf199a3f6e7b99d9 *inst/examples/ConvolveBenchmarks/overhead.sh
41a7585097bb0330a19163f63b9eb582 *inst/examples/ConvolveBenchmarks/overhead_1.cpp
70bc5f4cab64d21baa5efd44371d6c06 *inst/examples/ConvolveBenchmarks/overhead_2.c
f98ba450080bf7ededba779a9eb9ef08 *inst/examples/FastLM/benchmark.r
187ff739229daa658a997db7361cf79a *inst/examples/FastLM/benchmarkLongley.r
57e3f462b6e57f6d4781d93ad0b5a0f0 *inst/examples/FastLM/fastLMviaArmadillo.r
96177e5073669fce0ada1a133a4b528a *inst/examples/FastLM/fastLMviaGSL.r
bed809fc1187686e9c3f031da7ecc03a *inst/examples/FastLM/lmArmadillo.R
e90e71260dd32a062301a565b0ceb78a *inst/examples/FastLM/lmGSL.R
dee16ee1aaf90787c0d3fe441b57e572 *inst/examples/Misc/fibonacci.r
51b7f11bdc147d595d3d7de4a7b88129 *inst/examples/Misc/ifelseLooped.r
80df7f84cd6c98c9d3b45ceaa62b6325 *inst/examples/Misc/newFib.r
3028009739751d645a3f3c1e65c335b1 *inst/examples/Misc/piBySimulation.r
b6d55aea50fdd5a95b36f006bfa9bbdf *inst/examples/Misc/piSugar.cpp
b28eef52d9c70bdc3bc1c7c4af74a705 *inst/examples/OpenMP/GNUmakefile
6ac8a4754e7a6c968f910b775837981b *inst/examples/OpenMP/OpenMPandInline.r
1fb803a50758e7abccccbacf6df79bb9 *inst/examples/OpenMP/check.R
33d174735e08ffcbfe8b14f77be6467e *inst/examples/OpenMP/piWithInterrupts.cpp
ee8c42a72f8ed650b8ac32443890c01b *inst/examples/RcppGibbs/RcppGibbs.R
cefdedf5f9c0d671bcf465e948198a29 *inst/examples/RcppGibbs/RcppGibbs_Updated.R
a57feb54c968ab827c78c5c18c1d1408 *inst/examples/RcppGibbs/timeRNGs.R
e8a89fe0eebf8ec758806abc84e42d8d *inst/examples/RcppInline/RObject.r
07260e8bebfc924ed834ac9adc10ed3e *inst/examples/RcppInline/RcppInlineExample.r
0e55533b689b5cc21d6e48ed89e39f50 *inst/examples/RcppInline/RcppInlineWithLibsExamples.r
8d8b770eaeee86bcb2a7b0939a3c75f3 *inst/examples/RcppInline/RcppSimpleExample.r
af8de22ca53be6cde070ad079bcc0560 *inst/examples/RcppInline/UncaughtExceptions.r
04094741972fda044af2c1982433f37a *inst/examples/RcppInline/external_pointer.r
924087b70f9e658de341442f27c787ee *inst/examples/SugarPerformance/Timer.h
ddfeedc53f53f33a3da83660c9bc022e *inst/examples/SugarPerformance/Timertest.cpp
8be8229bd89b2ea3a760d1112f7a7054 *inst/examples/SugarPerformance/sugarBenchmarks.R
4b5eef1853e02850de35d4799c7392ef *inst/examples/functionCallback/README
f55a0d78225fef3970fc5f54fddb5801 *inst/examples/functionCallback/newApiExample.r
2b3ff26140686d910b4fe51505b817a3 *inst/examples/performance/extractors.R
33c7adefe3137cae65b189490c958c6a *inst/examples/performance/performance.R
c43702432a8138a32aaee079bbf6e0cd *inst/include/Rcpp.h
36e44ff21273d50c3eaff4a46bb572ac *inst/include/Rcpp/Benchmark/Timer.h
d6797b8b8bdae9ff766e228c3483fd0c *inst/include/Rcpp/DataFrame.h
e4195b2fee650b67d709d7bd529f3de6 *inst/include/Rcpp/Dimension.h
c09874c5a20d27730a542566017a70a0 *inst/include/Rcpp/DottedPair.h
8ae8df6f92f7d17625b543348c9c035c *inst/include/Rcpp/DottedPairImpl.h
80de572b931b4174ee4f72568984b5b3 *inst/include/Rcpp/Environment.h
719d99509ff3398d24d31a4964dc6beb *inst/include/Rcpp/Extractor.h
0e673291cac4bf839157946880772c1d *inst/include/Rcpp/Fast.h
1836fe44282438109267ce447debae1a *inst/include/Rcpp/Formula.h
4882d4eed582eeaf9b37e10027a45777 *inst/include/Rcpp/Function.h
6ad1b0148d43fd84f39d8e030e39a871 *inst/include/Rcpp/InputParameter.h
a33639e3b142e20c4c5f87b8c252c860 *inst/include/Rcpp/InternalFunction.h
c1a30ee157262261c65ec27ef0435ce7 *inst/include/Rcpp/InternalFunctionWithStdFunction.h
4f649deb041fc8b0ff2680d1a75a49db *inst/include/Rcpp/Interrupt.h
10b9d367e8df67dc986c558e9f142681 *inst/include/Rcpp/Language.h
4df6c1501ce42ce8669ed6e6473653d5 *inst/include/Rcpp/Light
7423a0c0e22f136a8cde2ee861349d13 *inst/include/Rcpp/Lighter
831f454f66395440e5c4b805917f2b9d *inst/include/Rcpp/Lightest
eb0d9bf3d46dbedd1542a36743995dc6 *inst/include/Rcpp/Module.h
e54ff3fb24c5fb5c00e35804b4043177 *inst/include/Rcpp/Na_Proxy.h
30a357c1b1bf0a4b7b3c06aec6ac6891 *inst/include/Rcpp/Named.h
09c3d2e030266a2716c465005fddb8ad *inst/include/Rcpp/Nullable.h
355e849d93981b9ab17b965b1d79dab6 *inst/include/Rcpp/Pairlist.h
c299955262d228fc372294633ecb10a9 *inst/include/Rcpp/Promise.h
c7c202116cb2d8f9993f2d2879a48339 *inst/include/Rcpp/RNGScope.h
19d73d0c48066eab27b7e21f016aca39 *inst/include/Rcpp/RObject.h
7eaef3d46101154d1492c710f3cad3bf *inst/include/Rcpp/Rcpp
0708f78d2a5868bd0036bdffc92557eb *inst/include/Rcpp/Reference.h
577707408edc19445de29e2fd4182292 *inst/include/Rcpp/Rmath.h
4a8bc08de01a68edf476065293076bc9 *inst/include/Rcpp/S4.h
b479ccd53c1917ce1140ee0a17bb3d21 *inst/include/Rcpp/StretchyList.h
3d953b8ddb44689beaf90a435dd26141 *inst/include/Rcpp/String.h
16eb3c24a812321d0c985c26ecb14e0b *inst/include/Rcpp/StringTransformer.h
6d6d4343170f4d107a54715c24ad9c98 *inst/include/Rcpp/Symbol.h
e8984721738317caff337c1076b25cce *inst/include/Rcpp/Vector.h
eed9bf9af10a68be9cd55e5a5cdaa36a *inst/include/Rcpp/WeakReference.h
c84d37569cc5094df6e4c8600530d110 *inst/include/Rcpp/XPtr.h
2eff8a753ede96fbcf538eab9eb22889 *inst/include/Rcpp/algo.h
72757004433f52c06c4c7fd2bdb6c268 *inst/include/Rcpp/algorithm.h
3fa2caaea31d12b63d0a049c1da3c878 *inst/include/Rcpp/api/bones/Date.h
560684b180bc9eb1aaaf6f427ea97063 *inst/include/Rcpp/api/bones/Datetime.h
4d936b49167638e86368f4b8e26c13cc *inst/include/Rcpp/api/bones/bones.h
49f3c640f64681d80bfd2395309a4ddb *inst/include/Rcpp/api/bones/wrap_extra_steps.h
738de61f646f72b06810142fcb09af6f *inst/include/Rcpp/api/meat/DataFrame.h
80788c003d6b95f633d53db11b4c42e0 *inst/include/Rcpp/api/meat/Date.h
64e00680fbc6a82bbd1dd0e100e10673 *inst/include/Rcpp/api/meat/Datetime.h
13355fb54111f51930877bcddb41d50c *inst/include/Rcpp/api/meat/Dimension.h
26477794f8170b533113dcf620d64d1c *inst/include/Rcpp/api/meat/DottedPairImpl.h
006fb9ab61399d07b7f7bbd8ae6cf92f *inst/include/Rcpp/api/meat/Environment.h
e3132a348dd7c8cb342e4df0dd480737 *inst/include/Rcpp/api/meat/Rcpp_eval.h
a8b20b3c2b1e123172ab3a1eb78e04b0 *inst/include/Rcpp/api/meat/S4.h
9fd69c4ef0c1780784322f902305d1c7 *inst/include/Rcpp/api/meat/StretchyList.h
eded8a0a95dd5ecdcae8aa70aceb795c *inst/include/Rcpp/api/meat/Vector.h
a3e8a42322f0e644f1d6b6d4f55425e7 *inst/include/Rcpp/api/meat/as.h
f1b2b53b2851bbd3afb878ef3829f58f *inst/include/Rcpp/api/meat/export.h
cc1991e18d0c1d1e3470285fec935c36 *inst/include/Rcpp/api/meat/is.h
3ecf92371682f347f71c6da62730a05e *inst/include/Rcpp/api/meat/meat.h
b8b08db5250d9cd27130853ed04041bc *inst/include/Rcpp/api/meat/message.h
71c33d73cde9cdf7368627a9b00a8e7d *inst/include/Rcpp/api/meat/module/Module.h
d3e14b929d0b6cd092f52d1ced57b573 *inst/include/Rcpp/api/meat/protection.h
c9af45da88ea151bb2f8cd27900257e8 *inst/include/Rcpp/api/meat/proxy.h
12c775ee39ec274c4825219d25e04f43 *inst/include/Rcpp/api/meat/wrap.h
47fc05bb3d86217c07793ea37d833302 *inst/include/Rcpp/as.h
90c153091bc3fb1e123fef9dc40394e6 *inst/include/Rcpp/barrier.h
fa7b26bbe19f908b9c00ead2fe2717ac *inst/include/Rcpp/clone.h
1b3b2bee1fc9bd3f231c2a33ca572281 *inst/include/Rcpp/complex.h
c20263b496be5b7f39626962727b099a *inst/include/Rcpp/config.h
b90e19134c5d4a4c0652f956c022d1e4 *inst/include/Rcpp/date_datetime/Date.h
e75130fc77dac6243e5c88639c940dea *inst/include/Rcpp/date_datetime/Datetime.h
0d754f1a9266c3e1bbc6946ba1304ab5 *inst/include/Rcpp/date_datetime/date_datetime.h
db56d4d2d82a3d6ae834d8157b0459e3 *inst/include/Rcpp/date_datetime/newDateVector.h
83d1e1f3e2fc38cf2708402b6baaeccd *inst/include/Rcpp/date_datetime/newDatetimeVector.h
eeaacae019fe68c8acbd3e9fbea29a3d *inst/include/Rcpp/date_datetime/oldDateVector.h
a2bcdcb2cc9e096bfb46106875462a13 *inst/include/Rcpp/date_datetime/oldDatetimeVector.h
e9f4a5c7843d4bda2a6bcdd52be3abf0 *inst/include/Rcpp/exceptions.h
7c731d4c921ce35caaaf00ad6cdde425 *inst/include/Rcpp/exceptions_impl.h
f15033c5a9a025e85b0d45f42e1ab29d *inst/include/Rcpp/grow.h
5fa886fea6bfe95d86c97fc32794711e *inst/include/Rcpp/hash/IndexHash.h
118185092dfabe6230c4e6c2a8e50257 *inst/include/Rcpp/hash/SelfHash.h
ce761de72f7730fe942b91e35e6b9ba6 *inst/include/Rcpp/hash/hash.h
3c1b55773be7d386bca01a99c8fa94af *inst/include/Rcpp/internal/Exporter.h
87298c0d130f4d0c2c9e3bcbf8f52712 *inst/include/Rcpp/internal/GreedyVector.h
ac0b994918191501b757516ce5ee263b *inst/include/Rcpp/internal/ListInitialization.h
589b5e7ef7ec36ea7c72c0989856322e *inst/include/Rcpp/internal/NAComparator.h
ddeb259fb4dc45ce8f48af5e7c67327a *inst/include/Rcpp/internal/NAEquals.h
a1cfd42face708ee13c1b82d72990024 *inst/include/Rcpp/internal/Proxy_Iterator.h
508bef1a3592104abdca03463b25432e *inst/include/Rcpp/internal/SEXP_Iterator.h
03e9f4da956cce7a1a74bf935ef5b001 *inst/include/Rcpp/internal/call.h
ef7589197950d24c37c68868a2fd4ec5 *inst/include/Rcpp/internal/caster.h
1cc9fbe420c4d94a392fa41db6607f81 *inst/include/Rcpp/internal/converter.h
78cca884967d645095bb8de46e97eb9d *inst/include/Rcpp/internal/export.h
d75740f6c80130661e85ef0e8af6ef17 *inst/include/Rcpp/internal/na.h
2d6716a93c54ae524caab179db28206f *inst/include/Rcpp/internal/r_coerce.h
ced4d19ec0af39a1402abc9dfc772759 *inst/include/Rcpp/internal/r_vector.h
8cdcef073f86a88d1bd228cae7a9383d *inst/include/Rcpp/internal/wrap.h
14b302e7f5cca681f122cccde5418cbd *inst/include/Rcpp/internal/wrap_end.h
1914c43f5b9f93808062adf5e2c0a005 *inst/include/Rcpp/iostream/Rstreambuf.h
c852659f0876b4dd0a3d3d99e972d1cb *inst/include/Rcpp/is.h
24e8a8c1f4a580954091edb9dae2cfd9 *inst/include/Rcpp/lang.h
3fffc861f0e2426155bf5013ce173cb6 *inst/include/Rcpp/lgrow.h
ccf210a0d15b9bb2ed39b1b476997bbd *inst/include/Rcpp/longlong.h
4e9effca3c5f2dabaa4e6aa478b67528 *inst/include/Rcpp/macros/cat.hpp
623f4ca3111e4a28afe10133897a8f89 *inst/include/Rcpp/macros/config.hpp
ec19b90809bb03c920fa9d6df8af2732 *inst/include/Rcpp/macros/debug.h
e937eb94d20c4ba5899571364783864f *inst/include/Rcpp/macros/dispatch.h
32681ffdaa790b76bf3e20d3a6c17771 *inst/include/Rcpp/macros/interface.h
bf6d92385b7958959cb10a6b3bfd2a44 *inst/include/Rcpp/macros/macros.h
3347bc9bf5c92bf9b929c61275c1714b *inst/include/Rcpp/macros/module.h
0c4f36da838e8571b7bc602b4b483295 *inst/include/Rcpp/macros/traits.h
acdd29c8bc3af4e20bbb733ab4bd7e74 *inst/include/Rcpp/macros/unroll.h
1762f3b08abffc14b677c9d4c0ee24d2 *inst/include/Rcpp/macros/xp.h
90f826d6b2719cd8b19266f7eed1d71b *inst/include/Rcpp/module/CppFunction.h
8d492c19d0746d6f0531a42ce62e4169 *inst/include/Rcpp/module/Module.h
1f282a0f0e1498bbe9f228dad9fdebfd *inst/include/Rcpp/module/Module_Add_Property.h
fd6ad1311c4cc5e0cffcc29722ca0f20 *inst/include/Rcpp/module/Module_Field.h
923ca9c389ce3dd672edcaa3f1e0fe6b *inst/include/Rcpp/module/Module_Property.h
12d7c007a282682b06c8bcff85c78972 *inst/include/Rcpp/module/class.h
b021df8570d99c4821e25c137aa45a01 *inst/include/Rcpp/module/class_Base.h
99322cf8421a1cc8964659b05d79a906 *inst/include/Rcpp/module/get_return_type.h
615592b33bb6633f54c088cba4503412 *inst/include/Rcpp/platform/compiler.h
8f9d3b2218818dfe5f703e6900d603e9 *inst/include/Rcpp/platform/solaris.h
e6f882c26076e813fe8290c46b1c0fd8 *inst/include/Rcpp/print.h
abd6c01295a88b73432a77f6a79aca3a *inst/include/Rcpp/protection/Armor.h
fa63d47f044e1012a5431319108f01f9 *inst/include/Rcpp/protection/Shelter.h
6357a773233c2c9f5415c6445fe103f9 *inst/include/Rcpp/protection/Shield.h
2fb2464623e39ad6040f4457b6ef382c *inst/include/Rcpp/protection/protection.h
9b71f44a9870eaee5c63de664e5db4f1 *inst/include/Rcpp/proxy/AttributeProxy.h
d1800f7df6f83a017e0501af64551239 *inst/include/Rcpp/proxy/Binding.h
2767ffc2e7c0e7832e7223cd8da38be1 *inst/include/Rcpp/proxy/DottedPairProxy.h
59d09bb7d953413d5452a45616fca92f *inst/include/Rcpp/proxy/FieldProxy.h
bb4b32da96533b2cae35b524cf796d04 *inst/include/Rcpp/proxy/GenericProxy.h
e34b2baf18b2684fe26743c96f78b3c6 *inst/include/Rcpp/proxy/NamesProxy.h
e6ffa94de4d38f34d9b363785fbdf1ff *inst/include/Rcpp/proxy/ProtectedProxy.h
0a75a348caecd8836340ca11be0435d7 *inst/include/Rcpp/proxy/RObjectMethods.h
9e412a44a35eb570fe422b00c15dc84e *inst/include/Rcpp/proxy/SlotProxy.h
16583a2ce9f3f158d32a59bc69dc6045 *inst/include/Rcpp/proxy/TagProxy.h
5b3488834c9e483325dc45493deaf0d4 *inst/include/Rcpp/proxy/proxy.h
0f03769521dac747e5a7094818315d10 *inst/include/Rcpp/r/compat.h
e9a35004a15d790b0bdf4086232fdef6 *inst/include/Rcpp/r/headers.h
97b839da2480b8beef14466695e02b3e *inst/include/Rcpp/r_cast.h
0975231e8a827815b7cf027a56bd7fec *inst/include/Rcpp/routines.h
5c5eddabb61b11f1e2aa1dfd3b7dfcc6 *inst/include/Rcpp/sprintf.h
652b362ffc5b25dc354e2f94ccf775df *inst/include/Rcpp/stats/beta.h
830d809435ad6d90f513ceb19ed229ff *inst/include/Rcpp/stats/binom.h
de8f527ad087fd135d60496e83600129 *inst/include/Rcpp/stats/cauchy.h
28c835cdee1aa30eff6d7f6481a7c7b7 *inst/include/Rcpp/stats/chisq.h
2fcae848fbd39f938335de220dfceb56 *inst/include/Rcpp/stats/dpq/dpq.h
50246afd70a6c354111d21fef9a61454 *inst/include/Rcpp/stats/dpq/macros.h
2a0a10252c313fa1101c426a71f419b3 *inst/include/Rcpp/stats/exp.h
16b8c2b35aa2dd1acd61aea749bea591 *inst/include/Rcpp/stats/f.h
3531db9168652e50f1a2f7e48995e652 *inst/include/Rcpp/stats/gamma.h
259484f02f4b70c75f061eb3acebc68b *inst/include/Rcpp/stats/geom.h
cddc6f8806bbff126f43aad6d9f64225 *inst/include/Rcpp/stats/hyper.h
afbc488e006d43bbb44f00b39bdc9279 *inst/include/Rcpp/stats/lnorm.h
0148fa77627fc2649b4cc8fda21ff2cf *inst/include/Rcpp/stats/logis.h
2f20232d49ad4e0d5aa4affe29a83677 *inst/include/Rcpp/stats/nbeta.h
255732d79d848b5ef2dc23a0bb020c78 *inst/include/Rcpp/stats/nbinom.h
b648f374ad9b409f3a693cb13d2dacf2 *inst/include/Rcpp/stats/nbinom_mu.h
792ff5b69094be8d30a61da005e8b8a2 *inst/include/Rcpp/stats/nchisq.h
4285fba50176e606b3183e550ca57008 *inst/include/Rcpp/stats/nf.h
62bcbc788f700bb418899f2d5d71674e *inst/include/Rcpp/stats/norm.h
b9bb0937015e9915c9eed07d7d5e675e *inst/include/Rcpp/stats/nt.h
ee8d82efa40767e1ee30b1b39f0d2b9b *inst/include/Rcpp/stats/pois.h
bd6f29269c4cb5e0714c7eb14497dd24 *inst/include/Rcpp/stats/random/random.h
6be67d92344ae4ffe85a2d4a966c5712 *inst/include/Rcpp/stats/random/rbeta.h
cdc109dfaa7c849fe8f5108a8157286e *inst/include/Rcpp/stats/random/rbinom.h
2fe775c698a801f71c81d958ff2153bf *inst/include/Rcpp/stats/random/rcauchy.h
09e49a79928fba558003e949f7e42625 *inst/include/Rcpp/stats/random/rchisq.h
eb7d8d8957f95e55c7b4c883d07bde3e *inst/include/Rcpp/stats/random/rexp.h
796f003192b271cfd01be89f08fc5857 *inst/include/Rcpp/stats/random/rf.h
d3f7b0de54bbff91a52b5f3e97b6f0f9 *inst/include/Rcpp/stats/random/rgamma.h
f30537d903fd0e2fe0b8fbde1ad0f448 *inst/include/Rcpp/stats/random/rgeom.h
ef335473c41b8bf22c2ed8ead3d02802 *inst/include/Rcpp/stats/random/rhyper.h
812d6f54e228aa74586d4494462dc308 *inst/include/Rcpp/stats/random/rlnorm.h
e19c5aac4d1e6f05fb215da8ab9abd63 *inst/include/Rcpp/stats/random/rlogis.h
8401528e0344ac91e8a59d3c75ea3811 *inst/include/Rcpp/stats/random/rnbinom.h
da102c578dc03d90e134bc716ce86061 *inst/include/Rcpp/stats/random/rnbinom_mu.h
281fe24171a0dc1a2f5d32b792b29840 *inst/include/Rcpp/stats/random/rnchisq.h
d11f94b30bfe73bec96e494c19010112 *inst/include/Rcpp/stats/random/rnorm.h
68c0bc9a9bf8adf587cfafec41f2e0c3 *inst/include/Rcpp/stats/random/rpois.h
22c48598462a7a67f7c46f827a7ca37b *inst/include/Rcpp/stats/random/rsignrank.h
6d053ab00aee5507bdcd37b260edb2ca *inst/include/Rcpp/stats/random/rt.h
e4157ac1a6474db7d023ed619f8a3911 *inst/include/Rcpp/stats/random/runif.h
0de983b302b5686c55cf1348856736f2 *inst/include/Rcpp/stats/random/rweibull.h
9d96c7c693ee9ee2be41a02aca2c907c *inst/include/Rcpp/stats/random/rwilcox.h
d5e57758623ecb887417b652e9dbe431 *inst/include/Rcpp/stats/stats.h
51dea0f553fe2661ebbf069bba1c6fab *inst/include/Rcpp/stats/t.h
72600819bbbb51028983e81c6623f47f *inst/include/Rcpp/stats/unif.h
edcd15051fead7e65a02fe4848ec5969 *inst/include/Rcpp/stats/weibull.h
b19248e3d1ba5159604ee91bc499fbe0 *inst/include/Rcpp/storage/NoProtectStorage.h
0f0750ca5166fbea1a202f3a74e94579 *inst/include/Rcpp/storage/PreserveStorage.h
4bfc6bf68fd92addd39ad5eabe987ccd *inst/include/Rcpp/storage/storage.h
6d4b5fd0017b129f89731c3af6f63545 *inst/include/Rcpp/sugar/Range.h
be07b75cd41bf643098bf8dc9f6fd6bd *inst/include/Rcpp/sugar/block/SugarBlock_1.h
93914f21ce2678a075f440256bff7256 *inst/include/Rcpp/sugar/block/SugarBlock_2.h
b38058d7f4161d552c59199d971759d2 *inst/include/Rcpp/sugar/block/SugarBlock_3.h
77631c6ccb9bf7900cc3e9870308f15e *inst/include/Rcpp/sugar/block/SugarMath.h
0b04c68170924e36a049448bb9dffbcf *inst/include/Rcpp/sugar/block/Vectorized_Math.h
b303e234459f72118cdb77b5fc6c40d2 *inst/include/Rcpp/sugar/block/block.h
8989b1fc88898a94d028256afd535218 *inst/include/Rcpp/sugar/functions/Lazy.h
332e143da726e96aa5342a2d379ad888 *inst/include/Rcpp/sugar/functions/all.h
be21eae934bd2eb08c36aa98a95f8437 *inst/include/Rcpp/sugar/functions/any.h
2034cef020d507b44a56287085f01b03 *inst/include/Rcpp/sugar/functions/cbind.h
356ce7a62fd40bfb5c99f5d90ceab9c8 *inst/include/Rcpp/sugar/functions/clamp.h
006ff253f5119766397ae8786b6f3273 *inst/include/Rcpp/sugar/functions/complex.h
8c48d64608f50fd65a1060eb0ba0a94f *inst/include/Rcpp/sugar/functions/cummax.h
676a6d35542c22993a733ac9ca7f4557 *inst/include/Rcpp/sugar/functions/cummin.h
d48484d2c5885e5132dae2c5360cc003 *inst/include/Rcpp/sugar/functions/cumprod.h
b5875c167cebe51528173279a35e1c80 *inst/include/Rcpp/sugar/functions/cumsum.h
d9339ceea3657d0eebffff3c4fc19ade *inst/include/Rcpp/sugar/functions/diff.h
e89b6f5086b49094e87a58183226c37e *inst/include/Rcpp/sugar/functions/duplicated.h
ee8361b3d041e25bf9dd142b2b6809db *inst/include/Rcpp/sugar/functions/functions.h
8a1d27971f10c32f1c2dbc2441c47797 *inst/include/Rcpp/sugar/functions/head.h
71a232c26d62819d7752cbd198ccd471 *inst/include/Rcpp/sugar/functions/ifelse.h
e6be4a52d004d3d7cdf4577c03bc0ad6 *inst/include/Rcpp/sugar/functions/is_finite.h
29a018bc6da09bea93392ac25e4c5ff6 *inst/include/Rcpp/sugar/functions/is_infinite.h
e04f27b0d6d0902fd507b0c8a6c1ab6f *inst/include/Rcpp/sugar/functions/is_na.h
905bd30e93c3bfea935a665f6e8eeecf *inst/include/Rcpp/sugar/functions/is_nan.h
d344320200af69792cc4b6c3f864ecd4 *inst/include/Rcpp/sugar/functions/lapply.h
e17dd7603ed04900df60d381e1f8a117 *inst/include/Rcpp/sugar/functions/mapply.h
161a75d06f3022693b9f6e75e091afd2 *inst/include/Rcpp/sugar/functions/mapply/mapply_2.h
49377a45cc5faf0a8bf6258e84dc0d89 *inst/include/Rcpp/sugar/functions/mapply/mapply_3.h
ab7b9d24e77fe2dc072077714933d59d *inst/include/Rcpp/sugar/functions/match.h
747824a9e7823288ba51af113ed9af50 *inst/include/Rcpp/sugar/functions/math.h
e1d5c777461b843bc04bec8b3c4f6787 *inst/include/Rcpp/sugar/functions/max.h
bf3fb31ed2cfec71483f5cf92a6b3ff8 *inst/include/Rcpp/sugar/functions/mean.h
e7ddf543af82118e4774aab3f2e63271 *inst/include/Rcpp/sugar/functions/median.h
17f81f3f0fb3cc04341371ab641ff46a *inst/include/Rcpp/sugar/functions/min.h
55ea8f9269403a501d18d47198f997ef *inst/include/Rcpp/sugar/functions/na_omit.h
fe272f9c21bb17980bdb2efffd7a7f1c *inst/include/Rcpp/sugar/functions/pmax.h
7bd993f789e126017b34ff9858bd915a *inst/include/Rcpp/sugar/functions/pmin.h
ae74c9114eec986e67ecab7ea08d401c *inst/include/Rcpp/sugar/functions/pow.h
a1f5d8e23763f3e16039b32589131aaa *inst/include/Rcpp/sugar/functions/range.h
1646622d8ec6731c53b7d74292906c43 *inst/include/Rcpp/sugar/functions/rep.h
73bfa7e84c00ac5badd0306336c93330 *inst/include/Rcpp/sugar/functions/rep_each.h
cb49753448b25c3cd6498bfbbae3c8de *inst/include/Rcpp/sugar/functions/rep_len.h
5524927f94bb2c48f81cf050d5548e3d *inst/include/Rcpp/sugar/functions/rev.h
e780762055db29b8108b020f605729a2 *inst/include/Rcpp/sugar/functions/rowSums.h
e81e6ae804c78e169d9689df7843f20e *inst/include/Rcpp/sugar/functions/sample.h
08751fd161cfd28c0c3c6003dea07f80 *inst/include/Rcpp/sugar/functions/sapply.h
f964dafa72508e308f9ff057c577c49e *inst/include/Rcpp/sugar/functions/sd.h
f415faaadd4de7ee8cd9f69ceb546a92 *inst/include/Rcpp/sugar/functions/self_match.h
4723c52a2e6ffcb5a99bbf5f120f0e1f *inst/include/Rcpp/sugar/functions/seq_along.h
d96689dfed6e69bd91948b49aacbf448 *inst/include/Rcpp/sugar/functions/setdiff.h
d5a5b9a9b75d93f355534de01dc6ca07 *inst/include/Rcpp/sugar/functions/sign.h
148a1f4a4a0017f7c5520a4a44441fe8 *inst/include/Rcpp/sugar/functions/strings/collapse.h
6a4ca421d9353d551e3454c3c7ba6b00 *inst/include/Rcpp/sugar/functions/strings/strings.h
5f405963ec4bd5cbcc470285814ee796 *inst/include/Rcpp/sugar/functions/strings/trimws.h
fa6996110472311d86217245a4817e28 *inst/include/Rcpp/sugar/functions/sum.h
5ebb5010a39d3135d9797576f92c8256 *inst/include/Rcpp/sugar/functions/table.h
6aece98287f5b416b1b9dde8258b7ba3 *inst/include/Rcpp/sugar/functions/tail.h
3714352196527f3eb1911d7dfeda0925 *inst/include/Rcpp/sugar/functions/unique.h
6af0ed03b22ab5376164eeca35d27830 *inst/include/Rcpp/sugar/functions/var.h
a21e2d861c3e1641d451e8542ac90da7 *inst/include/Rcpp/sugar/functions/which_max.h
cb63e9ae52933534b47e4b03b3345d10 *inst/include/Rcpp/sugar/functions/which_min.h
1f232e3aea101e0a7a967b292f5fee3e *inst/include/Rcpp/sugar/logical/SingleLogicalResult.h
633aaf9fd410363a0816ee14ea0756fe *inst/include/Rcpp/sugar/logical/and.h
fa170788a69bc85fcb1ead3c8e3d8d61 *inst/include/Rcpp/sugar/logical/can_have_na.h
ea316f6c93309fb814bcba060b4243c5 *inst/include/Rcpp/sugar/logical/is.h
349f08cf81f52ed760ecd4dedd472443 *inst/include/Rcpp/sugar/logical/logical.h
c848c2c54466ce13e842fff36b33cbfe *inst/include/Rcpp/sugar/logical/not.h
ceda7f41514004d0f41a0a25df616480 *inst/include/Rcpp/sugar/logical/or.h
16fbabf279bea866b7a9241084d582dc *inst/include/Rcpp/sugar/matrix/as_vector.h
22dce70c24a72d954c9c0ddb637a87af *inst/include/Rcpp/sugar/matrix/col.h
1efcfad1b72aac3ab68857be3a0578da *inst/include/Rcpp/sugar/matrix/diag.h
2ce9df0e2282b1780d168cdaec70e501 *inst/include/Rcpp/sugar/matrix/lower_tri.h
ac84cad78d201a054f8d7df13a6b1353 *inst/include/Rcpp/sugar/matrix/matrix_functions.h
fd9bd47cec790c2604a4987472eec0e1 *inst/include/Rcpp/sugar/matrix/outer.h
5d698479a84a2e019271ca70556478eb *inst/include/Rcpp/sugar/matrix/row.h
115b6149b7f328f12440fd1e5a5a0300 *inst/include/Rcpp/sugar/matrix/tools.h
23f94c2d6cbd068312a949798b403467 *inst/include/Rcpp/sugar/matrix/upper_tri.h
30973622e9d3acef832c7e2578e0ddd0 *inst/include/Rcpp/sugar/nona/nona.h
278c96c59d33653b53db01862911a17d *inst/include/Rcpp/sugar/operators/Comparator.h
6c43390b2d47dd6b7d2bb7824d37061b *inst/include/Rcpp/sugar/operators/Comparator_With_One_Value.h
c62f193c49b200ee28687469fb2e61c5 *inst/include/Rcpp/sugar/operators/divides.h
dbc2f27e6693976f7e1d745db791b712 *inst/include/Rcpp/sugar/operators/logical_operators__Vector__Vector.h
631ba1c3a5983fa36aba958fbe0fac01 *inst/include/Rcpp/sugar/operators/logical_operators__Vector__primitive.h
57b8e523981ced17043df0a35db0503c *inst/include/Rcpp/sugar/operators/minus.h
ce6f7cfa18cfcafb15ebd8eb8c45f802 *inst/include/Rcpp/sugar/operators/not.h
da8a2c17103b00aeb0d205f76aaebf7d *inst/include/Rcpp/sugar/operators/operators.h
2e6171e8d4ed6c21710aa0758e7f0536 *inst/include/Rcpp/sugar/operators/plus.h
d129eac323c93bb69d99b023eb05812d *inst/include/Rcpp/sugar/operators/r_binary_op.h
73722dc109290c63d68934f52637d27b *inst/include/Rcpp/sugar/operators/times.h
5f9acbfddd1c397b017cfd5691293bb4 *inst/include/Rcpp/sugar/operators/unary_minus.h
6c85f88e633df848747b28705f12419a *inst/include/Rcpp/sugar/sets.h
813ff968a963e3058a58c469e070ef82 *inst/include/Rcpp/sugar/sugar.h
89a193bed15037ce566fefe07f049d4b *inst/include/Rcpp/sugar/sugar_forward.h
b4c3ecdf94025da94e6dde6eeafe8a44 *inst/include/Rcpp/sugar/tools/iterator.h
f01c3fd8fe059517e03062b7d8422407 *inst/include/Rcpp/sugar/undoRmath.h
894245a3f8d5c212ab9c808662c22160 *inst/include/Rcpp/traits/char_type.h
d39c02a1033bce9b1193f12eee141171 *inst/include/Rcpp/traits/enable_if.h
4a72487b73047f686e868b4c4cb44382 *inst/include/Rcpp/traits/expands_to_logical.h
129c2e9c6e0a73fce5cebd72c14c2254 *inst/include/Rcpp/traits/get_na.h
e20649d25657d2a949492331c7758b7c *inst/include/Rcpp/traits/has_iterator.h
235a43df43936d00128253ef7005915c *inst/include/Rcpp/traits/has_na.h
3cd036e8adc3672b90bf08504e9f7a76 *inst/include/Rcpp/traits/if_.h
fe6ce0c1245797c031830f9efc2180eb *inst/include/Rcpp/traits/index_sequence.h
f6618d0224159bfc48c1df1d83828d68 *inst/include/Rcpp/traits/init_type.h
569027e71fdb2bda19c8184a12d08762 *inst/include/Rcpp/traits/integral_constant.h
6eb1fc7443352426923660525040b98b *inst/include/Rcpp/traits/is_arithmetic.h
29571f5642930d175ef873140c776975 *inst/include/Rcpp/traits/is_bool.h
4fa497cea2410fb4e662b866663bc0ac *inst/include/Rcpp/traits/is_const.h
abcb7e2b556b94d82a09a8849a1c1096 *inst/include/Rcpp/traits/is_convertible.h
cd901317f51083b5a6d3f2414fe82607 *inst/include/Rcpp/traits/is_eigen_base.h
7bfb288fca1e46ed6b931500ad42a43d *inst/include/Rcpp/traits/is_finite.h
b7587e1b4122a84038f7a5800b535e8e *inst/include/Rcpp/traits/is_infinite.h
abd4686b93894a8a221f6da4f3bf74f0 *inst/include/Rcpp/traits/is_module_object.h
d97fd982b65ea3d8efc6455b3b1e8102 *inst/include/Rcpp/traits/is_na.h
60122e02e5bb562e557db0c38e17f790 *inst/include/Rcpp/traits/is_nan.h
b4d4b4ecdcc75f7004378d9a4c52c490 *inst/include/Rcpp/traits/is_pointer.h
74d6de2afc81c98a4e34fb368aea6a53 *inst/include/Rcpp/traits/is_primitive.h
2a7ce1cf1b5479b6453c7c28d346bcfa *inst/include/Rcpp/traits/is_reference.h
5e2acd97071b71e05d9b11a3f96387e5 *inst/include/Rcpp/traits/is_sugar_expression.h
28916414af7cdb5b5bf9673bffe3fed8 *inst/include/Rcpp/traits/is_trivial.h
2aa827ff4a611723f8fda7e58c9225d7 *inst/include/Rcpp/traits/is_wide_string.h
738e632a612038e6be1baafb8936d5dd *inst/include/Rcpp/traits/longlong.h
d2d2d22f014dbda73370de85977494be *inst/include/Rcpp/traits/matrix_interface.h
4165bd63dd3b616e807d730a1909b1d6 *inst/include/Rcpp/traits/module_wrap_traits.h
e19d74e319b8af6cbaeb1516a81435c5 *inst/include/Rcpp/traits/named_object.h
e9717cf30ad078a3722702d54d744b11 *inst/include/Rcpp/traits/num2type.h
fda43f65172234cb8e672b725ff21dc3 *inst/include/Rcpp/traits/one_type.h
3ab68cc3b397346dde5c071d6b1dc2ca *inst/include/Rcpp/traits/r_sexptype_traits.h
9f83f99113b796b5b37668e395f07ec8 *inst/include/Rcpp/traits/r_type_traits.h
2c55008e8515714263346d6c3cdeb35c *inst/include/Rcpp/traits/remove_const.h
0830e491fc6a03ab6c735a215fa70ee0 *inst/include/Rcpp/traits/remove_const_and_reference.h
49e7441fad045085e944a89c2b6d2f14 *inst/include/Rcpp/traits/remove_reference.h
ae9eded0d6af8b91bda4e91d7e8c47ce *inst/include/Rcpp/traits/result_of.h
10df0fad7bfeca54513814e89fd28d60 *inst/include/Rcpp/traits/same_type.h
9091fcb005196d81ed41c6a89550e89a *inst/include/Rcpp/traits/storage_type.h
6ffcd9b3ae200cb9f82bf43df519f3a4 *inst/include/Rcpp/traits/traits.h
3d6fc7e388a23053d99a353535ae1275 *inst/include/Rcpp/traits/un_pointer.h
8f92942349c07f0032f5715822387218 *inst/include/Rcpp/traits/wrap_type_traits.h
c858d22e58939329e5fe3e10c6e61471 *inst/include/Rcpp/unwindProtect.h
fadece0229ef4ff741cfa4c0c42b6c1b *inst/include/Rcpp/utils/tinyformat.h
dedbf46dfae724476eedb59622b6c0be *inst/include/Rcpp/utils/tinyformat/tinyformat.h
89a07678f678cfb48de4bd3d4420ea64 *inst/include/Rcpp/vector/00_forward_Vector.h
4fe970f8b2608fb97026142528d21518 *inst/include/Rcpp/vector/00_forward_proxy.h
411c3c52a0011d4fdd9392637172a97d *inst/include/Rcpp/vector/ChildVector.h
d4c4878eede03e50c776afcf7836fc7a *inst/include/Rcpp/vector/DimNameProxy.h
47f675c64171ec8e4072036d972aad4f *inst/include/Rcpp/vector/LazyVector.h
020c11693ef729783f6ce9c70e0b3a86 *inst/include/Rcpp/vector/ListOf.h
bd73507d75d9178924fc00b70b1f6f55 *inst/include/Rcpp/vector/Matrix.h
a6c5cdec475185adc2b61152bc9379de *inst/include/Rcpp/vector/MatrixBase.h
fea18a15ac16177399b74b3aba1e8d3c *inst/include/Rcpp/vector/MatrixColumn.h
410f8a433cea0b58017e10edcdd520d7 *inst/include/Rcpp/vector/MatrixRow.h
dabec153dcf826b040e592e1c60fc37f *inst/include/Rcpp/vector/RangeIndexer.h
31372a9f3d172f4e9df62c559ff1ad66 *inst/include/Rcpp/vector/SubMatrix.h
282fcdbb1720184e46ec0224de57a500 *inst/include/Rcpp/vector/Subsetter.h
ef637b66900da7170303250e1a0d9aa6 *inst/include/Rcpp/vector/Vector.h
99dc1e7a939e6f11ec33588c382517cd *inst/include/Rcpp/vector/VectorBase.h
0c3ff20020b3ff5248826ff796752946 *inst/include/Rcpp/vector/const_generic_proxy.h
c76a4bfbaf1c61171799f258f6393ea4 *inst/include/Rcpp/vector/const_string_proxy.h
82421a927c857b34a028774399518289 *inst/include/Rcpp/vector/converter.h
fe60090372703d0fd887c32e45f944a3 *inst/include/Rcpp/vector/generic_proxy.h
026adf34a827731798dbf3b6c3159421 *inst/include/Rcpp/vector/instantiation.h
8bfaa9746b1126a74324cab8b5170439 *inst/include/Rcpp/vector/no_init.h
84dbe92383dc935b5576814fd6937418 *inst/include/Rcpp/vector/proxy.h
86af06f9720947eaa083c4fa9bc11289 *inst/include/Rcpp/vector/string_proxy.h
07c9204ef548fd66d5e42ff84cf1da09 *inst/include/Rcpp/vector/swap.h
0467559689b4d5d3eb6504a8a90de7d1 *inst/include/Rcpp/vector/traits.h
b53a80ae2aa1de12e8bd0fbff69c904b *inst/include/Rcpp/vector/vector_from_string.h
e825c305f490243c7dabb33413dfaa84 *inst/include/RcppCommon.h
83051c918c676565c50377280f3d80a9 *inst/include/doxygen/Examples.h
fc570e7927219c2ed9bdb13ca05134d9 *inst/prompt/module.Rd
e78047bdda3db5af33456370e65a98d0 *inst/skeleton/Num.cpp
ceccb01282e3e574aa78fec0102df6da *inst/skeleton/Rcpp_modules_examples.Rd
519be498e2f048a2750863a147964737 *inst/skeleton/manual-page-stub.Rd
411d02aaf3c409722bf6a39a4a4ffa90 *inst/skeleton/rcpp_hello_world.R
736db59264020d28cb1870868cfa916b *inst/skeleton/rcpp_hello_world.Rd
329380236bdae3a32e349531c0ee2d54 *inst/skeleton/rcpp_hello_world.cpp
2c1227dd8097d9fca8040f3d29f59633 *inst/skeleton/rcpp_hello_world.h
0da63b615f705aa9dfa2e91b15a0ec3a *inst/skeleton/rcpp_hello_world_attributes.cpp
9cbc66836028cfab4df53c8e1c4ccbf5 *inst/skeleton/rcpp_module.cpp
87e64fbfae8826697bdfd1020d2b2641 *inst/skeleton/stdVector.cpp
32a99eb2d472350734277940a2e2a1bb *inst/skeleton/zzz.R
7fb9967c5d48052f8dc6167b1ee619d3 *inst/tinytest/bin/amd64/r-cran-testrcpppackage_0.1.0-1_amd64.deb
56b8f712e86e0113715ead494065346e *inst/tinytest/bin/i386/r-cran-testrcpppackage_0.1.0-1_i386.deb
08aa53008c9d0b88446c534cbf91a165 *inst/tinytest/cpp/DataFrame.cpp
caded512e0425b790380edddc00967f4 *inst/tinytest/cpp/Environment.cpp
378c5ca02f76666d28abc7f0f0bbb82a *inst/tinytest/cpp/Exceptions_nocall.cpp
b81bf018da788eadaf8f101144e1841b *inst/tinytest/cpp/Function.cpp
ca3ce6364c578acf0542617cb09505d1 *inst/tinytest/cpp/InternalFunction.cpp
a9b57d92bffc646ac6f074c98c81db6e *inst/tinytest/cpp/InternalFunctionCPP11.cpp
62bd3687f6fae5f022287932343b34b0 *inst/tinytest/cpp/ListOf.cpp
4592f91b2ff1a6cea2125115ce8f75e4 *inst/tinytest/cpp/Matrix.cpp
c171e3f43d4293bcfb4341cdc1c2bd29 *inst/tinytest/cpp/Module.cpp
ae344d14e4a2711ff2462d02ac0baa78 *inst/tinytest/cpp/RObject.cpp
83bb109ce6845fbdb08a732527556ff1 *inst/tinytest/cpp/Reference.cpp
431733375a744f92c308b95f9d402f42 *inst/tinytest/cpp/S4.cpp
239bf07c23051fc0318de2f80e95385c *inst/tinytest/cpp/String.cpp
bf2f556311ef8884928d6db63fccf112 *inst/tinytest/cpp/Subset.cpp
8f85f4c4b8fd6f3456224ce8c7812ca5 *inst/tinytest/cpp/Vector.cpp
2834dfe1270c0e1cc24aba14721c09da *inst/tinytest/cpp/VectorOld.cpp
aa3497bfcf9b9d14f35e9558a19fc1b4 *inst/tinytest/cpp/XPtr.cpp
d19479e6aab83b12124389782f4bf739 *inst/tinytest/cpp/algorithm.cpp
219e1d71106fb3bb1253ce60affbb398 *inst/tinytest/cpp/as.cpp
12c4f9c7f7323095f118fc9c11ace5da *inst/tinytest/cpp/attributes.cpp
7dd5700e27b702cba4cede554cdb65ba *inst/tinytest/cpp/attributes.hpp
fdf3557dcb7e7fbaa37afcbfaba4b088 *inst/tinytest/cpp/coerce.cpp
0644a8cbc3598636082eb8caf23408c0 *inst/tinytest/cpp/dates.cpp
9c81ac1fb25a970b84e543aef34d6cde *inst/tinytest/cpp/dispatch.cpp
385abbb997641176de511ef784b87b45 *inst/tinytest/cpp/embeddedR.cpp
3142234408f0d17bb7edd2238f6beb78 *inst/tinytest/cpp/embeddedR2.cpp
4e6b3693278fd9c33e5fc7724e268fa8 *inst/tinytest/cpp/exceptions.cpp
6e824ef93678e96b63e8dc314a86abb4 *inst/tinytest/cpp/language.cpp
cdd742bd240621d7e33ecf4818691e66 *inst/tinytest/cpp/misc.cpp
31eb0032506e988316357913ffc28dee *inst/tinytest/cpp/modref.cpp
705309cd5376196a486d14c73f76ba29 *inst/tinytest/cpp/na.cpp
05a686ca3070780f8dcb1a1de321797e *inst/tinytest/cpp/rcppversion.cpp
511f2da216d7480c3bd4b50d48983799 *inst/tinytest/cpp/rmath.cpp
c7bb688561ccc8a9039413782640be7e *inst/tinytest/cpp/stack.cpp
37f1770bce35bf5f2c6a523d42e1ea75 *inst/tinytest/cpp/stats.cpp
3d7f876183e254bcbe9ac4197a1cded6 *inst/tinytest/cpp/sugar.cpp
956e39fb6eb566987b3130a85b4da3c6 *inst/tinytest/cpp/support.cpp
c8a357d67dd56b672cd7616e7bbbf520 *inst/tinytest/cpp/table.cpp
9d9ca2312b72c753d9c6f787bf455540 *inst/tinytest/cpp/wrap.cpp
2db3a044a68e8cf5d76a9a1473dee526 *inst/tinytest/cpp/wstring.cpp
54073056db0ba60cf0b1707c4b6db85c *inst/tinytest/src/r-cran-testrcpppackage_0.1.0-1.diff.gz
1d2156181f8816c31306d77f4760697c *inst/tinytest/src/r-cran-testrcpppackage_0.1.0-1.dsc
18c540b0b12feac586f57f2411ed378e *inst/tinytest/src/r-cran-testrcpppackage_0.1.0-1_amd64.changes
7fb9967c5d48052f8dc6167b1ee619d3 *inst/tinytest/src/r-cran-testrcpppackage_0.1.0-1_amd64.deb
84ddc3de28ce0c458d6f19f91bc1710d *inst/tinytest/src/r-cran-testrcpppackage_0.1.0-1_i386.changes
56b8f712e86e0113715ead494065346e *inst/tinytest/src/r-cran-testrcpppackage_0.1.0-1_i386.deb
7263661801b44d075a3345ff4a1faffa *inst/tinytest/testRcppAttributePackage/DESCRIPTION
f06e063ca806e7fca22eb7482b2af2d1 *inst/tinytest/testRcppAttributePackage/NAMESPACE
c694664176af9bd21deb0248fdddbe7e *inst/tinytest/testRcppAttributePackage/src/rcpp_test.cpp
1a5f53d4b6ba9e3b98fe1eec48a5eb9b *inst/tinytest/testRcppClass/DESCRIPTION
f926317ac3486e08433a0fbdf3153efe *inst/tinytest/testRcppClass/NAMESPACE
03f336c9faea79524a608b9dd1d22a92 *inst/tinytest/testRcppClass/R/load.R
ec8250809d340e191fbf0b04c344fe00 *inst/tinytest/testRcppClass/R/rcpp_hello_world.R
60b39ca81dc918e7fe8a0c4737079396 *inst/tinytest/testRcppClass/man/Rcpp_class_examples.Rd
736db59264020d28cb1870868cfa916b *inst/tinytest/testRcppClass/man/rcpp_hello_world.Rd
fe2b352c0aa449acae8ae667b82aebb9 *inst/tinytest/testRcppClass/man/testRcppClass-package.Rd
5b71e6b5e64bc8418e6b9adf26c09cc8 *inst/tinytest/testRcppClass/src/Num.cpp
45a1446cd51cdbaf9b5833141da93b42 *inst/tinytest/testRcppClass/src/init.c
5e17501af84c7deb94e69c8c48abc6dc *inst/tinytest/testRcppClass/src/rcpp_hello_world.cpp
5c03d3d1426cf6886a0f6f6c412bb456 *inst/tinytest/testRcppClass/src/rcpp_hello_world.h
0abb0d55f1edc5ddb19ca87ed5c370f1 *inst/tinytest/testRcppClass/src/rcpp_module.cpp
3326bf4e52a561d08f9aa1370333222b *inst/tinytest/testRcppClass/src/stdVector.cpp
f369e8eabd84792764737850dc9cf599 *inst/tinytest/testRcppClass/tests/classes.R
55a2cc182d8bdab7df8367bb2c9ae4f1 *inst/tinytest/testRcppInterfaceExporter/DESCRIPTION
caccac1441b38bc3b9d91f9e189b1d68 *inst/tinytest/testRcppInterfaceExporter/NAMESPACE
052892f806ecd5542358fd7ae3bb58d9 *inst/tinytest/testRcppInterfaceExporter/R/RcppExports.R
f9c87d177bece784bca40b2294329568 *inst/tinytest/testRcppInterfaceExporter/R/exporter.R
cdb9489e21b94623f0f1e7d4af8ec157 *inst/tinytest/testRcppInterfaceExporter/inst/include/testRcppInterfaceExporter.h
1cbd306e27aed3fcb7b5fbc34d42b39d *inst/tinytest/testRcppInterfaceExporter/inst/include/testRcppInterfaceExporter_RcppExports.h
ae4a8309d7807432ae8e1b507132acb3 *inst/tinytest/testRcppInterfaceExporter/src/RcppExports.cpp
0805a3830147dedf4a37a91f9ad66a4d *inst/tinytest/testRcppInterfaceExporter/src/exporter.cpp
53dfff77ccb443103f44fb52eea3187b *inst/tinytest/testRcppInterfaceExporter/src/unwound.h
d4ceb27b690d25e3bf791340e1082ede *inst/tinytest/testRcppInterfaceUser/DESCRIPTION
98aef5f5fafb61bfb9c2e3687ea7cd74 *inst/tinytest/testRcppInterfaceUser/NAMESPACE
a7632eb2a8e768dc6305ac25e4d1c666 *inst/tinytest/testRcppInterfaceUser/R/user.R
d41d8cd98f00b204e9800998ecf8427e *inst/tinytest/testRcppInterfaceUser/src/config.h
a195376bccd32edf2ec234585cdd19f1 *inst/tinytest/testRcppInterfaceUser/src/unwound.h
44a229bee1d2fd44365e82d64aff2e23 *inst/tinytest/testRcppInterfaceUser/src/user.cpp
c0e76426243757398223031c7c4c46b0 *inst/tinytest/testRcppInterfaceUser/tests/tests.R
fb4466d7edc9f03ab23dc0d557e49145 *inst/tinytest/testRcppModule/DESCRIPTION
add4aaed2d306765ce493922461f3a55 *inst/tinytest/testRcppModule/NAMESPACE
bd40b50ea592b9c3c0cfe79de3f6eb1d *inst/tinytest/testRcppModule/R/rcpp_hello_world.R
81dadeb632a55b8ce2ad71cf37d2c1ce *inst/tinytest/testRcppModule/R/zzz.R
0371f14c3812cd1a564488ca96b11ca2 *inst/tinytest/testRcppModule/man/Rcpp_modules_examples.Rd
2deeefcb97dc4727ba42f47594ad3be8 *inst/tinytest/testRcppModule/man/rcpp_hello_world.Rd
079d3f03a16107fd9ef8fe40b6175a9e *inst/tinytest/testRcppModule/man/testRcppModule-package.Rd
1999f8a3ad18e75c899c980902146d80 *inst/tinytest/testRcppModule/src/Num.cpp
d1c8b83cdba82518ad248f4612e22802 *inst/tinytest/testRcppModule/src/init.c
5e17501af84c7deb94e69c8c48abc6dc *inst/tinytest/testRcppModule/src/rcpp_hello_world.cpp
5c03d3d1426cf6886a0f6f6c412bb456 *inst/tinytest/testRcppModule/src/rcpp_hello_world.h
30f4072a33ca51c385cba14d8c41e7fc *inst/tinytest/testRcppModule/src/rcpp_module.cpp
974ce7cbf35e70ee51ee2f338d1a47ed *inst/tinytest/testRcppModule/src/stdVector.cpp
af70d56c91a91ed55fc4da6c1f8b7ca5 *inst/tinytest/testRcppModule/tests/modules.R
c83d5e7e43bdf9d149e62f8717facf73 *inst/tinytest/testRcppPackage/DESCRIPTION
f46e0bbc90d649eaed05e1a1f953645d *inst/tinytest/testRcppPackage/NAMESPACE
86700d82a2395c2d7c34f21ffb7dcaa4 *inst/tinytest/testRcppPackage/R/rcpp_hello_world.R
8a4012c68853de0e7ddd4ec8dd3ef9da *inst/tinytest/testRcppPackage/man/testRcppPackage-package.Rd
c980624db12b714ac2ec6bb7740c3030 *inst/tinytest/testRcppPackage/src/rcpp_hello_world.cpp
3fc7d87c655d7c58790b18dadbf17462 *inst/tinytest/testRcppPackage/src/rcpp_hello_world.h
d4d4b13e8e48f3d2dff079fa0cae4db2 *inst/tinytest/test_algorithm.R
d43f4463ec22a001f10f70e5968b741e *inst/tinytest/test_as.R
4622138c9061a54bded602a3fa89700e *inst/tinytest/test_attribute_package.R
6fafd86f9d6036ddeec256f6520940fb *inst/tinytest/test_attributes.R
645c61b59b44cf4a7d0a8935c94f30b8 *inst/tinytest/test_binary_package.R
5c61d77db502333de43ef63ab5542947 *inst/tinytest/test_client_package.R
6972e7398a0316ee9378d0235a98193e *inst/tinytest/test_coerce.R
f848412bd201674571166f59141ead32 *inst/tinytest/test_dataframe.R
5d8938f1a0dd193080a0dd858aace479 *inst/tinytest/test_date.R
f7020772ec2f52bca37aa52f328e8a4a *inst/tinytest/test_dispatch.R
37c878dba3a8c6ee4a512d8ae49d0510 *inst/tinytest/test_embedded_r.R
0bfe887104fa049afec792eb9e1d38ee *inst/tinytest/test_environments.R
8d0384378c1530ae2651ed30077c3849 *inst/tinytest/test_exceptions.R
d6b632cbcf1d0d2a809789a850393f04 *inst/tinytest/test_exceptions_nocall.R
6592b542414d9978e3b1c899e0966638 *inst/tinytest/test_expose_class.R
2659ca40245f5942186d612cc050290e *inst/tinytest/test_function.R
a979bf54492367431865c051efc150ca *inst/tinytest/test_global_rostream.R
f98648470bc21b3fdbb3176e90f45129 *inst/tinytest/test_interface.R
9fcdc77199f2adc16ddaab74ede5c15f *inst/tinytest/test_internal_function.R
b1ec64c8809b5017cc83db4e63bb23e7 *inst/tinytest/test_internal_function_cpp11.R
6f3de256ae47895bab7356f1d5db3532 *inst/tinytest/test_language.R
f3df4a9477700c9773503b0d72cb9f38 *inst/tinytest/test_listof.R
642a072d490f3adf9ad7ccdc0b583c8c *inst/tinytest/test_matrix.R
d820e9d99c8361bb9bcdff1df8748415 *inst/tinytest/test_misc.R
3b74e9c0f70c24ec455b8325bd575ad1 *inst/tinytest/test_modref.R
c4b1132390df294c71724513bbcb329c *inst/tinytest/test_module.R
4f1cb95ff3231714571275b5f60c21cc *inst/tinytest/test_module_client_package.R
8fa4cb9335b9239ffce495337cbbe4b4 *inst/tinytest/test_na.R
350f50b10fda4680f6416833c8459113 *inst/tinytest/test_packageversion.R
50ac8801171cadb6ce7535680e3d7b4b *inst/tinytest/test_quickanddirty.R
a6e775e8658b97f5e1d0414789f76a08 *inst/tinytest/test_rcpp_package_skeleton.R
12824f997493028fb75fb416fb4899bd *inst/tinytest/test_reference.R
bf9528a41d909d19eda20947fe73d042 *inst/tinytest/test_rmath.R
23cccaef77d1c7188a384e5e6400505e *inst/tinytest/test_robject.R
ec2b5b9cab31cafb4b2cbdef00cd89e3 *inst/tinytest/test_s4.R
0bd9a05a2ebcfc708aed3911d21a6dc7 *inst/tinytest/test_stack.R
5f3c73c9a10dd378a82d16ed7224f541 *inst/tinytest/test_stats.R
d164383dd85501e99acb936ee66210a7 *inst/tinytest/test_string.R
3d9e890abd6a080315b84b99d6ed3843 *inst/tinytest/test_subset.R
90aed58d095a7017f60ea5498b103a88 *inst/tinytest/test_sugar.R
eea3406aec4fe65cae71db5baa9a0b51 *inst/tinytest/test_sugar_var.R
46dcee8e76f26d5103efa5ad09441892 *inst/tinytest/test_support.R
9a97f20a6edeb3f2d7184ed909f70958 *inst/tinytest/test_system.R
44d3b675e624e692463ae9e9fe2776d0 *inst/tinytest/test_table.R
d06e982e043a66d6dc372dd98fc7c36e *inst/tinytest/test_vector.R
6a724a81b5a9281e7777b16ada40ac39 *inst/tinytest/test_vector_old.R
00c6d79e911c979b8b184fa6c946fe9a *inst/tinytest/test_wrap.R
daae893ce0886eccb852f34104884837 *inst/tinytest/test_wstring.R
5a3f1319ed569fd1f541dba428f9b7b7 *inst/tinytest/test_xptr.R
8e5b008afb149e5d2a53db37ece02775 *man/CppClass-class.Rd
0014f801734709bb479effdecc7b4718 *man/CppConstructor-class.Rd
0f6f6dd743da70147b0c2cac5c912ecb *man/CppField-class.Rd
7bd877824ff53185640a667392af41b2 *man/CppFunction-class.Rd
14c82eb310974beb4b904dcdc1617433 *man/CppObject-class.Rd
66e02f05536e2310d9e803ad3c874db7 *man/CppOverloadedMethods-class.Rd
4c34de06399c41644dfc380bb2f05a8d *man/DollarNames-methods.Rd
3088b043e8aab6cb3309701de2a8402f *man/Module-class.Rd
6161ec45d82f546757f7d02d1545675a *man/Module.Rd
42b39f5fc4290684199188c80a58ff9a *man/Rcpp-deprecated.Rd
2d49a16c0b7aae09482f3249dd93b2f1 *man/Rcpp-internal.Rd
d6b6c655ad4be529d1787a5594d6aacb *man/Rcpp-package.Rd
caf95a4016058ed94cacd73a11fd9925 *man/Rcpp.package.skeleton.Rd
5e22a0887ef6458d266f5a3ba7388ddc *man/Rcpp.plugin.maker.Rd
8c9df710945f7e4367c67b98c7172e67 *man/RcppLdFlags.Rd
277c9602f9273954b91ece7873667d11 *man/RcppUnitTests.Rd
cdfd54981ce589dcfaf30019dfa6b95b *man/compileAttributes.Rd
6d563c1b68971237af02edcab85370a8 *man/compilerCheck.Rd
e27c53a090cd857b3b53815841709f81 *man/cppFunction.Rd
01489ee8b81490b3516fee28615d461b *man/demangle.Rd
2c0fc00c864631092fe37dfc95b8a21d *man/dependsAttribute.Rd
f0e45ce1b304a89586becbae18e20135 *man/evalCpp.Rd
bef1d268eb1652a7cc3b15d5f691b6e8 *man/exportAttribute.Rd
01cbef50e7820a40e65d410ab4ce6d2e *man/exposeClass.Rd
236811309af8821f7e23dfc16f9a8d41 *man/formals.Rd
ee26bc930a1bff02c8664c0e51bd46da *man/getRcppVersion.Rd
708280bfbc3f6dc6d8cf76fe2a2afd0a *man/interfacesAttribute.Rd
25e1ffdc750d2f2778b38919c098c9cc *man/loadModule.Rd
92c309f1d37426d2e2b4737f99bd75af *man/loadRcppModules-deprecated.Rd
dd3b9b7596f51706f291dce032bfdb5c *man/pluginsAttribute.Rd
adf9afe6c945bc84505583d9e07bad49 *man/populate.Rd
8e8411de016d9bc94dc1d9585e660d34 *man/registerPlugin.Rd
ed0b08b15ead789f84e83ba46985a702 *man/setRcppClass.Rd
53e0cd847f1775e36539946d8112cf69 *man/sourceCpp.Rd
73e9e048a7c5003477f67089bf5d609c *src/Makevars
73e9e048a7c5003477f67089bf5d609c *src/Makevars.win
6ae726fde82e15f3777d25649aa8c181 *src/api.cpp
49a2f74beaa4ab2a2688477e9fa961bf *src/attributes.cpp
6c6e3f9a22510b848ff819063bad67bd *src/barrier.cpp
85a8a53c535e4c986f02c427b5e7b85e *src/date.cpp
eef4c2f0e1abd787b8fd62d289ed5961 *src/internal.h
4eeaedc1e555103025f1feeaee299538 *src/module.cpp
545982e58b067742919490cc23d62905 *src/rcpp_init.cpp
37a2a0606ac4ed8ce8fbc9e71287e715 *tests/tinytest.R
2baf167ce452976b0fcb43e44f566af7 *vignettes/Rcpp-FAQ.Rnw
887250b7e0675b4a70d6eb1a4689080c *vignettes/Rcpp-attributes.Rnw
37f50a136d1350e8e864c9265cc88ad8 *vignettes/Rcpp-extending.Rnw
90eade7bfffa82f250510759bc9a7f36 *vignettes/Rcpp-introduction.Rnw
e6cf1d12ce4e3a2fed6eddf6290d393f *vignettes/Rcpp-jss-2011.Rnw
4524c2761e07e170f681181c2e62eb05 *vignettes/Rcpp-libraries.Rnw
a96bcf4153b795bff19ddc36a17ca435 *vignettes/Rcpp-modules.Rnw
835d0e2dd365e4621663bd03ae219758 *vignettes/Rcpp-package.Rnw
d76adfdc4e68c69c5ff632e234db6a85 *vignettes/Rcpp-quickref.Rnw
929a1aad762b7354b6875a35093ec477 *vignettes/Rcpp-sugar.Rnw
c633371e5d82fb25d82acbc10a610ba3 *vignettes/pdf/Rcpp-FAQ.pdf
53f6cb43783567e8bd9f14a97c5a927b *vignettes/pdf/Rcpp-attributes.pdf
5a4324a50ee8a2ab30fe93a75d584b0d *vignettes/pdf/Rcpp-extending.pdf
acda7060a297c2bc8720bd135801e275 *vignettes/pdf/Rcpp-introduction.pdf
4400de72176df827637acd1e4315871b *vignettes/pdf/Rcpp-jss-2011.pdf
974a04437c2e5a37cb4038a7b4ead963 *vignettes/pdf/Rcpp-libraries.pdf
9fd40949ecc0c8f1ed00a081c929c90b *vignettes/pdf/Rcpp-modules.pdf
c67888daace8c97d145869b53d865a1d *vignettes/pdf/Rcpp-package.pdf
6d3516230be6a8b4c4936c9fa7d585ef *vignettes/pdf/Rcpp-quickref.pdf
499e8a2f4ae21c70a88c2ed8cbcd029d *vignettes/pdf/Rcpp-sugar.pdf
Rcpp/R/ 0000755 0001762 0000144 00000000000 15014017044 011353 5 ustar ligges users Rcpp/R/RcppClass.R 0000644 0001762 0000144 00000014705 14070703457 013412 0 ustar ligges users # Copyright (C) 2010 - 2021 John Chambers, Dirk Eddelbuettel and Romain Francois
#
# This file is part of Rcpp.
#
# Rcpp is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# Rcpp is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Rcpp. If not, see .
setRcppClass <- function(Class, CppClass,
module,
fields = list(),
contains = character(),
methods = list(),
saveAs = Class,
where = topenv(parent.frame()),
...) {
myCall <- match.call()
myCall[[1]] <- quote(Rcpp::loadRcppClass)
if (!missing(module) && moduleIsLoaded(module, where)) # eval now
eval.parent(myCall) # #nocov
else {
f <- function(NS)NULL
myCall$where = as.name("NS")
body(f, where) <- myCall
setLoadAction(f, where = where)
}
}
loadRcppClass <- function(Class, CppClass = Class,
module = paste0("class_",Class),
fields = character(),
contains = character(),
methods = list(),
saveAs = Class,
where = topenv(parent.frame()),
...) {
if(isBotchedSession()) {
value <- setRefClass(Class, fields = fields, methods = methods, contains = contains, where = where, ...) # kludge -- see loadModule.R #nocov start
if(is.character(saveAs) && length(saveAs) == 1)
assign(saveAs, value, envir = where)
return(value) # #nocov end
}
mod <- loadModule(module, NULL, env = where, loadNow = TRUE)
storage <- get("storage", envir = as.environment(mod))
if(exists(Class, envir = storage, inherits = FALSE)) {
cppclassinfo <- get(Class, envir = storage)
if(!is(cppclassinfo, "C++Class"))
stop(gettextf("Object \"%s\" in module \"%s\" is not a C++ class description", Class, module)) # #nocov
}
else
stop(gettextf("No object \"%s\" in module \"%s\"", Class, module)) # #nocov
allmethods <- .makeCppMethods(methods, cppclassinfo, where)
allfields <- .makeCppFields(fields, cppclassinfo, where)
value <- setRefClass(Class, fields = allfields,
contains = c(contains, "RcppClass"),
methods = allmethods, where=where, ...)
## declare the fields and methods to shut up codetools
## the R level fields and methods were declared by setRefClass
## but we declare them again; globalVariables() applies unique()
if(exists("globalVariables", envir = asNamespace("utils"))) # >=2.15.1
utils::globalVariables(c(names(allfields), names(allmethods)),
where)
if(is.character(saveAs) && length(saveAs) == 1)
assign(saveAs, value, envir = where)
value
}
.makeCppMethods <- function(methods, cppclassinfo, env) {
cppMethods <- names(cppclassinfo@methods)
newMethods <- names(methods)
for(what in cppMethods[! cppMethods %in% newMethods])
methods[[what]] <- eval(substitute(
function(...) .CppObject$WHAT(...), list(WHAT = as.name(what))),
env)
methods
}
.makeFieldsList <- function(fields) {
fnames <- allNames(fields)
any_s <- !nzchar(fnames)
fnames[any_s] <- fields[any_s]
fields[any_s] <- "ANY"
fields <- as.list(fields)
names(fields) <- fnames
fields
}
.makeCppFields <- function(fields, cppclassinfo, env) {
if(is.character(fields))
fields <- .makeFieldsList(fields)
cppFields <- names(cppclassinfo@fields)
newFields <- names(fields)
for(what in cppFields[! cppFields %in% newFields])
fields[[what]] <- eval(substitute(
function(value) if(missing(value)) .CppObject$WHAT else .CppObject$WHAT <- value,
list(WHAT = as.name(what))), env)
## insert the generator and cppclass def as constants
cppgenerator <- getRefClass(cppclassinfo)
fields[[".CppClassDef"]] <- eval(substitute(
function(value) if(missing(value)) DEF else stop("this field is a constant"),
list(DEF = cppclassinfo)), env)
fields[[".CppGenerator"]] <- eval(substitute(
function(value) if(missing(value)) DEF else stop("this field is a constant"),
list(DEF = cppgenerator)), env)
fields
}
.RcppClass <- setRefClass("RcppClass",
methods = list(
initialize = function(...){
args <- list(...)
argNames <- allNames(args)
cppArgs <- !nzchar(argNames)
.CppObject <<- do.call(.CppGenerator$new, args[cppArgs])
for(i in seq_along(args)[!cppArgs])
field(argNames[[i]], args[[i]]) # #nocov
}
),
fields = list(
.CppObject = "C++Object"
),
contains = "VIRTUAL"
)
.RcppClass$methods(show = function ()
{
cat("Rcpp class object of class ", classLabel(class(.self)), # #nocov start
"\n", sep = "")
fields <- names(.refClassDef@fieldClasses)
if(".CppObject" %in% fields) {
cat("\n")
methods::show(field(".CppObject"))
cat("\n")
}
fields <- fields[ ! fields %in% c(".CppObject", ".CppClassDef", ".CppGenerator")]
for (fi in fields) {
cat("Field \"", fi, "\":\n", sep = "")
methods::show(field(fi))
}
},
objectPointer = function()
.CppObject$.pointer # #nocov end
)
Rcpp/R/RcppLdpath.R 0000644 0001762 0000144 00000007304 14470465200 013551 0 ustar ligges users # Copyright (C) 2010 - 2021 Dirk Eddelbuettel and Romain Francois
#
# This file is part of Rcpp.
#
# Rcpp is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# Rcpp is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Rcpp. If not, see .
## make sure system.file returns an absolute path
Rcpp.system.file <- function(...){
tools::file_path_as_absolute( base::system.file( ..., package = "Rcpp" ) )
}
## quote path if non-standard characters are used
Rcpp.quoteNonStandard <- function(path) {
## On unix, check if path has only characters that do not need quoting
noquote <- .Platform$OS.type == "unix" && grepl("^[[:alnum:]/._~+@%-]*$", path)
## If no quoting needed return unchanged else quote input
if (noquote) path else shQuote(path)
}
## Use R's internal knowledge of path settings to find the lib/ directory
## plus optinally an arch-specific directory on system building multi-arch
RcppLdPath <- function() {
#.Deprecated(msg=paste("This function is now deprecated as it has not",
# "been needed since 2013."))
""
}
## Provide linker flags -- i.e. -L/path/to/libRcpp -- as well as an
## optional rpath call needed to tell the Linux dynamic linker about the
## location. This is not needed on OS X where we encode this as library
## built time (see src/Makevars) or Windows where we use a static library
## Updated Jan 2010: We now default to static linking but allow the use
## of rpath on Linux if static==FALSE has been chosen
## Note that this is probably being called from LdFlags()
## Updated Nov 2013: We no longer build a library. This should be deprecated.
RcppLdFlags <- function() {
#.Deprecated(msg=paste("This function is now deprecated as it has not",
# "been needed since 2013."))
""
}
# indicates if Rcpp was compiled with GCC >= 4.3
canUseCXX0X <- function() { TRUE } # .Call( "canUseCXX0X", PACKAGE = "Rcpp" )
## Provide compiler flags -- i.e. -I/path/to/Rcpp.h
RcppCxxFlags <- function(cxx0x=FALSE) {
path <- Rcpp.system.file( "include" )
if (.Platform$OS.type=="windows") {
path <- asBuildPath(path) # #nocov
}
paste0('-I', Rcpp.quoteNonStandard(path))
}
## Shorter names, and call cat() directly
## CxxFlags defaults to no using c++0x extensions are these are considered non-portable
CxxFlags <- function(cxx0x=FALSE) {
#.Deprecated(msg=paste("This function is now deprecated as R uses minimally",
# "viable compilers om all platforme."))
cat(RcppCxxFlags(cxx0x=cxx0x)) # #nocov
}
## LdFlags defaults to static linking on the non-Linux platforms Windows and OS X
LdFlags <- function() {
cat(RcppLdFlags())
}
# capabilities
RcppCapabilities <- capabilities <- function() .Call( rcpp_capabilities )
# compile, load and call the cxx0x.c script to identify whether
# the compiler is GCC >= 4.3
RcppCxx0xFlags <- function() {
#.Deprecated(msg=paste("This function is now deprecated as R uses minimally",
# "viable compilers om all platforme."))
script <- Rcpp.system.file( "discovery", "cxx0x.R" ) # #nocov start
flag <- capture.output( source( script ) )
flag
}
Cxx0xFlags <- function() {
cat(RcppCxx0xFlags()) # #nocov end
}
Rcpp/R/Attributes.R 0000644 0001762 0000144 00000137510 15014017044 013633 0 ustar ligges users
# Copyright (C) 2012 - 2022 JJ Allaire, Dirk Eddelbuettel and Romain Francois
# Copyright (C) 2023 - 2024 JJ Allaire, Dirk Eddelbuettel, Romain Francois and Iñaki Ucar
#
# This file is part of Rcpp.
#
# Rcpp is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# Rcpp is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Rcpp. If not, see .
# Source C++ code from a file
sourceCpp <- function(file = "",
code = NULL,
env = globalenv(),
embeddedR = TRUE,
rebuild = FALSE,
cacheDir = getOption("rcpp.cache.dir", tempdir()),
cleanupCacheDir = FALSE,
showOutput = verbose,
verbose = getOption("verbose"),
dryRun = FALSE,
windowsDebugDLL = FALSE,
echo = TRUE) {
# use an architecture/version specific subdirectory of the cacheDir
# (since cached dynlibs can now perist across sessions we need to be
# sure to invalidate them when R or Rcpp versions change)
cacheDir <- path.expand(cacheDir)
cacheDir <- .sourceCppPlatformCacheDir(cacheDir)
cacheDir <- normalizePath(cacheDir)
# resolve code into a file if necessary. also track the working
# directory to source the R embedded code chunk within
if (!missing(code)) {
rWorkingDir <- getwd()
file <- tempfile(fileext = ".cpp", tmpdir = cacheDir)
con <- file(file, open = "w")
writeLines(code, con)
close(con)
} else {
rWorkingDir <- normalizePath(dirname(file))
}
# resolve the file path
file <- normalizePath(file, winslash = "/")
# error if the file extension isn't one supported by R CMD SHLIB
if (! tools::file_ext(file) %in% c("cc", "cpp")) { # #nocov start
stop("The filename '", basename(file), "' does not have an ",
"extension of .cc or .cpp so cannot be compiled.")
} # #nocov end
# validate that there are no spaces in the path on windows
if (.Platform$OS.type == "windows") { # #nocov start
if (grepl(' ', basename(file), fixed=TRUE)) {
stop("The filename '", basename(file), "' contains spaces. This ",
"is not permitted.")
}
} else {
if (windowsDebugDLL) {
if (verbose) {
message("The 'windowsDebugDLL' toggle is ignored on ",
"non-Windows platforms.")
}
windowsDebugDLL <- FALSE # now we do not need to deal with OS choice below
} # #nocov end
}
# get the context (does code generation as necessary)
context <- .Call("sourceCppContext", PACKAGE="Rcpp",
file, code, rebuild, cacheDir, .Platform)
# perform a build if necessary
if (context$buildRequired || rebuild) {
# print output for verbose mode
if (verbose)
.printVerboseOutput(context) # #nocov
# variables used to hold completed state (passed to completed hook)
succeeded <- FALSE
output <- NULL
# build dependency list
depends <- .getSourceCppDependencies(context$depends, file)
# validate packages (error if package not found)
.validatePackages(depends, context$cppSourceFilename)
# temporarily modify environment for the build
envRestore <- .setupBuildEnvironment(depends, context$plugins, file)
# temporarily setwd to build directory
cwd <- getwd()
setwd(context$buildDirectory)
# call the onBuild hook. note that this hook should always be called
# after .setupBuildEnvironment so subscribers are able to examine
# the build environment
fromCode <- !missing(code)
if (!.callBuildHook(context$cppSourcePath, fromCode, showOutput)) {
.restoreEnvironment(envRestore) # #nocov start
setwd(cwd)
return (invisible(NULL))
} # #nocov end
# on.exit handler calls hook and restores environment and working dir
on.exit({
if (!succeeded)
.showBuildFailureDiagnostics() # #nocov
.callBuildCompleteHook(succeeded, output)
setwd(cwd)
.restoreEnvironment(envRestore)
})
# unload and delete existing dylib if necessary
if (file.exists(context$previousDynlibPath)) { # #nocov start
try(silent=TRUE, dyn.unload(context$previousDynlibPath))
file.remove(context$previousDynlibPath)
} # #nocov end
# grab components we need to build command
r <- file.path(R.home("bin"), "R")
lib <- context$dynlibFilename
deps <- context$cppDependencySourcePaths
src <- context$cppSourceFilename
# prepare the command (output if we are in showOutput mode)
args <- c(
"CMD", "SHLIB",
if (windowsDebugDLL) "-d",
if (rebuild) "--preclean",
if (dryRun) "--dry-run",
"-o", shQuote(lib),
if (length(deps))
paste(shQuote(deps), collapse = " "),
shQuote(src)
)
if (showOutput)
cat(paste(c(r, args), collapse = " "), "\n") # #nocov
# execute the build -- suppressWarnings b/c when showOutput = FALSE
# we are going to explicitly check for an error and print the output
so <- if (showOutput) "" else TRUE
result <- suppressWarnings(system2(r, args, stdout = so, stderr = so))
# check build results
if(!showOutput) {
# capture output
output <- result
attributes(output) <- NULL
# examine status
status <- attr(result, "status")
if (!is.null(status)) {
cat(result, sep = "\n") # #nocov start
succeeded <- FALSE
stop("Error ", status, " occurred building shared library.")
} else if (!file.exists(context$dynlibFilename)) {
cat(result, sep = "\n")
succeeded <- FALSE
stop("Error occurred building shared library.") # #nocov end
} else {
succeeded <- TRUE
}
}
else if (!identical(as.character(result), "0")) { # #nocov start
succeeded <- FALSE
stop("Error ", result, " occurred building shared library.")
} else {
succeeded <- TRUE # #nocov end
}
}
else {
cwd <- getwd()
on.exit({
setwd(cwd)
})
if (verbose) # #nocov start
cat("\nNo rebuild required (use rebuild = TRUE to ",
"force a rebuild)\n\n", sep="")
}
# return immediately if this was a dry run
if (dryRun)
return(invisible(NULL)) # #nocov end
# load the module if we have exported symbols
if (length(context$exportedFunctions) > 0 || length(context$modules) > 0) {
# remove existing objects of the same name from the environment
exports <- c(context$exportedFunctions, context$modules)
removeObjs <- exports[exports %in% ls(envir = env, all.names = T)]
remove(list = removeObjs, envir = env)
# source the R script
scriptPath <- file.path(context$buildDirectory, context$rSourceFilename)
source(scriptPath, local = env)
} else if (getOption("rcpp.warnNoExports", default=TRUE)) { # #nocov start
warning("No Rcpp::export attributes or RCPP_MODULE declarations ",
"found in source") # #nocov end
}
# source the embeddedR
if (embeddedR && (length(context$embeddedR) > 0)) {
srcConn <- textConnection(context$embeddedR)
setwd(rWorkingDir) # will be reset by previous on.exit handler
source(file = srcConn, local = env, echo = echo)
}
# cleanup the cache dir if requested
if (cleanupCacheDir)
cleanupSourceCppCache(cacheDir, context$cppSourcePath, context$buildDirectory) # #nocov
# return (invisibly) a list containing exported functions and modules
invisible(list(functions = context$exportedFunctions,
modules = context$modules,
cppSourcePath = context$cppSourcePath,
buildDirectory = context$buildDirectory))
}
# Cleanup a directory used as the cache for a sourceCpp compilation. This will
# remove all files from the cache directory that aren't a result of the
# compilation that yielded the passed buildDirectory.
cleanupSourceCppCache <- function(cacheDir, cppSourcePath, buildDirectory) {
# normalize cpp source path and build directory # #nocov start
cppSourcePath <- normalizePath(cppSourcePath)
buildDirectory <- normalizePath(buildDirectory)
# determine the parent dir that was used for the compilation then collect all the
# *.cpp files and subdirectories therein
cacheFiles <- list.files(cacheDir, pattern = glob2rx("*.cpp"), recursive = FALSE, full.names = TRUE)
cacheFiles <- c(cacheFiles, list.dirs(cacheDir, recursive = FALSE, full.names = TRUE))
cacheFiles <- normalizePath(cacheFiles)
# determine the list of tiles that were not yielded by the passed sourceCpp
# result and remove them
oldCacheFiles <- cacheFiles[!cacheFiles %in% c(cppSourcePath, buildDirectory)]
unlink(oldCacheFiles, recursive = TRUE) # #nocov end
}
# Define a single C++ function
cppFunction <- function(code,
depends = character(),
plugins = character(),
includes = character(),
env = parent.frame(),
rebuild = FALSE,
cacheDir = getOption("rcpp.cache.dir", tempdir()),
showOutput = verbose,
verbose = getOption("verbose"),
echo = TRUE) {
# process depends
if (!is.null(depends) && length(depends) > 0) { # #nocov start
depends <- paste(depends, collapse=", ")
scaffolding <- paste("// [[Rcpp::depends(", depends, ")]]", sep="")
scaffolding <- c(scaffolding, "", .linkingToIncludes(depends, FALSE),
recursive=TRUE) # #nocov end
}
else {
scaffolding <- "#include "
}
# process plugins
if (!is.null(plugins) && length(plugins) > 0) {
plugins <- paste(plugins, sep=", ") # #nocov start
pluginsAttrib <- paste("// [[Rcpp::plugins(", plugins, ")]]", sep="")
scaffolding <- c(scaffolding, pluginsAttrib)
# append plugin includes
for (pluginName in plugins) {
plugin <- .findPlugin(pluginName)
settings <- plugin()
scaffolding <- c(scaffolding, settings$includes, recursive=TRUE)
} # #nocov end
}
# remainder of scaffolding
scaffolding <- c(scaffolding,
"",
"using namespace Rcpp;",
"",
includes,
"// [[Rcpp::export]]",
recursive = T)
# prepend scaffolding to code
code <- paste(c(scaffolding, code, recursive = T), collapse="\n")
# print the generated code if we are in verbose mode
if (verbose) { # #nocov start
cat("\nGenerated code for function definition:",
"\n--------------------------------------------------------\n\n")
cat(code)
cat("\n")
}
# source cpp into specified environment. if env is set to NULL
# then create a new one (the caller can get a hold of the function
# via the return value)
if (is.null(env))
env <- new.env() # #nocov end
exported <- sourceCpp(code = code,
env = env,
rebuild = rebuild,
cacheDir = cacheDir,
showOutput = showOutput,
verbose = verbose,
echo = echo)
# verify that a single function was exported and return it
if (length(exported$functions) == 0)
stop("No function definition found") # #nocov
else if (length(exported$functions) > 1)
stop("More than one function definition") # #nocov
else {
functionName <- exported$functions[[1]]
invisible(get(functionName, env))
}
}
.type_manipulate <- function( what = "DEMANGLE", class = NULL ) {
function( type = "int", ... ){ # #nocov start
code <- sprintf( '
SEXP manipulate_this_type(){
typedef %s type ;
return wrap( %s(type) ) ;
}', type, what )
dots <- list( code, ... )
dots[["env"]] <- environment()
manipulate_this_type <- do.call( cppFunction, dots )
res <- manipulate_this_type()
if( ! is.null(class) ){
class(res) <- class
}
res
} # #nocov end
}
demangle <- .type_manipulate( "DEMANGLE" )
sizeof <- .type_manipulate( "sizeof", "bytes" )
print.bytes <- function( x, ...){ # #nocov start
writeLines( sprintf( "%d bytes (%d bits)", x, 8 * x ) )
invisible( x )
} # #nocov end
# Evaluate a simple c++ expression
evalCpp <- function(code,
depends = character(),
plugins = character(),
includes = character(),
rebuild = FALSE,
cacheDir = getOption("rcpp.cache.dir", tempdir()),
showOutput = verbose,
verbose = getOption( "verbose" ) ){
# #nocov start
code <- sprintf( "SEXP get_value(){ return wrap( %s ) ; }", code )
env <- new.env()
cppFunction(code, depends = depends, plugins = plugins,
includes = includes, env = env,
rebuild = rebuild, cacheDir = cacheDir, showOutput = showOutput, verbose = verbose )
fun <- env[["get_value"]]
fun() # #nocov end
}
areMacrosDefined <- function(names,
depends = character(),
includes = character(),
rebuild = FALSE,
showOutput = verbose,
verbose = getOption( "verbose" ) ){
code <- sprintf( '
LogicalVector get_value(){
return LogicalVector::create(
%s
) ;
}',
paste( sprintf( ' _["%s"] =
#if defined(%s)
true
#else
false
#endif
', names, names ), collapse = ",\n" )
)
env <- new.env()
cppFunction(code, depends = depends, includes = includes, env = env,
rebuild = rebuild, showOutput = showOutput, verbose = verbose )
fun <- env[["get_value"]]
fun()
}
# Scan the source files within a package for attributes and generate code
# based on the attributes.
compileAttributes <- function(pkgdir = ".", verbose = getOption("verbose")) {
# verify this is a package and read the DESCRIPTION to get it's name
pkgdir <- normalizePath(pkgdir, winslash = "/")
descFile <- file.path(pkgdir,"DESCRIPTION")
if (!file.exists(descFile))
stop("pkgdir must refer to the directory containing an R package") # #nocov
pkgDesc <- read.dcf(descFile)[1,]
pkgname = .readPkgDescField(pkgDesc, "Package")
depends <- c(.readPkgDescField(pkgDesc, "Depends", character()),
.readPkgDescField(pkgDesc, "Imports", character()),
.readPkgDescField(pkgDesc, "LinkingTo", character()))
depends <- unique(.splitDepends(depends))
depends <- depends[depends != "R"]
# check the NAMESPACE file to see if dynamic registration is enabled
namespaceFile <- file.path(pkgdir, "NAMESPACE")
if (!file.exists(namespaceFile))
stop("pkgdir must refer to the directory containing an R package") # #nocov
pkgNamespace <- readLines(namespaceFile, warn = FALSE)
registration <- any(grepl("^\\s*useDynLib.*\\.registration\\s*=\\s*TRUE.*$", pkgNamespace))
# determine source directory
srcDir <- file.path(pkgdir, "src")
if (!file.exists(srcDir))
return (FALSE) # #nocov
# create R directory if it doesn't already exist
rDir <- file.path(pkgdir, "R")
if (!file.exists(rDir))
dir.create(rDir) # #nocov
# remove the old RcppExports.R file
unlink(file.path(rDir, "RcppExports.R"))
# get a list of all source files
cppFiles <- list.files(srcDir, pattern = "\\.((c(c|pp)?)|(h(pp)?))$", ignore.case = TRUE)
# don't include RcppExports.cpp
cppFiles <- setdiff(cppFiles, "RcppExports.cpp")
# locale independent sort for stable output
locale <- Sys.getlocale(category = "LC_COLLATE")
Sys.setlocale(category = "LC_COLLATE", locale = "C")
cppFiles <- sort(cppFiles)
Sys.setlocale(category = "LC_COLLATE", locale = locale)
# derive base names (will be used for modules)
cppFileBasenames <- tools::file_path_sans_ext(cppFiles)
# expend them to their full paths
cppFiles <- file.path(srcDir, cppFiles)
cppFiles <- normalizePath(cppFiles, winslash = "/")
# generate the includes list based on LinkingTo. Specify plugins-only
# because we only need as/wrap declarations
linkingTo <- .readPkgDescField(pkgDesc, "LinkingTo")
includes <- .linkingToIncludes(linkingTo, TRUE)
# if a master include file or types file is in inst/include then use it
typesHeader <- c(paste0(pkgname, "_types.h"), paste0(pkgname, "_types.hpp"))
pkgHeader <- c(paste0(pkgname, ".h"), typesHeader)
pkgHeaderPath <- file.path(pkgdir, "inst", "include", pkgHeader)
pkgHeader <- pkgHeader[file.exists(pkgHeaderPath)]
if (length(pkgHeader) > 0) { # #nocov start
pkgInclude <- paste("#include \"../inst/include/",
pkgHeader, "\"", sep="")
includes <- c(pkgInclude, includes)
} # #nocov end
# if a _types file is in src then include it
pkgHeader <- typesHeader
pkgHeaderPath <- file.path(pkgdir, "src", pkgHeader)
pkgHeader <- pkgHeader[file.exists(pkgHeaderPath)]
if (length(pkgHeader) > 0)
includes <- c(paste0("#include \"", pkgHeader ,"\""), includes) # #nocov
# generate exports
invisible(.Call("compileAttributes", PACKAGE="Rcpp",
pkgdir, pkgname, depends, registration, cppFiles, cppFileBasenames,
includes, verbose, .Platform))
}
# setup plugins environment
.plugins <- new.env()
# built-in C++98 plugin
.plugins[["cpp98"]] <- function() {
if (getRversion() >= "3.4") # with recent R versions, R can decide
list(env = list(USE_CXX98 = "yes"))
else
list(env = list(PKG_CXXFLAGS ="-std=c++98"))
}
# built-in C++11 plugin
.plugins[["cpp11"]] <- function() {
if (getRversion() >= "3.4") # with recent R versions, R can decide
list(env = list(USE_CXX11 = "yes"))
else if (getRversion() >= "3.1") # with recent R versions, R can decide
list(env = list(USE_CXX1X = "yes"))
else if (.Platform$OS.type == "windows")
list(env = list(PKG_CXXFLAGS = "-std=c++0x"))
else # g++-4.8.1 or later
list(env = list(PKG_CXXFLAGS ="-std=c++11"))
}
# built-in C++11 plugin for older g++ compiler
.plugins[["cpp0x"]] <- function() {
list(env = list(PKG_CXXFLAGS ="-std=c++0x"))
}
## built-in C++14 plugin for C++14 standard
## this is the default in g++-6.1 and later
## per https://gcc.gnu.org/projects/cxx-status.html#cxx14
.plugins[["cpp14"]] <- function() {
if (getRversion() >= "3.4") # with recent R versions, R can decide
list(env = list(USE_CXX14 = "yes"))
else
list(env = list(PKG_CXXFLAGS ="-std=c++14"))
}
# built-in C++1y plugin for C++14 and C++17 standard under development
.plugins[["cpp1y"]] <- function() {
list(env = list(PKG_CXXFLAGS ="-std=c++1y"))
}
# built-in C++17 plugin for C++17 standard (g++-6 or later)
.plugins[["cpp17"]] <- function() {
if (getRversion() >= "3.4") # with recent R versions, R can decide
list(env = list(USE_CXX17 = "yes"))
else
list(env = list(PKG_CXXFLAGS ="-std=c++17"))
}
# built-in C++20 plugin for C++20
.plugins[["cpp20"]] <- function() {
if (getRversion() >= "4.2") # with recent R versions, R can decide
list(env = list(USE_CXX20 = "yes"))
else
list(env = list(PKG_CXXFLAGS ="-std=c++20"))
}
# built-in C++23 plugin for C++23
.plugins[["cpp23"]] <- function() {
if (getRversion() >= "4.3") # with recent R versions, R can decide
list(env = list(USE_CXX23 = "yes"))
else
list(env = list(PKG_CXXFLAGS ="-std=c++23"))
}
# built-in C++26 plugin for C++26
.plugins[["cpp26"]] <- function() {
if (getRversion() >= "4.5") # with recent R versions, R can decide
list(env = list(USE_CXX26 = "yes"))
else
list(env = list(PKG_CXXFLAGS ="-std=c++26"))
}
## built-in C++1z plugin for C++17 standard under development
## note that as of Feb 2017 this is taken to be a moving target
## see https://gcc.gnu.org/projects/cxx-status.html
.plugins[["cpp1z"]] <- function() {
list(env = list(PKG_CXXFLAGS ="-std=c++1z"))
}
## built-in C++2a plugin for g++ 8 and later
## cf https://gcc.gnu.org/projects/cxx-status.html as of Dec 2018
.plugins[["cpp2a"]] <- function() {
list(env = list(PKG_CXXFLAGS ="-std=c++2a"))
}
## built-in C++2b plugin for compilers without C++23 support
.plugins[["cpp2b"]] <- function() {
list(env = list(PKG_CXXFLAGS ="-std=c++2b"))
}
## built-in OpenMP plugin
.plugins[["openmp"]] <- function() {
list(env = list(PKG_CXXFLAGS="-fopenmp",
PKG_LIBS="-fopenmp"))
}
.plugins[["unwindProtect"]] <- function() { # nocov start
warning("unwindProtect is enabled by default and this plugin is deprecated.",
" It will be removed in a future version of Rcpp.")
list()
} # nocov end
# register a plugin
registerPlugin <- function(name, plugin) {
.plugins[[name]] <- plugin # #nocov
}
# Take an empty function body and connect it to the specified external symbol
sourceCppFunction <- function(func, isVoid, dll, symbol) {
args <- names(formals(func))
body <- quote( CALL_PLACEHOLDER ( EXTERNALNAME, ARG ) )[ c(1:2, rep(3, length(args))) ]
for (i in seq(along.with = args))
body[[i+2]] <- as.symbol(args[i])
body[[1L]] <- quote(.Call)
body[[2L]] <- getNativeSymbolInfo(symbol, dll)$address
if (isVoid)
body <- call("invisible", body)
body(func) <- body
func
}
# Print verbose output
.printVerboseOutput <- function(context) { # #nocov start
cat("\nGenerated extern \"C\" functions",
"\n--------------------------------------------------------\n")
cat(context$generatedCpp, sep="")
cat("\nGenerated R functions",
"\n-------------------------------------------------------\n\n")
cat(readLines(file.path(context$buildDirectory,
context$rSourceFilename)),
sep="\n")
cat("\nBuilding shared library",
"\n--------------------------------------------------------\n",
"\nDIR: ", context$buildDirectory, "\n\n", sep="")
} # #nocov end
# Add LinkingTo dependencies if the sourceFile is in a package
.getSourceCppDependencies <- function(depends, sourceFile) {
# If the source file is in a package then simulate it being built
# within the package by including it's LinkingTo dependencies,
# the src directory (.), and the inst/include directory
if (.isPackageSourceFile(sourceFile)) { # #nocov start
descFile <- file.path(dirname(sourceFile), "..", "DESCRIPTION")
DESCRIPTION <- read.dcf(descFile, all = TRUE)
linkingTo <- .parseLinkingTo(DESCRIPTION$LinkingTo)
unique(c(depends, linkingTo)) # #nocov end
} else {
depends
}
}
# Check whether a source file is in a package
.isPackageSourceFile <- function(sourceFile) {
file.exists(file.path(dirname(sourceFile), "..", "DESCRIPTION"))
}
# Error if a package is not currently available
.validatePackages <- function(depends, sourceFilename) {
unavailable <- depends[!depends %in% .packages(all.available=TRUE)]
if (length(unavailable) > 0) { # #nocov start
stop(paste("Package '", unavailable[[1]], "' referenced from ",
"Rcpp::depends in source file ",
sourceFilename, " is not available.",
sep=""),
call. = FALSE) # #nocov end
}
}
# Split the depends field of a package description
.splitDepends <- function(x) {
if (!length(x))
return(character()) # #nocov
x <- unlist(strsplit(x, ","))
x <- sub("[[:space:]]+$", "", x)
x <- unique(sub("^[[:space:]]*(.*)", "\\1", x))
sub("^([[:alnum:].]+).*$", "\\1", x)
}
# read a field from a named package description character vector
.readPkgDescField <- function(pkgDesc, name, default = NULL) {
if (name %in% names(pkgDesc))
pkgDesc[[name]]
else
default
}
# Get the inline plugin for the specified package (return NULL if none found)
.getInlinePlugin <- function(package) { # #nocov start
tryCatch(get("inlineCxxPlugin", asNamespace(package), inherits = FALSE),
error = function(e) NULL)
} # #nocov end
# Lookup a plugin
.findPlugin <- function(pluginName) {
plugin <- .plugins[[pluginName]]
if (is.null(plugin))
stop("Inline plugin '", pluginName, "' could not be found ", # #nocov start
"within the Rcpp package. You should be ",
"sure to call registerPlugin before using a plugin.") # #nocov end
return(plugin)
}
# Setup the build environment based on the specified dependencies. Returns an
# opaque object that can be passed to .restoreEnvironment to reverse whatever
# changes that were made
.setupBuildEnvironment <- function(depends, plugins, sourceFile) {
# setup
buildEnv <- list()
linkingToPackages <- c("Rcpp")
# merge values into the buildEnv
mergeIntoBuildEnv <- function(name, value) {
# protect against null or empty string
if (is.null(value) || !nzchar(value))
return(invisible(NULL))
# if it doesn't exist already just set it
if (is.null(buildEnv[[name]])) {
buildEnv[[name]] <<- value
}
# if it's not identical then append
else if (!identical(buildEnv[[name]], value)) { # #nocov
buildEnv[[name]] <<- paste(buildEnv[[name]], value) # #nocov
}
else {
# it already exists and it's the same value, this
# likely means it's a flag-type variable so we
# do nothing rather than appending it
}
}
# update dependencies from a plugin
setDependenciesFromPlugin <- function(plugin) {
# get the plugin settings
settings <- plugin()
# merge environment variables
pluginEnv <- settings$env
for (name in names(pluginEnv)) {
mergeIntoBuildEnv(name, pluginEnv[[name]])
}
# capture any LinkingTo elements defined by the plugin
linkingToPackages <<- unique(c(linkingToPackages,
settings$LinkingTo))
}
# add packages to linkingTo and introspect for plugins
for (package in depends) {
# #nocov start
# add a LinkingTo for this package
linkingToPackages <- unique(c(linkingToPackages, package))
# see if the package exports a plugin
plugin <- .getInlinePlugin(package)
if (!is.null(plugin))
setDependenciesFromPlugin(plugin) # #nocov end
}
# process plugins
for (pluginName in plugins) {
plugin <- .findPlugin(pluginName)
setDependenciesFromPlugin(plugin)
}
# if there is no buildEnv from a plugin then use the Rcpp plugin
if (length(buildEnv) == 0) {
buildEnv <- inlineCxxPlugin()$env
}
# set CLINK_CPPFLAGS based on the LinkingTo dependencies
buildEnv$CLINK_CPPFLAGS <- .buildClinkCppFlags(linkingToPackages)
# add the source file's directory to the compilation
srcDir <- dirname(sourceFile)
srcDir <- asBuildPath(srcDir)
buildDirs <- srcDir
# if the source file is in a package then add inst/include
if (.isPackageSourceFile(sourceFile)) { # #nocov start
incDir <- file.path(dirname(sourceFile), "..", "inst", "include")
incDir <- asBuildPath(incDir)
buildDirs <- c(buildDirs, incDir) # #nocov end
}
# set CLINK_CPPFLAGS with directory flags
dirFlags <- paste0('-I"', buildDirs, '"', collapse=" ")
buildEnv$CLINK_CPPFLAGS <- paste(buildEnv$CLINK_CPPFLAGS,
dirFlags,
collapse=" ")
# merge existing environment variables
for (name in names(buildEnv))
mergeIntoBuildEnv(name, Sys.getenv(name))
# add cygwin message muffler
buildEnv$CYGWIN = "nodosfilewarning"
# on windows see if we need to add Rtools to the path
# (don't do this for RStudio since it has it's own handling)
if (identical(Sys.info()[['sysname']], "Windows") &&
!nzchar(Sys.getenv("RSTUDIO"))) { # #nocov start
env <- .environmentWithRtools()
for (var in names(env))
buildEnv[[var]] <- env[[var]] # #nocov end
}
# create restore list
restore <- list()
for (name in names(buildEnv))
restore[[name]] <- Sys.getenv(name, unset = NA)
# set environment variables
do.call(Sys.setenv, buildEnv)
# return restore list
return (restore)
}
# If we don't have the GNU toolchain already on the path then see if
# we can find Rtools and add it to the path
.environmentWithRtools <- function() {
# #nocov start
# Only proceed if we don't have the required tools on the path
hasRtools <- nzchar(Sys.which("ls.exe")) && nzchar(Sys.which("gcc.exe"))
if (!hasRtools) {
# Read the Rtools registry key
key <- NULL
try(key <- utils::readRegistry("SOFTWARE\\R-core\\Rtools",
hive = "HLM", view = "32-bit"),
silent = TRUE)
# If we found the key examine it
if (!is.null(key)) {
# Check version
ver <- key$`Current Version`
if (ver %in% (c("2.15", "2.16", "3.0", "3.1", "3.2", "3.3", "3.4"))) {
# See if the InstallPath leads to the expected directories
# R version 3.3.0 alpha (2016-03-25 r70378)
isGcc49 <- ver %in% c("3.3", "3.4") && as.numeric(R.Version()$`svn rev`) >= 70378
rToolsPath <- key$`InstallPath`
if (!is.null(rToolsPath)) {
# add appropriate path entries
path <- file.path(rToolsPath, "bin", fsep="\\")
if (!isGcc49)
path <- c(path, file.path(rToolsPath, "gcc-4.6.3", "bin", fsep="\\"))
# if they all exist then return a list with modified
# environment variables for the compilation
if (all(file.exists(path))) {
env <- list()
path <- paste(path, collapse = .Platform$path.sep)
env$PATH <- paste(path, Sys.getenv("PATH"), sep=.Platform$path.sep)
if (isGcc49) {
env$RTOOLS <- .rtoolsPath(rToolsPath)
env$BINPREF <- file.path(env$RTOOLS, "mingw_$(WIN)/bin//", fsep = "/")
}
return(env)
}
}
}
}
}
return(NULL) # #nocov end
}
# Ensure that the path is suitable for passing as an RTOOLS
# environment variable
.rtoolsPath <- function(path) {
path <- gsub("\\\\", "/", path) # #nocov start
## R 3.2.0 or later only: path <- trimws(path)
.localsub <- function(re, x) sub(re, "", x, perl = TRUE)
path <- .localsub("[ \t\r\n]+$", .localsub("^[ \t\r\n]+", path))
if (substring(path, nchar(path)) != "/")
path <- paste(path, "/", sep="")
path # #nocov end
}
# Build CLINK_CPPFLAGS from include directories of LinkingTo packages
.buildClinkCppFlags <- function(linkingToPackages) {
pkgCxxFlags <- NULL
for (package in linkingToPackages) {
packagePath <- find.package(package, NULL, quiet=TRUE)
packagePath <- asBuildPath(packagePath)
pkgCxxFlags <- paste(pkgCxxFlags,
paste0('-I"', packagePath, '/include"'),
collapse=" ")
}
return (pkgCxxFlags)
}
.restoreEnvironment <- function(restore) {
# variables to reset
setVars <- restore[!is.na(restore)]
if (length(setVars))
do.call(Sys.setenv, setVars) # #nocov
# variables to remove
removeVars <- names(restore[is.na(restore)])
if (length(removeVars))
Sys.unsetenv(removeVars)
}
# Call the onBuild hook. This hook is provided so that external tools
# can perform processing (e.g. lint checking or other diagnostics) prior
# to the execution of a build). The showOutput flag is there to inform the
# subscriber whether they'll be getting output in the onBuildComplete hook
# or whether it will need to be scraped from the console (for verbose=TRUE)
# The onBuild hook is always called from within the temporary build directory
.callBuildHook <- function(file, fromCode, showOutput) {
for (fun in .getHooksList("sourceCpp.onBuild")) {
if (is.character(fun)) # #nocov start
fun <- get(fun)
# allow the hook to cancel the build (errors in the hook explicitly
# do not cancel the build since they are unexpected bugs)
continue <- tryCatch(fun(file, fromCode, showOutput),
error = function(e) TRUE)
if (!continue)
return (FALSE) # #nocov end
}
return (TRUE)
}
# Call the onBuildComplete hook. This hook is provided so that external tools
# can do analysis of build errors and (for example) present them in a
# navigable list. Note that the output parameter will be NULL when showOutput
# is TRUE. Tools can try to scrape the output from the console (in an
# implemenentation-dependent fashion) or can simply not rely on output
# processing in that case (since the user explicitly asked for output to be
# printed to the console). The onBuildCompleted hook is always called within
# the temporary build directory.
.callBuildCompleteHook <- function(succeeded, output) {
# Call the hooks in reverse order to align sequencing with onBuild
for (fun in .getHooksList("sourceCpp.onBuildComplete")) {
if (is.character(fun)) # #nocov start
fun <- get(fun)
try(fun(succeeded, output)) # #nocov end
}
}
# The value for getHooks can be a single function or a list of functions,
# This function ensures that the result can always be processed as a list
.getHooksList <- function(name) {
hooks <- getHook(name)
if (!is.list(hooks))
hooks <- list(hooks) # #nocov
hooks
}
# Generate list of includes based on LinkingTo. The pluginsOnly parameter
# to distinguish the case of capturing all includes needed for a compiliation
# (e.g. cppFunction) verses only needing to capture as/wrap converters which
# is the case for generation of shims (RcppExports.cpp) and Rcpp::interfaces
# package header files.
.linkingToIncludes <- function(linkingTo, pluginsOnly) {
# This field can be NULL or empty -- in that case just return Rcpp.h
if (is.null(linkingTo) || !nzchar(linkingTo))
return (c("#include ")) # #nocov
# Look for Rcpp inline plugins within the list or LinkedTo packages
include.before <- character()
include.after <- character()
linkingToPackages <- .parseLinkingTo(linkingTo)
for (package in linkingToPackages) {
# We already handle Rcpp internally
if (identical(package, "Rcpp"))
next
# see if there is a plugin that we can extract includes from
plugin <- .getInlinePlugin(package) # #nocov start
if (!is.null(plugin)) {
includes <- .pluginIncludes(plugin)
if (!is.null(includes)) {
include.before <- c(include.before, includes$before)
include.after <- c(include.after, includes$after)
}
}
# otherwise check for standard Rcpp::interfaces generated include
else if (!pluginsOnly) {
pkgPath <- find.package(package, NULL, quiet=TRUE)
if (length(pkgPath) == 0) {
stop(paste("Package '", package, "' referenced from ",
"LinkingTo directive is not available.", sep=""),
call. = FALSE)
}
pkgHeader <- paste(package, ".h", sep="")
pkgHeaderPath <- file.path(pkgPath, "include", pkgHeader)
if (file.exists(pkgHeaderPath)) {
pkgInclude <- paste("#include <", pkgHeader, ">", sep="")
include.after <- c(include.after, pkgInclude)
}
} # #nocov end
}
# return the includes
c(include.before, "#include ", include.after)
}
# Analyze the plugin's includes field to determine include.before and
# include.after. We are ONLY interested in plugins that work with Rcpp since
# the only types we need from includes are as/wrap marshallers. Therefore,
# we verify that the plugin was created using Rcpp.plugin.maker and then
# use that assumption to correctly extract include.before and include.after
.pluginIncludes <- function(plugin) {
# #nocov start
# First determine the standard suffix of an Rcpp plugin by calling
# Rcpp.plugin.maker. If the plugin$includes has this suffix we know
# it's an Rcpp plugin
token <- "include_after_token"
stockRcppPlugin <- Rcpp.plugin.maker(include.after=token)
includes <- stockRcppPlugin()$includes
suffix <- strsplit(includes, token)[[1]][[2]]
# now ask the plugin for it's includes, ensure that the plugin includes
# are not null, and verify they have the Rcpp suffix before proceeding
pluginIncludes <- plugin()$includes
if (is.null(pluginIncludes))
return (NULL)
if (!grepl(suffix, pluginIncludes))
return (NULL)
# strip the suffix then split on stock Rcpp include to get before and after
pluginIncludes <- strsplit(pluginIncludes, suffix)[[1]][[1]]
pluginIncludes <- strsplit(pluginIncludes, c("#include "))[[1]]
# extract before and after and nix empty lines
before <- pluginIncludes[[1]]
before <- strsplit(before, "\n")[[1]]
before <- before[nzchar(before)]
after <- pluginIncludes[[2]]
after <- strsplit(after, "\n")[[1]]
after <- after[nzchar(after)]
# return before and after
list(before = before, after = after) # #nocov end
}
# Parse a LinkingTo field into a character vector
.parseLinkingTo <- function(linkingTo) {
if (is.null(linkingTo))
return (character()) # #nocov
linkingTo <- strsplit(linkingTo, "\\s*\\,")[[1]]
result <- gsub("\\s", "", linkingTo)
gsub("\\(.*", "", result)
}
# show diagnostics for failed builds
.showBuildFailureDiagnostics <- function() {
# #nocov start
# RStudio does it's own diagnostics so only do this for other environments
if (nzchar(Sys.getenv("RSTUDIO")))
return();
# if we can't call R CMD SHLIB then notify the user they should
# install the appropriate development tools
if (!.checkDevelTools()) {
msg <- paste("\nWARNING: The tools required to build C++ code for R ",
"were not found.\n\n", sep="")
sysName <- Sys.info()[['sysname']]
if (identical(sysName, "Windows")) {
msg <- paste(msg, "Please download and install the appropriate ",
"version of Rtools:\n\n",
"http://cran.r-project.org/bin/windows/Rtools/\n",
sep="");
} else if (identical(sysName, "Darwin")) {
msg <- paste(msg, "Please install Command Line Tools for XCode ",
"(or equivalent).\n", sep="")
} else {
msg <- paste(msg, "Please install GNU development tools ",
"including a C++ compiler.\n", sep="")
}
message(msg)
} # #nocov end
}
# check if R development tools are installed (cache successful result)
.hasDevelTools <- FALSE
.checkDevelTools <- function() {
if (!.hasDevelTools) { # #nocov start
# create temp source file
tempFile <- file.path(tempdir(), "foo.c")
cat("void foo() {}\n", file = tempFile)
on.exit(unlink(tempFile))
# set working directory to tempdir (revert on exit)
oldDir <- setwd(tempdir())
on.exit(setwd(oldDir), add = TRUE)
# attempt the compilation and note whether we succeed
cmd <- paste(R.home(component="bin"), .Platform$file.sep, "R ",
"CMD SHLIB foo.c", sep = "")
result <- suppressWarnings(system(cmd,
ignore.stderr = TRUE,
intern = TRUE))
utils::assignInMyNamespace(".hasDevelTools", is.null(attr(result, "status")))
# if we build successfully then remove the shared library
if (.hasDevelTools) {
lib <- file.path(tempdir(),
paste("foo", .Platform$dynlib.ext, sep=''))
unlink(lib)
}
}
.hasDevelTools # #nocov end
}
# insert a dynlib entry into the cache
.sourceCppDynlibInsert <- function(cacheDir, file, code, dynlib) {
cache <- .sourceCppDynlibReadCache(cacheDir)
index <- .sourceCppFindCacheEntryIndex(cache, file, code)
if (is.null(index))
index <- length(cache) + 1
cache[[index]] <- list(file = file, code = code, dynlib = dynlib)
.sourceCppDynlibWriteCache(cacheDir, cache)
}
# attempt to lookup a dynlib entry from the cache
.sourceCppDynlibLookup <- function(cacheDir, file, code) {
cache <- .sourceCppDynlibReadCache(cacheDir)
index <- .sourceCppFindCacheEntryIndex(cache, file, code)
if (!is.null(index))
cache[[index]]$dynlib
else
list()
}
# write the cache to disk
.sourceCppDynlibWriteCache <- function(cacheDir, cache) {
index_file <- file.path(cacheDir, "cache.rds")
save(cache, file = index_file, compress = FALSE)
}
# read the cache from disk
.sourceCppDynlibReadCache <- function(cacheDir) {
index_file <- file.path(cacheDir, "cache.rds")
if (file.exists(index_file)) {
load(file = index_file)
get("cache")
} else {
list()
}
}
# search the cache for an entry that matches the file or code argument
.sourceCppFindCacheEntryIndex <- function(cache, file, code) {
if (length(cache) > 0) {
for (i in 1:length(cache)) {
entry <- cache[[i]]
if ((nzchar(file) && identical(file, entry$file)) ||
(nzchar(code) && identical(code, entry$code))) {
if (file.exists(entry$dynlib$cppSourcePath))
return(i)
}
}
}
# none found
NULL
}
# generate an R version / Rcpp version specific cache dir for dynlibs
.sourceCppPlatformCacheDir <- function(cacheDir) {
dir <- file.path(cacheDir,
paste("sourceCpp",
R.version$platform,
utils::packageVersion("Rcpp"),
sep = "-"))
if (!utils::file_test("-d", dir))
dir.create(dir, recursive = TRUE)
dir
}
# generate a unique token for a cacheDir
.sourceCppDynlibUniqueToken <- function(cacheDir) {
# read existing token (or create a new one)
token_file <- file.path(cacheDir, "token.rds")
if (file.exists(token_file))
load(file = token_file)
else
token <- 0
# increment
token <- token + 1
# write it
save(token, file = token_file)
# return it as a string
as.character(token)
}
.extraRoutineRegistrations <- function(targetFile, routines) {
declarations = character()
call_entries = character()
# if we are running R 3.4 or higher we can use an internal utility function
# to automatically discover additional native routines that require registration
if (getRversion() >= "3.4") {
# determine the package directory
pkgdir <- dirname(dirname(targetFile))
# get the generated code from R
con <- textConnection(object = NULL, open = "w")
on.exit(close(con), add = TRUE)
tools::package_native_routine_registration_skeleton(
dir = pkgdir,
con = con,
character_only = FALSE
)
code <- textConnectionValue(con)
# look for lines containing call entries
matches <- regexec('^\\s+\\{"([^"]+)",.*$', code)
matches <- regmatches(code, matches)
matches <- Filter(x = matches, function(x) {
length(x) > 0 # #nocov start
})
for (match in matches) {
routine <- match[[2]]
if (!routine %in% routines) {
declaration <- grep(sprintf("^extern .* %s\\(.*$", routine), code,
value = TRUE)
# FIXME: maybe we should extend this to *any* routine?
# or is there any case in which `void *` is not SEXP for a .Call?
if (routine == "run_testthat_tests")
declaration <- gsub("void *", "SEXP", declaration, fixed=TRUE)
declarations <- c(declarations, sub("^extern", "RcppExport", declaration))
call_entries <- c(call_entries, match[[1]]) # #nocov end
}
}
}
# return extra declaratiosn and call entries
list(declarations = declarations,
call_entries = call_entries)
}
Rcpp/R/exceptions.R 0000644 0001762 0000144 00000003114 13035734131 013662 0 ustar ligges users # Copyright (C) 2009 - 2017 Dirk Eddelbuettel and Romain Francois
#
# This file is part of Rcpp.
#
# Rcpp is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# Rcpp is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Rcpp. If not, see .
.rcpp_error_recorder <- function(e) {
invisible(.Call(rcpp_error_recorder, e)) # #nocov
}
.warningsEnv <- new.env()
.warningsEnv$warnings <- character()
.rcpp_warning_recorder <- function(w){
.warningsEnv$warnings <- append(.warningsEnv$warnings, w$message) # #nocov
invokeRestart("muffleWarning") # #nocov
}
.rcpp_collect_warnings <- function() {
warnings <- .warningsEnv$warnings # #nocov start
.warningsEnv$warnings <- character()
warnings # #nocov end
}
print.Rcpp_stack_trace <- function(x, ...) {
cat(format(x, ...)) # #nocov
}
str.Rcpp_stack_trace <- function(object, ...) {
cat(format(object, ...)) # #nocov
}
format.Rcpp_stack_trace <- function(x, ...) {
paste0( # #nocov start
if (nzchar(x$file)) paste0(x$file, ":", x$line),
"\n ", paste(collapse = "\n ", seq_along(x$stack), ":", x$stack), "\n")
} # #nocov end
Rcpp/R/02_completion.R 0000644 0001762 0000144 00000003353 13023631124 014153 0 ustar ligges users # Copyright (C) 2010 - 2016 John Chambers, Dirk Eddelbuettel and Romain Francois
#
# This file is part of Rcpp.
#
# Rcpp is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# Rcpp is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Rcpp. If not, see .
setGeneric( ".DollarNames" ) # #nocov start
.DollarNames.Module <- function(x, pattern){
pointer <- .getModulePointer( x )
if(identical(pointer, .badModulePointer)) {
stop( "unitialized module" )
}
grep( pattern , .Call( Module__complete, pointer), value = TRUE )
}
setMethod( ".DollarNames", "Module", .DollarNames.Module )
# completion for C++ objects
# do we actually need this or do we get it for free via setRefClass, etc ...
setGeneric( "complete", function(x) standardGeneric("complete") )
setMethod( "complete", "C++Object", function(x){
xp <- get(".cppclass", envir = as.environment(x))
# FIXME: implement another test
# if(identical(xp, .emptyPointer))
# stop("C++ object with unset pointer to C++ class")
.Call( CppClass__complete , xp )
} )
".DollarNames.C++Object" <- function( x, pattern ){
grep( pattern, complete(x), value = TRUE )
}
setMethod( ".DollarNames", "C++Object", `.DollarNames.C++Object` )
# #nocov end
Rcpp/R/bib.R 0000644 0001762 0000144 00000001446 13036047445 012251 0 ustar ligges users # Copyright (C) 2010 - 2017 Dirk Eddelbuettel and Romain Francois
#
# This file is part of Rcpp.
#
# Rcpp is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# Rcpp is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Rcpp. If not, see .
bib <- function() {
sub("\\.bib$", "", system.file("bib", "Rcpp.bib", package = "Rcpp"))
}
Rcpp/R/zzz.R 0000644 0001762 0000144 00000001601 13023631124 012330 0 ustar ligges users # Copyright (C) 2009 - 2016 Dirk Eddelbuettel and Romain Francois
#
# This file is part of Rcpp.
#
# Rcpp is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# Rcpp is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Rcpp. If not, see .
.dummyInstancePointer <- new.env() # just something permanent
.classes_map <- new.env()
.onLoad <- function(libname, pkgname){
new_dummyObject(.dummyInstancePointer) # nocov
}
Rcpp/R/tools.R 0000644 0001762 0000144 00000005546 14530124217 012653 0 ustar ligges users # Copyright (C) 2010 - 2019 Dirk Eddelbuettel and Romain Francois
#
# This file is part of Rcpp.
#
# Rcpp is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# Rcpp is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Rcpp. If not, see .
externalptr_address <- function(xp) {
.Call(as_character_externalptr, xp) # #nocov
}
# just like assignInNamespace but first checks that the binding exists
forceAssignInNamespace <- function(x, value, env) {
is_ns <- isNamespace(env)
unlocker <- get("unlockBinding", baseenv())
if (is_ns && exists(x, env) && bindingIsLocked(x, env)) {
unlocker(x, env) # #nocov
}
assign(x, value, env)
if (is_ns) {
lockBinding(x, env) # #nocov
}
}
# Transform a path for passing to the build system on the command line.
# Leave paths alone for posix. For Windows, mirror the behavior of the
# R package build system by starting with the fully resolved absolute path,
# transforming it to a short path name if it contains spaces, and then
# converting backslashes to forward slashes
asBuildPath <- function(path) {
if (.Platform$OS.type == "windows") {
path <- normalizePath(path) # #nocov start
if (grepl(' ', path, fixed=TRUE))
path <- utils::shortPathName(path)
path <- gsub("\\\\", "/", path) # #nocov end
}
return(path)
}
##' Helper function to report the package version of the R installation.
##'
##' While \code{packageVersion(Rcpp)} exports the version registers in
##' \code{DESCRIPTION}, this version does get incremented more easily
##' during development and can therefore be higher than the released
##' version. The actual \code{#define} long used at the C++ level
##' corresponds more to an \sQuote{API Version} which is now provided
##' by this function, and use for example in the package skeleton
##' generator.
##'
##' @title Export the Rcpp (API) Package Version
##' @param devel An logical value indicating if the development or
##' release version number should be returned, default is release.
##' @return A \code{package_version} object with either the release
##' or development version.
##' @author Dirk Eddelbuettel
##' @seealso \code{\link{packageVersion}},
##' \code{\link{Rcpp.package.skeleton}}
##' @examples getRcppVersion()
getRcppVersion <- function(devel = FALSE) {
rcpp <- .Call("getRcppVersionStrings", PACKAGE="Rcpp")
package_version(rcpp[if(devel) 2 else 1])
}
Rcpp/R/exposeClass.R 0000644 0001762 0000144 00000020076 13326202417 014000 0 ustar ligges users # Copyright (C) 2013 - 2016 John Chambers, Dirk Eddelbuettel and Romain Francois
#
# This file is part of Rcpp.
#
# Rcpp is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# Rcpp is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Rcpp. If not, see .
.stdHeader <- c( # #nocov start
"#include ",
"using namespace Rcpp ;"
)
.asString <- function(what) if(is.character(what)) what else deparse(what)
.strings <- function(expr) {
if(is.call(expr) && ! identical(expr[[1]], quote(`::`)))
lapply(as.list(expr)[-1], .strings)
else
.asString(expr)
}
.specifyItems <- function(what) {
what <- as.list(what)
wn <- allNames(what)
simple <- !nzchar(wn)
## todo: error checking here that unnamed elements are single strings
wn[simple] <- as.character(what[simple])
names(what) <- wn
what[simple] <- list(character())
what
}
.writeFieldFunction <- function(fldi, typei, CppClass, readOnly, ns, con){
rootName <- paste0("field_", fldi)
writeLines(sprintf(" %s %s_get(%s *obj) { return obj->%s; }\n",
typei, rootName, CppClass, fldi), con)
value <- "_get"
if(!readOnly) {
writeLines(sprintf(" void %s_set(%s *obj, %s value) { obj->%s = value; }\n",
rootName, CppClass, typei, fldi), con)
value <- c(value, "_set")
}
paste0(ns, "::field_", fldi, value)
}
.writeMethodFunction <- function(mdi, sigi, CppClass, ns, con) {
mName <- paste0("method_", mdi)
if(length(sigi) < 1)
stop(gettextf("The type signature for method %s for class %s was of length 0: Must at least include the return type",
mdi, CppClass))
rtnType <- sigi[[1]]
sigi <- sigi[-1]
if(length(sigi)) {
argNames <- paste0("a", seq_along(sigi))
args <- paste(" ,", paste(sigi, argNames, collapse = ", "))
}
else argNames <- args <- ""
writeLines(sprintf(" %s %s(%s *obj%s){ return obj->%s(%s); }\n",
rtnType, mName, CppClass, args, mdi, argNames), con)
paste0(ns, "::",mName)
}
exposeClass <- function(class, constructors, fields, methods,
file = paste0(CppClass, "Module.cpp"),
header = character(),
module = paste0("class_",class), CppClass = class,
readOnly = character(), rename = character(),
Rfile = TRUE) {
## some argument checks
## TODO: checks on constructors, fields, methods
if(length(readOnly)) {
readOnly <- as.character(readOnly)
if(!all(nzchar(readOnly)))
stop("argument readOnly should be a vector of non-empty strings")
}
newnames <- allNames(rename)
if(length(rename)) {
if(!all(sapply(rename, function(x) is.character(x) && length(x) == 1 && nzchar(x))))
stop("argument rename should be a vector of single, non-empty strings")
if(!all(nzchar(newnames)))
stop("all the elements of argument rename should be non-empty strings")
}
if(is.character(file)) {
## are we in a package directory? Writable, searchable src subdirectory:
if(file.access("src",3)==0 && (basename(file) == file))
cfile <- file.path("src", file)
else
cfile <- file
con <- file(cfile, "w")
on.exit({message(sprintf("Wrote C++ file \"%s\"", cfile)); close(con)})
}
else
con <- file
## and for the R code:
if(identical(Rfile, FALSE)) {}
else {
if(identical(Rfile, TRUE))
Rfile <- sprintf("%sClass.R",class)
if(is.character(Rfile)) {
if(file.access("R",3)==0 && (basename(file) == file)) # in a package directory
Rfile <- file.path("R", Rfile)
Rcon <- file(Rfile, "w")
msg <- sprintf("Wrote R file \"%s\"",Rfile)
on.exit({message(msg); close(Rcon)}, add = TRUE)
}
else
Rcon <- Rfile
Rfile <- TRUE
}
mfile <- tempfile()
mcon <- file(mfile, "w")
writeLines(.stdHeader, con)
if(length(header))
writeLines(header, con)
writeLines(c("", sprintf("RCPP_MODULE(%s) {\n",module), ""), mcon)
writeLines(sprintf(" class_<%s>(\"%s\")\n", CppClass, class), mcon)
## the constructors argument defines a list of vectors of types
for( cons in constructors) {
if(length(cons) > 1 ||
(length(cons) == 1 && nzchar(cons) && !identical(cons, "void")))
cons <- paste0("<", paste(cons, collapse = ","),">")
else
cons = ""
writeLines(paste0(" .constructor",cons,"()"),mcon)
}
writeLines("", mcon)
flds <- .specifyItems(fields)
nm <- fnm <- names(flds)
rdOnly <- nm %in% readOnly
macros <- ifelse(rdOnly, ".field_readonly", ".field")
test <- nm %in% rename
if(any(test))
nm[test] <- newnames[match(nm[test], rename)]
ns <- NULL
for(i in seq_along(nm)) {
typei <- flds[[i]]
fldi <- fnm[i]
nmi <- nm[[i]]
macroi <- macros[[i]]
if(!length(typei) || identical(typei, "")) ## direct field
writeLines(sprintf(" %s(\"%s\", &%s::%s)",
macroi, nmi, CppClass, fldi), mcon)
else { # create a free function, e.g. for an inherited field
if(is.null(ns)) { # enclose in a namespace
ns <- paste("module",class,"NS", sep = "_")
writeLines(sprintf("\nnamespace %s {\n", ns),
con)
}
fldFuns <- .writeFieldFunction(fldi, typei, CppClass, rdOnly[[i]], ns, con)
if(rdOnly[[i]])
## NOTE: string 3rd arg. required by problem w. module parsing 10/3/13
writeLines(sprintf(" .property(\"%s\", &%s, \"read-only field\")",
nmi, fldFuns[[1]]), mcon)
else
writeLines(sprintf(" .property(\"%s\", &%s, &%s)",
nmi, fldFuns[[1]], fldFuns[[2]]), mcon)
}
}
writeLines("", mcon)
sigs <- .specifyItems(methods)
nm <- mds <- names(sigs)
test <- nm %in% rename
if(any(test))
nm[test] <- newnames[match(nm[test], rename)]
for(i in seq_along(nm)) {
sigi <- sigs[[i]]
nmi <- nm[[i]]
mdi <- mds[[i]]
if(!length(sigi) || identical(sigi, "")) # direct method
writeLines(sprintf(" .method(\"%s\", &%s::%s)",
nmi, CppClass, mdi), mcon)
else { # create a free function, e.g. for an inherited method
if(is.null(ns)) { # enclose in a namespace
ns <- paste("module",class,"NS", sep = "_")
writeLines(sprintf("\nnamespace %s {\n", ns),
con)
}
mFun <- .writeMethodFunction(mdi, sigi, CppClass, ns, con)
writeLines(sprintf(" .method(\"%s\", &%s)",
nmi, mFun), mcon)
}
}
writeLines(" ;\n}", mcon)
close(mcon)
if(!is.null(ns))
writeLines(sprintf("} // %s", ns), con) # close namespace
writeLines(readLines(mfile), con)
if(Rfile) {
if(missing(CppClass))
CppString <- ""
else
CppString <- paste0(", \"",CppClass, "\"")
if(missing(module))
ModString <- ""
else
ModString <- paste0(", module = \"", module, "\"")
writeLines(sprintf("%s <- setRcppClass(\"%s\"%s%s)",
class, class, CppString,ModString), Rcon)
}
} # #nocov end
Rcpp/R/01_show.R 0000644 0001762 0000144 00000010230 13023631124 012751 0 ustar ligges users # Copyright (C) 2010 - 2016 John Chambers, Dirk Eddelbuettel and Romain Francois
#
# This file is part of Rcpp.
#
# Rcpp is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# Rcpp is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Rcpp. If not, see .
setMethod( "show", "C++Object", function(object){ # #nocov start
env <- as.environment(object)
pointer <- get(".pointer", envir = env)
cppclass <- get(".cppclass", envir = env)
txt <- sprintf( "C++ object <%s> of class '%s' <%s>",
externalptr_address(pointer),
.Call( Class__name, cppclass ),
externalptr_address(cppclass)
)
writeLines( txt )
} )
setMethod( "show", "C++Class", function(object){
doc <- object@docstring
txt <- sprintf( "C++ class '%s' <%s>%s",
.Call( Class__name, object@pointer ),
externalptr_address(object@pointer),
if( length(doc) && nchar(doc) ) sprintf( "\n docstring : %s", doc ) else ""
)
writeLines( txt )
ctors <- object@constructors
nctors <- length( ctors )
txt <- character( nctors )
for( i in seq_len(nctors) ){
ctor <- ctors[[i]]
doc <- ctor$docstring
txt[i] <- sprintf( " %s%s", ctor$signature, if( nchar(doc) ) sprintf( "\n docstring : %s", doc) else "" )
}
writeLines( "Constructors:" )
writeLines( paste( txt, collapse = "\n" ) )
fields <- object@fields
nfields <- length(fields)
if( nfields ){
names <- names(fields)
txt <- character(nfields)
writeLines( "\nFields: " )
for( i in seq_len(nfields) ){
f <- fields[[i]]
doc <- f$docstring
txt[i] <- sprintf( " %s %s%s%s",
f$cpp_class,
names[i],
if( f$read_only ) " [readonly]" else "",
if( nchar(doc) ) sprintf( "\n docstring : %s", doc ) else ""
)
}
writeLines( paste( txt, collapse = "\n" ) )
} else {
writeLines( "\nFields: No public fields exposed by this class" )
}
mets <- object@methods
nmethods <- length(mets)
if( nmethods ){
writeLines( "\nMethods: " )
txt <- character( nmethods )
for( i in seq_len(nmethods) ){
txt[i] <- mets[[i]]$info(" ")
}
writeLines( paste( txt, collapse = "\n" ) )
} else {
writeLines( "\nMethods: no methods exposed by this class" )
}
} )
setMethod( "show", "C++Function", function(object){
txt <- sprintf( "internal C++ function <%s>", externalptr_address(object@pointer) )
writeLines( txt )
doc <- object@docstring
if( length(doc) && nchar( doc ) ){
writeLines( sprintf( " docstring : %s", doc ) )
}
sign <- object@signature
if( length(sign) && nchar( sign ) ){
writeLines( sprintf( " signature : %s", sign ) )
}
} )
setMethod( "show", "Module", function( object ){
pointer <- .getModulePointer(object, FALSE)
if(identical(pointer, .badModulePointer)) {
object <- as.environment(object) ## not needed when 2.12.0 arrives
txt <- sprintf("Uninitialized module named \"%s\" from package \"%s\"",
get("moduleName", envir = object),
get("packageName", envir = object))
writeLines(txt)
}
else {
info <- .Call( Module__functions_arity, pointer )
name <- .Call( Module__name, pointer )
txt <- sprintf( "Rcpp module '%s' \n\t%d functions: ", name, length(info) )
writeLines( txt )
txt <- sprintf( "%15s : %d arguments", names(info), info )
writeLines( txt )
info <- .Call( Module__classes_info, pointer )
txt <- sprintf( "\n\t%d classes : ", length(info) )
writeLines( txt )
txt <- sprintf( "%15s ", names(info) )
writeLines( txt )
}
} ) # #nocov end
Rcpp/R/compilerCheck.R 0000644 0001762 0000144 00000003402 13023631124 014244 0 ustar ligges users ##' Helper function to establish minimal compiler versions, currently limited
##' only to \code{g++} which (particularly for older RHEL/CentOS releases) is
##' too far behind current C++11 standards required for some packages.
##'
##' This function looks up \code{g++} (as well as optional values in the
##' \code{CXX} and \code{CXX1X} environment variables) in the \code{PATH}. For
##' all values found, the output of \code{g++ -v} is analyzed for the version
##' string, which is then compared to the given minimal version.
##' @title Check for Minimal (g++) Compiler Version
##' @param minVersion An object of type \code{package_version}, with a default
##' of version 4.6.0
##' @return A boolean value is returned, indicating if the minimal version is
##' being met
##' @author Dirk Eddelbuettel
compilerCheck <- function(minVersion=package_version("4.6.0")) { # nocov start
binaries <- c("g++", Sys.getenv("CXX", unset=""), Sys.getenv("CXX1X", unset=""))
binpaths <- lapply(binaries, function(b) { if (b=="") NULL else Sys.which(b) })
allgood <- FALSE
rl <- lapply(binpaths, function(b) {
if (is.null(b)) return(NULL)
con <- pipe(paste(b, "-v 2>&1"), "r") # NB: not --version, but -v
lines <- readLines(con)
close(con)
lines <- lines[grepl("^g.. version", lines)]
if (length(lines) == 0) return(NULL)
ver <- strsplit(lines, " ")[[1]][3] # format is 'gcc version x.y.z ....'
package_version(ver) >= minVersion
})
all(do.call(c, rl)) # drops NULLs
} # nocov end
## TODO: maybe not limit to gcc/g++
## TODO: maybe be smarter about combination of path, CXX and CXX1X ?
## TODO: maybe make env.var optional arguments too
Rcpp/R/00_classes.R 0000644 0001762 0000144 00000006363 13023631124 013441 0 ustar ligges users # Copyright (C) 2010 - 2016 John Chambers, Dirk Eddelbuettel and Romain Francois
#
# This file is part of Rcpp.
#
# Rcpp is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# Rcpp is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Rcpp. If not, see .
# anticipating a change in R 2.16.0
setClass( "refClassGeneratorFunction" ) # #nocov start
setClassUnion("refGenerator", c("refObjectGenerator", "refClassGeneratorFunction"))
## "Module" class as an environment with "pointer", "moduleName",
## "packageName" and "refClassGenerators"
## Stands in for a reference class with those fields.
setClass( "Module", contains = "environment" )
setRefClass( "C++Field",
fields = list(
pointer = "externalptr",
cpp_class = "character",
read_only = "logical",
class_pointer = "externalptr",
docstring = "character"
)
)
setRefClass( "C++OverloadedMethods",
fields = list(
pointer = "externalptr",
class_pointer = "externalptr",
size = "integer",
void = "logical",
const = "logical",
docstrings = "character",
signatures = "character",
nargs = "integer"
),
methods = list(
info = function(prefix = " " ){
paste(
paste( prefix, signatures, ifelse(const, " const", "" ), "\n", prefix, prefix,
ifelse( nchar(docstrings), paste( "docstring :", docstrings) , "" )
) , collapse = "\n" )
}
)
)
setRefClass( "C++Constructor",
fields = list(
pointer = "externalptr",
class_pointer = "externalptr",
nargs = "integer",
signature = "character",
docstring = "character"
)
)
setClass( "C++Class",
representation(
pointer = "externalptr",
module = "externalptr",
fields = "list",
methods = "list",
constructors = "list",
generator = "refGenerator",
docstring = "character",
typeid = "character",
enums = "list",
parents = "character"
),
contains = "character"
)
setClass( "C++Object")
setClass( "C++Function",
representation(
pointer = "externalptr",
docstring = "character",
signature = "character"
),
contains = "function"
)
.cppfunction_formals_gets <- function (fun, envir = environment(fun), value) {
bd <- body(fun)
b2 <- bd[[2L]]
for( i in seq_along(value) ){
b2[[3L+i]] <- as.name( names(value)[i] )
}
bd[[2]] <- b2
f <- fun@.Data
formals(f) <- value
body(f) <- bd
fun@.Data <- f
fun
}
setGeneric( "formals<-" )
setMethod( "formals<-", "C++Function", .cppfunction_formals_gets ) # #nocov end
Rcpp/R/03_prompt.R 0000644 0001762 0000144 00000004571 13023631124 013327 0 ustar ligges users # Copyright (C) 2010 - 2016 John Chambers, Dirk Eddelbuettel and Romain Francois
#
# This file is part of Rcpp.
#
# Rcpp is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# Rcpp is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Rcpp. If not, see .
setGeneric( "functions", function(object, ...) standardGeneric( "functions" ) ) # #nocov start
setMethod( "functions", "Module", function(object, ...){
pointer <- .getModulePointer(object)
if(identical(pointer, .badModulePointer))
stop(gettextf("Module \"%s\" has not been intialized: try Module(object)",
get("moduleName", envir = as.environment(object))), domain = NA)
else
.Call( Module__functions_arity, pointer )
} )
setGeneric( "prompt" )
setMethod( "prompt", "Module", function(object, filename = NULL, name = NULL, ...){
lines <- readLines( system.file( "prompt", "module.Rd", package = "Rcpp" ) )
pointer <- .getModulePointer(object)
if( is.null(name) )
name <- .Call( Module__name, pointer )
if( is.null(filename) ) filename <- sprintf( "%s-module.Rd", name )
lines <- gsub( "NAME", name, lines )
info <- functions( object )
f.txt <- if( length( info ) ){
sprintf( "functions: \\\\describe{
%s
}", paste( sprintf( " \\\\item{%s}{ ~~ description of function %s ~~ }", names(info), names(info) ), collapse = "\n" ) )
} else {
""
}
lines <- sub( "FUNCTIONS", f.txt, lines )
## at this point functions() would have failed if the
## pointer in object was not valid
classes <- .Call( Module__classes_info, pointer )
c.txt <- if( length( classes ) ){
sprintf( "classes: \\\\describe{
%s
}", paste( sprintf( " \\\\item{%s}{ ~~ description of class %s ~~ }", names(classes), names(classes) ), collapse = "\n" ) )
} else {
""
}
lines <- sub( "CLASSES", c.txt, lines )
writeLines( lines, filename )
invisible(NULL)
} ) # nocov end
Rcpp/R/Module.R 0000644 0001762 0000144 00000042777 14470465200 012752 0 ustar ligges users # Copyright (C) 2010 - 2021 John Chambers, Dirk Eddelbuettel and Romain Francois
#
# This file is part of Rcpp.
#
# Rcpp is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# Rcpp is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Rcpp. If not, see .
internal_function <- function(pointer){
f <- function(xp){
force(xp)
function(...){
.External( InternalFunction_invoke, xp, ... )
}
}
o <- new( "C++Function", f(pointer) )
o@pointer <- pointer
o
}
setMethod("$", "C++Class", function(x, name) {
x <- x@generator
eval.parent(substitute(x$name))
})
.badModulePointer <- NULL
.setModulePointer <- function(module, value) {
assign("pointer", value, envir = as.environment(module))
value
}
.getModulePointer <- function(module, mustStart = TRUE) {
pointer <- get("pointer", envir = as.environment(module))
if(is.null(pointer) && mustStart) { # #nocov start
## should be (except for bug noted in identical())
## if(identical(pointer, .badModulePointer) && mustStart) {
Module(module, mustStart = TRUE) # will either initialize pointer or throw error
pointer <- get("pointer", envir = as.environment(module))
} # #nocov end
pointer
}
setMethod("initialize", "Module",
function(.Object,
moduleName = "UNKNOWN",
packageName = "",
pointer = .badModulePointer, ...) {
env <- new.env(TRUE, emptyenv())
as(.Object, "environment") <- env
assign("pointer", pointer, envir = env)
assign("packageName", packageName, envir = env)
assign("moduleName", moduleName, envir = env)
if(length(list(...)) > 0) {
.Object <- callNextMethod(.Object, ...) # #nocov
}
.Object
})
.get_Module_function <- function(x, name, pointer = .getModulePointer(x) ){
pointer <- .getModulePointer(x)
info <- .Call( Module__get_function, pointer, name )
fun_ptr <- info[[1L]]
is_void <- info[[2L]]
doc <- info[[3L]]
sign <- info[[4L]]
formal_args <- info[[5L]]
nargs <- info[[6L]]
f <- function(...) NULL
if( nargs == 0L ) formals(f) <- NULL
stuff <- list( fun_pointer = fun_ptr, InternalFunction_invoke = InternalFunction_invoke )
body(f) <- if( nargs == 0L ){
if( is_void ) {
substitute( { # #nocov start
.External( InternalFunction_invoke, fun_pointer)
invisible(NULL)
}, stuff ) # #nocov end
} else {
substitute( {
.External( InternalFunction_invoke, fun_pointer)
}, stuff )
}
} else {
if( is_void ) {
substitute( { # #nocov start
.External( InternalFunction_invoke, fun_pointer, ... )
invisible(NULL)
}, stuff ) # #nocov end
} else {
substitute( {
.External( InternalFunction_invoke, fun_pointer, ... )
}, stuff )
}
}
out <- new( "C++Function", f, pointer = fun_ptr, docstring = doc, signature = sign )
if( ! is.null( formal_args ) ){
formals( out ) <- formal_args # #nocov
}
out
}
.get_Module_Class <- function( x, name, pointer = .getModulePointer(x) ){
value <- .Call( Module__get_class, pointer, name )
value@generator <- get("refClassGenerators", envir=x)[[value@.Data]]
value
}
setMethod( "$", "Module", function(x, name){ # #nocov start
pointer <- .getModulePointer(x)
storage <- get( "storage", envir = as.environment(x) )
storage[[ name ]]
} ) # #nocov end
new_CppObject_xp <- function(module, pointer, ...) {
.External( class__newInstance, module, pointer, ... )
}
new_dummyObject <- function(...) # #nocov
.External( class__dummyInstance, ...) # #nocov
# class method for $initialize
cpp_object_initializer <- function(.self, .refClassDef, ..., .object_pointer){
# force finalize method to be materialized
invisible(.self$finalize)
selfEnv <- as.environment(.self)
## generate the C++-side object and store its pointer, etc.
## access the private fields in the fieldPrototypes env.
fields <- .refClassDef@fieldPrototypes
pointer <- if(missing(.object_pointer)) new_CppObject_xp(fields$.module, fields$.pointer, ...) else .object_pointer
assign(".module", fields$.module, envir = selfEnv)
assign(".pointer", pointer, envir = selfEnv)
assign(".cppclass", fields$.pointer, envir = selfEnv)
.self
}
cpp_object_dummy <- function(.self, .refClassDef) { # #nocov start
selfEnv <- as.environment(.self)
## like initializer but a dummy for the case of no default
## constructor. Will throw an error if the object is used.
fields <- .refClassDef@fieldPrototypes
pointer <- new_dummyObject()
assign(".module", fields$.module, envir = selfEnv)
assign(".pointer", pointer, envir = selfEnv)
assign(".cppclass", fields$.pointer, envir = selfEnv)
.self
} # #nocov end
cpp_object_maker <- function(typeid, pointer){
Class <- .classes_map[[ typeid ]]
new( Class, .object_pointer = pointer )
}
Module <- function( module, PACKAGE = methods::getPackageName(where), where = topenv(parent.frame()), mustStart = FALSE ) {
if (inherits(module, "DLLInfo") && missing(mustStart)) mustStart <- TRUE # #nocov
if (inherits(module, "Module")) {
xp <- .getModulePointer(module, FALSE)
if(!missing(PACKAGE))
warning("ignoring PACKAGE argument in favor of internal package from Module object") # #nocov
env <- as.environment(module) # not needed from R 2.12.0
PACKAGE <- get("packageName", envir = env)
moduleName <- get("moduleName", envir = env)
}
else if( identical( typeof( module ), "externalptr" ) ){
## [john] Should Module() ever be called with a pointer as argument?
## If so, we need a safe check of the pointer's validity
## [romain] I don't think we actually can, external pointers
## are stored as void*, they don't know what they are. Or we could
## perhaps keep a vector of all known module pointers
## [John] One technique is to initialize the pointer to a known value
## and just check whether it's been reset from that (bad) value
xp <- module # #nocov start
moduleName <- .Call( Module__name, xp )
module <- methods::new("Module", pointer = xp, packageName = PACKAGE,
moduleName = moduleName) # #nocov end
} else if(is.character(module)) {
moduleName <- module
xp <- .badModulePointer
module <- methods::new("Module", pointer = xp, packageName = PACKAGE,
moduleName = moduleName)
}
if(identical(xp, .badModulePointer)) {
if(mustStart) {
name <- sprintf( "_rcpp_module_boot_%s", moduleName )
symbol <- tryCatch(getNativeSymbolInfo( name, PACKAGE ),
error = function(e)e)
if(inherits(symbol, "error"))
stop(gettextf("Failed to initialize module pointer: %s",
symbol), domain = NA)
xp <- .Call( symbol )
.setModulePointer(module, xp)
}
else
return(module)
}
classes <- .Call( Module__classes_info, xp )
## We need a general strategy for assigning class defintions
## since delaying the initialization of the module causes
## where to be the Rcpp namespace:
if(environmentIsLocked(where))
where <- .GlobalEnv # or???
generators <- list()
storage <- new.env()
for( i in seq_along(classes) ){
CLASS <- classes[[i]]
clname <- CLASS@.Data
fields <- cpp_fields( CLASS, where )
methods <- cpp_refMethods(CLASS, where)
generator <- methods::setRefClass( clname,
fields = fields,
contains = "C++Object",
methods = methods,
where = where
)
# just to make codetools happy
.self <- .refClassDef <- NULL
generator$methods(initialize =
if (cpp_hasDefaultConstructor(CLASS))
function(...) Rcpp::cpp_object_initializer(.self,.refClassDef, ...)
else
function(...) {
if (nargs()) Rcpp::cpp_object_initializer(.self,.refClassDef, ...)
else Rcpp::cpp_object_dummy(.self, .refClassDef) # #nocov
}
)
rm( .self, .refClassDef )
classDef <- methods::getClass(clname)
## non-public (static) fields in class representation
## Should these become real fields?
fields <- classDef@fieldPrototypes
assign(".pointer", CLASS@pointer, envir = fields)
assign(".module", xp, envir = fields)
assign(".CppClassName", clname, envir = fields)
generators[[clname]] <- generator
# [romain] : should this be promoted to reference classes
# perhaps with better handling of j and ... arguments
if( any( grepl( "^[[]", names(CLASS@methods) ) ) ){ # #nocov start
if( "[[" %in% names( CLASS@methods ) ){
methods::setMethod( "[[", clname, function(x, i, j, ..., exact = TRUE){
x$`[[`( i )
}, where = where )
}
if( "[[<-" %in% names( CLASS@methods ) ){
methods::setReplaceMethod( "[[", clname, function(x, i, j, ..., exact = TRUE, value){
x$`[[<-`( i, value )
x
} , where = where )
}
} # #nocov end
# promoting show to S4
if( any( grepl( "show", names(CLASS@methods) ) ) ){
setMethod( "show", clname, function(object) object$show(), where = where ) # #nocov
}
}
if(length(classes)) {
module$refClassGenerators <- generators
}
for( i in seq_along(classes) ){
CLASS <- classes[[i]]
clname <- CLASS@.Data
demangled_name <- sub( "^Rcpp_", "", clname )
.classes_map[[ CLASS@typeid ]] <- storage[[ demangled_name ]] <- .get_Module_Class( module, demangled_name, xp )
# exposing enums values as CLASS.VALUE
# (should really be CLASS$value but I don't know how to do it)
if( length( CLASS@enums ) ){
for( enum in CLASS@enums ){ # #nocov start
for( i in 1:length(enum) ){
storage[[ paste( demangled_name, ".", names(enum)[i], sep = "" ) ]] <- enum[i]
}
} # #nocov end
}
}
# functions
functions <- .Call( Module__functions_names, xp )
for( fun in functions ){
storage[[ fun ]] <- .get_Module_function( module, fun, xp )
# register as(FROM, TO) methods
converter_rx <- "^[.]___converter___(.*)___(.*)$"
if( length( matches <- grep( converter_rx, functions ) ) ){ # #nocov start
for( i in matches ){
fun <- functions[i]
from <- sub( converter_rx, "\\1", fun )
to <- sub( converter_rx, "\\2", fun )
converter <- function( from ){}
body( converter ) <- substitute( { CONVERT(from) },
list( CONVERT = storage[[fun]] )
)
setAs( from, to, converter, where = where )
}
} # #nocov end
}
assign( "storage", storage, envir = as.environment(module) )
module
}
dealWith <- function( x ) if(isTRUE(x[[1]])) invisible(NULL) else x[[2]] # #nocov
method_wrapper <- function( METHOD, where ){
noargs <- all( METHOD$nargs == 0 )
stuff <- list(
class_pointer = METHOD$class_pointer,
pointer = METHOD$pointer,
CppMethod__invoke = CppMethod__invoke,
CppMethod__invoke_void = CppMethod__invoke_void,
CppMethod__invoke_notvoid = CppMethod__invoke_notvoid,
dealWith = dealWith,
docstring = METHOD$info("")
)
f <- function(...) NULL
if( noargs ){
formals(f) <- NULL
}
extCall <- if( noargs ) {
if( all( METHOD$void ) ){
# all methods are void, so we know we want to return invisible(NULL)
substitute(
{
docstring
.External(CppMethod__invoke_void, class_pointer, pointer, .pointer )
invisible(NULL)
} , stuff )
} else if( all( ! METHOD$void ) ){
# none of the methods are void so we always return the result of
# .External
substitute(
{
docstring
.External(CppMethod__invoke_notvoid, class_pointer, pointer, .pointer )
} , stuff )
} else {
# some are void, some are not, so the voidness is part of the result
# we get from internally and we need to deal with it
substitute( # #nocov start
{
docstring
dealWith( .External(CppMethod__invoke, class_pointer, pointer, .pointer ) )
} , stuff ) # #nocov end
}
} else {
if( all( METHOD$void ) ){
# all methods are void, so we know we want to return invisible(NULL)
substitute(
{
docstring
.External(CppMethod__invoke_void, class_pointer, pointer, .pointer, ...)
invisible(NULL)
} , stuff )
} else if( all( ! METHOD$void ) ){
# none of the methods are void so we always return the result of
# .External
substitute(
{
docstring
.External(CppMethod__invoke_notvoid, class_pointer, pointer, .pointer, ...)
} , stuff )
} else {
# some are void, some are not, so the voidness is part of the result
# we get from internally and we need to deal with it
substitute( # #nocov start
{
docstring
dealWith( .External(CppMethod__invoke, class_pointer, pointer, .pointer, ...) )
} , stuff ) # #nocov end
}
}
body(f, where) <- extCall
f
}
## create a named list of the R methods to invoke C++ methods
## from the C++ class with pointer xp
cpp_refMethods <- function(CLASS, where) {
finalizer <- eval( substitute(
function(){
.Call( CppObject__finalize, class_pointer , .pointer )
},
list(
CLASS = CLASS@pointer,
CppObject__finalize = CppObject__finalize,
class_pointer = CLASS@pointer
)
) )
mets <- c(
sapply( CLASS@methods, method_wrapper, where = where ),
"finalize" = finalizer
)
mets
}
cpp_hasDefaultConstructor <- function(CLASS) {
.Call( Class__has_default_constructor, CLASS@pointer )
}
binding_maker <- function( FIELD, where ){
f <- function( x ) NULL
body(f) <- substitute({
if( missing( x ) )
.Call( CppField__get, class_pointer, pointer, .pointer)
else
.Call( CppField__set, class_pointer, pointer, .pointer, x)
}, list(class_pointer = FIELD$class_pointer,
pointer = FIELD$pointer,
CppField__get = CppField__get,
CppField__set = CppField__set ))
environment(f) <- where
f
}
cpp_fields <- function( CLASS, where){
sapply( CLASS@fields, binding_maker, where = where )
}
.CppClassName <- function(name) {
paste0("Rcpp_",name) # #nocov
}
Rcpp/R/loadRcppModules.R 0000644 0001762 0000144 00000004503 13023631124 014574 0 ustar ligges users # Copyright (C) 2010 - 2016 John Chambers, Dirk Eddelbuettel and Romain Francois
#
# This file is part of Rcpp.
#
# Rcpp is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# Rcpp is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Rcpp. If not, see .
loadRcppModules <- function(direct=TRUE) { # #nocov start
# deprecation added May 2016, 'loadModule' has been prefered for years
.Deprecated("loadModule")
## hunt for the namespace of the package that calls this
calls <- sys.calls()
w <- which( sapply( calls, function(call){
identical( call[[1L]], as.name( "runHook" ) )
} ) )
if( !length(w) )
stop( "loadRcppModules can only be used within a .onLoad function" )
w <- w[ length(w) ]
call <- calls[[w]]
if( !identical( call[[2L]], ".onLoad" ) )
stop( "loadRcppModules can only be used within a .onLoad function" )
f <- sys.frame( w )
ns <- get("env", f )
if( !isNamespace( ns ) )
stop( "loadRcppModules not called from a namespace" )
pkg <- get( "pkgname", f )
lib <- get( "libname", f )
## look for declared modules in the DESCRIPTION fields
description <- packageDescription(pkg, lib.loc=lib)
modules <- description[["RcppModules"]]
if( !is.null( modules ) ){
modules <- strsplit( modules, "[[:space:]]*,[[:space:]]*")[[1L]]
for( m in modules ){
tryCatch( {
mod <- Module( m, pkg, mustStart = TRUE)
if(isTRUE(direct)){
populate( mod, ns )
} else {
forceAssignInNamespace( m, mod, ns )
}
assign(.moduleMetaName(m), mod, envir = ns)
}, error = function(e){
stop( sprintf( "failed to load module %s from package %s\n%s", m, pkg, conditionMessage(e) ) )
})
}
}
} # #nocov end
Rcpp/R/inline.R 0000644 0001762 0000144 00000003676 13110577633 013002 0 ustar ligges users # Copyright (C) 2009 - 2017 Dirk Eddelbuettel and Romain Francois
#
# This file is part of Rcpp.
#
# Rcpp is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# Rcpp is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Rcpp. If not, see .
Rcpp.plugin.maker <- function(include.before = "",
include.after = "",
LinkingTo = unique(c(package, "Rcpp")),
Depends = unique(c(package, "Rcpp")),
Imports = unique(c(package, "Rcpp")),
libs = "",
Makevars = NULL ,
Makevars.win = NULL,
package = "Rcpp") {
function(...) {
includes <- sprintf("%s
#include
%s
#ifndef BEGIN_RCPP
#define BEGIN_RCPP
#endif
#ifndef END_RCPP
#define END_RCPP
#endif
using namespace Rcpp;", include.before, include.after)
out <- list(env = list( PKG_LIBS = libs ),
includes = includes,
LinkingTo = LinkingTo ,
body = function( x ) {
sprintf( "BEGIN_RCPP\n%s\nEND_RCPP", x )
},
Depends = Depends,
Imports = Imports)
if (!is.null(Makevars)) out$Makevars <- Makevars
if (!is.null(Makevars.win)) out$Makevars.win <- Makevars.win
out
}
}
inlineCxxPlugin <- Rcpp.plugin.maker()
Rcpp/R/populate.R 0000644 0001762 0000144 00000002056 12754425121 013341 0 ustar ligges users # Copyright (C) 2010 - 2011 John Chambers, Dirk Eddelbuettel and Romain Francois
#
# This file is part of Rcpp.
#
# Rcpp is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# Rcpp is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Rcpp. If not, see .
populate <- function( module, env ){
# make sure the module is loaded
module <- Module( module, mustStart = TRUE )
storage <- get( "storage", as.environment(module ) )
symbols <- ls( storage )
is_ns <- isNamespace( env )
for( x in symbols ){
forceAssignInNamespace( x, storage[[x]], env )
}
}
Rcpp/R/Rcpp.package.skeleton.R 0000644 0001762 0000144 00000026214 15014017044 015624 0 ustar ligges users # Copyright (C) 2009 - 2025 Dirk Eddelbuettel and Romain Francois
#
# This file is part of Rcpp.
#
# Rcpp is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# Rcpp is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Rcpp. If not, see .
Rcpp.package.skeleton <- function(name = "anRpackage", list = character(),
environment = .GlobalEnv,
path = ".", force = FALSE,
code_files = character(), cpp_files = character(),
example_code = TRUE, attributes = TRUE, module = FALSE,
author = "Your Name",
maintainer = if (missing(author)) "Your Name"
else author,
email = "your@email.com",
githubuser = NA_character_,
license = "GPL (>= 2)") {
havePkgKitten <- requireNamespace("pkgKitten", quietly=TRUE)
call <- match.call()
call[[1]] <- as.name("package.skeleton")
env <- parent.frame(1)
if (!is.character(cpp_files))
stop("'cpp_files' must be a character vector") # #nocov
if (!length(list)) {
fake <- TRUE
assign("Rcpp.fake.fun", function() {}, envir = env)
if (example_code && !isTRUE(attributes)) {
assign("rcpp_hello_world", function() {}, envir = env)
remove_hello_world <- TRUE
} else {
remove_hello_world <- FALSE
}
} else {
if (example_code && !isTRUE(attributes)) {
if (!"rcpp_hello_world" %in% list) { # #nocov start
assign( "rcpp_hello_world", function() {}, envir = env)
call[["list"]] <- as.call(c(as.name("c"),
as.list(c("rcpp_hello_world", list))))
}
remove_hello_world <- TRUE # #nocov end
} else {
remove_hello_world <- FALSE
}
fake <- FALSE
}
## first let the traditional version do its business
## remove Rcpp specific arguments
call <- call[ c(1L, which(names(call) %in% names(formals(package.skeleton)))) ]
if (fake) {
call[["list"]] <- c(if(isTRUE(example_code)
&& !isTRUE(attributes)) "rcpp_hello_world", "Rcpp.fake.fun")
}
tryCatch(eval(call, envir = env), error = function(e){
stop(sprintf("error while calling `package.skeleton` : %s", conditionMessage(e))) # #nocov
})
message("\nAdding Rcpp settings")
## now pick things up
root <- file.path(path, name)
# Add Rcpp to the DESCRIPTION
DESCRIPTION <- file.path(root, "DESCRIPTION")
if (file.exists(DESCRIPTION)) {
imports <- c(if (isTRUE(module)) "methods", sprintf("Rcpp (>= %s)", getRcppVersion()))
splitname <- strsplit(author, " ")[[1]]
x <- cbind(read.dcf(DESCRIPTION, fields = c("Package", "Type", "Title", "Version", "Date",
"Description", "License")),
"Imports" = paste(imports, collapse = ", "),
"LinkingTo" = "Rcpp",
"Authors@R" = sprintf("person(\"%s\", \"%s\", role = c(\"aut\", \"cre\"), email = \"%s\")",
paste(splitname[-length(splitname)], collapse=" "),
splitname[length(splitname)],
email))
fields_written <- c("Package", "Type", "Title", "Version", "Date",
"Authors@R", "Description", "License", "Imports", "LinkingTo")
if (!is.na(githubuser)) {
x <- cbind(x, matrix("", 1, 1, dimnames=list("", "URL")))
x[1, "URL"] <- paste0("https://github.com/", githubuser, "/", name)
x <- cbind(x, matrix("", 1, 1, dimnames=list("", "BugReports")))
x[1, "BugReports"] <- paste0("https://github.com/", githubuser, "/", name, "/issues")
fields_written <- c("Package", "Type", "Title", "Version", "Date",
"Authors@R", "Description", "URL", "BugReports",
"License", "Imports", "LinkingTo")
}
x[, "License"] <- license
x[, "Title"] <- "Concise Summary of What the Package Does"
x[, "Description"] <- "More about what it does (maybe more than one line)."
x[, "Version"] <- "0.0.1"
message( " >> added Imports: Rcpp" )
message( " >> added LinkingTo: Rcpp" )
write.dcf(x[1, fields_written, drop = FALSE], file = DESCRIPTION)
}
## add useDynLib and importFrom to NAMESPACE
NAMESPACE <- file.path(root, "NAMESPACE")
lines <- readLines(NAMESPACE)
ns <- file(NAMESPACE, open="w")
if (!any(grepl("useDynLib", lines))) {
if (getRversion() >= "3.4.0") {
lines <- c(sprintf( "useDynLib(%s, .registration=TRUE)", name), lines)
} else {
lines <- c(sprintf( "useDynLib(%s)", name), lines) # #nocov
}
writeLines(lines, con = ns)
message(" >> added useDynLib directive to NAMESPACE" )
}
if (isTRUE(module)) {
writeLines('import(methods, Rcpp)', ns)
message(" >> added import(methods, Rcpp) directive to NAMESPACE")
} else {
writeLines('importFrom(Rcpp, evalCpp)', ns)
message(" >> added importFrom(Rcpp, evalCpp) directive to NAMESPACE" )
}
if (!any(grepl("^exportPattern", lines))) {
writeLines("exportPattern(\"^[[:alpha:]]+\")", ns)
}
close( ns )
## update the package description help page
if (havePkgKitten) { # if pkgKitten is available, use it
pkgKitten::playWithPerPackageHelpPage(name, path, maintainer, email)
} else {
.playWithPerPackageHelpPage(name, path, maintainer, email) # #nocov
}
## lay things out in the src directory
src <- file.path(root, "src")
if (!file.exists(src)) {
dir.create(src)
}
skeleton <- system.file("skeleton", package = "Rcpp")
if (length(cpp_files) > 0L) {
for (file in cpp_files) { # #nocov start
file.copy(file, src)
message(" >> copied ", file, " to src directory" ) # #nocov end
}
}
if (example_code) {
if (isTRUE(attributes)) {
file.copy(file.path( skeleton, "rcpp_hello_world_attributes.cpp"),
file.path( src, "rcpp_hello_world.cpp"))
message(" >> added example src file using Rcpp attributes")
} else {
header <- readLines(file.path(skeleton, "rcpp_hello_world.h"))
header <- gsub("@PKG@", name, header, fixed = TRUE)
writeLines(header , file.path(src, "rcpp_hello_world.h"))
message(" >> added example header file using Rcpp classes")
file.copy(file.path(skeleton, "rcpp_hello_world.cpp"), src)
message(" >> added example src file using Rcpp classes")
rcode <- readLines(file.path( skeleton, "rcpp_hello_world.R"))
rcode <- gsub("@PKG@", name, rcode, fixed = TRUE)
writeLines( rcode , file.path( root, "R", "rcpp_hello_world.R"))
message(" >> added example R file calling the C++ example")
}
hello.Rd <- file.path(root, "man", "rcpp_hello_world.Rd")
unlink(hello.Rd)
file.copy(system.file("skeleton", "rcpp_hello_world.Rd", package = "Rcpp"), hello.Rd)
message( " >> added Rd file for rcpp_hello_world")
}
if (isTRUE(module)) {
file.copy(system.file("skeleton", "rcpp_module.cpp", package="Rcpp"),
file.path(root, "src"))
file.copy(system.file("skeleton", "Num.cpp", package="Rcpp"),
file.path(root, "src"))
file.copy(system.file("skeleton", "stdVector.cpp", package="Rcpp"),
file.path(root, "src"))
file.copy(system.file("skeleton", "zzz.R", package ="Rcpp"),
file.path(root, "R"))
file.copy(system.file("skeleton", "Rcpp_modules_examples.Rd", package ="Rcpp"),
file.path(root, "man"))
message(" >> copied the example module file ")
}
# generate native routines if we aren't using attributes (which already generate
# them automatically) and we have at least R 3.4
if (!attributes) {
if (getRversion() >= "3.4.0") {
con <- file(file.path(src, "init.c"), "wt")
tools::package_native_routine_registration_skeleton(root, con=con)
close(con)
message(" >> created init.c for package registration")
} else {
message(" >> R version older than 3.4.0 detected, so NO file init.c created.") # #nocov
}
}
lines <- readLines(package.doc <- file.path( root, "man", sprintf("%s-package.Rd", name)))
lines <- sub("~~ simple examples", "%% ~~ simple examples", lines)
lines <- lines[! grepl("~~ package title", lines)]
lines <- lines[! grepl("~~ The author and", lines)]
lines <- sub("Who wrote it", author, lines )
lines <- sub("Who to complain to.*", sprintf("%s <%s>", maintainer, email), lines)
writeLines(lines, package.doc)
if (fake) {
rm("Rcpp.fake.fun", envir = env)
unlink(file.path(root, "R" , "Rcpp.fake.fun.R"))
unlink(file.path(root, "man", "Rcpp.fake.fun.Rd"))
## cleansing NAMESPACE of fake function entry
lines <- readLines(NAMESPACE)
lines <- lines[!grepl("^export.*fake\\.fun", lines)]
writeLines(lines, NAMESPACE)
}
if (isTRUE(remove_hello_world)) {
rm("rcpp_hello_world", envir = env)
}
if (attributes) {
compileAttributes(root)
message(" >> compiled Rcpp attributes ")
}
invisible(NULL)
}
## Borrowed with love from pkgKitten, and modified slightly
.playWithPerPackageHelpPage <- function(name = "anRpackage",
path = ".",
maintainer = "Your Name",
email = "your@mail.com") {
root <- file.path(path, name) # #nocov start
helptgt <- file.path(root, "man", sprintf( "%s-package.Rd", name))
helpsrc <- system.file("skeleton", "manual-page-stub.Rd", package="Rcpp")
## update the package description help page
if (file.exists(helpsrc)) {
lines <- readLines(helpsrc)
lines <- gsub("__placeholder__", name, lines, fixed = TRUE)
lines <- gsub("Who to complain to ",
sprintf( "%s <%s>", maintainer, email),
lines, fixed = TRUE)
writeLines(lines, helptgt)
}
invisible(NULL) # #nocov end
}
Rcpp/R/loadModule.R 0000644 0001762 0000144 00000011057 13023631124 013566 0 ustar ligges users # Copyright (C) 2010 - 2015 John Chambers, Dirk Eddelbuettel and Romain Francois
#
# This file is part of Rcpp.
#
# Rcpp is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# Rcpp is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Rcpp. If not, see .
## the following items are to get around some insanity in the
## CMD check of packages using Rcpp that dies in loadModule()
## because some code somewhere can't find the methods package
isBotchedSession <- function()
! ("package:methods" %in% search())
.moduleNames <- function(what) {
assignAs <- allNames(what)
sameNames <- !nzchar(assignAs)
assignAs[sameNames] <- what[sameNames]
assignAs
}
.DummyModule <- function(name, what) { # #nocov start
value <- new.env()
storage <- new.env()
assign("storage", storage, envir = value)
assign("moduleName", name, envir = value)
allNames <- names(.moduleNames(what))
for(el in allNames)
assign(el, NULL, envir = storage)
value
} # #nocov end
.moduleMetaName <- function(name)
methods::methodsPackageMetaName("Mod",name)
moduleIsLoaded <- function(name, env)
exists(.moduleMetaName(name), envir = env, inherits = FALSE)
loadModule <- function( module, what = character(), loadNow,
env = topenv(parent.frame())) {
if(is(module, "character")) {
loadM <- NULL
metaName <- .moduleMetaName(module)
if(exists(metaName, envir = env, inherits = FALSE))
loadM <- get(metaName, envir = env)
}
else if(is(module, "Module")) {
loadM <- as.environment(module) # #nocov
module <- get(loadM, "moduleName") # #nocov
}
else
stop(gettextf("Argument \"module\" should be a module or the name of a module: got an object of class \"%s\"", class(module)))
if(missing(loadNow)) { # test it
if(is.null(loadM))
loadM <- tryCatch(Module( module, mustStart = TRUE, where = env ),
error = function(e)e)
loadNow <- !is(loadM, "error")
}
if(loadNow) {
## .botched <- isBotchedSession()
.botched <- FALSE
if(is.null(loadM))
loadM <- tryCatch(Module( module, mustStart = TRUE, where = env ),
error = function(e)e)
if(is(loadM, "error")) {
if(.botched) # #nocov start
return(.DummyModule(module, what))
stop(gettextf("Unable to load module \"%s\": %s",
as(module, "character"), loadM$message)) # #nocov end
}
if(!exists(metaName, envir = env, inherits =FALSE))
assign(metaName, loadM, envir = env)
if(!length(what)) # no assignments
return(loadM)
env <- as.environment(env)
## get the storage environment, for what=TRUE
storage <- as.environment(get( "storage", as.environment(loadM ) ))
if(identical(what, TRUE))
what <- objects(storage)
missingObjs <- !sapply(what, function(symb) exists(symb, envir = storage, inherits = FALSE))
if(any(missingObjs)) {
if(.botched) { # #nocov start
for(el in what[missingObjs])
assign(el, NULL, envir = storage)
}
else {
warning(gettextf("%s not found in module \"%s\"",
paste0('"', what[missingObjs], '"', collapse = ", "),
as.character(module)))
what <- what[!missingObjs]
} # #nocov end
}
assignAs <- .moduleNames(what)
for( i in seq_along(what) ) {
if(.botched)
assign(assignAs[[i]], NULL, envir = storage)
else
assign(assignAs[[i]], get(what[[i]], envir = storage), envir = env)
}
loadM
}
else { # create a load action to recall this function
myCall <- match.call()
f <- function(ns) NULL
myCall$env <- as.name("ns")
myCall$loadNow <- TRUE
body(f, envir = env) <- myCall
setLoadAction(f, where = env)
invisible(myCall) # #nocov
}
}
Rcpp/cleanup 0000755 0001762 0000144 00000003104 15030755601 012533 0 ustar ligges users #!/bin/sh
#cd inst/doc && rm -f index.html *.tex *.bbl *.blg *.aux *.out *.log && cd -
rm -f confdefs.h config.log config.status \
src/*.o src/*.so src/*.a src/*.d src/*.dll src/*.rc \
RcppSrc/*.o RcppSrc/*.a inst/Rcpp-version.txt \
inst/lib/libRcpp.so inst/lib/Rcpp*.h inst/lib/libRcpp.a \
inst/doc/*.cpp inst/doc/*.hpp \
inst/doc/*.out \
inst/doc/.build.timestamp \
inst/doc/*.Rd inst/doc/*.aux inst/doc/*.log inst/doc/*.tex \
inst/doc/latex/*.aux inst/doc/latex/*.log \
inst/examples/ConvolveBenchmarks/*.o \
inst/examples/ConvolveBenchmarks/*.so \
inst/examples/functionCallback/*.so \
inst/examples/functionCallback/*.o \
inst/examples/OpenMP/piWithInterrupts.o \
inst/examples/OpenMP/piWithInterrupts.so \
inst/discovery/cxx0x.Rout \
inst/unitTests/testRcppModule/src/*.o \
inst/unitTests/testRcppModule/src/*.so \
inst/unitTests/testRcppClass/src/*.o \
inst/unitTests/testRcppClass/src/*.so \
src/Makedeps libRcpp.a \
src/symbols.rds \
inst/unitTests/testRcppClass/src/symbols.rds \
vignettes/*.aux vignettes/*.log vignettes/*.out \
vignettes/*.tex vignettes/*.bbl vignettes/*.blg \
vignettes/*.toc vignettes/*.tpt vignettes/*.xwm
rm -rf autom4te.cache inst/lib/ inst/doc/man/ inst/doc/html/ inst/doc/latex/ \
inst/doc/auto inst/bib/auto inst/doc/Rcpp-*/auto/ src-* vignettes/auto
find . -name \*~ -exec rm {} \;
find . -name \*.flc -exec rm {} \;
(test -d vignettes/ && cd vignettes/ && test -f Makefile && make clean && cd -) >/dev/null
(test -d vignettes/rmd && cd vignettes/rmd/ && test -f Makefile && make clean && cd -) >/dev/null
Rcpp/vignettes/ 0000755 0001762 0000144 00000000000 15030755600 013167 5 ustar ligges users Rcpp/vignettes/Rcpp-FAQ.Rnw 0000644 0001762 0000144 00000000374 13555555203 015203 0 ustar ligges users \documentclass{article}
\usepackage{pdfpages}
%\VignetteIndexEntry{Rcpp-FAQ}
%\VignetteKeywords{Rcpp, FAQ, R, Cpp}
%\VignettePackage{Rcpp}
%\VignetteEncoding{UTF-8}
\begin{document}
\includepdf[pages=-, fitpaper=true]{pdf/Rcpp-FAQ.pdf}
\end{document}
Rcpp/vignettes/Rcpp-sugar.Rnw 0000644 0001762 0000144 00000000402 13555555203 015705 0 ustar ligges users \documentclass{article}
\usepackage{pdfpages}
%\VignetteIndexEntry{Rcpp-sugar}
%\VignetteKeywords{Rcpp, sugar, R, Cpp}
%\VignettePackage{Rcpp}
%\VignetteEncoding{UTF-8}
\begin{document}
\includepdf[pages=-, fitpaper=true]{pdf/Rcpp-sugar.pdf}
\end{document}
Rcpp/vignettes/Rcpp-package.Rnw 0000644 0001762 0000144 00000000410 13555555203 016156 0 ustar ligges users \documentclass{article}
\usepackage{pdfpages}
%\VignetteIndexEntry{Rcpp-package}
%\VignetteKeywords{Rcpp, package, R, Cpp}
%\VignettePackage{Rcpp}
%\VignetteEncoding{UTF-8}
\begin{document}
\includepdf[pages=-, fitpaper=true]{pdf/Rcpp-package.pdf}
\end{document}
Rcpp/vignettes/pdf/ 0000755 0001762 0000144 00000000000 15027252146 013743 5 ustar ligges users Rcpp/vignettes/pdf/Rcpp-attributes.pdf 0000644 0001762 0000144 00000317677 15030755311 017547 0 ustar ligges users %PDF-1.5
%
1 0 obj
<< /Type /ObjStm /Length 3676 /Filter /FlateDecode /N 61 /First 502 >>
stream
x[ko6B~h7%-v$yL3IYVu)I~ϥ$[lGN2-z$=<= zSBzSaYPY/P{ POXd)C$*O)O@Nzښg1 00AIY)Qsh=<Yk//"IRB7#)ʹO /IA%.t2P7)hCT6
<=t5[=5EPô@hH2hj).d)#$A4ZCЁe5
(/ddQde
YxB$kJoF"7Cd-z2/ǎ*U
x짛$Wiyw/IjfIq|cd^$?C{Wެۿ!Hb ۃK.
0Z1*q
ߴa||nʻH.:6/& w\8LJ˫qT0#d\9gi5Mi|U:EmOY}GC_{,+\0wղFx+7W\esUU7W\ms
ZYdZQ2Iztr 8.ߓg͡<^Vx OQc2E>>M*He/w3viUAGO>@͎Nut1]՚FMjGY;P
ƾEcϢgس0k=
۵_^V/Ң]ٻ ;< I\9%H