├── .Rbuildignore
├── .Rinstignore
├── .codecov.yml
├── .editorconfig
├── .gitattributes
├── .github
├── CONTRIBUTING.md
├── FUNDING.yml
├── ISSUE_TEMPLATE.md
├── PULL_REQUEST_TEMPLATE.md
└── workflows
│ ├── ci.yaml
│ ├── docker.yaml
│ ├── linuxarm.yaml
│ ├── macos.yaml
│ └── stale.yaml
├── .gitignore
├── ChangeLog
├── Contributing.md
├── DESCRIPTION
├── LICENSE
├── NAMESPACE
├── R
├── 00_classes.R
├── 01_show.R
├── 02_completion.R
├── 03_prompt.R
├── Attributes.R
├── Module.R
├── Rcpp.package.skeleton.R
├── RcppClass.R
├── RcppLdpath.R
├── bib.R
├── compilerCheck.R
├── exceptions.R
├── exposeClass.R
├── inline.R
├── loadModule.R
├── loadRcppModules.R
├── populate.R
├── tools.R
└── zzz.R
├── README.md
├── Rcpp.Rproj
├── TODO
├── cleanup
├── docker
├── ci-3.4
│ └── Dockerfile
├── ci-3.5
│ └── Dockerfile
├── ci-3.6
│ └── Dockerfile
├── ci-4.0
│ └── Dockerfile
├── ci-4.1
│ └── Dockerfile
├── ci-4.2
│ └── Dockerfile
├── ci-4.3
│ └── Dockerfile
├── ci-4.4
│ └── Dockerfile
├── ci-dev
│ └── Dockerfile
├── ci
│ └── Dockerfile
├── plus
│ └── Dockerfile
└── run
│ └── Dockerfile
├── doxyfile
├── inst
├── CITATION
├── NEWS.Rd
├── announce
│ ├── ANNOUNCE-0.10.0.txt
│ ├── ANNOUNCE-0.11.0.txt
│ ├── ANNOUNCE-0.6.0.txt
│ ├── ANNOUNCE-0.7.0.txt
│ ├── ANNOUNCE-0.8.0.txt
│ └── ANNOUNCE-0.9.0.txt
├── bib
│ └── Rcpp.bib
├── discovery
│ └── cxx0x.R
├── examples
│ ├── Attributes
│ │ ├── Depends.cpp
│ │ ├── Export.cpp
│ │ ├── cppFunction.R
│ │ └── sourceCpp.R
│ ├── ConvolveBenchmarks
│ │ ├── GNUmakefile
│ │ ├── buildAndRun.sh
│ │ ├── convolve10_cpp.cpp
│ │ ├── convolve10_cpp.h
│ │ ├── convolve11_cpp.cpp
│ │ ├── convolve12_cpp.cpp
│ │ ├── convolve13_cpp.cpp
│ │ ├── convolve14_cpp.cpp
│ │ ├── convolve2_c.c
│ │ ├── convolve3_cpp.cpp
│ │ ├── convolve4_cpp.cpp
│ │ ├── convolve5_cpp.cpp
│ │ ├── convolve7_c.c
│ │ ├── convolve8_cpp.cpp
│ │ ├── convolve9_cpp.cpp
│ │ ├── exampleRCode.r
│ │ ├── loopmacro.h
│ │ ├── overhead.r
│ │ ├── overhead.sh
│ │ ├── overhead_1.cpp
│ │ └── overhead_2.c
│ ├── FastLM
│ │ ├── benchmark.r
│ │ ├── benchmarkLongley.r
│ │ ├── fastLMviaArmadillo.r
│ │ ├── fastLMviaGSL.r
│ │ ├── lmArmadillo.R
│ │ └── lmGSL.R
│ ├── Misc
│ │ ├── fibonacci.r
│ │ ├── ifelseLooped.r
│ │ ├── newFib.r
│ │ ├── piBySimulation.r
│ │ └── piSugar.cpp
│ ├── OpenMP
│ │ ├── GNUmakefile
│ │ ├── OpenMPandInline.r
│ │ ├── check.R
│ │ └── piWithInterrupts.cpp
│ ├── RcppGibbs
│ │ ├── RcppGibbs.R
│ │ ├── RcppGibbs_Updated.R
│ │ └── timeRNGs.R
│ ├── RcppInline
│ │ ├── RObject.r
│ │ ├── RcppInlineExample.r
│ │ ├── RcppInlineWithLibsExamples.r
│ │ ├── RcppSimpleExample.r
│ │ ├── UncaughtExceptions.r
│ │ └── external_pointer.r
│ ├── SugarPerformance
│ │ ├── Timer.h
│ │ ├── Timertest.cpp
│ │ └── sugarBenchmarks.R
│ ├── functionCallback
│ │ ├── README
│ │ └── newApiExample.r
│ └── performance
│ │ ├── extractors.R
│ │ └── performance.R
├── include
│ ├── Rcpp.h
│ ├── Rcpp
│ │ ├── Benchmark
│ │ │ └── Timer.h
│ │ ├── DataFrame.h
│ │ ├── Dimension.h
│ │ ├── DottedPair.h
│ │ ├── DottedPairImpl.h
│ │ ├── Environment.h
│ │ ├── Extractor.h
│ │ ├── Fast.h
│ │ ├── Formula.h
│ │ ├── Function.h
│ │ ├── InputParameter.h
│ │ ├── InternalFunction.h
│ │ ├── InternalFunctionWithStdFunction.h
│ │ ├── Interrupt.h
│ │ ├── Language.h
│ │ ├── Light
│ │ ├── Lighter
│ │ ├── Lightest
│ │ ├── Module.h
│ │ ├── Na_Proxy.h
│ │ ├── Named.h
│ │ ├── Nullable.h
│ │ ├── Pairlist.h
│ │ ├── Promise.h
│ │ ├── RNGScope.h
│ │ ├── RObject.h
│ │ ├── Rcpp
│ │ ├── Reference.h
│ │ ├── Rmath.h
│ │ ├── S4.h
│ │ ├── StretchyList.h
│ │ ├── String.h
│ │ ├── StringTransformer.h
│ │ ├── Symbol.h
│ │ ├── Vector.h
│ │ ├── WeakReference.h
│ │ ├── XPtr.h
│ │ ├── algo.h
│ │ ├── algorithm.h
│ │ ├── api
│ │ │ ├── bones
│ │ │ │ ├── Date.h
│ │ │ │ ├── Datetime.h
│ │ │ │ ├── bones.h
│ │ │ │ └── wrap_extra_steps.h
│ │ │ └── meat
│ │ │ │ ├── DataFrame.h
│ │ │ │ ├── Date.h
│ │ │ │ ├── Datetime.h
│ │ │ │ ├── Dimension.h
│ │ │ │ ├── DottedPairImpl.h
│ │ │ │ ├── Environment.h
│ │ │ │ ├── Rcpp_eval.h
│ │ │ │ ├── S4.h
│ │ │ │ ├── StretchyList.h
│ │ │ │ ├── Vector.h
│ │ │ │ ├── as.h
│ │ │ │ ├── export.h
│ │ │ │ ├── is.h
│ │ │ │ ├── meat.h
│ │ │ │ ├── message.h
│ │ │ │ ├── module
│ │ │ │ └── Module.h
│ │ │ │ ├── protection.h
│ │ │ │ ├── proxy.h
│ │ │ │ └── wrap.h
│ │ ├── as.h
│ │ ├── barrier.h
│ │ ├── clone.h
│ │ ├── complex.h
│ │ ├── config.h
│ │ ├── date_datetime
│ │ │ ├── Date.h
│ │ │ ├── Datetime.h
│ │ │ ├── date_datetime.h
│ │ │ ├── newDateVector.h
│ │ │ ├── newDatetimeVector.h
│ │ │ ├── oldDateVector.h
│ │ │ └── oldDatetimeVector.h
│ │ ├── exceptions.h
│ │ ├── exceptions_impl.h
│ │ ├── grow.h
│ │ ├── hash
│ │ │ ├── IndexHash.h
│ │ │ ├── SelfHash.h
│ │ │ └── hash.h
│ │ ├── internal
│ │ │ ├── Exporter.h
│ │ │ ├── GreedyVector.h
│ │ │ ├── ListInitialization.h
│ │ │ ├── NAComparator.h
│ │ │ ├── NAEquals.h
│ │ │ ├── Proxy_Iterator.h
│ │ │ ├── SEXP_Iterator.h
│ │ │ ├── call.h
│ │ │ ├── caster.h
│ │ │ ├── converter.h
│ │ │ ├── export.h
│ │ │ ├── na.h
│ │ │ ├── r_coerce.h
│ │ │ ├── r_vector.h
│ │ │ ├── wrap.h
│ │ │ └── wrap_end.h
│ │ ├── iostream
│ │ │ └── Rstreambuf.h
│ │ ├── is.h
│ │ ├── lang.h
│ │ ├── lgrow.h
│ │ ├── longlong.h
│ │ ├── macros
│ │ │ ├── cat.hpp
│ │ │ ├── config.hpp
│ │ │ ├── debug.h
│ │ │ ├── dispatch.h
│ │ │ ├── interface.h
│ │ │ ├── macros.h
│ │ │ ├── module.h
│ │ │ ├── traits.h
│ │ │ ├── unroll.h
│ │ │ └── xp.h
│ │ ├── module
│ │ │ ├── CppFunction.h
│ │ │ ├── Module.h
│ │ │ ├── Module_Add_Property.h
│ │ │ ├── Module_Field.h
│ │ │ ├── Module_Property.h
│ │ │ ├── class.h
│ │ │ ├── class_Base.h
│ │ │ └── get_return_type.h
│ │ ├── platform
│ │ │ ├── compiler.h
│ │ │ └── solaris.h
│ │ ├── print.h
│ │ ├── protection
│ │ │ ├── Armor.h
│ │ │ ├── Shelter.h
│ │ │ ├── Shield.h
│ │ │ └── protection.h
│ │ ├── proxy
│ │ │ ├── AttributeProxy.h
│ │ │ ├── Binding.h
│ │ │ ├── DottedPairProxy.h
│ │ │ ├── FieldProxy.h
│ │ │ ├── GenericProxy.h
│ │ │ ├── NamesProxy.h
│ │ │ ├── ProtectedProxy.h
│ │ │ ├── RObjectMethods.h
│ │ │ ├── SlotProxy.h
│ │ │ ├── TagProxy.h
│ │ │ └── proxy.h
│ │ ├── r
│ │ │ ├── compat.h
│ │ │ └── headers.h
│ │ ├── r_cast.h
│ │ ├── routines.h
│ │ ├── sprintf.h
│ │ ├── stats
│ │ │ ├── beta.h
│ │ │ ├── binom.h
│ │ │ ├── cauchy.h
│ │ │ ├── chisq.h
│ │ │ ├── dpq
│ │ │ │ ├── dpq.h
│ │ │ │ └── macros.h
│ │ │ ├── exp.h
│ │ │ ├── f.h
│ │ │ ├── gamma.h
│ │ │ ├── geom.h
│ │ │ ├── hyper.h
│ │ │ ├── lnorm.h
│ │ │ ├── logis.h
│ │ │ ├── nbeta.h
│ │ │ ├── nbinom.h
│ │ │ ├── nbinom_mu.h
│ │ │ ├── nchisq.h
│ │ │ ├── nf.h
│ │ │ ├── norm.h
│ │ │ ├── nt.h
│ │ │ ├── pois.h
│ │ │ ├── random
│ │ │ │ ├── random.h
│ │ │ │ ├── rbeta.h
│ │ │ │ ├── rbinom.h
│ │ │ │ ├── rcauchy.h
│ │ │ │ ├── rchisq.h
│ │ │ │ ├── rexp.h
│ │ │ │ ├── rf.h
│ │ │ │ ├── rgamma.h
│ │ │ │ ├── rgeom.h
│ │ │ │ ├── rhyper.h
│ │ │ │ ├── rlnorm.h
│ │ │ │ ├── rlogis.h
│ │ │ │ ├── rnbinom.h
│ │ │ │ ├── rnbinom_mu.h
│ │ │ │ ├── rnchisq.h
│ │ │ │ ├── rnorm.h
│ │ │ │ ├── rpois.h
│ │ │ │ ├── rsignrank.h
│ │ │ │ ├── rt.h
│ │ │ │ ├── runif.h
│ │ │ │ ├── rweibull.h
│ │ │ │ └── rwilcox.h
│ │ │ ├── stats.h
│ │ │ ├── t.h
│ │ │ ├── unif.h
│ │ │ └── weibull.h
│ │ ├── storage
│ │ │ ├── NoProtectStorage.h
│ │ │ ├── PreserveStorage.h
│ │ │ └── storage.h
│ │ ├── sugar
│ │ │ ├── Range.h
│ │ │ ├── block
│ │ │ │ ├── SugarBlock_1.h
│ │ │ │ ├── SugarBlock_2.h
│ │ │ │ ├── SugarBlock_3.h
│ │ │ │ ├── SugarMath.h
│ │ │ │ ├── Vectorized_Math.h
│ │ │ │ └── block.h
│ │ │ ├── functions
│ │ │ │ ├── Lazy.h
│ │ │ │ ├── all.h
│ │ │ │ ├── any.h
│ │ │ │ ├── cbind.h
│ │ │ │ ├── clamp.h
│ │ │ │ ├── complex.h
│ │ │ │ ├── cummax.h
│ │ │ │ ├── cummin.h
│ │ │ │ ├── cumprod.h
│ │ │ │ ├── cumsum.h
│ │ │ │ ├── diff.h
│ │ │ │ ├── duplicated.h
│ │ │ │ ├── functions.h
│ │ │ │ ├── head.h
│ │ │ │ ├── ifelse.h
│ │ │ │ ├── is_finite.h
│ │ │ │ ├── is_infinite.h
│ │ │ │ ├── is_na.h
│ │ │ │ ├── is_nan.h
│ │ │ │ ├── lapply.h
│ │ │ │ ├── mapply.h
│ │ │ │ ├── mapply
│ │ │ │ │ ├── mapply_2.h
│ │ │ │ │ └── mapply_3.h
│ │ │ │ ├── match.h
│ │ │ │ ├── math.h
│ │ │ │ ├── max.h
│ │ │ │ ├── mean.h
│ │ │ │ ├── median.h
│ │ │ │ ├── min.h
│ │ │ │ ├── na_omit.h
│ │ │ │ ├── pmax.h
│ │ │ │ ├── pmin.h
│ │ │ │ ├── pow.h
│ │ │ │ ├── range.h
│ │ │ │ ├── rep.h
│ │ │ │ ├── rep_each.h
│ │ │ │ ├── rep_len.h
│ │ │ │ ├── rev.h
│ │ │ │ ├── rowSums.h
│ │ │ │ ├── sample.h
│ │ │ │ ├── sapply.h
│ │ │ │ ├── sd.h
│ │ │ │ ├── self_match.h
│ │ │ │ ├── seq_along.h
│ │ │ │ ├── setdiff.h
│ │ │ │ ├── sign.h
│ │ │ │ ├── strings
│ │ │ │ │ ├── collapse.h
│ │ │ │ │ ├── strings.h
│ │ │ │ │ └── trimws.h
│ │ │ │ ├── sum.h
│ │ │ │ ├── table.h
│ │ │ │ ├── tail.h
│ │ │ │ ├── unique.h
│ │ │ │ ├── var.h
│ │ │ │ ├── which_max.h
│ │ │ │ └── which_min.h
│ │ │ ├── logical
│ │ │ │ ├── SingleLogicalResult.h
│ │ │ │ ├── and.h
│ │ │ │ ├── can_have_na.h
│ │ │ │ ├── is.h
│ │ │ │ ├── logical.h
│ │ │ │ ├── not.h
│ │ │ │ └── or.h
│ │ │ ├── matrix
│ │ │ │ ├── as_vector.h
│ │ │ │ ├── col.h
│ │ │ │ ├── diag.h
│ │ │ │ ├── lower_tri.h
│ │ │ │ ├── matrix_functions.h
│ │ │ │ ├── outer.h
│ │ │ │ ├── row.h
│ │ │ │ ├── tools.h
│ │ │ │ └── upper_tri.h
│ │ │ ├── nona
│ │ │ │ └── nona.h
│ │ │ ├── operators
│ │ │ │ ├── Comparator.h
│ │ │ │ ├── Comparator_With_One_Value.h
│ │ │ │ ├── divides.h
│ │ │ │ ├── logical_operators__Vector__Vector.h
│ │ │ │ ├── logical_operators__Vector__primitive.h
│ │ │ │ ├── minus.h
│ │ │ │ ├── not.h
│ │ │ │ ├── operators.h
│ │ │ │ ├── plus.h
│ │ │ │ ├── r_binary_op.h
│ │ │ │ ├── times.h
│ │ │ │ └── unary_minus.h
│ │ │ ├── sets.h
│ │ │ ├── sugar.h
│ │ │ ├── sugar_forward.h
│ │ │ ├── tools
│ │ │ │ └── iterator.h
│ │ │ └── undoRmath.h
│ │ ├── traits
│ │ │ ├── char_type.h
│ │ │ ├── enable_if.h
│ │ │ ├── expands_to_logical.h
│ │ │ ├── get_na.h
│ │ │ ├── has_iterator.h
│ │ │ ├── has_na.h
│ │ │ ├── if_.h
│ │ │ ├── index_sequence.h
│ │ │ ├── init_type.h
│ │ │ ├── integral_constant.h
│ │ │ ├── is_arithmetic.h
│ │ │ ├── is_bool.h
│ │ │ ├── is_const.h
│ │ │ ├── is_convertible.h
│ │ │ ├── is_eigen_base.h
│ │ │ ├── is_finite.h
│ │ │ ├── is_infinite.h
│ │ │ ├── is_module_object.h
│ │ │ ├── is_na.h
│ │ │ ├── is_nan.h
│ │ │ ├── is_pointer.h
│ │ │ ├── is_primitive.h
│ │ │ ├── is_reference.h
│ │ │ ├── is_sugar_expression.h
│ │ │ ├── is_trivial.h
│ │ │ ├── is_wide_string.h
│ │ │ ├── longlong.h
│ │ │ ├── matrix_interface.h
│ │ │ ├── module_wrap_traits.h
│ │ │ ├── named_object.h
│ │ │ ├── num2type.h
│ │ │ ├── one_type.h
│ │ │ ├── r_sexptype_traits.h
│ │ │ ├── r_type_traits.h
│ │ │ ├── remove_const.h
│ │ │ ├── remove_const_and_reference.h
│ │ │ ├── remove_reference.h
│ │ │ ├── result_of.h
│ │ │ ├── same_type.h
│ │ │ ├── storage_type.h
│ │ │ ├── traits.h
│ │ │ ├── un_pointer.h
│ │ │ └── wrap_type_traits.h
│ │ ├── unwindProtect.h
│ │ ├── utils
│ │ │ ├── tinyformat.h
│ │ │ └── tinyformat
│ │ │ │ └── tinyformat.h
│ │ └── vector
│ │ │ ├── 00_forward_Vector.h
│ │ │ ├── 00_forward_proxy.h
│ │ │ ├── ChildVector.h
│ │ │ ├── DimNameProxy.h
│ │ │ ├── LazyVector.h
│ │ │ ├── ListOf.h
│ │ │ ├── Matrix.h
│ │ │ ├── MatrixBase.h
│ │ │ ├── MatrixColumn.h
│ │ │ ├── MatrixRow.h
│ │ │ ├── RangeIndexer.h
│ │ │ ├── SubMatrix.h
│ │ │ ├── Subsetter.h
│ │ │ ├── Vector.h
│ │ │ ├── VectorBase.h
│ │ │ ├── const_generic_proxy.h
│ │ │ ├── const_string_proxy.h
│ │ │ ├── converter.h
│ │ │ ├── generic_proxy.h
│ │ │ ├── instantiation.h
│ │ │ ├── no_init.h
│ │ │ ├── proxy.h
│ │ │ ├── string_proxy.h
│ │ │ ├── swap.h
│ │ │ ├── traits.h
│ │ │ └── vector_from_string.h
│ ├── RcppCommon.h
│ └── doxygen
│ │ └── Examples.h
├── prompt
│ └── module.Rd
├── skeleton
│ ├── Num.cpp
│ ├── Rcpp_modules_examples.Rd
│ ├── manual-page-stub.Rd
│ ├── rcpp_hello_world.R
│ ├── rcpp_hello_world.Rd
│ ├── rcpp_hello_world.cpp
│ ├── rcpp_hello_world.h
│ ├── rcpp_hello_world_attributes.cpp
│ ├── rcpp_module.cpp
│ ├── stdVector.cpp
│ └── zzz.R
└── tinytest
│ ├── bin
│ ├── amd64
│ │ └── r-cran-testrcpppackage_0.1.0-1_amd64.deb
│ └── i386
│ │ └── r-cran-testrcpppackage_0.1.0-1_i386.deb
│ ├── cpp
│ ├── DataFrame.cpp
│ ├── Environment.cpp
│ ├── Exceptions_nocall.cpp
│ ├── Function.cpp
│ ├── InternalFunction.cpp
│ ├── InternalFunctionCPP11.cpp
│ ├── ListOf.cpp
│ ├── Matrix.cpp
│ ├── Module.cpp
│ ├── RObject.cpp
│ ├── Reference.cpp
│ ├── S4.cpp
│ ├── String.cpp
│ ├── Subset.cpp
│ ├── Vector.cpp
│ ├── VectorOld.cpp
│ ├── XPtr.cpp
│ ├── algorithm.cpp
│ ├── as.cpp
│ ├── attributes.cpp
│ ├── attributes.hpp
│ ├── coerce.cpp
│ ├── dates.cpp
│ ├── dispatch.cpp
│ ├── embeddedR.cpp
│ ├── embeddedR2.cpp
│ ├── exceptions.cpp
│ ├── language.cpp
│ ├── misc.cpp
│ ├── modref.cpp
│ ├── na.cpp
│ ├── rcppversion.cpp
│ ├── rmath.cpp
│ ├── stack.cpp
│ ├── stats.cpp
│ ├── sugar.cpp
│ ├── support.cpp
│ ├── table.cpp
│ ├── wrap.cpp
│ └── wstring.cpp
│ ├── src
│ ├── r-cran-testrcpppackage_0.1.0-1.diff.gz
│ ├── r-cran-testrcpppackage_0.1.0-1.dsc
│ ├── r-cran-testrcpppackage_0.1.0-1_amd64.changes
│ ├── r-cran-testrcpppackage_0.1.0-1_amd64.deb
│ ├── r-cran-testrcpppackage_0.1.0-1_i386.changes
│ └── r-cran-testrcpppackage_0.1.0-1_i386.deb
│ ├── testRcppAttributePackage
│ ├── DESCRIPTION
│ ├── NAMESPACE
│ └── src
│ │ └── rcpp_test.cpp
│ ├── testRcppClass
│ ├── DESCRIPTION
│ ├── NAMESPACE
│ ├── R
│ │ ├── load.R
│ │ └── rcpp_hello_world.R
│ ├── man
│ │ ├── Rcpp_class_examples.Rd
│ │ ├── rcpp_hello_world.Rd
│ │ └── testRcppClass-package.Rd
│ ├── src
│ │ ├── Num.cpp
│ │ ├── init.c
│ │ ├── rcpp_hello_world.cpp
│ │ ├── rcpp_hello_world.h
│ │ ├── rcpp_module.cpp
│ │ └── stdVector.cpp
│ └── tests
│ │ └── classes.R
│ ├── testRcppInterfaceExporter
│ ├── DESCRIPTION
│ ├── NAMESPACE
│ ├── R
│ │ ├── RcppExports.R
│ │ └── exporter.R
│ ├── inst
│ │ └── include
│ │ │ ├── testRcppInterfaceExporter.h
│ │ │ └── testRcppInterfaceExporter_RcppExports.h
│ └── src
│ │ ├── RcppExports.cpp
│ │ ├── exporter.cpp
│ │ └── unwound.h
│ ├── testRcppInterfaceUser
│ ├── DESCRIPTION
│ ├── NAMESPACE
│ ├── R
│ │ └── user.R
│ ├── src
│ │ ├── config.h
│ │ ├── unwound.h
│ │ └── user.cpp
│ └── tests
│ │ └── tests.R
│ ├── testRcppModule
│ ├── DESCRIPTION
│ ├── NAMESPACE
│ ├── R
│ │ ├── rcpp_hello_world.R
│ │ └── zzz.R
│ ├── man
│ │ ├── Rcpp_modules_examples.Rd
│ │ ├── rcpp_hello_world.Rd
│ │ └── testRcppModule-package.Rd
│ ├── src
│ │ ├── Num.cpp
│ │ ├── init.c
│ │ ├── rcpp_hello_world.cpp
│ │ ├── rcpp_hello_world.h
│ │ ├── rcpp_module.cpp
│ │ └── stdVector.cpp
│ └── tests
│ │ └── modules.R
│ ├── testRcppPackage
│ ├── DESCRIPTION
│ ├── NAMESPACE
│ ├── R
│ │ └── rcpp_hello_world.R
│ ├── debian
│ │ ├── changelog
│ │ ├── compat
│ │ ├── control
│ │ ├── copyright
│ │ ├── rules
│ │ └── source
│ │ │ └── format
│ ├── man
│ │ └── testRcppPackage-package.Rd
│ └── src
│ │ ├── rcpp_hello_world.cpp
│ │ └── rcpp_hello_world.h
│ ├── test_algorithm.R
│ ├── test_as.R
│ ├── test_attribute_package.R
│ ├── test_attributes.R
│ ├── test_binary_package.R
│ ├── test_client_package.R
│ ├── test_coerce.R
│ ├── test_dataframe.R
│ ├── test_date.R
│ ├── test_dispatch.R
│ ├── test_embedded_r.R
│ ├── test_environments.R
│ ├── test_exceptions.R
│ ├── test_exceptions_nocall.R
│ ├── test_expose_class.R
│ ├── test_function.R
│ ├── test_global_rostream.R
│ ├── test_interface.R
│ ├── test_internal_function.R
│ ├── test_internal_function_cpp11.R
│ ├── test_language.R
│ ├── test_listof.R
│ ├── test_matrix.R
│ ├── test_misc.R
│ ├── test_modref.R
│ ├── test_module.R
│ ├── test_module_client_package.R
│ ├── test_na.R
│ ├── test_packageversion.R
│ ├── test_quickanddirty.R
│ ├── test_rcpp_package_skeleton.R
│ ├── test_reference.R
│ ├── test_rmath.R
│ ├── test_robject.R
│ ├── test_s4.R
│ ├── test_stack.R
│ ├── test_stats.R
│ ├── test_string.R
│ ├── test_subset.R
│ ├── test_sugar.R
│ ├── test_sugar_var.R
│ ├── test_support.R
│ ├── test_system.R
│ ├── test_table.R
│ ├── test_vector.R
│ ├── test_vector_old.R
│ ├── test_wrap.R
│ ├── test_wstring.R
│ └── test_xptr.R
├── local
├── README
└── THANKS
├── man
├── CppClass-class.Rd
├── CppConstructor-class.Rd
├── CppField-class.Rd
├── CppFunction-class.Rd
├── CppObject-class.Rd
├── CppOverloadedMethods-class.Rd
├── DollarNames-methods.Rd
├── Module-class.Rd
├── Module.Rd
├── Rcpp-deprecated.Rd
├── Rcpp-internal.Rd
├── Rcpp-package.Rd
├── Rcpp.package.skeleton.Rd
├── Rcpp.plugin.maker.Rd
├── RcppLdFlags.Rd
├── RcppUnitTests.Rd
├── compileAttributes.Rd
├── compilerCheck.Rd
├── cppFunction.Rd
├── demangle.Rd
├── dependsAttribute.Rd
├── evalCpp.Rd
├── exportAttribute.Rd
├── exposeClass.Rd
├── formals.Rd
├── getRcppVersion.Rd
├── interfacesAttribute.Rd
├── loadModule.Rd
├── loadRcppModules-deprecated.Rd
├── pluginsAttribute.Rd
├── populate.Rd
├── registerPlugin.Rd
├── setRcppClass.Rd
└── sourceCpp.Rd
├── src
├── Makevars
├── Makevars.win
├── api.cpp
├── attributes.cpp
├── barrier.cpp
├── date.cpp
├── internal.h
├── module.cpp
└── rcpp_init.cpp
├── tests
└── tinytest.R
└── vignettes
├── .gitignore
├── Makefile
├── Rcpp-FAQ.Rnw
├── Rcpp-FAQ.pdf
├── Rcpp-attributes.Rnw
├── Rcpp-attributes.pdf
├── Rcpp-extending.Rnw
├── Rcpp-extending.pdf
├── Rcpp-introduction.Rnw
├── Rcpp-introduction.pdf
├── Rcpp-jss-2011.Rnw
├── Rcpp-jss-2011.pdf
├── Rcpp-libraries.Rnw
├── Rcpp-libraries.pdf
├── Rcpp-modules.Rnw
├── Rcpp-modules.pdf
├── Rcpp-package.Rnw
├── Rcpp-package.pdf
├── Rcpp-quickref.Rnw
├── Rcpp-quickref.pdf
├── Rcpp-sugar.Rnw
├── Rcpp-sugar.pdf
├── pdf
├── Rcpp-FAQ.pdf
├── Rcpp-attributes.pdf
├── Rcpp-extending.pdf
├── Rcpp-introduction.pdf
├── Rcpp-jss-2011.pdf
├── Rcpp-libraries.pdf
├── Rcpp-modules.pdf
├── Rcpp-package.pdf
├── Rcpp-quickref.pdf
└── Rcpp-sugar.pdf
└── rmd
├── .install_extras
├── Makefile
├── Rcpp-FAQ.Rmd
├── Rcpp-attributes.Rmd
├── Rcpp-extending.Rmd
├── Rcpp-introduction.Rmd
├── Rcpp-jss-2011.Rnw
├── Rcpp-libraries.Rmd
├── Rcpp-modules.Rmd
├── Rcpp-package.Rmd
├── Rcpp-quickref.Rmd
├── Rcpp-sugar.Rmd
├── Rcpp.bib
├── figures
├── bootstrap.pdf
├── dist_graphs-1.pdf
├── function_annotation_cpp.png
└── samplePkg-files-light-bg.png
├── getCurrentVersionsOfCitedPackages.R
├── jss.bst
└── notyet
├── Rcpp-api.Rnw
└── Rcpp-unitTests.Rnw
/.Rbuildignore:
--------------------------------------------------------------------------------
1 | debian
2 | inst/doc/html
3 | inst/doc/latex
4 | inst/doc/man
5 | inst/doc/jss.bst
6 | vignettes/jss.bst
7 | ^.*\.Rproj$
8 | ^\.Rproj\.user$
9 | vignettes/notyet
10 | doxyfile
11 | \.travis\.yml
12 | \.dir-locals\.el
13 | \.clang_format
14 | vignettes/getCurrentVersionsOfCitedPackages.R
15 | ^Contributing.md$
16 | ^\.codecov\.yml$
17 | inst/include/Rcpp.h.new
18 | inst/include/Rcpp.h.old
19 | LICENSE
20 | .*\.tar\.gz$
21 | \.editorconfig
22 | docker
23 | ^GPATH
24 | ^GRTAGS
25 | ^GTAGS
26 | ^local
27 | vignettes/Makefile
28 | vignettes/rmd
29 | \.github
30 | ^issue.*\.md
31 | ^note.*\.md
32 | \.vscode
33 |
--------------------------------------------------------------------------------
/.Rinstignore:
--------------------------------------------------------------------------------
1 | inst/doc/Makefile
2 | inst/doc/jss.bst
3 | inst/doc/RJournal.sty
4 | inst/unitTests/src
5 |
--------------------------------------------------------------------------------
/.codecov.yml:
--------------------------------------------------------------------------------
1 | comment: false
2 | coverage:
3 | status:
4 | project:
5 | default:
6 | target: 70% # the (on purpose low) required coverage value
7 | threshold: 2% # the permitted delta in hitting the target
8 | patch:
9 | default:
10 | target: 0% # the (on purpose low) required coverage value
11 |
12 | # layout: "header, diff, tree, changes"
13 | # behavior: default
14 | # require_changes: false # if true: only post the comment if coverage changes
15 | # branches: null
16 | # flags: null
17 | # paths: null
18 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig is awesome: http://EditorConfig.org
2 |
3 | # top-most EditorConfig file
4 | root = true
5 |
6 | # Unix-style newlines with a newline ending every file
7 | [*]
8 | end_of_line = lf
9 | insert_final_newline = true
10 | trim_trailing_whitespace = true
11 |
12 | # Matches multiple files with brace expansion notation
13 | # 4 space indentation
14 | [*.{c,cpp,h,hpp,R,r}]
15 | indent_style = space
16 | indent_size = 4
17 |
18 | # Tab indentation (no size specified)
19 | [Makefile]
20 | indent_style = tab
21 |
22 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | ChangeLog merge=union
2 | inst/NEWS.Rd merge=union
3 |
4 | # gitattribute override for linguist
5 | *.h linguist-language=C++
6 |
--------------------------------------------------------------------------------
/.github/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 |
2 | ### Contributing to Rcpp
3 |
4 | Please see the file [Contributing](https://github.com/RcppCore/Rcpp/blob/master/Contributing.md) for details on
5 |
6 | - how to report an issue: a [Minimally Complete (and) Verifiable Example (MCVE)](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) helps a lot;
7 | - how to submit a pull request: post an issue first, get consensus about _what_ and _how_;
8 | - how to follow our (informal) coding style: simply do as other files do and do not invent a new style;
9 | - how to be nice and add [ChangeLog](https://github.com/RcppCore/Rcpp/blob/master/ChangeLog) and [NEWS.Rd](https://github.com/RcppCore/Rcpp/blob/master/ChangeLog).
10 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | github: eddelbuettel
2 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
2 | ### Reporting an Issue
3 |
4 | Make use of the *Preview* tab just above!
5 |
6 | #### Before filing an issue with Rcpp, please ensure that you
7 |
8 | - searched the mailing list archives for the [rcpp-devel](https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel) list for the question you want to ask about; you can do this at at Google with the `site:` qualifier as in this simple example: `site:lists.r-forge.r-project.org rcpp-devel how do I declare a const vector`;
9 |
10 | - searched the [StackOverflow](https://stackoverflow.com/) `[rcpp]` tag _e.g._ via `[rcpp] how do I sample a vector`;
11 |
12 | - searched existing [GitHub issues](https://github.com/RcppCore/Rcpp/issues) which can be searched among open and closed ones;
13 |
14 | - read the [Contributing](https://github.com/RcppCore/Rcpp/blob/master/Contributing.md) page for details on preferred reporting and style;
15 |
16 | If you have the above, remove the text above and provide a [Minimally Complete and Verifiable Example (MCVE)](https://stackoverflow.com/help/minimal-reproducible-example), the output of `sessionInfo()` plus relevant information about the C++ compiler. All this takes a little bit of effort---but greatly increases your chances of getting an applicable and helpful follow-up in return.
17 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
2 | ### Pull Request Template for Rcpp
3 |
4 | Please explain the changes you want to apply to Rcpp, preferably in an issue ticket **before** you create a pull request. See the file [Contributing](https://github.com/RcppCore/Rcpp/blob/master/Contributing.md) and the other templates for details.
5 |
6 | #### Checklist
7 |
8 | - [ ] Code compiles correctly
9 | - [ ] `R CMD check` still passes all tests
10 | - [ ] Preferably, new tests were added which fail without the change
11 | - [ ] Document the changes by file in [ChangeLog](https://github.com/RcppCore/Rcpp/blob/master/ChangeLog)
12 |
--------------------------------------------------------------------------------
/.github/workflows/linuxarm.yaml:
--------------------------------------------------------------------------------
1 | # Run CI for R using https://eddelbuettel.github.io/r-ci/
2 |
3 | name: linuxarm
4 |
5 | on:
6 | #push:
7 | #pull_request:
8 | workflow_dispatch:
9 |
10 | env:
11 | _R_CHECK_FORCE_SUGGESTS_: "false"
12 |
13 | jobs:
14 | ci:
15 | strategy:
16 | matrix:
17 | include:
18 | #- {os: ubuntu-latest}
19 | - {os: ubuntu-24.04-arm}
20 |
21 | runs-on: ${{ matrix.os }}
22 |
23 | steps:
24 | - name: Checkout
25 | uses: actions/checkout@v4
26 |
27 | - name: Setup
28 | uses: eddelbuettel/github-actions/r-ci@master
29 |
30 | - name: Dependencies
31 | run: ./run.sh install_deps
32 |
33 | - name: Test
34 | run: ./run.sh run_tests
35 |
36 | #- name: Coverage
37 | # if: ${{ matrix.os == 'ubuntu-latest' }}
38 | # run: ./run.sh coverage
39 |
--------------------------------------------------------------------------------
/.github/workflows/macos.yaml:
--------------------------------------------------------------------------------
1 | # Run CI for R using https://eddelbuettel.github.io/r-ci/
2 |
3 | name: macos
4 |
5 | on:
6 | push:
7 | pull_request:
8 |
9 | env:
10 | _R_CHECK_FORCE_SUGGESTS_: "false"
11 |
12 | jobs:
13 | ci:
14 | strategy:
15 | matrix:
16 | include:
17 | - {os: macos-latest}
18 | - {os: macos-13}
19 | #- {os: ubuntu-latest}
20 | #- {os: ubuntu-24.04-arm}
21 |
22 | runs-on: ${{ matrix.os }}
23 |
24 | steps:
25 | - name: Checkout
26 | uses: actions/checkout@v4
27 |
28 | - name: Setup
29 | uses: eddelbuettel/github-actions/r-ci@master
30 |
31 | - name: Dependencies
32 | run: ./run.sh install_deps
33 |
34 | - name: Test
35 | run: ./run.sh run_tests
36 |
37 | #- name: Coverage
38 | # if: ${{ matrix.os == 'ubuntu-latest' }}
39 | # run: ./run.sh coverage
40 |
--------------------------------------------------------------------------------
/.github/workflows/stale.yaml:
--------------------------------------------------------------------------------
1 | # Mark stale issues and pull requests
2 | # cf https://github.com/actions/stale
3 |
4 | name: stale
5 |
6 | on:
7 | schedule:
8 | - cron: "11 1 * * 6"
9 |
10 | jobs:
11 | stale:
12 | runs-on: ubuntu-latest
13 | steps:
14 | - uses: actions/stale@v8
15 | with:
16 | repo-token: ${{ secrets.GITHUB_TOKEN }}
17 | stale-issue-label: 'no-issue-activity'
18 | stale-pr-label: 'no-pr-activity'
19 | days-before-stale: 365
20 | days-before-close: 31
21 | stale-issue-message: >
22 | This issue is stale (365 days without activity) and will be closed
23 | in 31 days unless new activity is seen. Please feel free to re-open
24 | it is still a concern, possibly with additional data.
25 | stale-pr-message: >
26 | This pull request is is stale (365 days without activity) and will
27 | be closed in 31 days unless new activity is seen. Please feel free
28 | to open a new issue to discuss a fresh approach.
29 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | inst/lib
2 | .Rproj.user
3 | src/*.o
4 | src/*.so
5 | src/*.dll
6 | src/symbols.rds
7 | .Rhistory
8 | .RData
9 | .DS_Store
10 |
11 | ## QtCreator
12 | Rcpp.pro
13 | Rcpp.pro.user
14 | *.autosave
15 | .#*
16 |
17 | *.tar.gz
18 |
19 | vignettes/*_cache
20 |
21 | ## GNU global
22 | GPATH
23 | GRTAGS
24 | GTAGS
25 |
26 | ##
27 | local/
28 |
29 | ## docker helpers
30 | docker/*sh
31 | docker/*/*.sh
32 |
33 | ## Emacs
34 | *~
35 |
36 | ## VSCode
37 | .vscode/
38 |
--------------------------------------------------------------------------------
/NAMESPACE:
--------------------------------------------------------------------------------
1 | useDynLib(Rcpp, .registration = TRUE)
2 |
3 | import(methods)
4 | importFrom(utils, capture.output, assignInNamespace, .DollarNames, prompt,
5 | packageDescription, package.skeleton, glob2rx)
6 |
7 | exportClasses(Module, "C++Field",
8 | "C++OverloadedMethods",
9 | "C++Constructor",
10 | "C++Class", "C++Object", "C++Function")
11 |
12 | S3method(.DollarNames, "C++Object")
13 | S3method(.DollarNames, "Module")
14 | exportMethods(prompt, show, .DollarNames, initialize, "formals<-")
15 |
16 | export(Module,
17 | Rcpp.package.skeleton,
18 | populate,
19 | loadRcppModules, # deprecated since Rcpp 0.12.5 released May 2016
20 | setRcppClass,
21 | loadRcppClass,
22 | loadModule,
23 | cppFunction,
24 | exposeClass,
25 | evalCpp,
26 | sourceCpp,
27 | compileAttributes,
28 | registerPlugin,
29 | RcppLdFlags, # deprecated since Rcpp 0.12.19 released Sep 2018
30 | LdFlags, # deprecated since Rcpp 0.12.19 released Sep 2018
31 | demangle,
32 | sizeof,
33 | cpp_object_initializer,
34 | cpp_object_dummy,
35 | Rcpp.plugin.maker,
36 | getRcppVersion
37 | )
38 | S3method(print, bytes)
39 | S3method(format, Rcpp_stack_trace)
40 | S3method(str, Rcpp_stack_trace)
41 | S3method(print, Rcpp_stack_trace)
42 | exportClass(RcppClass)
43 |
--------------------------------------------------------------------------------
/R/bib.R:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2010 - 2017 Dirk Eddelbuettel and Romain Francois
2 | #
3 | # This file is part of Rcpp.
4 | #
5 | # Rcpp is free software: you can redistribute it and/or modify it
6 | # under the terms of the GNU General Public License as published by
7 | # the Free Software Foundation, either version 2 of the License, or
8 | # (at your option) any later version.
9 | #
10 | # Rcpp is distributed in the hope that it will be useful, but
11 | # WITHOUT ANY WARRANTY; without even the implied warranty of
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | # GNU General Public License for more details.
14 | #
15 | # You should have received a copy of the GNU General Public License
16 | # along with Rcpp. If not, see .
17 |
18 | bib <- function() {
19 | sub("\\.bib$", "", system.file("bib", "Rcpp.bib", package = "Rcpp"))
20 | }
21 |
--------------------------------------------------------------------------------
/R/populate.R:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2010 - 2011 John Chambers, Dirk Eddelbuettel and Romain Francois
2 | #
3 | # This file is part of Rcpp.
4 | #
5 | # Rcpp is free software: you can redistribute it and/or modify it
6 | # under the terms of the GNU General Public License as published by
7 | # the Free Software Foundation, either version 2 of the License, or
8 | # (at your option) any later version.
9 | #
10 | # Rcpp is distributed in the hope that it will be useful, but
11 | # WITHOUT ANY WARRANTY; without even the implied warranty of
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | # GNU General Public License for more details.
14 | #
15 | # You should have received a copy of the GNU General Public License
16 | # along with Rcpp. If not, see .
17 |
18 | populate <- function( module, env ){
19 |
20 | # make sure the module is loaded
21 | module <- Module( module, mustStart = TRUE )
22 |
23 | storage <- get( "storage", as.environment(module ) )
24 | symbols <- ls( storage )
25 |
26 | is_ns <- isNamespace( env )
27 | for( x in symbols ){
28 | forceAssignInNamespace( x, storage[[x]], env )
29 | }
30 | }
31 |
32 |
--------------------------------------------------------------------------------
/R/zzz.R:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2009 - 2016 Dirk Eddelbuettel and Romain Francois
2 | #
3 | # This file is part of Rcpp.
4 | #
5 | # Rcpp is free software: you can redistribute it and/or modify it
6 | # under the terms of the GNU General Public License as published by
7 | # the Free Software Foundation, either version 2 of the License, or
8 | # (at your option) any later version.
9 | #
10 | # Rcpp is distributed in the hope that it will be useful, but
11 | # WITHOUT ANY WARRANTY; without even the implied warranty of
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | # GNU General Public License for more details.
14 | #
15 | # You should have received a copy of the GNU General Public License
16 | # along with Rcpp. If not, see .
17 |
18 | .dummyInstancePointer <- new.env() # just something permanent
19 |
20 | .classes_map <- new.env()
21 |
22 | .onLoad <- function(libname, pkgname){
23 | new_dummyObject(.dummyInstancePointer) # nocov
24 | }
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Rcpp.Rproj:
--------------------------------------------------------------------------------
1 | Version: 1.0
2 |
3 | RestoreWorkspace: Default
4 | SaveWorkspace: Default
5 | AlwaysSaveHistory: Default
6 |
7 | EnableCodeIndexing: Yes
8 | UseSpacesForTab: Yes
9 | NumSpacesForTab: 4
10 | Encoding: UTF-8
11 |
12 | RnwWeave: Sweave
13 | LaTeX: pdfLaTeX
14 |
15 | AutoAppendNewline: Yes
16 | StripTrailingWhitespace: Yes
17 |
18 | BuildType: Package
19 | PackageInstallArgs: --no-multiarch --with-keep.source
20 |
--------------------------------------------------------------------------------
/docker/ci-3.4/Dockerfile:
--------------------------------------------------------------------------------
1 | ## Emacs, make this -*- mode: sh; -*-
2 |
3 | FROM r-base:3.4.4
4 |
5 | LABEL org.label-schema.license="GPL-2.0" \
6 | org.label-schema.vcs-url="https://github.com/RcppCore/Rcpp" \
7 | maintainer="Dirk Eddelbuettel "
8 |
9 | RUN apt-get update \
10 | && apt-get install -y --no-install-recommends \
11 | git \
12 | && install.r inline pkgKitten rbenchmark tinytest
13 |
14 | ENV _R_CHECK_FORCE_SUGGESTS_ FALSE
15 | ENV _R_CHECK_TESTS_NLINES_ 0
16 | ENV RunAllRcppTests yes
17 |
18 | CMD ["bash"]
19 |
--------------------------------------------------------------------------------
/docker/ci-3.5/Dockerfile:
--------------------------------------------------------------------------------
1 | ## Emacs, make this -*- mode: sh; -*-
2 |
3 | FROM r-base:3.5.3
4 |
5 | LABEL org.label-schema.license="GPL-2.0" \
6 | org.label-schema.vcs-url="https://github.com/RcppCore/Rcpp" \
7 | maintainer="Dirk Eddelbuettel "
8 |
9 | RUN apt-get update \
10 | && apt-get install -y --no-install-recommends git \
11 | && install.r inline pkgKitten rbenchmark tinytest
12 |
13 | ENV _R_CHECK_FORCE_SUGGESTS_ FALSE
14 | ENV _R_CHECK_TESTS_NLINES_ 0
15 | ENV RunAllRcppTests yes
16 |
17 | CMD ["bash"]
18 |
--------------------------------------------------------------------------------
/docker/ci-3.6/Dockerfile:
--------------------------------------------------------------------------------
1 | ## Emacs, make this -*- mode: sh; -*-
2 |
3 | FROM r-base:3.6.3
4 |
5 | LABEL org.label-schema.license="GPL-2.0" \
6 | org.label-schema.vcs-url="https://github.com/RcppCore/Rcpp" \
7 | maintainer="Dirk Eddelbuettel "
8 |
9 | RUN apt-get update \
10 | && apt-get install -y --no-install-recommends git \
11 | && install.r inline pkgKitten rbenchmark tinytest
12 |
13 | ENV _R_CHECK_FORCE_SUGGESTS_ FALSE
14 | ENV _R_CHECK_TESTS_NLINES_ 0
15 | ENV RunAllRcppTests yes
16 |
17 | CMD ["bash"]
18 |
--------------------------------------------------------------------------------
/docker/ci-4.0/Dockerfile:
--------------------------------------------------------------------------------
1 | ## Emacs, make this -*- mode: sh; -*-
2 |
3 | FROM r-base:4.0.5
4 |
5 | LABEL org.label-schema.license="GPL-2.0" \
6 | org.label-schema.vcs-url="https://github.com/RcppCore/Rcpp" \
7 | maintainer="Dirk Eddelbuettel "
8 |
9 | RUN apt-get update \
10 | && apt-get install -y --no-install-recommends git \
11 | && install.r inline pkgKitten rbenchmark tinytest
12 |
13 | ENV _R_CHECK_FORCE_SUGGESTS_ FALSE
14 | ENV _R_CHECK_TESTS_NLINES_ 0
15 | ENV RunAllRcppTests yes
16 |
17 | CMD ["bash"]
18 |
--------------------------------------------------------------------------------
/docker/ci-4.1/Dockerfile:
--------------------------------------------------------------------------------
1 | ## Emacs, make this -*- mode: sh; -*-
2 |
3 | FROM r-base:4.1.3
4 |
5 | LABEL org.label-schema.license="GPL-2.0" \
6 | org.label-schema.vcs-url="https://github.com/RcppCore/Rcpp" \
7 | maintainer="Dirk Eddelbuettel "
8 |
9 | RUN apt-get update \
10 | && apt-get install -y --no-install-recommends git \
11 | && install.r inline pkgKitten rbenchmark tinytest
12 |
13 | ENV _R_CHECK_FORCE_SUGGESTS_ FALSE
14 | ENV _R_CHECK_TESTS_NLINES_ 0
15 | ENV RunAllRcppTests yes
16 |
17 | CMD ["bash"]
18 |
--------------------------------------------------------------------------------
/docker/ci-4.2/Dockerfile:
--------------------------------------------------------------------------------
1 | ## Emacs, make this -*- mode: sh; -*-
2 |
3 | FROM r-base:4.2.3
4 |
5 | LABEL org.label-schema.license="GPL-2.0" \
6 | org.label-schema.vcs-url="https://github.com/RcppCore/Rcpp" \
7 | maintainer="Dirk Eddelbuettel "
8 |
9 | RUN apt-get update \
10 | && apt-get install -y --no-install-recommends git \
11 | && install.r inline pkgKitten rbenchmark tinytest
12 |
13 | ENV _R_CHECK_FORCE_SUGGESTS_ FALSE
14 | ENV _R_CHECK_TESTS_NLINES_ 0
15 | ENV RunAllRcppTests yes
16 |
17 | CMD ["bash"]
18 |
--------------------------------------------------------------------------------
/docker/ci-4.3/Dockerfile:
--------------------------------------------------------------------------------
1 | ## Emacs, make this -*- mode: sh; -*-
2 |
3 | FROM r-base:4.3.3
4 |
5 | LABEL org.label-schema.license="GPL-2.0" \
6 | org.label-schema.vcs-url="https://github.com/RcppCore/Rcpp" \
7 | maintainer="Dirk Eddelbuettel "
8 |
9 | RUN apt-get update \
10 | && apt-get install -y --no-install-recommends git \
11 | && install.r inline pkgKitten rbenchmark tinytest
12 |
13 | ENV _R_CHECK_FORCE_SUGGESTS_ FALSE
14 | ENV _R_CHECK_TESTS_NLINES_ 0
15 | ENV RunAllRcppTests yes
16 |
17 | CMD ["bash"]
18 |
--------------------------------------------------------------------------------
/docker/ci-4.4/Dockerfile:
--------------------------------------------------------------------------------
1 | ## Emacs, make this -*- mode: sh; -*-
2 |
3 | FROM r-base:4.4.3
4 |
5 | LABEL org.label-schema.license="GPL-2.0" \
6 | org.label-schema.vcs-url="https://github.com/RcppCore/Rcpp" \
7 | maintainer="Dirk Eddelbuettel "
8 |
9 | RUN apt-get update \
10 | && apt-get install -y --no-install-recommends git \
11 | && install.r inline pkgKitten rbenchmark tinytest
12 |
13 | ENV _R_CHECK_FORCE_SUGGESTS_=FALSE
14 | ENV _R_CHECK_TESTS_NLINES_=0
15 | ENV RunAllRcppTests=yes
16 |
17 | CMD ["bash"]
18 |
--------------------------------------------------------------------------------
/docker/ci-dev/Dockerfile:
--------------------------------------------------------------------------------
1 | ## Emacs, make this -*- mode: sh; -*-
2 |
3 | FROM rocker/drd
4 |
5 | LABEL org.label-schema.license="GPL-2.0" \
6 | org.label-schema.vcs-url="https://github.com/RcppCore/Rcpp" \
7 | maintainer="Dirk Eddelbuettel "
8 |
9 | RUN rm -f /etc/apt/sources.list.d/experimental.list \
10 | && apt update -y \
11 | && apt install -y --no-install-recommends git \
12 | && RDscript -e 'install.packages(c("codetools", "inline", "pkgKitten", "rbenchmark", "tinytest"))'
13 |
14 | ENV _R_CHECK_FORCE_SUGGESTS_ FALSE
15 | ENV _R_CHECK_TESTS_NLINES_ 0
16 | ENV RunAllRcppTests yes
17 |
18 | CMD ["bash"]
19 |
--------------------------------------------------------------------------------
/docker/ci/Dockerfile:
--------------------------------------------------------------------------------
1 | ## Emacs, make this -*- mode: sh; -*-
2 |
3 | FROM rocker/r2u:latest
4 |
5 | LABEL org.label-schema.license="GPL-2.0" \
6 | org.label-schema.vcs-url="https://github.com/RcppCore/Rcpp" \
7 | maintainer="Dirk Eddelbuettel "
8 |
9 | RUN apt-get update \
10 | && apt-get install -y --no-install-recommends \
11 | libcurl4-openssl-dev \
12 | libssl-dev \
13 | r-cran-covr \
14 | r-cran-inline \
15 | r-cran-pkgkitten \
16 | r-cran-tinytest \
17 | r-cran-xml2 \
18 | git \
19 | && install.r rbenchmark
20 |
21 | ENV _R_CHECK_FORCE_SUGGESTS_ FALSE
22 | ENV _R_CHECK_TESTS_NLINES_ 0
23 | ENV RunAllRcppTests yes
24 |
25 | CMD ["bash"]
26 |
--------------------------------------------------------------------------------
/docker/plus/Dockerfile:
--------------------------------------------------------------------------------
1 | ## Emacs, make this -*- mode: sh; -*-
2 |
3 | FROM rcpp/run
4 |
5 | LABEL org.label-schema.license="GPL-2.0" \
6 | org.label-schema.vcs-url="https://github.com/RcppCore/Rcpp" \
7 | maintainer="Dirk Eddelbuettel "
8 |
9 | RUN apt-get update \
10 | && apt-get install -y --no-install-recommends \
11 | r-cran-bh \
12 | r-cran-bit64 \
13 | r-cran-curl \
14 | r-cran-httr \
15 | r-cran-knitr \
16 | r-cran-lazyeval \
17 | r-cran-microbenchmark \
18 | r-cran-openssl \
19 | r-cran-pinp \
20 | r-cran-rcpparmadillo \
21 | r-cran-rcppeigen \
22 | r-cran-rcppgsl \
23 | r-cran-rmarkdown \
24 | r-cran-runit \
25 | r-cran-withr
26 |
27 | CMD ["bash"]
28 |
--------------------------------------------------------------------------------
/docker/run/Dockerfile:
--------------------------------------------------------------------------------
1 | ## Emacs, make this -*- mode: sh; -*-
2 |
3 | FROM rcpp/ci
4 |
5 | LABEL org.label-schema.license="GPL-2.0" \
6 | org.label-schema.vcs-url="https://github.com/RcppCore/Rcpp" \
7 | maintainer="Dirk Eddelbuettel "
8 |
9 | ## If on CRAN, install the latest version from CRAN
10 | RUN install.r Rcpp
11 |
12 | ## Alternatively, install from Github (after first installing remotes)
13 | #RUN install.r remotes && installGithub.r RcppCore/Rcpp
14 |
15 | CMD ["bash"]
16 |
--------------------------------------------------------------------------------
/inst/examples/Attributes/Depends.cpp:
--------------------------------------------------------------------------------
1 |
2 | // [[Rcpp::depends(RcppArmadillo)]]
3 |
4 | #include
5 |
6 | using namespace Rcpp;
7 |
8 | // [[Rcpp::export]]
9 | List fastLm(NumericVector yr, NumericMatrix Xr) {
10 |
11 | int n = Xr.nrow(), k = Xr.ncol();
12 |
13 | arma::mat X(Xr.begin(), n, k, false); // reuses memory and avoids extra copy
14 | arma::colvec y(yr.begin(), yr.size(), false);
15 |
16 | arma::colvec coef = arma::solve(X, y); // fit model y ~ X
17 | arma::colvec resid = y - X*coef; // residuals
18 |
19 | double sig2 = arma::as_scalar( arma::trans(resid)*resid/(n-k) );
20 | // std.error of estimate
21 | arma::colvec stderrest = arma::sqrt(
22 | sig2 * arma::diagvec( arma::inv(arma::trans(X)*X)) );
23 |
24 | return List::create(Named("coefficients") = coef,
25 | Named("stderr") = stderrest
26 | );
27 | }
28 |
29 |
--------------------------------------------------------------------------------
/inst/examples/Attributes/Export.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include
3 |
4 | using namespace Rcpp;
5 |
6 | // [[Rcpp::export]]
7 | int fibonacci(const int x) {
8 |
9 | if (x == 0) return(0);
10 | if (x == 1) return(1);
11 |
12 | return (fibonacci(x - 1)) + fibonacci(x - 2);
13 | }
14 |
15 |
16 | // [[Rcpp::export("convolveCpp")]]
17 | NumericVector convolve(NumericVector a, NumericVector b) {
18 |
19 | int na = a.size(), nb = b.size();
20 | int nab = na + nb - 1;
21 | NumericVector xab(nab);
22 |
23 | for (int i = 0; i < na; i++)
24 | for (int j = 0; j < nb; j++)
25 | xab[i + j] += a[i] * b[j];
26 |
27 | return xab;
28 | }
29 |
30 |
31 | // [[Rcpp::export]]
32 | List lapplyCpp(List input, Function f) {
33 |
34 | List output(input.size());
35 |
36 | std::transform(input.begin(), input.end(), output.begin(), f);
37 | output.names() = input.names();
38 |
39 | return output;
40 | }
41 |
--------------------------------------------------------------------------------
/inst/examples/Attributes/sourceCpp.R:
--------------------------------------------------------------------------------
1 |
2 | library(Rcpp)
3 |
4 | sourceCpp("Export.cpp")
5 | fibonacci(5)
6 |
7 |
8 | sourceCpp("Depends.cpp")
9 | fastLm(c(1,2,3), matrix(3,3))
10 |
11 |
--------------------------------------------------------------------------------
/inst/examples/ConvolveBenchmarks/GNUmakefile:
--------------------------------------------------------------------------------
1 |
2 | ## comment this out if you need a different version of R,
3 | ## and set set R_HOME accordingly as an environment variable
4 | R_HOME := $(shell R RHOME)
5 |
6 | ## include headers and libraries for R
7 | RCPPFLAGS := $(shell $(R_HOME)/bin/R CMD config --cppflags)
8 | RLDFLAGS := $(shell $(R_HOME)/bin/R CMD config --ldflags)
9 |
10 | ## include headers and libraries for Rcpp interface classes
11 | RCPPINCL := $(shell echo 'Rcpp:::CxxFlags()' | $(R_HOME)/bin/R --vanilla --slave)
12 | RCPPLIBS := $(shell echo 'Rcpp:::LdFlags()' | $(R_HOME)/bin/R --vanilla --slave)
13 |
14 | c_sources := $(wildcard *.c)
15 | c_sharedlibs := $(patsubst %.c,%.o,$(c_sources))
16 |
17 | cpp_sources := $(wildcard *.cpp)
18 | cpp_sharedlibs := $(patsubst %.cpp,%.o,$(cpp_sources))
19 |
20 | all : $(c_sharedlibs) $(cpp_sharedlibs)
21 |
22 | %.o : %.c
23 | R CMD SHLIB $<
24 |
25 | %.o : %.cpp
26 | PKG_CPPFLAGS="$(RCPPFLAGS) $(RCPPINCL)" PKG_LIBS="$(RLDFLAGS) $(RCPPLIBS)" R CMD SHLIB $<
27 |
28 | run : $(c_sharedlibs) $(cpp_sharedlibs)
29 | Rscript exampleRCode.r
30 |
--------------------------------------------------------------------------------
/inst/examples/ConvolveBenchmarks/buildAndRun.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | rm -f *.o *.so
4 |
5 | # build the shared library for the C variant
6 | R CMD SHLIB convolve2_c.c
7 | R CMD SHLIB convolve7_c.c
8 |
9 | # build the shared library for the C++ variant
10 | # we have to let R know where the Rcpp header and library are
11 | export PKG_CPPFLAGS=`Rscript -e "Rcpp:::CxxFlags()"`
12 | export PKG_LIBS=`Rscript -e "Rcpp:::LdFlags()"`
13 | R CMD SHLIB convolve3_cpp.cpp
14 | R CMD SHLIB convolve4_cpp.cpp
15 | R CMD SHLIB convolve5_cpp.cpp
16 | R CMD SHLIB convolve8_cpp.cpp
17 | R CMD SHLIB convolve9_cpp.cpp
18 | R CMD SHLIB convolve10_cpp.cpp
19 | R CMD SHLIB convolve11_cpp.cpp
20 | R CMD SHLIB convolve12_cpp.cpp
21 | R CMD SHLIB convolve14_cpp.cpp
22 |
23 | # call R so that we get an interactive session
24 | Rscript exampleRCode.r
25 |
26 |
--------------------------------------------------------------------------------
/inst/examples/ConvolveBenchmarks/convolve10_cpp.cpp:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2 |
3 | // this version expands convolve8_cpp by making Vec mimic the structure of
4 | // NumericVector. It peforms well, so this is is not the structure of
5 | // NumericVector that is the problem. So what is it then ?
6 | //
7 | // could it be because NumericVector is in a different library than
8 | // this code, so that operator[] is not inlined ?
9 | //
10 | // clues:
11 | // - http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka3538.html
12 |
13 | #include
14 |
15 | #include "convolve10_cpp.h"
16 |
17 | RcppExport SEXP convolve10cpp(SEXP a, SEXP b){
18 | Rcpp::NumericVector xa(a);
19 | Rcpp::NumericVector xb(b);
20 | int n_xa = xa.size() ;
21 | int n_xb = xb.size() ;
22 | int nab = n_xa + n_xb - 1;
23 | Rcpp::NumericVector xab(nab);
24 |
25 | Vec vab(xab.begin()), va(xa.begin()), vb(xb.begin()) ;
26 |
27 | for (int i = 0; i < n_xa; i++)
28 | for (int j = 0; j < n_xb; j++)
29 | vab[i + j] += va[i] * vb[j];
30 |
31 | return xab ;
32 | }
33 |
34 | #include "loopmacro.h"
35 | LOOPMACRO_CPP(convolve10cpp)
36 |
37 |
--------------------------------------------------------------------------------
/inst/examples/ConvolveBenchmarks/convolve10_cpp.h:
--------------------------------------------------------------------------------
1 |
2 | class Cache{
3 | public:
4 | typedef double& proxy ;
5 | typedef double* iterator ;
6 |
7 | Cache( iterator data_) : data(data_){}
8 |
9 | inline proxy ref(int i){ return data[i] ; }
10 | inline proxy ref(int i) const { return data[i] ; }
11 |
12 | private:
13 | iterator data ;
14 | } ;
15 |
16 | class Vec {
17 | public:
18 | typedef double& proxy ;
19 |
20 | Vec( double* data_ ) : cache(data_){}
21 | inline proxy operator[]( int i){ return cache.ref(i) ; }
22 | inline proxy operator[]( int i) const { return cache.ref(i) ; }
23 |
24 | private:
25 | Cache cache ;
26 | } ;
27 |
28 |
--------------------------------------------------------------------------------
/inst/examples/ConvolveBenchmarks/convolve11_cpp.cpp:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2 |
3 | // This version uses nona to indicate that xb does not contain any missing
4 | // value. This is the assumption that all other versions do.
5 |
6 | #include
7 | using namespace Rcpp ;
8 |
9 |
10 | RcppExport SEXP convolve11cpp(SEXP a, SEXP b) {
11 | NumericVector xa(a); int n_xa = xa.size() ;
12 | NumericVector xb(b); int n_xb = xb.size() ;
13 | NumericVector xab(n_xa + n_xb - 1,0.0);
14 |
15 | Range r( 0, n_xb-1 );
16 | for(int i=0; i
6 |
7 | RcppExport SEXP convolve12cpp(SEXP a, SEXP b){
8 | Rcpp::NumericVector xa(a), xb(b);
9 | int n_xa = xa.size(), n_xb = xb.size();
10 | Rcpp::NumericVector xab(n_xa + n_xb - 1);
11 |
12 | typedef Rcpp::NumericVector::iterator vec_iterator ;
13 | vec_iterator ia = xa.begin(), ib = xb.begin();
14 | vec_iterator iab = xab.begin();
15 | for (int i = 0; i < n_xa; i++)
16 | for (int j = 0; j < n_xb; j++)
17 | iab[i + j] += ia[i] * ib[j];
18 |
19 | return xab;
20 | }
21 |
22 | #include "loopmacro.h"
23 | LOOPMACRO_CPP(convolve12cpp)
24 |
25 |
--------------------------------------------------------------------------------
/inst/examples/ConvolveBenchmarks/convolve13_cpp.cpp:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2 |
3 | // This is a rewrite of the 'Writing R Extensions' section 5.10.1 example
4 |
5 | #include
6 |
7 | template
8 | T convolve( const T& a, const T& b ){
9 | int na = a.size() ; int nb = b.size() ;
10 | T out(na + nb - 1);
11 | typename T::iterator iter_a(a.begin()), iter_b(b.begin()), iter_ab( out.begin() ) ;
12 |
13 | for (int i = 0; i < na; i++)
14 | for (int j = 0; j < nb; j++)
15 | iter_ab[i + j] += iter_a[i] * iter_b[j];
16 |
17 | return out ;
18 | }
19 |
20 |
21 | RcppExport SEXP convolve13cpp(SEXP a, SEXP b){
22 | return convolve( Rcpp::NumericVector(a), Rcpp::NumericVector(b) ) ;
23 | }
24 |
25 | #include "loopmacro.h"
26 | LOOPMACRO_CPP(convolve13cpp)
27 |
28 |
--------------------------------------------------------------------------------
/inst/examples/ConvolveBenchmarks/convolve14_cpp.cpp:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2 |
3 | // This is a rewrite of the 'Writing R Extensions' section 5.10.1 example
4 |
5 | #include
6 |
7 | using namespace Rcpp ;
8 | RcppExport SEXP convolve14cpp(SEXP a, SEXP b){
9 | NumericVector xa(a), xb(b);
10 | int n_xa = xa.size() ;
11 | int n_xb = xb.size() ;
12 | int nab = n_xa + n_xb - 1;
13 | NumericVector xab(nab);
14 | Fast fa(xa), fb(xb), fab(xab) ;
15 |
16 | for (int i = 0; i < n_xa; i++)
17 | for (int j = 0; j < n_xb; j++)
18 | fab[i + j] += fa[i] * fb[j];
19 |
20 | return xab ;
21 | }
22 |
23 | #include "loopmacro.h"
24 | LOOPMACRO_CPP(convolve14cpp)
25 |
26 |
--------------------------------------------------------------------------------
/inst/examples/ConvolveBenchmarks/convolve2_c.c:
--------------------------------------------------------------------------------
1 |
2 | /* This is from 'Writing R Extensions' section 5.10.1 */
3 |
4 | #include
5 | #include
6 |
7 | SEXP convolve2(SEXP a, SEXP b)
8 | {
9 | int i, j, na, nb, nab;
10 | double *xa, *xb, *xab;
11 | SEXP ab;
12 |
13 | PROTECT(a = AS_NUMERIC(a));
14 | PROTECT(b = AS_NUMERIC(b));
15 | na = LENGTH(a); nb = LENGTH(b); nab = na + nb - 1;
16 | PROTECT(ab = NEW_NUMERIC(nab));
17 | xa = NUMERIC_POINTER(a); xb = NUMERIC_POINTER(b);
18 | xab = NUMERIC_POINTER(ab);
19 | for(i = 0; i < nab; i++) xab[i] = 0.0;
20 | for(i = 0; i < na; i++)
21 | for(j = 0; j < nb; j++) xab[i + j] += xa[i] * xb[j];
22 | UNPROTECT(3);
23 | return(ab);
24 | }
25 |
26 | #include "loopmacro.h"
27 | LOOPMACRO_C(convolve2)
28 |
29 |
--------------------------------------------------------------------------------
/inst/examples/ConvolveBenchmarks/convolve3_cpp.cpp:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2 |
3 | // This is a rewrite of the 'Writing R Extensions' section 5.10.1 example
4 |
5 | #include
6 |
7 | RcppExport SEXP convolve3cpp(SEXP a, SEXP b){
8 | Rcpp::NumericVector xa(a);
9 | Rcpp::NumericVector xb(b);
10 | int n_xa = xa.size() ;
11 | int n_xb = xb.size() ;
12 | int nab = n_xa + n_xb - 1;
13 | Rcpp::NumericVector xab(nab);
14 |
15 | for (int i = 0; i < n_xa; i++)
16 | for (int j = 0; j < n_xb; j++)
17 | xab[i + j] += xa[i] * xb[j];
18 |
19 | return xab ;
20 | }
21 |
22 | #include "loopmacro.h"
23 | LOOPMACRO_CPP(convolve3cpp)
24 |
25 |
--------------------------------------------------------------------------------
/inst/examples/ConvolveBenchmarks/convolve4_cpp.cpp:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2 |
3 | // This is a rewrite of the 'Writing R Extensions' section 5.10.1 example
4 |
5 | #include
6 |
7 | RcppExport SEXP convolve4cpp(SEXP a, SEXP b) {
8 | Rcpp::NumericVector xa(a);
9 | Rcpp::NumericVector xb(b);
10 | int n_xa = xa.size() ;
11 | int n_xb = xb.size() ;
12 | int nab = n_xa + n_xb - 1;
13 | Rcpp::NumericVector xab(nab,0.0);
14 |
15 | double* pa = xa.begin() ;
16 | double* pb = xb.begin() ;
17 | double* pab = xab.begin() ;
18 | int i,j=0;
19 | for (i = 0; i < n_xa; i++)
20 | for (j = 0; j < n_xb; j++)
21 | pab[i + j] += pa[i] * pb[j];
22 |
23 | return xab ;
24 | }
25 |
26 | #include "loopmacro.h"
27 | LOOPMACRO_CPP(convolve4cpp)
28 |
29 |
30 |
--------------------------------------------------------------------------------
/inst/examples/ConvolveBenchmarks/convolve5_cpp.cpp:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2 |
3 | // This is a rewrite of the 'Writing R Extensions' section 5.10.1 example
4 |
5 | #include
6 | using namespace Rcpp ;
7 |
8 |
9 | RcppExport SEXP convolve5cpp(SEXP a, SEXP b) {
10 | NumericVector xa(a); int n_xa = xa.size() ;
11 | NumericVector xb(b); int n_xb = xb.size() ;
12 | NumericVector xab(n_xa + n_xb - 1,0.0);
13 |
14 | Range r( 0, n_xb-1 );
15 | for(int i=0; i
6 | #include
7 |
8 | SEXP convolve7(SEXP a, SEXP b)
9 | {
10 | int i, j, na, nb, nab;
11 | SEXP ab;
12 |
13 | PROTECT(a = AS_NUMERIC(a));
14 | PROTECT(b = AS_NUMERIC(b));
15 | na = LENGTH(a); nb = LENGTH(b); nab = na + nb - 1;
16 | PROTECT(ab = NEW_NUMERIC(nab));
17 | for(i = 0; i < nab; i++) REAL(ab)[i] = 0.0;
18 | for(i = 0; i < na; i++)
19 | for(j = 0; j < nb; j++) REAL(ab)[i + j] += REAL(a)[i] * REAL(b)[j];
20 | UNPROTECT(3);
21 | return(ab);
22 |
23 | }
24 |
25 |
26 | #include "loopmacro.h"
27 | LOOPMACRO_C(convolve7)
28 |
29 |
--------------------------------------------------------------------------------
/inst/examples/ConvolveBenchmarks/convolve8_cpp.cpp:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2 |
3 | // this version is between the Rcpp_New_ptr and the Rcpp_New_std version
4 | // test elapsed relative user.self sys.self
5 | // 5 Rcpp_New_ptr(REPS, a, b) 0.214 1.000000 0.213 0.001
6 | // 7 Rcpp_New_std_2(REPS, a, b) 0.223 1.042056 0.216 0.006
7 | // 4 Rcpp_New_std(REPS, a, b) 0.524 2.448598 0.523 0.001
8 | //
9 | // so there is some overhead due to creating Vec objects and indexing them
10 | // but much less than when we index the NumericVector
11 |
12 | #include
13 |
14 | class Vec {
15 | public:
16 | Vec( double* data_ ) : data(data_){}
17 | inline double& operator[]( int i){ return data[i] ; }
18 |
19 | private:
20 | double* data ;
21 | } ;
22 |
23 |
24 | RcppExport SEXP convolve8cpp(SEXP a, SEXP b){
25 | Rcpp::NumericVector xa(a);
26 | Rcpp::NumericVector xb(b);
27 | int n_xa = xa.size() ;
28 | int n_xb = xb.size() ;
29 | int nab = n_xa + n_xb - 1;
30 | Rcpp::NumericVector xab(nab);
31 |
32 | Vec vab(xab.begin()), va(xa.begin()), vb(xb.begin()) ;
33 |
34 | for (int i = 0; i < n_xa; i++)
35 | for (int j = 0; j < n_xb; j++)
36 | vab[i + j] += va[i] * vb[j];
37 |
38 | return xab ;
39 | }
40 |
41 | #include "loopmacro.h"
42 | LOOPMACRO_CPP(convolve8cpp)
43 |
44 |
--------------------------------------------------------------------------------
/inst/examples/ConvolveBenchmarks/loopmacro.h:
--------------------------------------------------------------------------------
1 |
2 | #define LOOPMACRO_C(name) \
3 | SEXP name##__loop(SEXP n_, SEXP a, SEXP b){ \
4 | int n = INTEGER(n_)[0] ; \
5 | SEXP res = R_NilValue ; \
6 | for( int i=0; i
6 | // using namespace Rcpp ;
7 |
8 | SEXP overhead_cpp(SEXP a, SEXP b) {
9 | return R_NilValue ;
10 | }
11 |
12 | extern "C" void R_init_overhead_1(DllInfo *info){
13 |
14 | R_CallMethodDef callMethods[] = {
15 | {"overhead_cpp", (DL_FUNC) &overhead_cpp, 2},
16 | {NULL, NULL, 0}
17 | };
18 |
19 | R_registerRoutines(info, NULL, callMethods, NULL, NULL);
20 | }
21 |
22 |
--------------------------------------------------------------------------------
/inst/examples/ConvolveBenchmarks/overhead_2.c:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2 |
3 | // This is a rewrite of the 'Writing R Extensions' section 5.10.1 example
4 | #include
5 | #include
6 | #include
7 |
8 | SEXP overhead_c(SEXP a, SEXP b) {
9 | return R_NilValue ;
10 | }
11 |
12 | void R_init_overhead_2(DllInfo *info){
13 |
14 | R_CallMethodDef callMethods[] = {
15 | {"overhead_c", (DL_FUNC) &overhead_c, 2},
16 | {NULL, NULL, 0}
17 | };
18 |
19 | R_registerRoutines(info, NULL, callMethods, NULL, NULL);
20 | }
21 |
22 |
--------------------------------------------------------------------------------
/inst/examples/Misc/newFib.r:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env r
2 |
3 | ## New and shorter version of Fibonacci example using Rcpp 0.9.16 or later features
4 | ## The the sibbling file 'fibonacci.r' for context
5 |
6 | require(Rcpp) # no longer need inline
7 |
8 | ## R version
9 | fibR <- function(seq) {
10 | if (seq < 2) return(seq)
11 | return (fibR(seq - 1) + fibR(seq - 2))
12 | }
13 |
14 | ## C++ code
15 | cpptxt <- '
16 | int fibonacci(const int x) {
17 | if (x < 2) return(x);
18 | return (fibonacci(x - 1)) + fibonacci(x - 2);
19 | }'
20 |
21 | ## C++ version
22 | fibCpp <- cppFunction(cpptxt) # compiles, load, links, ...
23 |
24 | ## load rbenchmark to compare
25 | library(rbenchmark)
26 |
27 | N <- 35 ## same parameter as original post
28 | res <- benchmark(fibR(N), fibCpp(N),
29 | columns=c("test", "replications", "elapsed", "relative"),
30 | order="relative", replications=1)
31 | print(res) ## show result
32 |
33 |
--------------------------------------------------------------------------------
/inst/examples/Misc/piBySimulation.r:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env r
2 |
3 | library(Rcpp)
4 | library(rbenchmark)
5 |
6 | piR <- function(N) {
7 | x <- runif(N)
8 | y <- runif(N)
9 | d <- sqrt(x^2 + y^2)
10 | return(4 * sum(d < 1.0) / N)
11 | }
12 |
13 | sourceCpp("piSugar.cpp")
14 |
15 | N <- 1e6
16 |
17 | set.seed(42)
18 | resR <- piR(N)
19 |
20 | set.seed(42)
21 | resCpp <- piSugar(N)
22 |
23 | ## important: check results are identical with RNG seeded
24 | stopifnot(identical(resR, resCpp))
25 |
26 | res <- benchmark(piR(N), piSugar(N), order="relative")
27 |
28 | print(res[,1:4])
29 |
--------------------------------------------------------------------------------
/inst/examples/Misc/piSugar.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include
3 |
4 | using namespace Rcpp;
5 |
6 | // [[Rcpp::export]]
7 | double piSugar(const int N) {
8 | NumericVector x = runif(N);
9 | NumericVector y = runif(N);
10 | NumericVector d = sqrt(x*x + y*y);
11 | return 4.0 * sum(d < 1.0) / N;
12 | }
13 |
--------------------------------------------------------------------------------
/inst/examples/OpenMP/GNUmakefile:
--------------------------------------------------------------------------------
1 |
2 | ## comment this out if you need a different version of R,
3 | ## and set set R_HOME accordingly as an environment variable
4 | R_HOME := $(shell R RHOME)
5 |
6 | ## include headers and libraries for R
7 | RCPPFLAGS := $(shell $(R_HOME)/bin/R CMD config --cppflags)
8 | RLDFLAGS := $(shell $(R_HOME)/bin/R CMD config --ldflags)
9 |
10 | ## include headers and libraries for Rcpp interface classes
11 | RCPPINCL := $(shell echo 'Rcpp:::CxxFlags()' | $(R_HOME)/bin/R --vanilla --slave)
12 | RCPPLIBS := $(shell echo 'Rcpp:::LdFlags()' | $(R_HOME)/bin/R --vanilla --slave)
13 |
14 | ## OpenMP
15 | OPENMPFLAGS := -fopenmp
16 |
17 | c_sources := $(wildcard *.c)
18 | c_sharedlibs := $(patsubst %.c,%.o,$(c_sources))
19 |
20 | cpp_sources := $(wildcard *.cpp)
21 | cpp_sharedlibs := $(patsubst %.cpp,%.o,$(cpp_sources))
22 |
23 | all : $(c_sharedlibs) $(cpp_sharedlibs)
24 |
25 | %.o : %.c
26 | R CMD SHLIB $<
27 |
28 | %.o : %.cpp
29 | PKG_CPPFLAGS="$(RCPPFLAGS) $(RCPPINCL) $(OPENMPFLAGS)" PKG_LIBS="$(RLDFLAGS) $(RCPPLIBS) $(OPENMPFLAGS)" R CMD SHLIB $<
30 |
31 |
--------------------------------------------------------------------------------
/inst/examples/OpenMP/check.R:
--------------------------------------------------------------------------------
1 |
2 | dyn.load("piWithInterrupts.so")
3 | #res <- .Call("PiLeibniz", n=1e9, frequency=1e6)
4 | res <- .Call("PiLeibniz", n=1e9, frequency=1e6)
5 | print(res, digits=10)
6 |
--------------------------------------------------------------------------------
/inst/examples/RcppInline/RcppSimpleExample.r:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env r
2 |
3 |
4 | suppressMessages(library(Rcpp))
5 | suppressMessages(library(inline))
6 |
7 |
8 | foo <- '
9 | int i, j, na, nb, nab;
10 | double *xa, *xb, *xab;
11 | SEXP ab;
12 |
13 | PROTECT(a = AS_NUMERIC(a));
14 | PROTECT(b = AS_NUMERIC(b));
15 | na = LENGTH(a); nb = LENGTH(b); nab = na + nb - 1;
16 | PROTECT(ab = NEW_NUMERIC(nab));
17 | xa = NUMERIC_POINTER(a); xb = NUMERIC_POINTER(b);
18 | xab = NUMERIC_POINTER(ab);
19 | for(i = 0; i < nab; i++) xab[i] = 0.0;
20 | for(i = 0; i < na; i++)
21 | for(j = 0; j < nb; j++) xab[i + j] += xa[i] * xb[j];
22 | UNPROTECT(3);
23 | return(ab);
24 | '
25 |
26 | funx <- cfunction(signature(a="numeric",b="numeric"), foo, Rcpp=FALSE, verbose=FALSE)
27 | funx(a=1:20, b=2:11)
28 |
--------------------------------------------------------------------------------
/inst/examples/SugarPerformance/Timertest.cpp:
--------------------------------------------------------------------------------
1 | // -*- mode: c++; compile-command: "g++ -Wall -O3 -o Timertest Timertest.cpp"; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2 |
3 | // from http://www.cs.uiowa.edu/~sriram/30/fall03/
4 |
5 | #include
6 | #include
7 | #include "Timer.h"
8 |
9 | int main() {
10 | Timer test;
11 |
12 | std::cout << "Sleeping 2 seconds" << std::endl;
13 | test.Start();
14 | sleep(2);
15 | test.Stop();
16 | std::cout << "Sleep lasted for " << test.ElapsedTime() << " seconds." << std::endl;
17 | std::cout << "Sleeping 1 second" << std::endl;
18 | test.Start();
19 | sleep(1);
20 | test.Stop();
21 | std::cout << "Sleep lasted for " << test.ElapsedTime() << " seconds." << std::endl;
22 | std::cout << "Cumulative time is " << test.CumulativeTime() << " seconds." << std::endl;
23 | std::cout << "Reseting" << std::endl;
24 | test.Reset();
25 | std::cout << "Sleeping 2 seconds" << std::endl;
26 | test.Start();
27 | sleep(2);
28 | test.Stop();
29 | std::cout << "Sleep lasted for " << test.ElapsedTime() << " seconds." << std::endl;
30 | std::cout << "Cumulative time is " << test.CumulativeTime() << " seconds." << std::endl;
31 | }
32 |
--------------------------------------------------------------------------------
/inst/examples/functionCallback/README:
--------------------------------------------------------------------------------
1 |
2 | A much simpler version of the example is provided in the file newApiExample.r.
3 | With littler installed, it can be run 'as is' as a shell script; else it can
4 | be sourced into R.
5 |
6 | -- Dirk Eddelbuettel and Romain Francois, 06 Feb 2010
7 |
8 |
9 | This directory provides a simple example of how an R function
10 | can be passed back and forth between R and C++.
11 |
12 | We define the function at the R level, pass it to C++ using the Rcpp
13 | interface and have C++ call it. This works by subclassing the C++ class
14 | RcppFunction (from Rcpp) and adding a new member function transformVector()
15 | which is vector-valued. We then instantiate this new class in the C++
16 | function called from R -- and by calling the transformVector() function from
17 | C++ we get R to operate on the supplied vector.
18 |
19 | In this demo, we simply exponeniate the data vector but also plot it as a
20 | side effect -- effectively giving us R plotting from a C++ function.
21 |
22 | -- Dirk Eddelbuettel, 29 Sep 2009
23 |
--------------------------------------------------------------------------------
/inst/examples/performance/performance.R:
--------------------------------------------------------------------------------
1 |
2 | require( inline )
3 | require( Rcpp )
4 |
5 | expressions <- list(
6 | times = "x * y" ,
7 | plus = "x + y"
8 | # ,
9 | # minus = "x - y",
10 | # divides = "x / y",
11 | # exp_ = "exp( x )"
12 | )
13 |
14 | signatures <- lapply( expressions, function(.) signature( x_ = "numeric", y_ = "numeric", n_ = "integer" ) )
15 | bodies <- lapply( expressions, function(.){
16 | sprintf( '
17 | int n = as( n_ ) ;
18 | NumericVector x(x_), y(y_), z(x.size()) ;
19 | for( int i=0; i.
21 |
22 | #ifndef Rcpp__Extractor_h
23 | #define Rcpp__Extractor_h
24 |
25 | namespace Rcpp {
26 | namespace traits {
27 |
28 | template
29 | struct Extractor {
30 | typedef VECTOR type ;
31 | } ;
32 |
33 | } // traits
34 | } // Rcpp
35 |
36 | #endif
37 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/Light:
--------------------------------------------------------------------------------
1 | // Rcpp/Light: R/C++ interface class library -- without Rcpp Modules
2 | //
3 | // Copyright (C) 2008 - 2021 Dirk Eddelbuettel
4 | // Copyright (C) 2009 - 2021 Dirk Eddelbuettel and Romain Francois
5 | //
6 | // This file is part of Rcpp.
7 | //
8 | // Rcpp is free software: you can redistribute it and/or modify it
9 | // under the terms of the GNU General Public License as published by
10 | // the Free Software Foundation, either version 2 of the License, or
11 | // (at your option) any later version.
12 | //
13 | // Rcpp is distributed in the hope that it will be useful, but
14 | // WITHOUT ANY WARRANTY; without even the implied warranty of
15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | // GNU General Public License for more details.
17 | //
18 | // You should have received a copy of the GNU General Public License
19 | // along with Rcpp. If not, see .
20 |
21 | // no Modules
22 | #define RCPP_NO_MODULES
23 |
24 | // include Rcpp as usual
25 | #include
26 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/Lighter:
--------------------------------------------------------------------------------
1 | // Rcpp/Lighter: R/C++ interface class library -- without Rcpp Modules + RTTI
2 | //
3 | // Copyright (C) 2008 - 2021 Dirk Eddelbuettel
4 | // Copyright (C) 2009 - 2021 Dirk Eddelbuettel and Romain Francois
5 | //
6 | // This file is part of Rcpp.
7 | //
8 | // Rcpp is free software: you can redistribute it and/or modify it
9 | // under the terms of the GNU General Public License as published by
10 | // the Free Software Foundation, either version 2 of the License, or
11 | // (at your option) any later version.
12 | //
13 | // Rcpp is distributed in the hope that it will be useful, but
14 | // WITHOUT ANY WARRANTY; without even the implied warranty of
15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | // GNU General Public License for more details.
17 | //
18 | // You should have received a copy of the GNU General Public License
19 | // along with Rcpp. If not, see .
20 |
21 | // no RTTI (actually implies no Modules) -- solid gain
22 | #define RCPP_NO_RTTI
23 |
24 | // include Rcpp/Light which includes Rcpp
25 | #include
26 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/Lightest:
--------------------------------------------------------------------------------
1 | // Rcpp/Lightest: R/C++ interface class library -- without Rcpp Modules, RTTI, Sugar
2 | //
3 | // Copyright (C) 2008 - 2021 Dirk Eddelbuettel
4 | // Copyright (C) 2009 - 2021 Dirk Eddelbuettel and Romain Francois
5 | //
6 | // This file is part of Rcpp.
7 | //
8 | // Rcpp is free software: you can redistribute it and/or modify it
9 | // under the terms of the GNU General Public License as published by
10 | // the Free Software Foundation, either version 2 of the License, or
11 | // (at your option) any later version.
12 | //
13 | // Rcpp is distributed in the hope that it will be useful, but
14 | // WITHOUT ANY WARRANTY; without even the implied warranty of
15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | // GNU General Public License for more details.
17 | //
18 | // You should have received a copy of the GNU General Public License
19 | // along with Rcpp. If not, see .
20 | // New (draft) header with optional components off
21 |
22 | // no Sugar (but unclear how much it helps)
23 | #define RCPP_NO_SUGAR
24 |
25 | // include Rcpp/Lighter
26 | #include
27 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/Rcpp:
--------------------------------------------------------------------------------
1 | // Rcpp/Rcpp: R/C++ interface class library
2 | //
3 | // Copyright (C) 2008 - 2021 Dirk Eddelbuettel
4 | // Copyright (C) 2009 - 2021 Dirk Eddelbuettel and Romain Francois
5 | //
6 | // This file is part of Rcpp.
7 | //
8 | // Rcpp is free software: you can redistribute it and/or modify it
9 | // under the terms of the GNU General Public License as published by
10 | // the Free Software Foundation, either version 2 of the License, or
11 | // (at your option) any later version.
12 | //
13 | // Rcpp is distributed in the hope that it will be useful, but
14 | // WITHOUT ANY WARRANTY; without even the implied warranty of
15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | // GNU General Public License for more details.
17 | //
18 | // You should have received a copy of the GNU General Public License
19 | // along with Rcpp. If not, see .
20 |
21 | #include
22 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/api/bones/bones.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 4 -*-
2 | //
3 | // bones.h: Rcpp R/C++ interface class library --
4 | //
5 | // Copyright (C) 2010 - 2012 Dirk Eddelbuettel and Romain Francois
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #ifndef Rcpp__api__bones__bones_h
23 | #define Rcpp__api__bones__bones_h
24 |
25 | #include
26 | #include
27 | #include
28 |
29 | #endif
30 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/api/bones/wrap_extra_steps.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
2 | /* :tabSize=4:indentSize=4:noTabs=false:folding=explicit:collapseFolds=1: */
3 | //
4 | // wrap_extra_steps.h: Rcpp R/C++ interface class library -- wrap forward decl
5 | //
6 | // Copyright (C) 2010 - 2017 Dirk Eddelbuettel and Romain Francois
7 | //
8 | // This file is part of Rcpp.
9 | //
10 | // Rcpp is free software: you can redistribute it and/or modify it
11 | // under the terms of the GNU General Public License as published by
12 | // the Free Software Foundation, either version 2 of the License, or
13 | // (at your option) any later version.
14 | //
15 | // Rcpp is distributed in the hope that it will be useful, but
16 | // WITHOUT ANY WARRANTY; without even the implied warranty of
17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | // GNU General Public License for more details.
19 | //
20 | // You should have received a copy of the GNU General Public License
21 | // along with Rcpp. If not, see .
22 |
23 | #ifndef Rcpp__api__bones__wrap_extra_steps_h
24 | #define Rcpp__api__bones__wrap_extra_steps_h
25 |
26 | namespace Rcpp {
27 |
28 | template SEXP wrap_extra_steps(SEXP x) { // #nocov start
29 | return x;
30 | } // #nocov end
31 |
32 | } // Rcpp
33 |
34 | #endif
35 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/api/meat/DataFrame.h:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2013 Romain Francois
2 | //
3 | // This file is part of Rcpp.
4 | //
5 | // Rcpp is free software: you can redistribute it and/or modify it
6 | // under the terms of the GNU General Public License as published by
7 | // the Free Software Foundation, either version 2 of the License, or
8 | // (at your option) any later version.
9 | //
10 | // Rcpp is distributed in the hope that it will be useful, but
11 | // WITHOUT ANY WARRANTY; without even the implied warranty of
12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | // GNU General Public License for more details.
14 | //
15 | // You should have received a copy of the GNU General Public License
16 | // along with Rcpp. If not, see .
17 |
18 | #ifndef Rcpp_api_meat_DataFrame_h
19 | #define Rcpp_api_meat_DataFrame_h
20 |
21 | namespace Rcpp{
22 |
23 | template class StoragePolicy>
24 | template
25 | DataFrame_Impl::DataFrame_Impl( const T& obj){
26 | set__(Shield(wrap(obj)));
27 | }
28 |
29 | }
30 |
31 | #endif
32 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/api/meat/Dimension.h:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2013 Romain Francois
2 | //
3 | // This file is part of Rcpp.
4 | //
5 | // Rcpp is free software: you can redistribute it and/or modify it
6 | // under the terms of the GNU General Public License as published by
7 | // the Free Software Foundation, either version 2 of the License, or
8 | // (at your option) any later version.
9 | //
10 | // Rcpp is distributed in the hope that it will be useful, but
11 | // WITHOUT ANY WARRANTY; without even the implied warranty of
12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | // GNU General Public License for more details.
14 | //
15 | // You should have received a copy of the GNU General Public License
16 | // along with Rcpp. If not, see .
17 |
18 | #ifndef Rcpp_api_meat_Dimension_h
19 | #define Rcpp_api_meat_Dimension_h
20 |
21 | namespace Rcpp{
22 |
23 | inline Dimension::Dimension(SEXP dims_) : dims( as< std::vector >(dims_) ){}
24 |
25 | inline Dimension::operator SEXP() const {
26 | return wrap( dims.begin(), dims.end() ) ;
27 | }
28 |
29 | }
30 |
31 | #endif
32 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/api/meat/as.h:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2013 Romain Francois
2 | //
3 | // This file is part of Rcpp.
4 | //
5 | // Rcpp is free software: you can redistribute it and/or modify it
6 | // under the terms of the GNU General Public License as published by
7 | // the Free Software Foundation, either version 2 of the License, or
8 | // (at your option) any later version.
9 | //
10 | // Rcpp is distributed in the hope that it will be useful, but
11 | // WITHOUT ANY WARRANTY; without even the implied warranty of
12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | // GNU General Public License for more details.
14 | //
15 | // You should have received a copy of the GNU General Public License
16 | // along with Rcpp. If not, see .
17 |
18 | #ifndef Rcpp_api_meat_as_h
19 | #define Rcpp_api_meat_as_h
20 |
21 | namespace Rcpp{
22 | namespace internal{
23 |
24 | inline void* as_module_object_internal(SEXP obj){
25 | Environment env(obj) ;
26 | SEXP xp = env.get(".pointer") ;
27 | return R_ExternalPtrAddr(xp );
28 | }
29 |
30 | }
31 | }
32 |
33 | #endif
34 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/api/meat/message.h:
--------------------------------------------------------------------------------
1 |
2 | // message.h: Rcpp R/C++ interface class library -- Wrapper for base::message
3 | //
4 | // Copyright (C) 2021 Dirk Eddelbuettel
5 | //
6 | // This file is part of Rcpp.
7 | //
8 | // Rcpp is free software: you can redistribute it and/or modify it
9 | // under the terms of the GNU General Public License as published by
10 | // the Free Software Foundation, either version 2 of the License, or
11 | // (at your option) any later version.
12 | //
13 | // Rcpp is distributed in the hope that it will be useful, but
14 | // WITHOUT ANY WARRANTY; without even the implied warranty of
15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | // GNU General Public License for more details.
17 | //
18 | // You should have received a copy of the GNU General Public License
19 | // along with Rcpp. If not, see .
20 |
21 | #ifndef Rcpp_api_meat_message_h
22 | #define Rcpp_api_meat_message_h
23 |
24 | namespace Rcpp {
25 |
26 | inline void message(SEXP s) {
27 | Rcpp::Function msg = Rcpp::Environment::base_env()["message"];
28 | msg(s);
29 | }
30 |
31 | }
32 |
33 | #endif
34 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/api/meat/protection.h:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2013 Romain Francois
2 | //
3 | // This file is part of Rcpp.
4 | //
5 | // Rcpp is free software: you can redistribute it and/or modify it
6 | // under the terms of the GNU General Public License as published by
7 | // the Free Software Foundation, either version 2 of the License, or
8 | // (at your option) any later version.
9 | //
10 | // Rcpp is distributed in the hope that it will be useful, but
11 | // WITHOUT ANY WARRANTY; without even the implied warranty of
12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | // GNU General Public License for more details.
14 | //
15 | // You should have received a copy of the GNU General Public License
16 | // along with Rcpp. If not, see .
17 |
18 | #ifndef Rcpp_protection_meat_H
19 | #define Rcpp_protection_meat_H
20 |
21 | namespace Rcpp{
22 |
23 | template
24 | template
25 | Armor::Armor( U x ) : data() {
26 | init( wrap(x) ) ;
27 | }
28 |
29 | template
30 | template
31 | inline Armor& Armor::operator=( const U& x ){
32 | REPROTECT(data = wrap(x), index) ;
33 | return *this ;
34 | }
35 |
36 | }
37 |
38 | #endif
39 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/clone.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2 | //
3 | // clone.h: Rcpp R/C++ interface class library -- clone RObject's
4 | //
5 | // Copyright (C) 2010 - 2012 Dirk Eddelbuettel and Romain Francois
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #ifndef Rcpp_clone_h
23 | #define Rcpp_clone_h
24 |
25 | #include
26 |
27 | namespace Rcpp{
28 |
29 | /* cloning type T is possible if :
30 | - T can be converted to SEXP
31 | - T has a SEXP constructor
32 | */
33 | template T clone(const T& object) {
34 | Shield x(const_cast(object));
35 | Shield copy(Rf_duplicate(x));
36 | return T((SEXP)copy);
37 | }
38 |
39 | } // namespace Rcpp
40 |
41 | #endif
42 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/hash/hash.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 4 -*-
2 | //
3 | // hash.h: Rcpp R/C++ interface class library -- hashing
4 | //
5 | // Copyright (C) 2012 Dirk Eddelbuettel and Romain Francois
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #ifndef RCPP__HASH__HASH_H
23 | #define RCPP__HASH__HASH_H
24 |
25 | #include // needed with g++-4.7 to declare intptr_t
26 |
27 | #include
28 | #include
29 |
30 | #endif
31 |
32 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/internal/na.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2 | /* :tabSize=4:indentSize=4:noTabs=false:folding=explicit:collapseFolds=1: */
3 | //
4 | // na.h: Rcpp R/C++ interface class library -- optimized na checking
5 | //
6 | // Copyright (C) 2012-2014 Dirk Eddelbuettel, Romain Francois and Kevin Ushey
7 | //
8 | // This file is part of Rcpp.
9 | //
10 | // Rcpp is free software: you can redistribute it and/or modify it
11 | // under the terms of the GNU General Public License as published by
12 | // the Free Software Foundation, either version 2 of the License, or
13 | // (at your option) any later version.
14 | //
15 | // Rcpp is distributed in the hope that it will be useful, but
16 | // WITHOUT ANY WARRANTY; without even the implied warranty of
17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | // GNU General Public License for more details.
19 | //
20 | // You should have received a copy of the GNU General Public License
21 | // along with Rcpp. If not, see .
22 |
23 | namespace Rcpp {
24 | namespace internal {
25 |
26 | inline bool Rcpp_IsNA(double x) {
27 | return R_IsNA(x);
28 | }
29 |
30 | inline bool Rcpp_IsNaN(double x) {
31 | return R_IsNaN(x);
32 | }
33 |
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/longlong.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
2 | //
3 | // longlong.h: Rcpp R/C++ interface class library -- long long support
4 | //
5 | // Copyright (C) 2013 - 2017 Dirk Eddelbuettel and Romain Francois
6 | // Copyright (C) 2018 - 2025 Dirk Eddelbuettel, Romain Francois and Kevin Ushey
7 | //
8 | // This file is part of Rcpp.
9 | //
10 | // Rcpp is free software: you can redistribute it and/or modify it
11 | // under the terms of the GNU General Public License as published by
12 | // the Free Software Foundation, either version 2 of the License, or
13 | // (at your option) any later version.
14 | //
15 | // Rcpp is distributed in the hope that it will be useful, but
16 | // WITHOUT ANY WARRANTY; without even the implied warranty of
17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | // GNU General Public License for more details.
19 | //
20 | // You should have received a copy of the GNU General Public License
21 | // along with Rcpp. If not, see .
22 |
23 | #ifndef RCPP_LONG_LONG_H
24 | #define RCPP_LONG_LONG_H
25 |
26 | typedef long long int rcpp_long_long_type;
27 | typedef unsigned long long int rcpp_ulong_long_type;
28 | # define RCPP_HAS_LONG_LONG_TYPES
29 |
30 | #endif
31 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/macros/cat.hpp:
--------------------------------------------------------------------------------
1 | # /* Copyright (C) 2001
2 | # * Housemarque Oy
3 | # * http://www.housemarque.com
4 | # *
5 | # * Distributed under the Boost Software License, Version 1.0. (See
6 | # * accompanying file LICENSE_1_0.txt or copy at
7 | # * http://www.boost.org/LICENSE_1_0.txt)
8 | # */
9 | #
10 | # /* Revised by Paul Mensonides (2002) */
11 | #
12 | # /* See http://www.boost.org for most recent version. */
13 | #
14 | # ifndef RCPP_PREPROCESSOR_CAT_HPP
15 | # define RCPP_PREPROCESSOR_CAT_HPP
16 | #
17 | # /* RCPP_PP_CAT */
18 | #
19 | # if ~RCPP_PP_CONFIG_FLAGS() & RCPP_PP_CONFIG_MWCC()
20 | # define RCPP_PP_CAT(a, b) RCPP_PP_CAT_I(a, b)
21 | # else
22 | # define RCPP_PP_CAT(a, b) RCPP_PP_CAT_OO((a, b))
23 | # define RCPP_PP_CAT_OO(par) RCPP_PP_CAT_I ## par
24 | # endif
25 | #
26 | # if ~RCPP_PP_CONFIG_FLAGS() & RCPP_PP_CONFIG_MSVC()
27 | # define RCPP_PP_CAT_I(a, b) a ## b
28 | # else
29 | # define RCPP_PP_CAT_I(a, b) RCPP_PP_CAT_II(a ## b)
30 | # define RCPP_PP_CAT_II(res) res
31 | # endif
32 | #
33 | # endif
34 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/print.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (C) 2015 - 2023 Dirk Eddelbuettel
3 | //
4 | // This file is part of Rcpp.
5 | //
6 | // Rcpp is free software: you can redistribute it and/or modify it
7 | // under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation, either version 2 of the License, or
9 | // (at your option) any later version.
10 | //
11 | // Rcpp is distributed in the hope that it will be useful, but
12 | // WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | // You should have received a copy of the GNU General Public License
17 | // along with Rcpp. If not, see .
18 |
19 | #ifndef RCPP_PRINT_H
20 | #define RCPP_PRINT_H
21 |
22 | namespace Rcpp {
23 |
24 | inline void print(SEXP s) {
25 | Rf_PrintValue(s); // defined in Rinternals.h
26 | }
27 |
28 | inline void warningcall(SEXP call, const std::string & s) {
29 | Rf_warningcall(call, "%s", s.c_str());
30 | }
31 |
32 | // also note that warning() is defined in file exceptions.h
33 |
34 | }
35 |
36 | #endif
37 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/protection/protection.h:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2013 Romain Francois
2 | //
3 | // This file is part of Rcpp.
4 | //
5 | // Rcpp is free software: you can redistribute it and/or modify it
6 | // under the terms of the GNU General Public License as published by
7 | // the Free Software Foundation, either version 2 of the License, or
8 | // (at your option) any later version.
9 | //
10 | // Rcpp is distributed in the hope that it will be useful, but
11 | // WITHOUT ANY WARRANTY; without even the implied warranty of
12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | // GNU General Public License for more details.
14 | //
15 | // You should have received a copy of the GNU General Public License
16 | // along with Rcpp. If not, see .
17 |
18 | #ifndef Rcpp_protection_protection_H
19 | #define Rcpp_protection_protection_H
20 |
21 | #include
22 | #include
23 | #include
24 |
25 | #endif
26 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/proxy/GenericProxy.h:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2013 Romain Francois
2 | //
3 | // This file is part of Rcpp.
4 | //
5 | // Rcpp is free software: you can redistribute it and/or modify it
6 | // under the terms of the GNU General Public License as published by
7 | // the Free Software Foundation, either version 2 of the License, or
8 | // (at your option) any later version.
9 | //
10 | // Rcpp is distributed in the hope that it will be useful, but
11 | // WITHOUT ANY WARRANTY; without even the implied warranty of
12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | // GNU General Public License for more details.
14 | //
15 | // You should have received a copy of the GNU General Public License
16 | // along with Rcpp. If not, see .
17 |
18 | #ifndef Rcpp_proxy_GenericProxy_h
19 | #define Rcpp_proxy_GenericProxy_h
20 |
21 | namespace Rcpp{
22 |
23 | template
24 | struct GenericProxy {
25 | inline SEXP get() const {
26 | return static_cast(*this) ;
27 | }
28 | } ;
29 |
30 | }
31 |
32 | #endif
33 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/proxy/proxy.h:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2013 Romain Francois
2 | //
3 | // This file is part of Rcpp.
4 | //
5 | // Rcpp is free software: you can redistribute it and/or modify it
6 | // under the terms of the GNU General Public License as published by
7 | // the Free Software Foundation, either version 2 of the License, or
8 | // (at your option) any later version.
9 | //
10 | // Rcpp is distributed in the hope that it will be useful, but
11 | // WITHOUT ANY WARRANTY; without even the implied warranty of
12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | // GNU General Public License for more details.
14 | //
15 | // You should have received a copy of the GNU General Public License
16 | // along with Rcpp. If not, see .
17 |
18 | #ifndef Rcpp_proxy_proxy_h
19 |
20 | #include
21 |
22 | #include
23 | #include
24 | #include
25 | #include
26 | #include
27 | #include
28 | #include
29 | #include
30 | #include
31 |
32 | #endif
33 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/r/compat.h:
--------------------------------------------------------------------------------
1 |
2 | //
3 | // compat.h: Rcpp R/C++ interface class library -- compatibility defines
4 | //
5 | // Copyright (C) 2024 Dirk Eddelbuettel, Kevin Ushey
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #ifndef RCPP_R_COMPAT_H
23 | #define RCPP_R_COMPAT_H
24 |
25 | #include
26 |
27 | #if R_VERSION >= R_Version(4, 5, 0)
28 | # define RCPP_STRING_PTR STRING_PTR_RO
29 | #else
30 | # define RCPP_STRING_PTR STRING_PTR
31 | #endif
32 |
33 | #if R_VERSION >= R_Version(4, 5, 0)
34 | # define RCPP_VECTOR_PTR VECTOR_PTR_RO
35 | #else
36 | # define RCPP_VECTOR_PTR VECTOR_PTR
37 | #endif
38 |
39 | #endif /* RCPP_R_COMPAT_H */
40 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/sprintf.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2 | //
3 | // sprintf.h: Rcpp R/C++ interface class library -- string formatting
4 | //
5 | // Copyright (C) 2010 - 2018 Dirk Eddelbuettel and Romain Francois
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #include
23 | #include
24 |
25 | namespace Rcpp {
26 |
27 | template
28 | std::string sprintf( const char *format, ...) {
29 | static char buffer[MAX_SIZE];
30 | va_list ap;
31 | va_start(ap, format);
32 | vsnprintf(buffer, MAX_SIZE, format, ap);
33 | va_end(ap);
34 | return buffer ;
35 | }
36 |
37 | }
38 |
39 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/stats/beta.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
2 | //
3 | // beta.h: Rcpp R/C++ interface class library -- beta distribution
4 | //
5 | // Copyright (C) 2010 - 2016 Dirk Eddelbuettel and Romain Francois
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #ifndef Rcpp__stats__beta_h
23 | #define Rcpp__stats__beta_h
24 |
25 | RCPP_DPQ_2(beta,::Rf_dbeta,::Rf_pbeta,::Rf_qbeta)
26 |
27 | #endif
28 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/stats/binom.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
2 | //
3 | // binom.h: Rcpp R/C++ interface class library --
4 | //
5 | // Copyright (C) 2010 - 2016 Dirk Eddelbuettel and Romain Francois
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #ifndef Rcpp__stats__binom_h
23 | #define Rcpp__stats__binom_h
24 |
25 | RCPP_DPQ_2(binom,::Rf_dbinom,::Rf_pbinom,::Rf_qbinom)
26 |
27 | #endif
28 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/stats/chisq.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
2 | //
3 | // chisq.h: Rcpp R/C++ interface class library --
4 | //
5 | // Copyright (C) 2010 - 2016 Douglas Bates, Dirk Eddelbuettel and Romain Francois
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #ifndef Rcpp__stats__chisq_h
23 | #define Rcpp__stats__chisq_h
24 |
25 | RCPP_DPQ_1(chisq,::Rf_dchisq,::Rf_pchisq,::Rf_qchisq)
26 |
27 | #endif
28 |
29 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/stats/f.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
2 | //
3 | // f.h: Rcpp R/C++ interface class library --
4 | //
5 | // Copyright (C) 2010 - 2016 Douglas Bates, Dirk Eddelbuettel and Romain Francois
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #ifndef Rcpp__stats__f_h
23 | #define Rcpp__stats__f_h
24 |
25 | RCPP_DPQ_2(f,::Rf_df,::Rf_pf,::Rf_qf)
26 |
27 | #endif
28 |
29 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/stats/geom.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
2 | //
3 | // geom.h: Rcpp R/C++ interface class library --
4 | //
5 | // Copyright (C) 2010 - 2016 Douglas Bates, Dirk Eddelbuettel and Romain Francois
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #ifndef Rcpp__stats__geom_h
23 | #define Rcpp__stats__geom_h
24 |
25 | RCPP_DPQ_1(geom, ::Rf_dgeom, ::Rf_pgeom, ::Rf_qgeom )
26 |
27 | #endif
28 |
29 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/stats/hyper.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
2 | //
3 | // hyper.h: Rcpp R/C++ interface class library --
4 | //
5 | // Copyright (C) 2010 - 2016 Douglas Bates, Dirk Eddelbuettel and Romain Francois
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #ifndef Rcpp__stats__hyper_h
23 | #define Rcpp__stats__hyper_h
24 |
25 | RCPP_DPQ_3(hyper,::Rf_dhyper,::Rf_phyper,::Rf_qhyper)
26 |
27 | #endif
28 |
29 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/stats/nbeta.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
2 | //
3 | // nbeta.h: Rcpp R/C++ interface class library --
4 | //
5 | // Copyright (C) 2010 - 2016 Douglas Bates, Dirk Eddelbuettel and Romain Francois
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #ifndef Rcpp__stats__nbeta_h
23 | #define Rcpp__stats__nbeta_h
24 |
25 | RCPP_DPQ_3(nbeta,::Rf_dnbeta,::Rf_pnbeta,::Rf_qnbeta)
26 |
27 | #endif
28 |
29 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/stats/nbinom.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
2 | //
3 | // nbinom.h: Rcpp R/C++ interface class library --
4 | //
5 | // Copyright (C) 2010 - 2016 Douglas Bates, Dirk Eddelbuettel and Romain Francois
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #ifndef Rcpp__stats__nbinom_h
23 | #define Rcpp__stats__nbinom_h
24 |
25 | RCPP_DPQ_2(nbinom, ::Rf_dnbinom, ::Rf_pnbinom, ::Rf_qnbinom )
26 |
27 | #endif
28 |
29 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/stats/nbinom_mu.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
2 | //
3 | // nbinom_mu.h: Rcpp R/C++ interface class library --
4 | //
5 | // Copyright (C) 2010 - 2016 Douglas Bates, Dirk Eddelbuettel and Romain Francois
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #ifndef Rcpp__stats__nbinom_mu_h
23 | #define Rcpp__stats__nbinom_mu_h
24 |
25 | RCPP_DPQ_2(nbinom_mu,::dnbinom_mu, ::pnbinom_mu, ::qnbinom_mu )
26 |
27 | #endif
28 |
29 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/stats/nchisq.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
2 | //
3 | // nchisq.h: Rcpp R/C++ interface class library --
4 | //
5 | // Copyright (C) 2010 - 2016 Douglas Bates, Dirk Eddelbuettel and Romain Francois
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #ifndef Rcpp__stats__nchisq_h
23 | #define Rcpp__stats__nchisq_h
24 |
25 | RCPP_DPQ_2( nchisq, ::Rf_dnchisq, ::Rf_pnchisq, ::Rf_qnchisq )
26 |
27 | #endif
28 |
29 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/stats/nf.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
2 | //
3 | // nf.h: Rcpp R/C++ interface class library --
4 | //
5 | // Copyright (C) 2010 - 2016 Douglas Bates, Dirk Eddelbuettel and Romain Francois
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #ifndef Rcpp__stats__nf_h
23 | #define Rcpp__stats__nf_h
24 |
25 | RCPP_DPQ_3(nf,::Rf_dnf,::Rf_pnf,::Rf_qnf)
26 |
27 | #endif
28 |
29 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/stats/nt.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
2 | //
3 | // nt.h: Rcpp R/C++ interface class library --
4 | //
5 | // Copyright (C) 2010 - 2016 Douglas Bates, Dirk Eddelbuettel and Romain Francois
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #ifndef Rcpp__stats__nt_h
23 | #define Rcpp__stats__nt_h
24 |
25 | RCPP_DPQ_2(nt,::Rf_dnt,::Rf_pnt,::Rf_qnt)
26 |
27 | #endif
28 |
29 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/stats/pois.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
2 | //
3 | // pois.h: Rcpp R/C++ interface class library --
4 | //
5 | // Copyright (C) 2010 - 2016 Dirk Eddelbuettel and Romain Francois
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #ifndef Rcpp__stats__pois_h
23 | #define Rcpp__stats__pois_h
24 |
25 | RCPP_DPQ_1(pois,::Rf_dpois,::Rf_ppois,::Rf_qpois)
26 |
27 | #endif
28 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/stats/random/rpois.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
2 | //
3 | // rpois.h: Rcpp R/C++ interface class library --
4 | //
5 | // Copyright (C) 2010 - 2016 Douglas Bates, Dirk Eddelbuettel and Romain Francois
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #ifndef Rcpp__stats__random_rpois_h
23 | #define Rcpp__stats__random_rpois_h
24 |
25 | namespace Rcpp {
26 | namespace stats{
27 |
28 | class PoissonGenerator : public Generator{
29 | public:
30 | PoissonGenerator( double mu_ ) : mu(mu_){}
31 | inline double operator()() const { return ::Rf_rpois(mu); }
32 | private:
33 | double mu ;
34 | };
35 |
36 | } // stats
37 | } // Rcpp
38 |
39 | #endif
40 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/stats/random/rsignrank.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
2 | //
3 | // rsignrank.h: Rcpp R/C++ interface class library --
4 | //
5 | // Copyright (C) 2010 - 2016 Douglas Bates, Dirk Eddelbuettel and Romain Francois
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #ifndef Rcpp__stats__random_rsignrank_h
23 | #define Rcpp__stats__random_rsignrank_h
24 |
25 | namespace Rcpp {
26 | namespace stats{
27 |
28 |
29 | class SignRankGenerator : public Generator{
30 | public:
31 | SignRankGenerator(double nn_) : nn(nn_){}
32 | inline double operator()() const { return ::Rf_rsignrank(nn) ; }
33 | private:
34 | double nn ;
35 | };
36 |
37 | } // stats
38 | } // Rcpp
39 |
40 | #endif
41 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/stats/t.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
2 | //
3 | // t.h: Rcpp R/C++ interface class library -- t distribution
4 | //
5 | // Copyright (C) 2010 - 2016 Dirk Eddelbuettel and Romain Francois
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #ifndef Rcpp__stats__t_h
23 | #define Rcpp__stats__t_h
24 |
25 | RCPP_DPQ_1(t, ::Rf_dt, ::Rf_pt, ::Rf_qt)
26 |
27 | #endif
28 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/storage/NoProtectStorage.h:
--------------------------------------------------------------------------------
1 | #ifndef Rcpp_NoProtectStorage_h
2 | #define Rcpp_NoProtectStorage_h
3 |
4 | namespace Rcpp{
5 |
6 | template
7 | class NoProtectStorage {
8 | public:
9 |
10 | NoProtectStorage() : data(R_NilValue){}
11 |
12 | ~NoProtectStorage(){
13 | data = R_NilValue;
14 | }
15 |
16 | inline void set__(SEXP x){
17 | data = x ;
18 |
19 | // calls the update method of CLASS
20 | // this is where to react to changes in the underlying SEXP
21 | static_cast(*this).update(data) ;
22 | }
23 |
24 | inline SEXP get__() const {
25 | return data ;
26 | }
27 |
28 | inline SEXP invalidate__(){
29 | data = R_NilValue ;
30 | return data ;
31 | }
32 |
33 | inline CLASS& copy__(const CLASS& other){
34 | if( this != &other){
35 | set__(other.get__());
36 | }
37 | return static_cast(*this) ;
38 | }
39 |
40 | inline bool inherits(const char* clazz) const {
41 | return ::Rf_inherits( data, clazz) ;
42 | }
43 |
44 | inline operator SEXP() const {
45 | return data;
46 | }
47 |
48 | private:
49 | SEXP data ;
50 | } ;
51 |
52 | }
53 |
54 | #endif
55 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/storage/storage.h:
--------------------------------------------------------------------------------
1 | #ifndef Rcpp_storage_storage_h
2 | #define Rcpp_storage_storage_h
3 |
4 | #include
5 | #include
6 |
7 | #endif
8 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/sugar/block/block.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2 | //
3 | // block.h: Rcpp R/C++ interface class library -- sugar blocks
4 | //
5 | // Copyright (C) 2010 - 2011 Dirk Eddelbuettel and Romain Francois
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #ifndef Rcpp__sugar__block__block_h
23 | #define Rcpp__sugar__block__block_h
24 |
25 | #include
26 | #include
27 | #include
28 |
29 | #include
30 | #include
31 |
32 | #endif
33 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/sugar/functions/Lazy.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2 | //
3 | // Lazy.h: Rcpp R/C++ interface class library -- Lazy
4 | //
5 | // Copyright (C) 2010 - 2011 Dirk Eddelbuettel and Romain Francois
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #ifndef Rcpp__sugar__Lazy_h
23 | #define Rcpp__sugar__Lazy_h
24 |
25 | namespace Rcpp{
26 | namespace sugar{
27 |
28 | template
29 | class Lazy {
30 | public:
31 | inline operator T() const { return static_cast(*this).get() ; }
32 | } ;
33 |
34 | }
35 | }
36 |
37 | #endif
38 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/sugar/functions/duplicated.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2 | //
3 | // duplicated.h: Rcpp R/C++ interface class library -- duplicated
4 | //
5 | // Copyright (C) 2012 Dirk Eddelbuettel and Romain Francois
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #ifndef Rcpp__sugar__duplicated_h
23 | #define Rcpp__sugar__duplicated_h
24 |
25 | namespace Rcpp{
26 |
27 | template
28 | inline LogicalVector duplicated( const VectorBase& x ){
29 | Vector vec(x) ;
30 | sugar::IndexHash hash(vec) ;
31 | return hash.fill_and_get_duplicated() ;
32 | }
33 |
34 |
35 | } // Rcpp
36 | #endif
37 |
38 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/sugar/functions/mapply.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2 | //
3 | // mapply.h: Rcpp R/C++ interface class library -- mapply
4 | //
5 | // Copyright (C) 2012 Dirk Eddelbuettel and Romain Francois
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #ifndef Rcpp__sugar__mapply_h
23 | #define Rcpp__sugar__mapply_h
24 |
25 | #include
26 | #include
27 |
28 | #endif
29 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/sugar/functions/match.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2 | //
3 | // match.h: Rcpp R/C++ interface class library -- match
4 | //
5 | // Copyright (C) 2012 Dirk Eddelbuettel and Romain Francois
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #ifndef Rcpp__sugar__match_h
23 | #define Rcpp__sugar__match_h
24 |
25 | namespace Rcpp{
26 |
27 | template
28 | inline IntegerVector match( const VectorBase& x, const VectorBase& table_ ){
29 | Vector table = table_ ;
30 | return sugar::IndexHash( table ).fill().lookup( x.get_ref() ) ;
31 | }
32 |
33 | } // Rcpp
34 | #endif
35 |
36 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/sugar/functions/strings/strings.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2 | //
3 | // strings.h: Rcpp R/C++ interface class library -- string sugar functions
4 | //
5 | // Copyright (C) 2012 Dirk Eddelbuettel and Romain Francois
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #ifndef RCPP_SUGAR_FUNCTIONS_STRINGS_H
23 | #define RCPP_SUGAR_FUNCTIONS_STRINGS_H
24 |
25 | #include
26 | #include
27 |
28 | #endif
29 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/sugar/logical/can_have_na.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2 | //
3 | // can_have_na.h: Rcpp R/C++ interface class library --
4 | //
5 | // Copyright (C) 2010 - 2011 Dirk Eddelbuettel and Romain Francois
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #ifndef Rcpp__sugar__can_have_na_h
23 | #define Rcpp__sugar__can_have_na_h
24 |
25 | namespace Rcpp{
26 |
27 | template
28 | struct can_have_na : T::can_have_na::type {} ;
29 |
30 | } // Rcpp
31 | #endif
32 |
33 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/sugar/logical/logical.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2 | //
3 | // logical.h: Rcpp R/C++ interface class library --
4 | //
5 | // Copyright (C) 2010 - 2011 Dirk Eddelbuettel and Romain Francois
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #ifndef RCPP_SUGAR_LOGICAL_H
23 | #define RCPP_SUGAR_LOGICAL_H
24 |
25 | #include
26 |
27 | #include
28 | #include
29 | #include
30 | #include
31 |
32 | #include
33 |
34 | #endif
35 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/sugar/matrix/matrix_functions.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2 | //
3 | // matrix_functions.h: Rcpp R/C++ interface class library -- matrix sugar functions
4 | //
5 | // Copyright (C) 2010 - 2011 Dirk Eddelbuettel and Romain Francois
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #ifndef RCPP_SUGAR_MATRIX_FUNCTIONS_H
23 | #define RCPP_SUGAR_MATRIX_FUNCTIONS_H
24 |
25 | #include
26 | #include
27 | #include
28 | #include
29 | #include
30 | #include
31 | #include
32 |
33 | #endif
34 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/sugar/sets.h:
--------------------------------------------------------------------------------
1 | // sets.h: Rcpp R/C++ interface class library --
2 | //
3 | // Copyright (C) 2012 - 2025 Dirk Eddelbuettel and Romain Francois
4 | //
5 | // This file is part of Rcpp.
6 | //
7 | // Rcpp is free software: you can redistribute it and/or modify it
8 | // under the terms of the GNU General Public License as published by
9 | // the Free Software Foundation, either version 2 of the License, or
10 | // (at your option) any later version.
11 | //
12 | // Rcpp is distributed in the hope that it will be useful, but
13 | // WITHOUT ANY WARRANTY; without even the implied warranty of
14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | // GNU General Public License for more details.
16 | //
17 | // You should have received a copy of the GNU General Public License
18 | // along with Rcpp. If not, see .
19 |
20 | #ifndef Rcpp__sugar__sets_h
21 | #define Rcpp__sugar__sets_h
22 |
23 | namespace std {
24 | template<>
25 | struct hash {
26 | std::size_t operator()(const Rcpp::String& key) const {
27 | return pointer_hasher( key.get_sexp() ) ;
28 | }
29 | hash pointer_hasher ;
30 | };
31 | }
32 |
33 | #endif
34 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/sugar/sugar.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2 | //
3 | // sugar.h: Rcpp R/C++ interface class library -- main file for Rcpp::sugar
4 | //
5 | // Copyright (C) 2010 - 2012 Dirk Eddelbuettel and Romain Francois
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #ifndef RCPP_SUGAR_H
23 | #define RCPP_SUGAR_H
24 |
25 | #include
26 | #include
27 |
28 | #include
29 |
30 | #include
31 | #include
32 | #include
33 |
34 |
35 | #endif
36 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/sugar/sugar_forward.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2 | //
3 | // sugar_forward.h: Rcpp R/C++ interface class library -- forward declaration for Rcpp::sugar
4 | //
5 | // Copyright (C) 2010 - 2011 Dirk Eddelbuettel and Romain Francois
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #ifndef RCPP_SUGAR_FORWARD_H
23 | #define RCPP_SUGAR_FORWARD_H
24 |
25 | // traits
26 | #include
27 |
28 | // abstractions
29 | #include
30 |
31 | #include
32 |
33 | #endif
34 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/traits/enable_if.h:
--------------------------------------------------------------------------------
1 | #ifndef RCPP_TRAITS_ENABLE_IF_H
2 | #define RCPP_TRAITS_ENABLE_IF_H
3 |
4 | namespace Rcpp {
5 | namespace traits {
6 |
7 | template
8 | struct enable_if {};
9 |
10 | template
11 | struct enable_if {
12 | typedef T type;
13 | };
14 |
15 | }
16 | }
17 |
18 | #endif
19 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/traits/if_.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2 | //
3 | // if.h: Rcpp R/C++ interface class library -- dispatch
4 | //
5 | // Copyright (C) 2010 - 2011 Dirk Eddelbuettel and Romain Francois
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #ifndef Rcpp__traits_if_h
23 | #define Rcpp__traits_if_h
24 |
25 | namespace Rcpp{
26 | namespace traits{
27 |
28 | template
29 | struct if_ {
30 | typedef LHS type ;
31 | } ;
32 |
33 | template
34 | struct if_ {
35 | typedef RHS type ;
36 | } ;
37 |
38 | }
39 | }
40 |
41 | #endif
42 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/traits/index_sequence.h:
--------------------------------------------------------------------------------
1 | #ifndef RCPP_TRAITS_INDEX_SEQUENCE_H
2 | #define RCPP_TRAITS_INDEX_SEQUENCE_H
3 |
4 | namespace Rcpp {
5 | namespace traits {
6 | /**
7 | * C++11 implementations for index_sequence and make_index_sequence.
8 | * To avoid name conflicts or ambiguity when compiling with C++14 or later,
9 | * they should always be prefaced with `Rcpp::traits::` when used.
10 | */
11 | template
12 | struct index_sequence {};
13 |
14 | template
15 | struct make_index_sequence : make_index_sequence {};
16 |
17 | template
18 | struct make_index_sequence<0, Is...> : index_sequence {};
19 | }
20 | }
21 |
22 | #endif
23 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/traits/is_bool.h:
--------------------------------------------------------------------------------
1 | #ifndef Rcpp__traits__is_bool__h
2 | #define Rcpp__traits__is_bool__h
3 |
4 | namespace Rcpp{ namespace traits {
5 |
6 | template
7 | struct is_bool
8 | : public false_type { };
9 |
10 | template<>
11 | struct is_bool
12 | : public true_type { };
13 |
14 | template<>
15 | struct is_bool
16 | : public true_type { };
17 |
18 | template<>
19 | struct is_bool
20 | : public true_type { };
21 |
22 | }}
23 |
24 | #endif
25 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/traits/is_pointer.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2 | /* :tabSize=4:indentSize=4:noTabs=false:folding=explicit:collapseFolds=1: */
3 | //
4 | // is_pointer.h: Rcpp R/C++ interface class library -- identifies if a type is a pointer
5 | //
6 | // Copyright (C) 2012 Dirk Eddelbuettel and Romain Francois
7 | //
8 | // This file is part of Rcpp.
9 | //
10 | // Rcpp is free software: you can redistribute it and/or modify it
11 | // under the terms of the GNU General Public License as published by
12 | // the Free Software Foundation, either version 2 of the License, or
13 | // (at your option) any later version.
14 | //
15 | // Rcpp is distributed in the hope that it will be useful, but
16 | // WITHOUT ANY WARRANTY; without even the implied warranty of
17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | // GNU General Public License for more details.
19 | //
20 | // You should have received a copy of the GNU General Public License
21 | // along with Rcpp. If not, see .
22 |
23 | #ifndef Rcpp__traits__is_pointer__h
24 | #define Rcpp__traits__is_pointer__h
25 |
26 | namespace Rcpp{
27 | namespace traits{
28 |
29 | template struct is_pointer : public false_type{};
30 | template struct is_pointer : public true_type{};
31 |
32 | }
33 | }
34 |
35 | #endif
36 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/traits/is_primitive.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2 | /* :tabSize=4:indentSize=4:noTabs=false:folding=explicit:collapseFolds=1: */
3 | //
4 | // is_primitive.h: Rcpp R/C++ interface class library -- traits to help wrap
5 | //
6 | // Copyright (C) 2013 Dirk Eddelbuettel and Romain Francois
7 | //
8 | // This file is part of Rcpp.
9 | //
10 | // Rcpp is free software: you can redistribute it and/or modify it
11 | // under the terms of the GNU General Public License as published by
12 | // the Free Software Foundation, either version 2 of the License, or
13 | // (at your option) any later version.
14 | //
15 | // Rcpp is distributed in the hope that it will be useful, but
16 | // WITHOUT ANY WARRANTY; without even the implied warranty of
17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | // GNU General Public License for more details.
19 | //
20 | // You should have received a copy of the GNU General Public License
21 | // along with Rcpp. If not, see .
22 |
23 | #ifndef Rcpp__traits__is_primitive__h
24 | #define Rcpp__traits__is_primitive__h
25 |
26 | namespace Rcpp{
27 | namespace traits{
28 |
29 | template struct is_primitive : public same_type<
30 | typename r_type_traits::r_category ,
31 | r_type_primitive_tag
32 | >{} ;
33 |
34 | } // traits
35 | } // Rcpp
36 |
37 | #endif
38 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/traits/is_trivial.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2 | //
3 | // traits.h: Rcpp R/C++ interface class library -- support traits for vector
4 | //
5 | // Copyright (C) 2010 - 2011 Dirk Eddelbuettel and Romain Francois
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #ifndef Rcpp__traits__is_trivial_h
23 | #define Rcpp__traits__is_trivial_h
24 |
25 | namespace Rcpp{
26 | namespace traits{
27 |
28 | template struct is_trivial : public true_type{} ;
29 | template <> struct is_trivial : public false_type{} ;
30 | template <> struct is_trivial : public false_type{} ;
31 |
32 | } // traits
33 | } // Rcpp
34 |
35 | #endif
36 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/traits/num2type.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2 | //
3 | // num2type.h: Rcpp R/C++ interface class library -- convert number to type
4 | //
5 | // Copyright (C) 2014 Dirk Eddelbuettel, Romain Francois and Kevin Ushey
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #ifndef Rcpp__traits__num2type__h
23 | #define Rcpp__traits__num2type__h
24 |
25 | namespace Rcpp{
26 | namespace traits{
27 |
28 | template
29 | struct num2type {};
30 |
31 | }
32 | }
33 |
34 | #endif
35 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/traits/same_type.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2 | /* :tabSize=4:indentSize=4:noTabs=false:folding=explicit:collapseFolds=1: */
3 | //
4 | // same_type.h: Rcpp R/C++ interface class library -- identifies if two types are the same
5 | //
6 | // Copyright (C) 2010 - 2011 Dirk Eddelbuettel and Romain Francois
7 | //
8 | // This file is part of Rcpp.
9 | //
10 | // Rcpp is free software: you can redistribute it and/or modify it
11 | // under the terms of the GNU General Public License as published by
12 | // the Free Software Foundation, either version 2 of the License, or
13 | // (at your option) any later version.
14 | //
15 | // Rcpp is distributed in the hope that it will be useful, but
16 | // WITHOUT ANY WARRANTY; without even the implied warranty of
17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | // GNU General Public License for more details.
19 | //
20 | // You should have received a copy of the GNU General Public License
21 | // along with Rcpp. If not, see .
22 |
23 | #ifndef Rcpp__traits__same_type_traits__h
24 | #define Rcpp__traits__same_type_traits__h
25 |
26 | namespace Rcpp{
27 | namespace traits{
28 |
29 | template struct same_type : public false_type{} ;
30 | template struct same_type : public true_type{} ;
31 |
32 | }
33 | }
34 |
35 | #endif
36 |
--------------------------------------------------------------------------------
/inst/include/Rcpp/vector/00_forward_Vector.h:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2 | //
3 | // 00_forward_Vector.h: Rcpp R/C++ interface class library --
4 | //
5 | // Copyright (C) 2010 - 2013 Dirk Eddelbuettel and Romain Francois
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #ifndef Rcpp__vector__forward_Vector_h
23 | #define Rcpp__vector__forward_Vector_h
24 |
25 | namespace Rcpp{
26 | template class StoragePolicy> class Vector ;
27 | }
28 | #endif
29 |
--------------------------------------------------------------------------------
/inst/prompt/module.Rd:
--------------------------------------------------------------------------------
1 | \name{NAME}
2 | \alias{NAME}
3 | \title{
4 | Rcpp module: %% ~~ Name of the module ~~
5 | }
6 | \description{
7 | Rcpp module %% ~~ A concise description of the module ~~
8 | }
9 | \details{
10 | The module contains the following items:
11 |
12 | FUNCTIONS
13 |
14 | CLASSES
15 | }
16 | \source{
17 | %% ~~ reference to a publication or URL ~~
18 | %% ~~ perhaps a reference to the project page of the c++ code being exposed ~~
19 | }
20 | \references{
21 | %% ~~ possibly secondary sources and usages ~~
22 | %% ~~ perhaps references to the C++ code that the module exposes ~~
23 | }
24 | \examples{
25 | show( NAME )
26 | }
27 | \keyword{datasets}
28 |
--------------------------------------------------------------------------------
/inst/skeleton/Rcpp_modules_examples.Rd:
--------------------------------------------------------------------------------
1 | \name{Rcpp Modules Examples}
2 | \alias{Num}
3 | \alias{World}
4 | \alias{bar}
5 | \alias{bla}
6 | \alias{bla1}
7 | \alias{bla2}
8 | \alias{foo}
9 | \alias{vec}
10 | \alias{hello}
11 | \alias{Rcpp_Num-class}
12 | \alias{Rcpp_World-class}
13 | \alias{Rcpp_vec-class}
14 | \alias{C++Object-class}
15 | \title{
16 | Functions and Objects created by Rcpp Modules Example
17 | }
18 | \description{
19 | These function and objects are accessible from R via the Rcpp Modules mechanism
20 | which creates them based on the declaration in the C++ file.
21 | }
22 | \seealso{
23 | The Rcpp Modules vignette.
24 | }
--------------------------------------------------------------------------------
/inst/skeleton/manual-page-stub.Rd:
--------------------------------------------------------------------------------
1 | \name{__placeholder__-package}
2 | \alias{__placeholder__-package}
3 | \alias{__placeholder__}
4 | \docType{package}
5 | \title{
6 | A short title line describing what the package does
7 | }
8 | \description{
9 | A more detailed description of what the package does. A length
10 | of about one to five lines is recommended.
11 | }
12 | \details{
13 | This section should provide a more detailed overview of how to use the
14 | package, including the most important functions.
15 | }
16 | \author{
17 | Who wrote it, email optional.
18 |
19 | Maintainer: Who to complain to
20 | }
21 | \references{
22 | This optional section can contain literature or other references for
23 | background information.
24 | }
25 | \keyword{ package }
26 | \seealso{
27 | Optional links to other man pages
28 | }
29 | \examples{
30 | \dontrun{
31 | ## Optional simple examples of the most important functions
32 | ## These can be in \dontrun{} and \donttest{} blocks.
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/inst/skeleton/rcpp_hello_world.R:
--------------------------------------------------------------------------------
1 |
2 | rcpp_hello_world <- function() {
3 | .Call("rcpp_hello_world", PACKAGE = "@PKG@")
4 | }
5 |
6 |
--------------------------------------------------------------------------------
/inst/skeleton/rcpp_hello_world.Rd:
--------------------------------------------------------------------------------
1 | \name{rcpp_hello_world}
2 | \alias{rcpp_hello_world}
3 | \docType{package}
4 | \title{
5 | Simple function using Rcpp
6 | }
7 | \description{
8 | Simple function using Rcpp
9 | }
10 | \usage{
11 | rcpp_hello_world()
12 | }
13 | \examples{
14 | \dontrun{
15 | rcpp_hello_world()
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/inst/skeleton/rcpp_hello_world.cpp:
--------------------------------------------------------------------------------
1 | #include "rcpp_hello_world.h"
2 |
3 | SEXP rcpp_hello_world(){
4 | using namespace Rcpp ;
5 |
6 | CharacterVector x = CharacterVector::create( "foo", "bar" ) ;
7 | NumericVector y = NumericVector::create( 0.0, 1.0 ) ;
8 | List z = List::create( x, y ) ;
9 |
10 | return z ;
11 | }
12 |
--------------------------------------------------------------------------------
/inst/skeleton/rcpp_hello_world.h:
--------------------------------------------------------------------------------
1 | #ifndef _@PKG@_RCPP_HELLO_WORLD_H
2 | #define _@PKG@_RCPP_HELLO_WORLD_H
3 |
4 | #include
5 |
6 | /*
7 | * note : RcppExport is an alias to `extern "C"` defined by Rcpp.
8 | *
9 | * It gives C calling convention to the rcpp_hello_world function so that
10 | * it can be called from .Call in R. Otherwise, the C++ compiler mangles the
11 | * name of the function and .Call cannot find it.
12 | *
13 | * It is only useful to use RcppExport when the function is intended to be called
14 | * by .Call. See the thread http://thread.gmane.org/gmane.comp.lang.r.rcpp/649/focus=672
15 | * on Rcpp-devel for a misuse of RcppExport
16 | */
17 | RcppExport SEXP rcpp_hello_world() ;
18 |
19 | #endif
20 |
--------------------------------------------------------------------------------
/inst/skeleton/rcpp_hello_world_attributes.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include
3 | using namespace Rcpp;
4 |
5 | // [[Rcpp::export]]
6 | List rcpp_hello_world() {
7 |
8 | CharacterVector x = CharacterVector::create( "foo", "bar" ) ;
9 | NumericVector y = NumericVector::create( 0.0, 1.0 ) ;
10 | List z = List::create( x, y ) ;
11 |
12 | return z ;
13 | }
14 |
--------------------------------------------------------------------------------
/inst/skeleton/zzz.R:
--------------------------------------------------------------------------------
1 |
2 | ## Up until R 2.15.0, the require("methods") is needed but (now)
3 | ## triggers an warning from R CMD check
4 | #.onLoad <- function(libname, pkgname){
5 | # #require("methods") ## needed with R <= 2.15.0
6 | # loadRcppModules()
7 | #}
8 |
9 |
10 | ## For R 2.15.1 and later this also works. Note that calling loadModule() triggers
11 | ## a load action, so this does not have to be placed in .onLoad() or evalqOnLoad().
12 | loadModule("NumEx", TRUE)
13 | loadModule("yada", TRUE)
14 | loadModule("stdVector", TRUE)
15 |
16 |
17 |
--------------------------------------------------------------------------------
/inst/tinytest/bin/amd64/r-cran-testrcpppackage_0.1.0-1_amd64.deb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RcppCore/Rcpp/f3e4b2d7aad1ec9fca1acdbb15c5db43aa7c1f91/inst/tinytest/bin/amd64/r-cran-testrcpppackage_0.1.0-1_amd64.deb
--------------------------------------------------------------------------------
/inst/tinytest/bin/i386/r-cran-testrcpppackage_0.1.0-1_i386.deb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RcppCore/Rcpp/f3e4b2d7aad1ec9fca1acdbb15c5db43aa7c1f91/inst/tinytest/bin/i386/r-cran-testrcpppackage_0.1.0-1_i386.deb
--------------------------------------------------------------------------------
/inst/tinytest/cpp/Exceptions_nocall.cpp:
--------------------------------------------------------------------------------
1 | #define RCPP_DEFAULT_INCLUDE_CALL false
2 | #include
3 | using namespace Rcpp;
4 |
5 | // [[Rcpp::export]]
6 | void Rcpp_exception(){
7 | throw Rcpp::exception("ouch");
8 | }
9 |
10 | // [[Rcpp::export]]
11 | void eval_error_no_call(){
12 | Rcpp_eval(Rf_lang1(Rf_install("ouch")), R_EmptyEnv);
13 | }
14 |
--------------------------------------------------------------------------------
/inst/tinytest/cpp/Reference.cpp:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2 | //
3 | // Reference.cpp: Rcpp R/C++ interface class library -- Reference unit tests
4 | //
5 | // Copyright (C) 2013 Dirk Eddelbuettel and Romain Francois
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #include
23 | using namespace Rcpp ;
24 |
25 | // [[Rcpp::export]]
26 | std::string runit_Reference_getId(Reference obj) {
27 | std::string txt = obj.field("id");
28 | return txt;
29 | }
30 |
31 |
--------------------------------------------------------------------------------
/inst/tinytest/cpp/VectorOld.cpp:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2 | //
3 | // Vector-old.cpp: Rcpp R/C++ interface class library -- Vector unit tests
4 | //
5 | // Copyright (C) 2014 Dirk Eddelbuettel, Romain Francois and Kevin Ushey
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #define RCPP_COMMA_INITIALIZATION
23 | #include
24 | using namespace Rcpp;
25 |
26 | // [[Rcpp::export]]
27 | IntegerVector integer_comma(){
28 | IntegerVector x(4) ;
29 | x = 0, 1, 2, 3 ;
30 | return x ;
31 | }
32 |
33 | // [[Rcpp::export]]
34 | CharacterVector character_comma(){
35 | CharacterVector x(3) ;
36 | x = "foo", "bar", "bling" ;
37 | return x ;
38 | }
39 |
--------------------------------------------------------------------------------
/inst/tinytest/cpp/attributes.hpp:
--------------------------------------------------------------------------------
1 |
2 | #ifndef __RCPP_UNITTESTS_ATTRIBUTES__
3 | #define __RCPP_UNITTESTS_ATTRIBUTES__
4 |
5 | /*
6 | * dummy header used to test that local includes for sourceCpp are working
7 | */
8 |
9 | #endif // __RCPP_UNITTESTS_ATTRIBUTES__
10 |
--------------------------------------------------------------------------------
/inst/tinytest/cpp/coerce.cpp:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2 | //
3 | // coerce.cpp: Rcpp R/C++ interface class library -- coerce unit tests
4 | //
5 | // Copyright (C) 2022 Dirk Eddelbuettel and Kevin Ushey
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #include
23 | using namespace Rcpp ;
24 |
25 | // [[Rcpp::export]]
26 | std::string coerce_raw_to_string(Rbyte x) {
27 | return internal::coerce_to_string(x);
28 | }
29 |
--------------------------------------------------------------------------------
/inst/tinytest/cpp/embeddedR.cpp:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2 | //
3 | // Environment.cpp: Rcpp R/C++ interface class library -- Environment unit tests
4 | //
5 | // Copyright (C) 2018 Dirk Eddelbuettel and Romain Francois
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #include
23 | using namespace Rcpp ;
24 |
25 | // [[Rcpp::export]]
26 | int foo(){
27 | return 42 ;
28 | }
29 |
30 | /*** R
31 | x <- foo()
32 | x
33 | */
34 |
--------------------------------------------------------------------------------
/inst/tinytest/cpp/embeddedR2.cpp:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2 | //
3 | // Environment.cpp: Rcpp R/C++ interface class library -- Environment unit tests
4 | //
5 | // Copyright (C) 2018 Dirk Eddelbuettel and Romain Francois
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #include
23 | using namespace Rcpp ;
24 |
25 | // [[Rcpp::export]]
26 | int bar(){
27 | return 42 ;
28 | }
29 |
30 | /*** R
31 | x <- foo()
32 | x
33 | */
34 |
--------------------------------------------------------------------------------
/inst/tinytest/cpp/na.cpp:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2 | //
3 | // na.cpp: Rcpp R/C++ interface class library -- na unit tests
4 | //
5 | // Copyright (C) 2014 Kevin Ushey
6 | //
7 | // This file is part of Rcpp.
8 | //
9 | // Rcpp is free software: you can redistribute it and/or modify it
10 | // under the terms of the GNU General Public License as published by
11 | // the Free Software Foundation, either version 2 of the License, or
12 | // (at your option) any later version.
13 | //
14 | // Rcpp is distributed in the hope that it will be useful, but
15 | // WITHOUT ANY WARRANTY; without even the implied warranty of
16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | // GNU General Public License for more details.
18 | //
19 | // You should have received a copy of the GNU General Public License
20 | // along with Rcpp. If not, see .
21 |
22 | #include
23 | using namespace Rcpp ;
24 |
25 | // [[Rcpp::export]]
26 | bool Rcpp_IsNA(double x) {
27 | return internal::Rcpp_IsNA(x);
28 | }
29 |
30 | // [[Rcpp::export]]
31 | bool Rcpp_IsNaN(double x) {
32 | return internal::Rcpp_IsNaN(x);
33 | }
34 |
35 | // [[Rcpp::export]]
36 | bool R_IsNA_(double x) {
37 | return ::R_IsNA(x);
38 | }
39 |
40 | // [[Rcpp::export]]
41 | bool R_IsNaN_(double x) {
42 | return ::R_IsNaN(x);
43 | }
44 |
45 |
--------------------------------------------------------------------------------
/inst/tinytest/cpp/rcppversion.cpp:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | // [[Rcpp::export]]
4 | Rcpp::List checkVersion(Rcpp::IntegerVector v) {
5 |
6 | // incoming, we expect v to have been made by
7 | // as.integer(unlist(strsplit(as.character(packageVersion("Rcpp")), "\\.")))
8 | // yielding eg
9 | // c(1L, 0L, 3L, 1L)
10 |
11 | // ensure that length is four, after possibly appending 0
12 | if (v.size() == 3) v.push_back(0);
13 | if (v.size() == 4) v.push_back(0);
14 | if (v.size() > 5) Rcpp::stop("Expect vector with up to five elements.");
15 |
16 | return Rcpp::List::create(Rcpp::Named("def_ver") = RCPP_VERSION,
17 | Rcpp::Named("def_str") = RCPP_VERSION_STRING,
18 | Rcpp::Named("cur_ver") = Rcpp_Version(v[0], v[1], v[2]),
19 | Rcpp::Named("def_dev_ver") = RCPP_DEV_VERSION,
20 | Rcpp::Named("def_dev_str") = RCPP_DEV_VERSION_STRING,
21 | Rcpp::Named("cur_dev_ver") = RcppDevVersion(v[0], v[1], v[2], v[3]));
22 | }
23 |
--------------------------------------------------------------------------------
/inst/tinytest/cpp/wstring.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | using namespace Rcpp ;
3 |
4 | // [[Rcpp::export]]
5 | CharacterVector CharacterVector_wstring( ){
6 | CharacterVector res(2) ;
7 | res[0] = L"foo" ;
8 | res[0] += L"bar" ;
9 |
10 | res[1] = std::wstring( L"foo" ) ;
11 | res[1] += std::wstring( L"bar" ) ;
12 |
13 | return res ;
14 | }
15 |
16 | // [[Rcpp::export]]
17 | std::wstring wstring_return(){
18 | return L"foo" ;
19 | }
20 |
21 | // [[Rcpp::export]]
22 | String wstring_param(std::wstring s1, std::wstring s2){
23 | String s = s1 ;
24 | s += s2 ;
25 | return s ;
26 | }
27 |
28 | // [[Rcpp::export]]
29 | std::vector wrap_vector_wstring(){
30 | std::vector res(2 );
31 | res[0] = L"foo" ;
32 | res[1] = L"bar" ;
33 | return res;
34 | }
35 |
36 | // [[Rcpp::export]]
37 | std::vector as_vector_wstring( std::vector x){
38 | for( size_t i=0; i
7 | Standards-Version: 3.9.6
8 | Build-Depends: debhelper (>= 7.0.0), r-base-dev (>= 3.1.1), cdbs
9 | Package-List:
10 | r-cran-testrcpppackage deb gnu-r optional
11 | Checksums-Sha1:
12 | 4cfa8b64d4f4adc2e991ac1faae18263eb78fe07 2171 r-cran-testrcpppackage_0.1.0.orig.tar.gz
13 | 234e00a49064072d509cb5e6cc8e7d0bc3608245 572 r-cran-testrcpppackage_0.1.0-1.diff.gz
14 | Checksums-Sha256:
15 | 95575315827f284f5c6aacbafeba0a9609e50e312a09f7a2ff94faade83ef876 2171 r-cran-testrcpppackage_0.1.0.orig.tar.gz
16 | 540cc246865c5361587fa4b9cdfa604a7a2be630825bcc0b0d62cfbd7f648915 572 r-cran-testrcpppackage_0.1.0-1.diff.gz
17 | Files:
18 | e424c851ac8f4fa40185cf4399737c7d 2171 r-cran-testrcpppackage_0.1.0.orig.tar.gz
19 | 54073056db0ba60cf0b1707c4b6db85c 572 r-cran-testrcpppackage_0.1.0-1.diff.gz
20 |
--------------------------------------------------------------------------------
/inst/tinytest/src/r-cran-testrcpppackage_0.1.0-1_amd64.deb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RcppCore/Rcpp/f3e4b2d7aad1ec9fca1acdbb15c5db43aa7c1f91/inst/tinytest/src/r-cran-testrcpppackage_0.1.0-1_amd64.deb
--------------------------------------------------------------------------------
/inst/tinytest/src/r-cran-testrcpppackage_0.1.0-1_i386.deb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RcppCore/Rcpp/f3e4b2d7aad1ec9fca1acdbb15c5db43aa7c1f91/inst/tinytest/src/r-cran-testrcpppackage_0.1.0-1_i386.deb
--------------------------------------------------------------------------------
/inst/tinytest/testRcppAttributePackage/DESCRIPTION:
--------------------------------------------------------------------------------
1 | Package: testRcppAttributePackage
2 | Type: Package
3 | Title: Tests the signature attribute and other attributes in package compilation
4 | Version: 1.0
5 | Date: 2021-10-09
6 | Author: Travers Ching
7 | Maintainer: Dirk Eddelbuettel
8 | Description: Small test package part of Rcpp unit tests
9 | License: GPL (>= 2)
10 | Imports: Rcpp (>= 1.0.7)
11 | LinkingTo: Rcpp
12 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppAttributePackage/NAMESPACE:
--------------------------------------------------------------------------------
1 | useDynLib(testRcppAttributePackage, .registration=TRUE)
2 | importFrom(Rcpp, evalCpp)
3 | exportPattern("^[[:alpha:]]+")
4 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppClass/DESCRIPTION:
--------------------------------------------------------------------------------
1 | Package: testRcppClass
2 | Type: Package
3 | Title: Some Examples using Rcpp Classes and loadModule()
4 | Version: 0.1
5 | Date: 2012-04-06
6 | Author: John Chambers
7 | Maintainer: John Chambers
8 | Description: Some examples from the Rcpp Modules documentation, with
9 | load-time creation of classes that extend C++ classes and with
10 | explicit loading of some objects.
11 | License: GPL(>=2)
12 | LazyLoad: yes
13 | Depends: R (>= 2.15.0)
14 | Imports: Rcpp (>= 0.8.5), methods
15 | LinkingTo: Rcpp
16 | Packaged: 2012-04-14 18:42:28 UTC; jmc
17 | NeedsCompilation: yes
18 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppClass/NAMESPACE:
--------------------------------------------------------------------------------
1 | useDynLib(testRcppClass, .registration=TRUE)
2 | import(Rcpp,methods)
3 |
4 | export(genWorld, stdNumeric, rcpp_hello_world,
5 | bar, foo, baz, baz1)
6 |
7 | exportClass(RcppClassWorld, stdNumeric)#, NumEx)
8 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppClass/R/rcpp_hello_world.R:
--------------------------------------------------------------------------------
1 |
2 | rcpp_hello_world <- function(){
3 | .Call("rcpp_hello_world_cpp", PACKAGE = "testRcppClass")
4 | }
5 |
6 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppClass/man/Rcpp_class_examples.Rd:
--------------------------------------------------------------------------------
1 | \name{Rcpp Modules Examples}
2 | \alias{Num}
3 | \alias{RcppClassWorld}
4 | \alias{bar}
5 | \alias{bla}
6 | \alias{baz}
7 | \alias{bla1}
8 | \alias{baz1}
9 | \alias{bla2}
10 | \alias{foo}
11 | \alias{vec}
12 | \alias{hello}
13 | \alias{genWorld}
14 | \alias{stdNumeric}
15 | \alias{Rcpp_Num-class}
16 | \alias{Rcpp_RcppClassWorld-class}
17 | \alias{Rcpp_vec-class}
18 | \alias{stdNumeric-class}
19 | \alias{RcppClassWorld-class}
20 | \alias{C++Object-class}
21 | \title{
22 | Functions and Objects created by Rcpp Modules Example
23 | }
24 | \description{
25 | These function and objects are accessible from R via the Rcpp Modules mechanism
26 | which creates them based on the declaration in the C++ file.
27 | }
28 | \seealso{
29 | The Rcpp Modules vignette.
30 | }
--------------------------------------------------------------------------------
/inst/tinytest/testRcppClass/man/rcpp_hello_world.Rd:
--------------------------------------------------------------------------------
1 | \name{rcpp_hello_world}
2 | \alias{rcpp_hello_world}
3 | \docType{package}
4 | \title{
5 | Simple function using Rcpp
6 | }
7 | \description{
8 | Simple function using Rcpp
9 | }
10 | \usage{
11 | rcpp_hello_world()
12 | }
13 | \examples{
14 | \dontrun{
15 | rcpp_hello_world()
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppClass/man/testRcppClass-package.Rd:
--------------------------------------------------------------------------------
1 | \name{testRcppClass-package}
2 | \alias{testRcppClass-package}
3 | \alias{testRcppClass}
4 | \docType{package}
5 | \title{
6 | Dummy package part of Rcpp unit testing
7 | }
8 | \description{
9 | Dummy package part of Rcpp unit testing
10 | }
11 | \details{
12 | \tabular{ll}{
13 | Package: \tab testRcppClass\cr
14 | Type: \tab Package\cr
15 | Version: \tab 1.0\cr
16 | Date: \tab 2010-09-06\cr
17 | License: \tab GPL (>=2)\cr
18 | LazyLoad: \tab yes\cr
19 | }
20 | }
21 | \keyword{ package }
22 |
23 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppClass/src/Num.cpp:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
2 |
3 | #include "rcpp_hello_world.h"
4 |
5 | class Num{
6 | public:
7 | Num() : x(0.0), y(0){} ;
8 |
9 | double getX() { return x ; }
10 | void setX(double value){ x = value ; }
11 |
12 | int getY() { return y ; }
13 |
14 | private:
15 | double x ;
16 | int y ;
17 | };
18 |
19 | RCPP_MODULE(NumEx){
20 | using namespace Rcpp ;
21 |
22 | class_( "Num" )
23 |
24 | .default_constructor()
25 |
26 | // read and write property
27 | .property( "x", &Num::getX, &Num::setX )
28 |
29 | // read-only property
30 | .property( "y", &Num::getY )
31 | ;
32 | }
33 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppClass/src/init.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include // for NULL
4 | #include
5 |
6 | /* FIXME:
7 | Check these declarations against the C/Fortran source code.
8 | */
9 |
10 | /* .Call calls */
11 | extern SEXP rcpp_hello_world_cpp(void);
12 | extern SEXP _rcpp_module_boot_NumEx(void);
13 | extern SEXP _rcpp_module_boot_RcppClassModule(void);
14 | extern SEXP _rcpp_module_boot_stdVector(void);
15 |
16 | static const R_CallMethodDef CallEntries[] = {
17 | {"rcpp_hello_world_cpp", (DL_FUNC) &rcpp_hello_world_cpp, 0},
18 | {"_rcpp_module_boot_NumEx", (DL_FUNC) &_rcpp_module_boot_NumEx, 0},
19 | {"_rcpp_module_boot_RcppClassModule", (DL_FUNC) &_rcpp_module_boot_RcppClassModule, 0},
20 | {"_rcpp_module_boot_stdVector", (DL_FUNC) &_rcpp_module_boot_stdVector, 0},
21 | {NULL, NULL, 0}
22 | };
23 |
24 | void R_init_testRcppModule(DllInfo *dll) {
25 | R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);
26 | R_useDynamicSymbols(dll, FALSE);
27 | }
28 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppClass/src/rcpp_hello_world.cpp:
--------------------------------------------------------------------------------
1 | #include "rcpp_hello_world.h"
2 |
3 | SEXP rcpp_hello_world_cpp(){
4 | using namespace Rcpp ;
5 |
6 | CharacterVector x = CharacterVector::create( "foo", "bar" ) ;
7 | NumericVector y = NumericVector::create( 0.0, 1.0 ) ;
8 | List z = List::create( x, y ) ;
9 |
10 | return z ;
11 | }
12 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppClass/src/rcpp_hello_world.h:
--------------------------------------------------------------------------------
1 | #ifndef _testRcppModule_RCPP_HELLO_WORLD_H
2 | #define _testRcppModule_RCPP_HELLO_WORLD_H
3 |
4 | #include
5 |
6 | RcppExport SEXP rcpp_hello_world_cpp() ;
7 |
8 | #endif
9 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppClass/src/rcpp_module.cpp:
--------------------------------------------------------------------------------
1 | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
2 |
3 | #include
4 |
5 | int bar(int x) {
6 | return x*2;
7 | }
8 |
9 | double foo(int x, double y) {
10 | return x * y;
11 | }
12 |
13 | void bla() {
14 | Rprintf("hello\\n");
15 | }
16 |
17 | void bla1(int x) {
18 | Rprintf("hello (x = %d)\\n", x);
19 | }
20 |
21 | void bla2(int x, double y) {
22 | Rprintf("hello (x = %d, y = %5.2f)\\n", x, y);
23 | }
24 |
25 | class RcppClassWorld {
26 | public:
27 | RcppClassWorld() : msg("hello") {}
28 | void set(std::string msg) { this->msg = msg; }
29 | std::string greet() { return msg; }
30 |
31 | private:
32 | std::string msg;
33 | };
34 |
35 |
36 |
37 | RCPP_MODULE(RcppClassModule) {
38 | using namespace Rcpp;
39 |
40 | function("bar" , &bar );
41 | function("foo" , &foo );
42 | function("bla" , &bla );
43 | function("bla1" , &bla1);
44 | function("bla2" , &bla2);
45 |
46 | class_( "RcppClassWorld" )
47 |
48 | .default_constructor()
49 |
50 | .method("greet", &RcppClassWorld::greet)
51 | .method("set", &RcppClassWorld::set)
52 | ;
53 | }
54 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppClass/tests/classes.R:
--------------------------------------------------------------------------------
1 | library(testRcppClass)
2 |
3 | v <- stdNumeric$new()
4 | data <- 1:10
5 | v$assign(data)
6 | v$set(3L, v$at(3L) + 1)
7 |
8 | data[[4]] <- data[[4]] +1
9 |
10 | stopifnot(identical(all.equal(v$as.vector(), data), TRUE))
11 |
12 | ## a few function calls
13 |
14 | stopifnot(all.equal(bar(2), 4))
15 | stopifnot(all.equal(foo(2,3), 6))
16 |
17 | ## Uncomment this when a C++Class can be found w/o extracting from module
18 | ## as in commented code in R/load.R
19 |
20 | ## nn <- new("NumEx")
21 | ## nn$x <- pi
22 | ## stopifnot(all.equal(nn$x, pi))
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppInterfaceExporter/DESCRIPTION:
--------------------------------------------------------------------------------
1 | Package: testRcppInterfaceExporter
2 | Title: Exports c++ function via the cpp interface
3 | Version: 0.1.0
4 | Authors@R: 'Lionel Henry [aut, cre]'
5 | Description: The API package.
6 | Depends:
7 | R (>= 3.1.0)
8 | Imports:
9 | Rcpp
10 | LinkingTo:
11 | Rcpp
12 | License: GPL-3
13 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppInterfaceExporter/NAMESPACE:
--------------------------------------------------------------------------------
1 | # Generated by roxygen2: do not edit by hand
2 |
3 | export(peek_flag)
4 | export(reset_flags)
5 | export(test_cpp_interface)
6 | importFrom(Rcpp,sourceCpp)
7 | useDynLib(testRcppInterfaceExporter, .registration = TRUE)
8 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppInterfaceExporter/R/RcppExports.R:
--------------------------------------------------------------------------------
1 | # Generated by using Rcpp::compileAttributes() -> do not edit by hand
2 | # Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
3 |
4 | #' @export
5 | test_cpp_interface <- function(x, fast = FALSE) {
6 | .Call(`_testRcppInterfaceExporter_test_cpp_interface`, x, fast)
7 | }
8 |
9 | # Register entry points for exported C++ functions
10 | methods::setLoadAction(function(ns) {
11 | .Call(`_testRcppInterfaceExporter_RcppExport_registerCCallable`)
12 | })
13 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppInterfaceExporter/R/exporter.R:
--------------------------------------------------------------------------------
1 | #' @useDynLib testRcppInterfaceExporter, .registration = TRUE
2 | #' @importFrom Rcpp sourceCpp
3 | NULL
4 |
5 | flags <- new.env(parent = emptyenv())
6 |
7 | #' @export
8 | reset_flags <- function() {
9 | flags$cpp_interface_upstream <- FALSE
10 | }
11 | .onLoad <- function(lib, pkg) {
12 | reset_flags()
13 | }
14 |
15 | #' @export
16 | peek_flag <- function(name) {
17 | flags[[name]]
18 | }
19 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppInterfaceExporter/inst/include/testRcppInterfaceExporter.h:
--------------------------------------------------------------------------------
1 | // Generated by using Rcpp::compileAttributes() -> do not edit by hand
2 | // Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
3 |
4 | #ifndef RCPP_testRcppInterfaceExporter_H_GEN_
5 | #define RCPP_testRcppInterfaceExporter_H_GEN_
6 |
7 | #include "testRcppInterfaceExporter_RcppExports.h"
8 |
9 | #endif // RCPP_testRcppInterfaceExporter_H_GEN_
10 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppInterfaceExporter/src/exporter.cpp:
--------------------------------------------------------------------------------
1 | #include "config.h"
2 |
3 | #include
4 | #include "unwound.h"
5 |
6 | // [[Rcpp::interfaces(r, cpp)]]
7 |
8 | //' @export
9 | // [[Rcpp::export]]
10 | SEXP test_cpp_interface(SEXP x, bool fast = false) {
11 | unwound_t stack_obj("cpp_interface_upstream");
12 | if (fast) {
13 | return Rcpp::Rcpp_fast_eval(x, R_GlobalEnv);
14 | } else {
15 | return Rcpp::Rcpp_eval(x, R_GlobalEnv);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppInterfaceExporter/src/unwound.h:
--------------------------------------------------------------------------------
1 | #ifndef UNWOUND_H
2 | #define UNWOUND_H
3 |
4 |
5 | #include
6 |
7 | #define PKG_NAME "testRcppInterfaceExporter"
8 |
9 | struct unwound_t {
10 | unwound_t(std::string flag_) {
11 | flag = flag_;
12 | Rcpp::Rcout << "Initialising " << flag << std::endl;
13 | Rcpp::Environment ns = Rcpp::Environment::namespace_env(PKG_NAME);
14 | flags_env = ns["flags"];
15 | flags_env[flag] = false;
16 | }
17 | ~unwound_t() {
18 | Rcpp::Rcout << "Unwinding " << flag << std::endl;
19 | flags_env[flag] = true;
20 | }
21 |
22 | std::string flag;
23 | Rcpp::Environment flags_env;
24 | };
25 |
26 |
27 | #endif
28 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppInterfaceUser/DESCRIPTION:
--------------------------------------------------------------------------------
1 | Package: testRcppInterfaceUser
2 | Title: Calls exported c++ function of testRcppInterfaceExporter
3 | Version: 0.1.0
4 | Authors@R: 'Lionel Henry [aut, cre]'
5 | Description: The client package.
6 | Depends:
7 | R (>= 3.1.0)
8 | Imports:
9 | Rcpp
10 | LinkingTo:
11 | testRcppInterfaceExporter,
12 | Rcpp
13 | License: GPL-3
14 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppInterfaceUser/NAMESPACE:
--------------------------------------------------------------------------------
1 | # Generated by roxygen2: do not edit by hand
2 |
3 | export(peek_flag)
4 | export(reset_flags)
5 | export(use_cpp_interface)
6 | importFrom(Rcpp,sourceCpp)
7 | useDynLib(testRcppInterfaceUser, .registration = TRUE)
8 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppInterfaceUser/R/user.R:
--------------------------------------------------------------------------------
1 | #' @useDynLib testRcppInterfaceUser, .registration = TRUE
2 | #' @importFrom Rcpp sourceCpp
3 | NULL
4 |
5 | flags <- new.env(parent = emptyenv())
6 |
7 | #' @export
8 | reset_flags <- function() {
9 | flags$cpp_interface_downstream <- FALSE
10 | }
11 | .onLoad <- function(lib, pkg) {
12 | reset_flags()
13 | }
14 |
15 | #' @export
16 | peek_flag <- function(name) {
17 | flags[[name]]
18 | }
19 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppInterfaceUser/src/config.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RcppCore/Rcpp/f3e4b2d7aad1ec9fca1acdbb15c5db43aa7c1f91/inst/tinytest/testRcppInterfaceUser/src/config.h
--------------------------------------------------------------------------------
/inst/tinytest/testRcppInterfaceUser/src/unwound.h:
--------------------------------------------------------------------------------
1 | #ifndef UNWOUND_H
2 | #define UNWOUND_H
3 |
4 |
5 | #include
6 |
7 | #define PKG_NAME "testRcppInterfaceUser"
8 |
9 | struct unwound_t {
10 | unwound_t(std::string flag_) {
11 | flag = flag_;
12 | Rcpp::Rcout << "Initialising " << flag << std::endl;
13 | Rcpp::Environment ns = Rcpp::Environment::namespace_env(PKG_NAME);
14 | flags_env = ns["flags"];
15 | flags_env[flag] = false;
16 | }
17 | ~unwound_t() {
18 | Rcpp::Rcout << "Unwinding " << flag << std::endl;
19 | flags_env[flag] = true;
20 | }
21 |
22 | std::string flag;
23 | Rcpp::Environment flags_env;
24 | };
25 |
26 |
27 | #endif
28 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppInterfaceUser/src/user.cpp:
--------------------------------------------------------------------------------
1 | #include "config.h"
2 |
3 | #include
4 | #include
5 |
6 | #include "unwound.h"
7 |
8 |
9 | //' @export
10 | // [[Rcpp::export]]
11 | SEXP use_cpp_interface(SEXP x, bool fast = false) {
12 | unwound_t stack_obj("cpp_interface_downstream");
13 | Rcpp::RObject out = testRcppInterfaceExporter::test_cpp_interface(x, fast);
14 | Rcpp::Rcout << "Wrapping up" << std::endl;
15 | return out;
16 | }
17 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppModule/DESCRIPTION:
--------------------------------------------------------------------------------
1 | Package: testRcppModule
2 | Type: Package
3 | Title: Some Test Examples using Rcpp with the Module Feature
4 | Version: 0.1
5 | Date: 2010-09-06
6 | Author: John Chambers
7 | Maintainer: John Chambers
8 | Description: Some examples taken (and perhaps modified) from the Rcpp Modules documentation.
9 | License: GPL (>=2)
10 | LazyLoad: yes
11 | Depends: methods, Rcpp (>= 0.8.5)
12 | LinkingTo: Rcpp
13 | RcppModules: RcppModuleWorld, stdVector, NumEx
14 | Packaged: 2010-09-09 18:42:28 UTC; jmc
15 |
16 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppModule/NAMESPACE:
--------------------------------------------------------------------------------
1 | useDynLib(testRcppModule, .registration=TRUE)
2 | exportPattern("^[[:alpha:]]+")
3 | import(Rcpp,methods)
4 |
5 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppModule/R/rcpp_hello_world.R:
--------------------------------------------------------------------------------
1 |
2 | rcpp_hello_world <- function(){
3 | .Call( "rcpp_hello_world_cpp", PACKAGE = "testRcppModule" )
4 | }
5 |
6 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppModule/R/zzz.R:
--------------------------------------------------------------------------------
1 | #
2 | #.onLoad <- function(libname, pkgname){
3 | # loadRcppModules()
4 | #}
5 |
6 | ## For R 2.15.1 and later this also works. Note that calling loadModule() triggers
7 | ## a load action, so this does not have to be placed in .onLoad() or evalqOnLoad().
8 | loadModule("RcppModuleNumEx", TRUE)
9 | loadModule("RcppModuleWorld", TRUE)
10 | loadModule("stdVector", TRUE)
11 |
12 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppModule/man/Rcpp_modules_examples.Rd:
--------------------------------------------------------------------------------
1 | \name{Rcpp Modules Examples}
2 | \alias{RcppModuleNum}
3 | \alias{RcppModuleWorld}
4 | \alias{bar}
5 | \alias{bla}
6 | \alias{bla1}
7 | \alias{bla2}
8 | \alias{foo}
9 | \alias{vec}
10 | \alias{hello}
11 | \alias{Rcpp_RcppModuleNum-class}
12 | \alias{Rcpp_RcppModuleWorld-class}
13 | \alias{Rcpp_vec-class}
14 | \alias{C++Object-class}
15 | \title{
16 | Functions and Objects created by Rcpp Modules Example
17 | }
18 | \description{
19 | These function and objects are accessible from R via the Rcpp Modules mechanism
20 | which creates them based on the declaration in the C++ file.
21 | }
22 | \seealso{
23 | The Rcpp Modules vignette.
24 | }
--------------------------------------------------------------------------------
/inst/tinytest/testRcppModule/man/rcpp_hello_world.Rd:
--------------------------------------------------------------------------------
1 | \name{rcpp_hello_world}
2 | \alias{rcpp_hello_world}
3 | \alias{rcpp_hello_world_cpp}
4 | \docType{package}
5 | \title{
6 | Simple function using Rcpp
7 | }
8 | \description{
9 | Simple function using Rcpp
10 | }
11 | \usage{
12 | rcpp_hello_world()
13 | }
14 | \examples{
15 | \dontrun{
16 | rcpp_hello_world()
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppModule/man/testRcppModule-package.Rd:
--------------------------------------------------------------------------------
1 | \name{testRcppModule-package}
2 | \alias{testRcppModule-package}
3 | \alias{testRcppModule}
4 | \docType{package}
5 | \title{
6 | Dummy package part of Rcpp unit testing
7 | }
8 | \description{
9 | Dummy package part of Rcpp unit testing
10 | }
11 | \details{
12 | \tabular{ll}{
13 | Package: \tab testRcppModule\cr
14 | Type: \tab Package\cr
15 | Version: \tab 1.0\cr
16 | Date: \tab 2010-09-06\cr
17 | License: \tab GPL (>=2)\cr
18 | LazyLoad: \tab yes\cr
19 | }
20 | }
21 | \keyword{ package }
22 |
23 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppModule/src/init.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include // for NULL
4 | #include
5 |
6 | /* FIXME:
7 | Check these declarations against the C/Fortran source code.
8 | */
9 |
10 | /* .Call calls */
11 | extern SEXP rcpp_hello_world_cpp();
12 | extern SEXP _rcpp_module_boot_RcppModuleNumEx();
13 | extern SEXP _rcpp_module_boot_RcppModuleWorld();
14 | extern SEXP _rcpp_module_boot_stdVector();
15 |
16 | static const R_CallMethodDef CallEntries[] = {
17 | {"rcpp_hello_world_cpp", (DL_FUNC) &rcpp_hello_world_cpp, 0},
18 | {"_rcpp_module_boot_RcppModuleNumEx", (DL_FUNC) &_rcpp_module_boot_RcppModuleNumEx, 0},
19 | {"_rcpp_module_boot_RcppModuleWorld", (DL_FUNC) &_rcpp_module_boot_RcppModuleWorld, 0},
20 | {"_rcpp_module_boot_stdVector", (DL_FUNC) &_rcpp_module_boot_stdVector, 0},
21 | {NULL, NULL, 0}
22 | };
23 |
24 | void R_init_testRcppModule(DllInfo *dll) {
25 | R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);
26 | R_useDynamicSymbols(dll, FALSE);
27 | }
28 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppModule/src/rcpp_hello_world.cpp:
--------------------------------------------------------------------------------
1 | #include "rcpp_hello_world.h"
2 |
3 | SEXP rcpp_hello_world_cpp(){
4 | using namespace Rcpp ;
5 |
6 | CharacterVector x = CharacterVector::create( "foo", "bar" ) ;
7 | NumericVector y = NumericVector::create( 0.0, 1.0 ) ;
8 | List z = List::create( x, y ) ;
9 |
10 | return z ;
11 | }
12 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppModule/src/rcpp_hello_world.h:
--------------------------------------------------------------------------------
1 | #ifndef _testRcppModule_RCPP_HELLO_WORLD_H
2 | #define _testRcppModule_RCPP_HELLO_WORLD_H
3 |
4 | #include
5 |
6 | RcppExport SEXP rcpp_hello_world_cpp() ;
7 |
8 | #endif
9 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppModule/tests/modules.R:
--------------------------------------------------------------------------------
1 | library(testRcppModule)
2 |
3 | v <- new(vec)
4 | data <- 1:10
5 | v$assign(data)
6 | v[[3]] <- v[[3]] + 1
7 |
8 | data[[4]] <- data[[4]] +1
9 |
10 | stopifnot(identical(all.equal(v$as.vector(), data), TRUE))
11 |
12 | ## a few function calls
13 |
14 | stopifnot(all.equal(bar(2), 4))
15 | stopifnot(all.equal(foo(2,3), 6))
16 |
17 | ## properties (at one stage this seqfaulted, so beware)
18 | nn <- new(RcppModuleNum)
19 | nn$x <- pi
20 | stopifnot(all.equal(nn$x, pi))
21 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppPackage/DESCRIPTION:
--------------------------------------------------------------------------------
1 | Package: testRcppPackage
2 | Type: Package
3 | Title: Small Test Package for Rcpp and Part of Rcpp Unit Tests
4 | Version: 0.1.0
5 | Date: 2014-11-02
6 | Author: Dirk Eddelbuettel and Romain Francois
7 | Maintainer: Dirk Eddelbuettel
8 | Description: Small test package uses as part of Rcpp unit tests
9 | License: GPL (>= 2)
10 | LazyLoad: yes
11 | Imports: Rcpp
12 | LinkingTo: Rcpp
13 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppPackage/NAMESPACE:
--------------------------------------------------------------------------------
1 | useDynLib(testRcppPackage)
2 | import(Rcpp)
3 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppPackage/R/rcpp_hello_world.R:
--------------------------------------------------------------------------------
1 | rcpp_hello_world <- function() {
2 | .Call("rcpp_hello_world", PACKAGE = "testRcppPackage")
3 | }
4 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppPackage/debian/changelog:
--------------------------------------------------------------------------------
1 | r-cran-testrcpppackage (0.1.0-1) unstable; urgency=low
2 |
3 | * Initial version
4 |
5 | * debian/control: Remove (Build-)Depends: on r-cran-rcpp as this package is
6 | internal and just used for testing from source when the packaged R binary
7 | may not be installed
8 |
9 | -- Dirk Eddelbuettel Fri, 03 Oct 2014 08:25:46 -0500
10 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppPackage/debian/compat:
--------------------------------------------------------------------------------
1 | 7
2 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppPackage/debian/control:
--------------------------------------------------------------------------------
1 | Source: r-cran-testrcpppackage
2 | Section: gnu-r
3 | Priority: optional
4 | Maintainer: Dirk Eddelbuettel
5 | Build-Depends: debhelper (>= 7.0.0), r-base-dev (>= 3.1.1), cdbs
6 | Standards-Version: 3.9.6
7 |
8 | Package: r-cran-testrcpppackage
9 | Architecture: any
10 | Depends: ${shlibs:Depends}, ${misc:Depends}, ${R:Depends}
11 | Description: GNU R package to test Rcpp during Unit Tests
12 |
13 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppPackage/debian/rules:
--------------------------------------------------------------------------------
1 | #!/usr/bin/make -f
2 | # -*- makefile -*-
3 | # debian/rules file for the Debian/GNU Linux testRcppPackage package
4 | # Copyright 2003 - 2014 by Dirk Eddelbuettel
5 |
6 | include /usr/share/R/debian/r-cran.mk
7 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppPackage/debian/source/format:
--------------------------------------------------------------------------------
1 | 1.0
2 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppPackage/man/testRcppPackage-package.Rd:
--------------------------------------------------------------------------------
1 | \name{testRcppPackage-package}
2 | \alias{testRcppPackage-package}
3 | \alias{testRcppPackage}
4 | \docType{package}
5 | \title{
6 | Dummy package part of Rcpp unit tests
7 | }
8 | \description{
9 | Dummy package part of Rcpp unit tests
10 | }
11 | \details{
12 | \tabular{ll}{
13 | Package: \tab testRcppPackage\cr
14 | Type: \tab Package\cr
15 | Version: \tab 0.1.0\cr
16 | Date: \tab 2014-11-02\cr
17 | License: \tab GPL (>= 2)\cr
18 | LazyLoad: \tab yes\cr
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppPackage/src/rcpp_hello_world.cpp:
--------------------------------------------------------------------------------
1 | #include "rcpp_hello_world.h"
2 |
3 | SEXP rcpp_hello_world(){
4 | using namespace Rcpp ;
5 | CharacterVector x = CharacterVector::create( "foo", "bar" ) ;
6 | NumericVector y = NumericVector::create( 0.0, 1.0 ) ;
7 | List z = List::create( x, y ) ;
8 | return z ;
9 | }
10 |
11 | SEXP hello_world_ex(){
12 | try{
13 | throw std::range_error( "boom" ) ;
14 | } catch( std::exception& __ex__ ){
15 | forward_exception_to_r( __ex__ ) ;
16 | }
17 | return R_NilValue ;
18 | }
19 |
20 |
--------------------------------------------------------------------------------
/inst/tinytest/testRcppPackage/src/rcpp_hello_world.h:
--------------------------------------------------------------------------------
1 | #ifndef _testRcppPackage_RCPP_HELLO_WORLD_H
2 | #define _testRcppPackage_RCPP_HELLO_WORLD_H
3 |
4 | #include
5 |
6 | RcppExport SEXP rcpp_hello_world() ;
7 | RcppExport SEXP hello_world_ex() ;
8 |
9 | #endif
10 |
--------------------------------------------------------------------------------
/inst/tinytest/test_coerce.R:
--------------------------------------------------------------------------------
1 |
2 | ## Copyright (C) 2022 Dirk Eddelbuettel and Kevin Ushey
3 | ##
4 | ## This file is part of Rcpp.
5 | ##
6 | ## Rcpp is free software: you can redistribute it and/or modify it
7 | ## under the terms of the GNU General Public License as published by
8 | ## the Free Software Foundation, either version 2 of the License, or
9 | ## (at your option) any later version.
10 | ##
11 | ## Rcpp is distributed in the hope that it will be useful, but
12 | ## WITHOUT ANY WARRANTY; without even the implied warranty of
13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | ## GNU General Public License for more details.
15 | ##
16 | ## You should have received a copy of the GNU General Public License
17 | ## along with Rcpp. If not, see .
18 |
19 | if (Sys.getenv("RunAllRcppTests") != "yes") exit_file("Set 'RunAllRcppTests' to 'yes' to run.")
20 |
21 | Rcpp::sourceCpp("cpp/coerce.cpp")
22 |
23 | expect_equal(coerce_raw_to_string(0xaa), "aa")
24 |
--------------------------------------------------------------------------------
/inst/tinytest/test_exceptions_nocall.R:
--------------------------------------------------------------------------------
1 |
2 | ## Copyright (C) 2018 - 2019 Dirk Eddelbuettel and Romain Francois
3 | ##
4 | ## This file is part of Rcpp.
5 | ##
6 | ## Rcpp is free software: you can redistribute it and/or modify it
7 | ## under the terms of the GNU General Public License as published by
8 | ## the Free Software Foundation, either version 2 of the License, or
9 | ## (at your option) any later version.
10 | ##
11 | ## Rcpp is distributed in the hope that it will be useful, but
12 | ## WITHOUT ANY WARRANTY; without even the implied warranty of
13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | ## GNU General Public License for more details.
15 | ##
16 | ## You should have received a copy of the GNU General Public License
17 | ## along with Rcpp. If not, see .
18 |
19 | if (Sys.getenv("RunAllRcppTests") != "yes") exit_file("Set 'RunAllRcppTests' to 'yes' to run.")
20 |
21 | Rcpp::sourceCpp("cpp/Exceptions_nocall.cpp")
22 |
23 | # test.Rcpp_exception <- function() {
24 | tryCatch(Rcpp_exception(), error = function(e){
25 | expect_true(is.null(e$call))
26 | expect_true(is.null(e$cppstack))
27 | })
28 |
29 | # test.eval_error <- function() {
30 | tryCatch(eval_error_no_call(), error = function(e){
31 | expect_true(is.null(e$call))
32 | expect_true(is.null(e$cppstack))
33 | })
34 |
--------------------------------------------------------------------------------
/inst/tinytest/test_internal_function.R:
--------------------------------------------------------------------------------
1 |
2 | ## Copyright (C) 2014 - 2019 Christian Authmann
3 | ##
4 | ## This file is part of Rcpp.
5 | ##
6 | ## Rcpp is free software: you can redistribute it and/or modify it
7 | ## under the terms of the GNU General Public License as published by
8 | ## the Free Software Foundation, either version 2 of the License, or
9 | ## (at your option) any later version.
10 | ##
11 | ## Rcpp is distributed in the hope that it will be useful, but
12 | ## WITHOUT ANY WARRANTY; without even the implied warranty of
13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | ## GNU General Public License for more details.
15 | ##
16 | ## You should have received a copy of the GNU General Public License
17 | ## along with Rcpp. If not, see .
18 |
19 | if (Sys.getenv("RunAllRcppTests") != "yes") exit_file("Set 'RunAllRcppTests' to 'yes' to run.")
20 |
21 | Rcpp::sourceCpp("cpp/InternalFunction.cpp")
22 |
23 | # test.internal_function_add <- function(){
24 | fun <- getAdd()
25 | expect_equal( fun(10,32), 42 )
26 |
27 | # test.internal_function_concatenate <- function(){
28 | fun <- getConcatenate()
29 | expect_equal( fun("Hello"," World"), "Hello World" )
30 |
--------------------------------------------------------------------------------
/inst/tinytest/test_internal_function_cpp11.R:
--------------------------------------------------------------------------------
1 |
2 | ## Copyright (C) 2014 - 2019 Christian Authmann
3 | ##
4 | ## This file is part of Rcpp.
5 | ##
6 | ## Rcpp is free software: you can redistribute it and/or modify it
7 | ## under the terms of the GNU General Public License as published by
8 | ## the Free Software Foundation, either version 2 of the License, or
9 | ## (at your option) any later version.
10 | ##
11 | ## Rcpp is distributed in the hope that it will be useful, but
12 | ## WITHOUT ANY WARRANTY; without even the implied warranty of
13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | ## GNU General Public License for more details.
15 | ##
16 | ## You should have received a copy of the GNU General Public License
17 | ## along with Rcpp. If not, see .
18 |
19 | if (Sys.getenv("RunAllRcppTests") != "yes") exit_file("Set 'RunAllRcppTests' to 'yes' to run.")
20 |
21 | if (!Rcpp:::capabilities()[["Full C++11 support"]]) exit_file("No C++11 support")
22 |
23 | Rcpp::sourceCpp("cpp/InternalFunctionCPP11.cpp")
24 |
25 | # test.internal_function_add <- function(){
26 | fun <- getAdd4()
27 | expect_equal( fun(38), 42 )
28 |
29 | # test.internal_function_concatenate <- function(){
30 | fun <- getConcatenate()
31 | expect_equal( fun("Hello"," World"), "Hello World" )
32 |
--------------------------------------------------------------------------------
/inst/tinytest/test_na.R:
--------------------------------------------------------------------------------
1 |
2 | ## Copyright (C) 2014 Kevin Ushey
3 | ##
4 | ## This file is part of Rcpp.
5 | ##
6 | ## Rcpp is free software: you can redistribute it and/or modify it
7 | ## under the terms of the GNU General Public License as published by
8 | ## the Free Software Foundation, either version 2 of the License, or
9 | ## (at your option) any later version.
10 | ##
11 | ## Rcpp is distributed in the hope that it will be useful, but
12 | ## WITHOUT ANY WARRANTY; without even the implied warranty of
13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | ## GNU General Public License for more details.
15 | ##
16 | ## You should have received a copy of the GNU General Public License
17 | ## along with Rcpp. If not, see .
18 |
19 | if (Sys.getenv("RunAllRcppTests") != "yes") exit_file("Set 'RunAllRcppTests' to 'yes' to run.")
20 |
21 | Rcpp::sourceCpp("cpp/na.cpp")
22 |
23 | #test.na <- function() {
24 | expect_identical( R_IsNA_(NA_real_), Rcpp_IsNA(NA_real_) )
25 | expect_identical( R_IsNA_(NA_real_+1), Rcpp_IsNA(NA_real_+1) )
26 | expect_identical( R_IsNA_(NA_real_+NaN), Rcpp_IsNA(NA_real_+NaN) )
27 | expect_identical( R_IsNA_(NaN+NA_real_), Rcpp_IsNA(NaN+NA_real_) )
28 | expect_identical( R_IsNaN_(NA_real_), Rcpp_IsNaN(NA_real_) )
29 | expect_identical( R_IsNaN_(NaN), Rcpp_IsNaN(NaN) )
30 | expect_identical( R_IsNaN_(NaN+1), Rcpp_IsNaN(NaN+1) )
31 |
--------------------------------------------------------------------------------
/inst/tinytest/test_reference.R:
--------------------------------------------------------------------------------
1 |
2 | ## Copyright (C) 2013 - 2019 Dirk Eddelbuettel and Romain Francois
3 | ##
4 | ## This file is part of Rcpp.
5 | ##
6 | ## Rcpp is free software: you can redistribute it and/or modify it
7 | ## under the terms of the GNU General Public License as published by
8 | ## the Free Software Foundation, either version 2 of the License, or
9 | ## (at your option) any later version.
10 | ##
11 | ## Rcpp is distributed in the hope that it will be useful, but
12 | ## WITHOUT ANY WARRANTY; without even the implied warranty of
13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | ## GNU General Public License for more details.
15 | ##
16 | ## You should have received a copy of the GNU General Public License
17 | ## along with Rcpp. If not, see .
18 |
19 | if (Sys.getenv("RunAllRcppTests") != "yes") exit_file("Set 'RunAllRcppTests' to 'yes' to run.")
20 |
21 | Rcpp::sourceCpp("cpp/Reference.cpp")
22 |
23 | # test.Reference <- function(){
24 | Instrument <- setRefClass(Class="Instrument", fields=list("id"="character", "description"="character"))
25 | Instrument$accessors(c("id", "description"))
26 |
27 | instrument <- Instrument$new(id="AAPL", description="Apple")
28 |
29 | expect_equal(runit_Reference_getId(instrument), "AAPL", msg = ".field")
30 |
--------------------------------------------------------------------------------
/inst/tinytest/test_vector_old.R:
--------------------------------------------------------------------------------
1 |
2 | ## Copyright (C) 2014 - 2019 Dirk Eddelbuettel, Romain Francois and Kevin Ushey
3 | ##
4 | ## This file is part of Rcpp.
5 | ##
6 | ## Rcpp is free software: you can redistribute it and/or modify it
7 | ## under the terms of the GNU General Public License as published by
8 | ## the Free Software Foundation, either version 2 of the License, or
9 | ## (at your option) any later version.
10 | ##
11 | ## Rcpp is distributed in the hope that it will be useful, but
12 | ## WITHOUT ANY WARRANTY; without even the implied warranty of
13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | ## GNU General Public License for more details.
15 | ##
16 | ## You should have received a copy of the GNU General Public License
17 | ## along with Rcpp. If not, see .
18 |
19 | if (Sys.getenv("RunAllRcppTests") != "yes") exit_file("Set 'RunAllRcppTests' to 'yes' to run.")
20 |
21 | Rcpp::sourceCpp("cpp/VectorOld.cpp")
22 |
23 | # test.IntegerVector.comma <- function(){
24 | fun <- integer_comma
25 | expect_equal( fun(), 0:3, info = "IntegerVector comma initialization" )
26 |
27 | # test.CharacterVector.comma <- function(){
28 | fun <- character_comma
29 | expect_equal( fun(), c("foo","bar", "bling" ), info = "CharacterVector comma operator" )
30 |
--------------------------------------------------------------------------------
/man/CppClass-class.Rd:
--------------------------------------------------------------------------------
1 | \name{C++Class-class}
2 | \Rdversion{1.1}
3 | \docType{class}
4 | \alias{C++Class-class}
5 | \alias{$,C++Class-method}
6 | \alias{show,C++Class-method}
7 |
8 | \title{Reflection information for an internal c++ class}
9 | \description{
10 | Information about an internal c++ class.
11 | }
12 | \section{Objects from the Class}{
13 | Objects are usually extracted from a \linkS4class{Module}
14 | using the dollar extractor.
15 | }
16 | \section{Slots}{
17 | \describe{
18 | \item{\code{.Data}:}{mangled name of the class}
19 | \item{\code{pointer}:}{external pointer to the internal infomation}
20 | \item{\code{module}:}{external pointer to the module}
21 | \item{\code{fields}:}{list of \linkS4class{C++Field} objects}
22 | \item{\code{constructors}:}{list of \linkS4class{C++Constructor} objects}
23 | \item{\code{methods}:}{list of \linkS4class{C++OverloadedMethods} objects}
24 | \item{generator}{the generator object for the class}
25 | \item{docstring}{description of the class}
26 | \item{typeid}{unmangled typeid of the class}
27 | \item{enums}{enums of the class}
28 | \item{parents}{names of the parent classes of this class}
29 | }
30 | }
31 | \section{Methods}{
32 | \describe{
33 | \item{show}{\code{signature(object = "C++Class")}: prints the class. }
34 | \item{$}{\code{signature(object = "C++Class")}: ... }
35 | }
36 | }
37 | \keyword{classes}
38 |
39 |
--------------------------------------------------------------------------------
/man/CppConstructor-class.Rd:
--------------------------------------------------------------------------------
1 | \name{C++Constructor-class}
2 | \Rdversion{1.1}
3 | \docType{class}
4 | \alias{C++Constructor-class}
5 |
6 | \title{Class "C++Constructor"}
7 | \description{
8 | Representation of a C++ constructor
9 | }
10 | \section{Extends}{
11 | Class \code{"\linkS4class{envRefClass}"}, directly.
12 | Class \code{"\linkS4class{.environment}"}, by class "envRefClass", distance 2.
13 | Class \code{"\linkS4class{refClass}"}, by class "envRefClass", distance 2.
14 | Class \code{"\linkS4class{environment}"}, by class "envRefClass", distance 3, with explicit coerce.
15 | Class \code{"\linkS4class{refObject}"}, by class "envRefClass", distance 3.
16 | }
17 | \keyword{classes}
18 | \section{Fields}{
19 | \describe{
20 | \item{\code{pointer}:}{pointer to the internal structure that represent the constructor}
21 | \item{\code{class_pointer}:}{pointer to the internal structure that represent the associated C++ class}
22 | \item{\code{nargs}:}{Number of arguments the constructor expects}
23 | \item{\code{signature}:}{C++ signature of the constructor}
24 | \item{\code{docstring}:}{Short description of the constructor}
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/man/CppField-class.Rd:
--------------------------------------------------------------------------------
1 | \name{C++Field-class}
2 | \Rdversion{1.1}
3 | \docType{class}
4 | \alias{C++Field-class}
5 |
6 | \title{Class "C++Field"}
7 | \description{
8 | Metadata associated with a field of a class exposed through Rcpp modules
9 | }
10 | \section{Fields}{
11 | \describe{
12 | \item{\code{pointer}:}{external pointer to the internal (C++) object that represents fields}
13 | \item{\code{cpp_class}:}{(demangled) name of the C++ class of the field}
14 | \item{\code{read_only}:}{Is this field read only}
15 | \item{\code{class_pointer}:}{external pointer to the class this field is from. }
16 | }
17 | }
18 | \section{Methods}{
19 | No methods defined with class "C++Field" in the signature.
20 | }
21 | \seealso{
22 | The \code{fields} slot of the \code{\linkS4class{C++Class}} class is a
23 | list of \code{C++Field} objects
24 | }
25 | \examples{
26 | showClass("C++Field")
27 | }
28 | \keyword{classes}
29 |
--------------------------------------------------------------------------------
/man/CppFunction-class.Rd:
--------------------------------------------------------------------------------
1 | \name{C++Function-class}
2 | \Rdversion{1.1}
3 | \docType{class}
4 | \alias{C++Function-class}
5 | \alias{show,C++Function-method}
6 |
7 | \title{Class "C++Function"}
8 | \description{
9 | Internal C++ function
10 | }
11 | \section{Objects from the Class}{
12 | Objects can be created by the \code{Rcpp::InternalFunction}
13 | class from the \code{Rcpp} library
14 | }
15 | \section{Slots}{
16 | \describe{
17 | \item{\code{.Data}:}{R function that calls back to the internal function}
18 | \item{\code{pointer}:}{External pointer to a C++ object poiting to the function}
19 | \item{\code{docstring}:}{Short documentation for the function}
20 | \item{\code{signature}:}{C++ signature}
21 | }
22 | }
23 | \section{Extends}{
24 | Class \code{"\linkS4class{function}"}, from data part.
25 | Class \code{"\linkS4class{OptionalFunction}"}, by class "function", distance 2.
26 | Class \code{"\linkS4class{PossibleMethod}"}, by class "function", distance 2.
27 | }
28 | \section{Methods}{
29 | \describe{
30 | \item{show}{\code{signature(object = "C++Function")}: print the object }
31 | }
32 | }
33 | \examples{
34 | showClass("C++Function")
35 | }
36 | \keyword{classes}
37 |
--------------------------------------------------------------------------------
/man/CppObject-class.Rd:
--------------------------------------------------------------------------------
1 | \name{C++Object-class}
2 | \Rdversion{1.1}
3 | \docType{class}
4 | \alias{C++Object-class}
5 | \alias{$,C++Object-method}
6 | \alias{$<-,C++Object-method}
7 | \alias{show,C++Object-method}
8 |
9 | \title{c++ internal objects}
10 | \description{
11 | C++ internal objects instanciated from a class exposed in an Rcpp module
12 | }
13 | \section{Objects from the Class}{
14 | This is a virtual class. Actual C++ classes are subclasses.
15 | }
16 | \section{Methods}{
17 | \describe{
18 | \item{$}{\code{signature(x = "C++Object")}: invokes a method on the object, or retrieves the value of a property }
19 | \item{$<-}{\code{signature(x = "C++Object")}: set the value of a property }
20 | \item{show}{\code{signature(object = "C++Object")}: print the object }
21 | }
22 | }
23 | \keyword{classes}
24 |
--------------------------------------------------------------------------------
/man/CppOverloadedMethods-class.Rd:
--------------------------------------------------------------------------------
1 | \name{C++OverloadedMethods-class}
2 | \Rdversion{1.1}
3 | \docType{class}
4 | \alias{C++OverloadedMethods-class}
5 |
6 | \title{Class "C++OverloadedMethods"}
7 | \description{
8 | Set of C++ methods
9 | }
10 | \section{Extends}{
11 | Class \code{"\linkS4class{envRefClass}"}, directly.
12 | Class \code{"\linkS4class{.environment}"}, by class "envRefClass", distance 2.
13 | Class \code{"\linkS4class{refClass}"}, by class "envRefClass", distance 2.
14 | Class \code{"\linkS4class{environment}"}, by class "envRefClass", distance 3, with explicit coerce.
15 | Class \code{"\linkS4class{refObject}"}, by class "envRefClass", distance 3.
16 | }
17 | \keyword{classes}
18 | \section{Fields}{
19 | \describe{
20 | \item{\code{pointer}:}{Object of class \code{externalptr} pointer to the internal structure that represents the set of methods }
21 | \item{\code{class_pointer}:}{Object of class \code{externalptr} pointer to the internal structure that models the related class }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/man/DollarNames-methods.Rd:
--------------------------------------------------------------------------------
1 | \name{.DollarNames-methods}
2 | \docType{methods}
3 | \alias{.DollarNames-methods}
4 | \alias{.DollarNames,ANY-method}
5 | \alias{.DollarNames,C++Object-method}
6 | \alias{.DollarNames,Module-method}
7 | \title{ completion }
8 | \description{
9 | completion
10 | }
11 | \section{Methods}{
12 | \describe{
13 |
14 | \item{\code{signature(x = "ANY")}}{}
15 |
16 | \item{\code{signature(x = "C++Object")}}{
17 | completes fields and methods of C++ objects
18 | }
19 |
20 | \item{\code{signature(x = "Module")}}{
21 | completes functions and classes of modules
22 | }
23 | }}
24 | \keyword{methods}
25 |
26 |
--------------------------------------------------------------------------------
/man/Module-class.Rd:
--------------------------------------------------------------------------------
1 | \name{Module-class}
2 | \Rdversion{1.1}
3 | \docType{class}
4 | \alias{Module-class}
5 | \alias{$,Module-method}
6 | \alias{prompt,Module-method}
7 | \alias{show,Module-method}
8 | \alias{initialize,Module-method}
9 |
10 | \title{Rcpp modules}
11 | \description{
12 | Collection of internal c++ functions and classes exposed to R
13 | }
14 | \section{Objects from the Class}{
15 | modules are created by the \code{link{Module}} function
16 | }
17 | \section{Methods}{
18 | \describe{
19 | \item{$}{\code{signature(x = "Module")}: extract a function or a class from the module. }
20 | \item{prompt}{\code{signature(object = "Module")}: generates skeleton of a documentation for a Module. }
21 | \item{show}{\code{signature(object = "Module")}: summary information about the module. }
22 | \item{initialize}{\code{signature(.Object = "Module")}: ... }
23 | }
24 | }
25 | \seealso{
26 | The \code{\link{Module}} function
27 | }
28 | \keyword{classes}
29 |
--------------------------------------------------------------------------------
/man/Module.Rd:
--------------------------------------------------------------------------------
1 | \name{Module}
2 | \alias{Module}
3 | \title{
4 | Retrieves an Rcpp module
5 | }
6 | \description{
7 | Retrieves an Rcpp module from a dynamic library, usually associated with a
8 | package.
9 | }
10 | \usage{
11 | Module(module, PACKAGE = , where = , mustStart = )
12 | }
13 | \arguments{
14 | \item{module}{Name of the module, as declared in the \code{RCPP_MODULE} macro internally}
15 | \item{PACKAGE}{Passed to \code{\link{getNativeSymbolInfo}}}
16 | \item{where}{When the module is loaded, S4 classes are defined based on the
17 | internal classes. This argument is passed to \code{\link{setClass}}
18 | }
19 | \item{mustStart}{TODO}
20 | }
21 | \value{
22 | An object of class \linkS4class{Module} collecting functions
23 | and classes declared in the module.
24 | }
25 | \keyword{programming}
26 |
27 |
--------------------------------------------------------------------------------
/man/Rcpp-deprecated.Rd:
--------------------------------------------------------------------------------
1 | \name{Rcpp-deprecated}
2 | \alias{Rcpp-deprecated}
3 | \title{Deprecated Functions in the Rcpp Package}
4 | \description{
5 | These functions are provided for compatibility with older versions of the
6 | \pkg{Rcpp} package only, and may be removed in future versions.
7 | }
8 | \details{
9 | \itemize{
10 | \item \code{\link{loadRcppModules}} calls should now be replaced by
11 | \code{\link{loadModule}} calls, one per Module.
12 |
13 | \item \code{\link{LdFlags}} and \code{\link{RcppLdFlags}} are no
14 | longer required as no library is provided (or needed) by Rcpp (as it
15 | was up until release 0.10.1).
16 | }
17 | }
18 | \author{Dirk Eddelbuettel and Romain Francois}
19 | \keyword{programming}
20 | \keyword{interface}
21 |
--------------------------------------------------------------------------------
/man/Rcpp-internal.Rd:
--------------------------------------------------------------------------------
1 | \name{Rcpp-internal}
2 | \alias{Rcpp-internal}
3 | \alias{cpp_object_initializer}
4 | \alias{cpp_object_dummy}
5 | \title{Rcpp internal functions}
6 | \description{The \pkg{Rcpp} utilizes several internal functions which
7 | need to visible within its namespace, yet are not user-facing. This
8 | page provides basic documentation for them.
9 | }
10 | \usage{
11 | cpp_object_initializer(.self, .refClassDef, ..., .object_pointer)
12 | cpp_object_dummy(.self, .refClassDef)
13 | }
14 | \arguments{
15 | \item{.self}{A reference to the object being modified}
16 | \item{.refClassDef}{The definition of a reference class}
17 | \item{...}{Further arguments}
18 | \item{.object_pointer}{Optional external pointer}
19 | }
20 | \keyword{programming}
21 | \keyword{interface}
22 | \keyword{internal}
23 |
--------------------------------------------------------------------------------
/man/RcppLdFlags.Rd:
--------------------------------------------------------------------------------
1 | \name{LdFlags-deprecated}
2 | \alias{LdFlags}
3 | \alias{RcppLdFlags}
4 | \title{Deprecated Rcpp Linker Flags}
5 | \description{
6 | In Rcpp versions prior to release 0.10.1 of November 2013,
7 | \code{LdFlags} and \code{RcppLdFlags} were used to return the required
8 | flags and options for the system linker to link to the Rcpp user
9 | library. Since we no longer build or ship a user library, these
10 | functions now return an empty string. As of Rcpp release 0.12.19,
11 | these functions are now deprecated.
12 | }
13 | \usage{
14 | LdFlags()
15 | RcppLdFlags()
16 | }
17 | \value{
18 | An empty string.
19 | }
20 | \references{
21 | Dirk Eddelbuettel and Romain Francois (2011). \pkg{Rcpp}: Seamless R
22 | and C++ Integration. \emph{Journal of Statistical Software},
23 | \bold{40(8)}, 1-18, \doi{10.18637/jss.v040.i08}. Also
24 | available as \code{vignette("Rcpp-introduction")}.
25 | }
26 | \author{Dirk Eddelbuettel and Romain Francois}
27 | \keyword{programming}
28 | \keyword{interface}
29 |
--------------------------------------------------------------------------------
/man/RcppUnitTests.Rd:
--------------------------------------------------------------------------------
1 | \name{RcppUnitTests}
2 | \alias{RcppUnitTests}
3 |
4 | \title{Rcpp : unit tests results}
5 | \description{
6 | Unit tests results for package Rcpp.
7 |
8 | Unit tests are run automatically at build time and reports are included in the
9 | \samp{doc} directory as html or text.
10 | }
11 |
12 | \seealso{
13 | \ifelse{latex}{}{\ifelse{html}{\url{../doc/unitTests-results/Rcpp-unitTests.html}: html formatted unit test report}{\samp{../doc/unitTests-results/Rcpp-unitTests.html}: html formatted unit test report}}
14 | }
15 |
16 | \examples{
17 | # unit tests are in the unitTests directory of the package
18 | list.files( system.file("unitTests", package = "Rcpp" ),
19 | pattern = "^runit", full = TRUE )
20 |
21 | # trigger the unit tests preparation, follow printed instructions
22 | # on how to run them
23 | \dontrun{
24 | source( system.file("unitTests", "runTests.R", package = "Rcpp" ) )
25 | }
26 | }
27 |
28 | \keyword{programming}
29 |
--------------------------------------------------------------------------------
/man/compilerCheck.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/compilerCheck.R
3 | \name{compilerCheck}
4 | \alias{compilerCheck}
5 | \title{Check for Minimal (g++) Compiler Version}
6 | \usage{
7 | compilerCheck(minVersion = package_version("4.6.0"))
8 | }
9 | \arguments{
10 | \item{minVersion}{An object of type \code{package_version}, with a default
11 | of version 4.6.0}
12 | }
13 | \value{
14 | A boolean value is returned, indicating if the minimal version is
15 | being met
16 | }
17 | \description{
18 | Helper function to establish minimal compiler versions, currently limited
19 | only to \code{g++} which (particularly for older RHEL/CentOS releases) is
20 | too far behind current C++11 standards required for some packages.
21 | }
22 | \details{
23 | This function looks up \code{g++} (as well as optional values in the
24 | \code{CXX} and \code{CXX1X} environment variables) in the \code{PATH}. For
25 | all values found, the output of \code{g++ -v} is analyzed for the version
26 | string, which is then compared to the given minimal version.
27 | }
28 | \author{
29 | Dirk Eddelbuettel
30 | }
31 |
32 |
--------------------------------------------------------------------------------
/man/formals.Rd:
--------------------------------------------------------------------------------
1 | \name{formals<--methods}
2 | \docType{methods}
3 | \alias{formals<--methods}
4 | \alias{formals<-,C++Function-method}
5 | \title{Set the formal arguments of a C++ function}
6 | \description{
7 | Set the formal arguments of a C++ function
8 | }
9 | \section{Methods}{
10 | \describe{
11 |
12 | \item{\code{signature(fun = "C++Function")}}{
13 | Set the formal arguments of a C++ function
14 | }
15 | }}
16 | \keyword{methods}
17 |
--------------------------------------------------------------------------------
/man/getRcppVersion.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/tools.R
3 | \name{getRcppVersion}
4 | \alias{getRcppVersion}
5 | \title{Export the Rcpp (API) Package Version}
6 | \usage{
7 | getRcppVersion(devel = FALSE)
8 | }
9 | \arguments{
10 | \item{devel}{An logical value indicating if the development or
11 | release version number should be returned, default is release.}
12 | }
13 | \value{
14 | A \code{package_version} object with either the release
15 | or development version.
16 | }
17 | \description{
18 | Helper function to report the package version of the R installation.
19 | }
20 | \details{
21 | While \code{packageVersion(Rcpp)} exports the version registers in
22 | \code{DESCRIPTION}, this version does get incremented more easily
23 | during development and can therefore be higher than the released
24 | version. The actual \code{#define} long used at the C++ level
25 | corresponds more to an \sQuote{API Version} which is now provided
26 | by this function, and use for example in the package skeleton
27 | generator.
28 | }
29 | \examples{
30 | getRcppVersion()
31 | }
32 | \seealso{
33 | \code{\link{packageVersion}},
34 | \code{\link{Rcpp.package.skeleton}}
35 | }
36 | \author{
37 | Dirk Eddelbuettel
38 | }
39 |
--------------------------------------------------------------------------------
/man/loadRcppModules-deprecated.Rd:
--------------------------------------------------------------------------------
1 | \name{loadRcppModules-deprecated}
2 | \alias{loadRcppModules}
3 | \title{
4 | Loads Rcpp modules on package startup
5 | }
6 | \description{
7 | \emph{Note:} As of release 0.12.5, this function is deprecated;
8 | \code{\link{loadModule}} should be used instead.
9 |
10 | Function to simplify loading Rcpp modules contained in a package.
11 | This function must be called from the \code{.onLoad} function of a package.
12 | It uses the \code{RcppModules} field of the package \code{DESCRIPTION} file
13 | to query the names of the modules that the package should export, loads each module,
14 | and \code{\link{populate}} each module into the package NAMESPACE.
15 | }
16 | \usage{
17 | loadRcppModules(direct=TRUE)
18 | }
19 | \arguments{
20 | \item{direct}{if \code{TRUE} the content of the module is exposed in the
21 | namespace. Otherwise, the module is exposed. }
22 | }
23 | \seealso{
24 | \code{\link{populate}}, \code{\link{loadModule}}
25 | }
26 | \keyword{interface}
27 |
--------------------------------------------------------------------------------
/man/pluginsAttribute.Rd:
--------------------------------------------------------------------------------
1 | \name{pluginsAttribute}
2 | \alias{pluginsAttribute}
3 |
4 | \title{Rcpp::plugins Attribute}
5 |
6 | \description{
7 | The \code{Rcpp::plugins} attribute is added to a C++ source file to specify the
8 | \link[inline:plugins]{inline plugins} that should be used in the compilation.
9 | \preformatted{
10 | // [[Rcpp::plugins(plugin1, plugin2)]]
11 | }
12 | }
13 |
14 | \arguments{
15 | \item{\dots}{
16 | Plugins to add to the compilation.
17 | }
18 | }
19 |
20 | \details{
21 | Plugins must be registered using the \code{\link{registerPlugin}}
22 | function.
23 |
24 | When included within a \code{\link{sourceCpp}} translation unit,
25 | the configuration-related fields of the plugin (e.g. \code{env} and
26 | \code{LinkingTo}) are utilized, however the code-generation fields
27 | (e.g. \code{includes} and \code{body}) are not.
28 |
29 | }
30 | \note{
31 | \pkg{Rcpp} includes a built-in \code{cpp11} plugin that
32 | adds the flags required to enable \code{C++11} features in the compiler.
33 | }
34 |
35 | \seealso{
36 | \code{\link{registerPlugin}}
37 | }
38 |
39 | \examples{
40 | \dontrun{
41 |
42 | // [[Rcpp::plugins(cpp11)]]
43 |
44 | // [[Rcpp::export]]
45 | int useCpp11() {
46 | auto x = 10;
47 | return x;
48 | }
49 | }
50 | }
51 |
52 |
--------------------------------------------------------------------------------
/man/populate.Rd:
--------------------------------------------------------------------------------
1 | \name{populate}
2 | \alias{populate}
3 | \title{
4 | Populates a namespace or an environment with the content of a module
5 | }
6 | \description{
7 | Populates a namespace or an environment with the content of a module
8 | }
9 | \usage{
10 | populate(module, env)
11 | }
12 | \arguments{
13 | \item{module}{Rcpp module}
14 | \item{env}{environment or namespace}
15 | }
16 | \keyword{manip}
17 |
18 |
--------------------------------------------------------------------------------
/man/registerPlugin.Rd:
--------------------------------------------------------------------------------
1 | \name{registerPlugin}
2 | \alias{registerPlugin}
3 | \title{
4 | Register an inline plugin
5 | }
6 | \description{
7 | Register an \link[inline:plugins]{inline plugin} for use with
8 | \code{\link{sourceCpp}} or \code{\link{cppFunction}}. Inline plugins are functions
9 | that return a list with additional includes, environment variables, and
10 | other compilation context.
11 | }
12 | \usage{
13 | registerPlugin(name, plugin)
14 | }
15 | \arguments{
16 | \item{name}{Name of the inline plugin}
17 | \item{plugin}{Inline plugin function}
18 | }
19 | \details{
20 | Plugins can be added to \code{\link{sourceCpp}} compilations using the
21 | \code{\link[=pluginsAttribute]{Rcpp::plugins}} attribute.
22 | }
23 | \seealso{
24 | \code{\link[=pluginsAttribute]{Rcpp::plugins}}
25 | }
26 |
27 |
28 |
--------------------------------------------------------------------------------
/src/Makevars:
--------------------------------------------------------------------------------
1 | PKG_CPPFLAGS = -I../inst/include/
2 |
3 |
--------------------------------------------------------------------------------
/src/Makevars.win:
--------------------------------------------------------------------------------
1 | PKG_CPPFLAGS = -I../inst/include/
2 |
3 |
--------------------------------------------------------------------------------
/vignettes/.gitignore:
--------------------------------------------------------------------------------
1 | Rcpp-*.aux
2 | Rcpp-*.out
3 | Rcpp-*.toc
4 | Rcpp-*.bbl
5 | Rcpp-*.blg
6 | Rcpp-*.log
7 | Rcpp-*.tex
8 | unitTests-results/
9 | rmd/figures/bootstrap.pdf
10 | rmd/OLDbackup
11 | rmd/*_cache
12 | rmd/*.pdf
13 | rmd/*.cls
14 |
--------------------------------------------------------------------------------
/vignettes/Makefile:
--------------------------------------------------------------------------------
1 |
2 | ## No GNUmake for R so replacing efficient wildcard ops with explicit enumeration
3 | ## Remove spaces between ': =' and '$ ( ... )' to re-activate
4 |
5 | ##rnwsources : = $ ( wildcard *.Rnw )
6 | ##rnwvignettes : = $ ( rnwsources:.Rnw=.pdf )
7 |
8 | rnwsources = Rcpp-attributes.Rnw \
9 | Rcpp-extending.Rnw \
10 | Rcpp-FAQ.Rnw \
11 | Rcpp-introduction.Rnw \
12 | Rcpp-jss-2011.Rnw \
13 | Rcpp-libraries.Rnw \
14 | Rcpp-modules.Rnw \
15 | Rcpp-package.Rnw \
16 | Rcpp-quickref.Rnw \
17 | Rcpp-sugar.Rnw
18 |
19 | rnwvignettes = Rcpp-attributes.pdf \
20 | Rcpp-extending.pdf \
21 | Rcpp-FAQ.pdf \
22 | Rcpp-introduction.pdf \
23 | Rcpp-jss-2011.pdf \
24 | Rcpp-libraries.pdf \
25 | Rcpp-modules.pdf \
26 | Rcpp-package.pdf \
27 | Rcpp-quickref.pdf \
28 | Rcpp-sugar.pdf
29 |
30 | %.tex: %.Rnw
31 | Rscript -e 'Sweave("$<")'
32 |
33 | %.pdf: %.tex
34 | Rscript -e 'tools::texi2pdf("$<", texi2dvi="pdflatex")'
35 | Rscript -e 'tools::texi2pdf("$<", texi2dvi="pdflatex")'
36 | Rscript -e 'tools::compactPDF("$@", gs_quality="ebook")'
37 |
38 | all: ${rnwvignettes}
39 | @rm -f *.aux *.log *.tex
40 |
41 | clean:
42 | @rm -f *.aux *.log *.tex
43 |
--------------------------------------------------------------------------------
/vignettes/Rcpp-FAQ.Rnw:
--------------------------------------------------------------------------------
1 | \documentclass{article}
2 | \usepackage{pdfpages}
3 | %\VignetteIndexEntry{Rcpp-FAQ}
4 | %\VignetteKeywords{Rcpp, FAQ, R, Cpp}
5 | %\VignettePackage{Rcpp}
6 | %\VignetteEncoding{UTF-8}
7 |
8 | \begin{document}
9 | \includepdf[pages=-, fitpaper=true]{pdf/Rcpp-FAQ.pdf}
10 | \end{document}
11 |
--------------------------------------------------------------------------------
/vignettes/Rcpp-FAQ.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RcppCore/Rcpp/f3e4b2d7aad1ec9fca1acdbb15c5db43aa7c1f91/vignettes/Rcpp-FAQ.pdf
--------------------------------------------------------------------------------
/vignettes/Rcpp-attributes.Rnw:
--------------------------------------------------------------------------------
1 | \documentclass{article}
2 | \usepackage{pdfpages}
3 | %\VignetteIndexEntry{Rcpp-attributes}
4 | %\VignetteKeywords{Rcpp, attributes, R, Cpp}
5 | %\VignettePackage{Rcpp}
6 | %\VignetteEncoding{UTF-8}
7 |
8 | \begin{document}
9 | \includepdf[pages=-, fitpaper=true]{pdf/Rcpp-attributes.pdf}
10 | \end{document}
11 |
--------------------------------------------------------------------------------
/vignettes/Rcpp-attributes.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RcppCore/Rcpp/f3e4b2d7aad1ec9fca1acdbb15c5db43aa7c1f91/vignettes/Rcpp-attributes.pdf
--------------------------------------------------------------------------------
/vignettes/Rcpp-extending.Rnw:
--------------------------------------------------------------------------------
1 | \documentclass{article}
2 | \usepackage{pdfpages}
3 | %\VignetteIndexEntry{Rcpp-extending}
4 | %\VignetteKeywords{Rcpp, extending, R, Cpp}
5 | %\VignettePackage{Rcpp}
6 | %\VignetteEncoding{UTF-8}
7 |
8 | \begin{document}
9 | \includepdf[pages=-, fitpaper=true]{pdf/Rcpp-extending.pdf}
10 | \end{document}
11 |
--------------------------------------------------------------------------------
/vignettes/Rcpp-extending.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RcppCore/Rcpp/f3e4b2d7aad1ec9fca1acdbb15c5db43aa7c1f91/vignettes/Rcpp-extending.pdf
--------------------------------------------------------------------------------
/vignettes/Rcpp-introduction.Rnw:
--------------------------------------------------------------------------------
1 | \documentclass{article}
2 | \usepackage{pdfpages}
3 | %\VignetteIndexEntry{Rcpp-introduction}
4 | %\VignetteKeywords{Rcpp, R, Cpp}
5 | %\VignettePackage{Rcpp}
6 | %\VignetteEncoding{UTF-8}
7 |
8 | \begin{document}
9 | \includepdf[pages=-, fitpaper=true]{pdf/Rcpp-introduction.pdf}
10 | \end{document}
11 |
12 |
--------------------------------------------------------------------------------
/vignettes/Rcpp-introduction.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RcppCore/Rcpp/f3e4b2d7aad1ec9fca1acdbb15c5db43aa7c1f91/vignettes/Rcpp-introduction.pdf
--------------------------------------------------------------------------------
/vignettes/Rcpp-jss-2011.Rnw:
--------------------------------------------------------------------------------
1 | \documentclass{article}
2 | \usepackage{pdfpages}
3 | %\VignetteIndexEntry{Rcpp-JSS-2011}
4 | %\VignetteKeywords{Rcpp, foreign function interface, .Call, C++, R}
5 | %\VignettePackage{Rcpp}
6 | %\VignetteEncoding{UTF-8}
7 |
8 | \begin{document}
9 | \includepdf[pages=-, fitpaper=true]{pdf/Rcpp-jss-2011.pdf}
10 | \end{document}
11 |
12 |
--------------------------------------------------------------------------------
/vignettes/Rcpp-jss-2011.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RcppCore/Rcpp/f3e4b2d7aad1ec9fca1acdbb15c5db43aa7c1f91/vignettes/Rcpp-jss-2011.pdf
--------------------------------------------------------------------------------
/vignettes/Rcpp-libraries.Rnw:
--------------------------------------------------------------------------------
1 | \documentclass{article}
2 | \usepackage{pdfpages}
3 | %\VignetteIndexEntry{Rcpp-libraries}
4 | %\VignetteKeywords{Rcpp, Package, Library}
5 | %\VignettePackage{Rcpp}
6 | %\VignetteEncoding{UTF-8}
7 |
8 | \begin{document}
9 | \includepdf[pages=-, fitpaper=true]{pdf/Rcpp-libraries.pdf}
10 | \end{document}
11 |
--------------------------------------------------------------------------------
/vignettes/Rcpp-libraries.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RcppCore/Rcpp/f3e4b2d7aad1ec9fca1acdbb15c5db43aa7c1f91/vignettes/Rcpp-libraries.pdf
--------------------------------------------------------------------------------
/vignettes/Rcpp-modules.Rnw:
--------------------------------------------------------------------------------
1 | \documentclass{article}
2 | \usepackage{pdfpages}
3 | %\VignetteIndexEntry{Rcpp-modules}
4 | %\VignetteKeywords{Rcpp, modules, R, Cpp}
5 | %\VignettePackage{Rcpp}
6 | %\VignetteEncoding{UTF-8}
7 |
8 | \begin{document}
9 | \includepdf[pages=-, fitpaper=true]{pdf/Rcpp-modules.pdf}
10 | \end{document}
11 |
--------------------------------------------------------------------------------
/vignettes/Rcpp-modules.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RcppCore/Rcpp/f3e4b2d7aad1ec9fca1acdbb15c5db43aa7c1f91/vignettes/Rcpp-modules.pdf
--------------------------------------------------------------------------------
/vignettes/Rcpp-package.Rnw:
--------------------------------------------------------------------------------
1 | \documentclass{article}
2 | \usepackage{pdfpages}
3 | %\VignetteIndexEntry{Rcpp-package}
4 | %\VignetteKeywords{Rcpp, package, R, Cpp}
5 | %\VignettePackage{Rcpp}
6 | %\VignetteEncoding{UTF-8}
7 |
8 | \begin{document}
9 | \includepdf[pages=-, fitpaper=true]{pdf/Rcpp-package.pdf}
10 | \end{document}
11 |
--------------------------------------------------------------------------------
/vignettes/Rcpp-package.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RcppCore/Rcpp/f3e4b2d7aad1ec9fca1acdbb15c5db43aa7c1f91/vignettes/Rcpp-package.pdf
--------------------------------------------------------------------------------
/vignettes/Rcpp-quickref.Rnw:
--------------------------------------------------------------------------------
1 | \documentclass{article}
2 | \usepackage{pdfpages}
3 | %\VignetteIndexEntry{Rcpp-quickref}
4 | %\VignetteKeywords{Rcpp, quickref, R, Cpp}
5 | %\VignettePackage{Rcpp}
6 | %\VignetteEncoding{UTF-8}
7 |
8 | \begin{document}
9 | \includepdf[pages=-, fitpaper=true]{pdf/Rcpp-quickref.pdf}
10 | \end{document}
11 |
--------------------------------------------------------------------------------
/vignettes/Rcpp-quickref.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RcppCore/Rcpp/f3e4b2d7aad1ec9fca1acdbb15c5db43aa7c1f91/vignettes/Rcpp-quickref.pdf
--------------------------------------------------------------------------------
/vignettes/Rcpp-sugar.Rnw:
--------------------------------------------------------------------------------
1 | \documentclass{article}
2 | \usepackage{pdfpages}
3 | %\VignetteIndexEntry{Rcpp-sugar}
4 | %\VignetteKeywords{Rcpp, sugar, R, Cpp}
5 | %\VignettePackage{Rcpp}
6 | %\VignetteEncoding{UTF-8}
7 |
8 | \begin{document}
9 | \includepdf[pages=-, fitpaper=true]{pdf/Rcpp-sugar.pdf}
10 | \end{document}
11 |
--------------------------------------------------------------------------------
/vignettes/Rcpp-sugar.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RcppCore/Rcpp/f3e4b2d7aad1ec9fca1acdbb15c5db43aa7c1f91/vignettes/Rcpp-sugar.pdf
--------------------------------------------------------------------------------
/vignettes/pdf/Rcpp-FAQ.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RcppCore/Rcpp/f3e4b2d7aad1ec9fca1acdbb15c5db43aa7c1f91/vignettes/pdf/Rcpp-FAQ.pdf
--------------------------------------------------------------------------------
/vignettes/pdf/Rcpp-attributes.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RcppCore/Rcpp/f3e4b2d7aad1ec9fca1acdbb15c5db43aa7c1f91/vignettes/pdf/Rcpp-attributes.pdf
--------------------------------------------------------------------------------
/vignettes/pdf/Rcpp-extending.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RcppCore/Rcpp/f3e4b2d7aad1ec9fca1acdbb15c5db43aa7c1f91/vignettes/pdf/Rcpp-extending.pdf
--------------------------------------------------------------------------------
/vignettes/pdf/Rcpp-introduction.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RcppCore/Rcpp/f3e4b2d7aad1ec9fca1acdbb15c5db43aa7c1f91/vignettes/pdf/Rcpp-introduction.pdf
--------------------------------------------------------------------------------
/vignettes/pdf/Rcpp-jss-2011.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RcppCore/Rcpp/f3e4b2d7aad1ec9fca1acdbb15c5db43aa7c1f91/vignettes/pdf/Rcpp-jss-2011.pdf
--------------------------------------------------------------------------------
/vignettes/pdf/Rcpp-libraries.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RcppCore/Rcpp/f3e4b2d7aad1ec9fca1acdbb15c5db43aa7c1f91/vignettes/pdf/Rcpp-libraries.pdf
--------------------------------------------------------------------------------
/vignettes/pdf/Rcpp-modules.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RcppCore/Rcpp/f3e4b2d7aad1ec9fca1acdbb15c5db43aa7c1f91/vignettes/pdf/Rcpp-modules.pdf
--------------------------------------------------------------------------------
/vignettes/pdf/Rcpp-package.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RcppCore/Rcpp/f3e4b2d7aad1ec9fca1acdbb15c5db43aa7c1f91/vignettes/pdf/Rcpp-package.pdf
--------------------------------------------------------------------------------
/vignettes/pdf/Rcpp-quickref.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RcppCore/Rcpp/f3e4b2d7aad1ec9fca1acdbb15c5db43aa7c1f91/vignettes/pdf/Rcpp-quickref.pdf
--------------------------------------------------------------------------------
/vignettes/pdf/Rcpp-sugar.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RcppCore/Rcpp/f3e4b2d7aad1ec9fca1acdbb15c5db43aa7c1f91/vignettes/pdf/Rcpp-sugar.pdf
--------------------------------------------------------------------------------
/vignettes/rmd/.install_extras:
--------------------------------------------------------------------------------
1 | Rcpp.bib
2 | rcpp.index.html
3 |
--------------------------------------------------------------------------------
/vignettes/rmd/Makefile:
--------------------------------------------------------------------------------
1 |
2 | ## This Makefile is not included in the package sources so we can use GNUmake idioms. Yay.
3 |
4 | rmdsources := $(wildcard *.Rmd)
5 | rmdvignettes := $(rmdsources:.Rmd=.pdf)
6 |
7 | %.pdf: %.Rmd
8 | Rscript -e 'rmarkdown::render("$<")'
9 | Rscript -e 'tools::compactPDF("$@", gs_quality="ebook")'
10 | cp -vax $@ ../pdf
11 |
12 | all: ${rmdvignettes} Rcpp-jss-2011.pdf
13 |
14 | Rcpp-jss-2011.tex: Rcpp-jss-2011.Rnw
15 | Rscript -e 'Sweave("$<")'
16 |
17 | Rcpp-jss-2011.pdf: Rcpp-jss-2011.tex
18 | Rscript -e 'tools::texi2pdf("$<", texi2dvi="pdflatex")'
19 | bibtex Rcpp-jss-2011.aux
20 | Rscript -e 'tools::texi2pdf("$<", texi2dvi="pdflatex")'
21 | Rscript -e 'tools::compactPDF("$@", gs_quality="ebook")'
22 | cp -vax $@ ../pdf
23 |
24 | clean:
25 | @rm -rf *.aux *.log *.out *.toc *.tex *.pdf Rcpp-introduction_cache Rcpp-libraries_cache pinp.cls Rcpp-jss-2011.bbl Rcpp-jss-2011.blg auto
26 |
--------------------------------------------------------------------------------
/vignettes/rmd/figures/bootstrap.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RcppCore/Rcpp/f3e4b2d7aad1ec9fca1acdbb15c5db43aa7c1f91/vignettes/rmd/figures/bootstrap.pdf
--------------------------------------------------------------------------------
/vignettes/rmd/figures/dist_graphs-1.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RcppCore/Rcpp/f3e4b2d7aad1ec9fca1acdbb15c5db43aa7c1f91/vignettes/rmd/figures/dist_graphs-1.pdf
--------------------------------------------------------------------------------
/vignettes/rmd/figures/function_annotation_cpp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RcppCore/Rcpp/f3e4b2d7aad1ec9fca1acdbb15c5db43aa7c1f91/vignettes/rmd/figures/function_annotation_cpp.png
--------------------------------------------------------------------------------
/vignettes/rmd/figures/samplePkg-files-light-bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RcppCore/Rcpp/f3e4b2d7aad1ec9fca1acdbb15c5db43aa7c1f91/vignettes/rmd/figures/samplePkg-files-light-bg.png
--------------------------------------------------------------------------------
/vignettes/rmd/getCurrentVersionsOfCitedPackages.R:
--------------------------------------------------------------------------------
1 | #!/usr/bin/r
2 |
3 | stopifnot(`Needs data.table` = requireNamespace("data.table", quietly = TRUE))
4 | library(data.table)
5 |
6 | if (!file.exists("Rcpp.bib")) setwd("~/git/rcpp/vignettes/rmd")
7 |
8 | cmd <- "awk '/package=/ { print($5) }' Rcpp.bib | sed -e 's/\"//g' - | awk -F= '{print($2)}' | sort | uniq"
9 | con <- pipe(cmd)
10 | pkgs <- readLines(con)
11 | close(con)
12 |
13 | pkg <- data.table(Package=pkgs)
14 |
15 | db <- data.table(tools::CRAN_package_db())
16 |
17 | print(db[pkg, on="Package"][, .(Package, Version, Date)])
18 |
--------------------------------------------------------------------------------