diff --git a/.Rbuildignore b/.Rbuildignore index 8a7f48938..a650b4086 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -6,27 +6,10 @@ inst/doc/jss.bst vignettes/jss.bst ^.*\.Rproj$ ^\.Rproj\.user$ +inst/include/Rcpp/preprocessor +inst/include/Rcpp/sugar/functions/impl vignettes/notyet doxyfile -\.travis\.yml -\.dir-locals\.el -\.clang_format +.travis.yml +.dir-locals.el vignettes/getCurrentVersionsOfCitedPackages.R -^Contributing.md$ -^\.codecov\.yml$ -inst/include/Rcpp.h.new -inst/include/Rcpp.h.old -LICENSE -.*\.tar\.gz$ -\.editorconfig -docker -^GPATH -^GRTAGS -^GTAGS -^local -vignettes/Makefile -vignettes/rmd -\.github -^issue.*\.md -^note.*\.md -\.vscode diff --git a/.codecov.yml b/.codecov.yml deleted file mode 100644 index e10eb4a78..000000000 --- a/.codecov.yml +++ /dev/null @@ -1,21 +0,0 @@ -comment: false - -coverage: - status: - project: - default: - target: 70% # the (on purpose low) required coverage value - threshold: 2% # the permitted delta in hitting the target - patch: - default: - target: 0% # the (on purpose low) required coverage value - -ignore: - - 'R/inline.R' # function factory setup confuses codecov - -# layout: "header, diff, tree, changes" -# behavior: default -# require_changes: false # if true: only post the comment if coverage changes -# branches: null -# flags: null -# paths: null diff --git a/.dir-locals.el b/.dir-locals.el new file mode 100644 index 000000000..ec1c384e3 --- /dev/null +++ b/.dir-locals.el @@ -0,0 +1,22 @@ +;; -*- emacs-lisp -*- +((nil . + ( + (tab-width . 8) + (indent-tabs-mode . nil) + (fill-column . 80) + )) + (c++-mode . + ( + (indent-tabs-mode . nil) + (tab-width . 8) + (show-trailing-whitespace . t) + (indicate-empty-lines . t) + (c-basic-offset . 4) + (eval . (progn + (c-set-offset 'innamespace '0) + (c-set-offset 'inline-open '0) + ) + ) + ) + ) + ) diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index c971b7487..000000000 --- a/.editorconfig +++ /dev/null @@ -1,21 +0,0 @@ -# EditorConfig is awesome: http://EditorConfig.org - -# top-most EditorConfig file -root = true - -# Unix-style newlines with a newline ending every file -[*] -end_of_line = lf -insert_final_newline = true -trim_trailing_whitespace = true - -# Matches multiple files with brace expansion notation -# 4 space indentation -[*.{c,cpp,h,hpp,R,r}] -indent_style = space -indent_size = 4 - -# Tab indentation (no size specified) -[Makefile] -indent_style = tab - diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 0d3b3d5db..000000000 --- a/.gitattributes +++ /dev/null @@ -1,5 +0,0 @@ -ChangeLog merge=union -inst/NEWS.Rd merge=union - -# gitattribute override for linguist -*.h linguist-language=C++ diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md deleted file mode 100644 index 51369d05d..000000000 --- a/.github/CONTRIBUTING.md +++ /dev/null @@ -1,9 +0,0 @@ - -### Contributing to Rcpp - -Please see the file [Contributing](https://github.com/RcppCore/Rcpp/blob/master/Contributing.md) for details on - -- 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; -- how to submit a pull request: post an issue first, get consensus about _what_ and _how_; -- how to follow our (informal) coding style: simply do as other files do and do not invent a new style; -- 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). diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 83387190d..000000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -github: eddelbuettel diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index b3944d4ad..000000000 --- a/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,16 +0,0 @@ - -### Reporting an Issue - -Make use of the *Preview* tab just above! - -#### Before filing an issue with Rcpp, please ensure that you - -- 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`; - -- searched the [StackOverflow](https://stackoverflow.com/) `[rcpp]` tag _e.g._ via `[rcpp] how do I sample a vector`; - -- searched existing [GitHub issues](https://github.com/RcppCore/Rcpp/issues) which can be searched among open and closed ones; - -- read the [Contributing](https://github.com/RcppCore/Rcpp/blob/master/Contributing.md) page for details on preferred reporting and style; - -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. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 34891f791..000000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,11 +0,0 @@ - -### Pull Request Template for Rcpp - -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. - -#### Checklist - -- [ ] Code compiles correctly -- [ ] `R CMD check` still passes all tests -- [ ] Preferably, new tests were added which fail without the change -- [ ] Document the changes by file in [ChangeLog](https://github.com/RcppCore/Rcpp/blob/master/ChangeLog) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml deleted file mode 100644 index ff9bc220f..000000000 --- a/.github/workflows/ci.yaml +++ /dev/null @@ -1,80 +0,0 @@ -# Run CI for R using https://eddelbuettel.github.io/r-ci/ -# This file is a slight variant by running a matrix of containers - -name: ci - -on: - push: - pull_request: - -env: - USE_BSPM: "true" - _R_CHECK_FORCE_SUGGESTS_: "false" - -jobs: - ci: - - runs-on: ubuntu-latest - - container: - image: ${{ matrix.cntr }} - - strategy: - matrix: - include: - - name: release - cntr: rcpp/ci - r: R - - name: r-4.4 - cntr: rcpp/ci-4.4 - r: R - - name: r-4.3 - cntr: rcpp/ci-4.3 - r: R - - name: r-4.2 - cntr: rcpp/ci-4.2 - r: R - - name: r-4.1 - cntr: rcpp/ci-4.1 - r: R - - name: r-4.0 - cntr: rcpp/ci-4.0 - r: R - - name: r-3.6 - cntr: rcpp/ci-3.6 - r: R - - name: r-3.5 - cntr: rcpp/ci-3.5 - r: R - - name: dev - cntr: rcpp/ci-dev - r: RD - - steps: - - uses: actions/checkout@v5 - - - name: SessionInfo - run: ${{ matrix.r }} -q -e 'sessionInfo()' - - - name: Build - run: ${{matrix.r }} CMD build --no-build-vignettes --no-manual . - - - name: Check - run: CI=true ${{ matrix.r }} CMD check --no-vignettes --no-manual Rcpp_*.tar.gz - - covr: - runs-on: ubuntu-latest - steps: - - name: Checkout Project - uses: actions/checkout@v5 - - - name: Setup - uses: eddelbuettel/github-actions/r-ci@master - - - name: Dependencies - run: ./run.sh install_deps - - - name: Coverage - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - run: ./run.sh coverage diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml deleted file mode 100644 index 5ac954e67..000000000 --- a/.github/workflows/docker.yaml +++ /dev/null @@ -1,91 +0,0 @@ -name: docker - -on: - push: - branches: - - master - workflow_dispatch: - schedule: - - cron: "32 1 * * 6" - -jobs: - docker-ci: - runs-on: ubuntu-latest - name: ${{ matrix.tag }} - - strategy: - fail-fast: false - matrix: - tag: [ci, ci-dev] - - steps: - - name: Checkout - uses: actions/checkout@v6 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Login to DockerHub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Build and push - uses: docker/build-push-action@v3 - with: - push: true - context: docker/${{ matrix.tag }} - tags: rcpp/${{ matrix.tag }} - - - docker-run: - runs-on: ubuntu-latest - name: run - needs: docker-ci - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Login to DockerHub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Build and push - uses: docker/build-push-action@v3 - with: - push: true - context: docker/run - tags: rcpp/run - - - docker-plus: - runs-on: ubuntu-latest - name: plus - needs: docker-run - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Login to DockerHub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Build and push - uses: docker/build-push-action@v3 - with: - push: true - context: docker/plus - tags: rcpp/plus diff --git a/.github/workflows/linuxarm.yaml b/.github/workflows/linuxarm.yaml deleted file mode 100644 index fa328c13b..000000000 --- a/.github/workflows/linuxarm.yaml +++ /dev/null @@ -1,38 +0,0 @@ -# Run CI for R using https://eddelbuettel.github.io/r-ci/ - -name: linuxarm - -on: - #push: - #pull_request: - workflow_dispatch: - -env: - _R_CHECK_FORCE_SUGGESTS_: "false" - -jobs: - ci: - strategy: - matrix: - include: - #- {os: ubuntu-latest} - - {os: ubuntu-24.04-arm} - - runs-on: ${{ matrix.os }} - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup - uses: eddelbuettel/github-actions/r-ci@master - - - name: Dependencies - run: ./run.sh install_deps - - - name: Test - run: ./run.sh run_tests - - #- name: Coverage - # if: ${{ matrix.os == 'ubuntu-latest' }} - # run: ./run.sh coverage diff --git a/.github/workflows/macos.yaml b/.github/workflows/macos.yaml deleted file mode 100644 index 373f3462e..000000000 --- a/.github/workflows/macos.yaml +++ /dev/null @@ -1,39 +0,0 @@ -# Run CI for R using https://eddelbuettel.github.io/r-ci/ - -name: macos - -on: - push: - pull_request: - -env: - _R_CHECK_FORCE_SUGGESTS_: "false" - -jobs: - ci: - strategy: - matrix: - include: - - {os: macos-latest} - - {os: macos-14} - #- {os: ubuntu-latest} - #- {os: ubuntu-24.04-arm} - - runs-on: ${{ matrix.os }} - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup - uses: eddelbuettel/github-actions/r-ci@master - - - name: Dependencies - run: ./run.sh install_deps - - - name: Test - run: ./run.sh run_tests - - #- name: Coverage - # if: ${{ matrix.os == 'ubuntu-latest' }} - # run: ./run.sh coverage diff --git a/.github/workflows/stale.yaml b/.github/workflows/stale.yaml deleted file mode 100644 index 1f73e3641..000000000 --- a/.github/workflows/stale.yaml +++ /dev/null @@ -1,28 +0,0 @@ -# Mark stale issues and pull requests -# cf https://github.com/actions/stale - -name: stale - -on: - schedule: - - cron: "11 1 * * 6" - -jobs: - stale: - runs-on: ubuntu-latest - steps: - - uses: actions/stale@v8 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-issue-label: 'no-issue-activity' - stale-pr-label: 'no-pr-activity' - days-before-stale: 365 - days-before-close: 31 - stale-issue-message: > - This issue is stale (365 days without activity) and will be closed - in 31 days unless new activity is seen. Please feel free to re-open - it is still a concern, possibly with additional data. - stale-pr-message: > - This pull request is is stale (365 days without activity) and will - be closed in 31 days unless new activity is seen. Please feel free - to open a new issue to discuss a fresh approach. diff --git a/.gitignore b/.gitignore index e93d0f4c2..d35c2da11 100644 --- a/.gitignore +++ b/.gitignore @@ -3,35 +3,10 @@ inst/lib src/*.o src/*.so src/*.dll -src/symbols.rds .Rhistory -.RData -.DS_Store ## QtCreator Rcpp.pro Rcpp.pro.user *.autosave .#* - -*.tar.gz - -vignettes/*_cache - -## GNU global -GPATH -GRTAGS -GTAGS - -## -local/ - -## docker helpers -docker/*sh -docker/*/*.sh - -## Emacs -*~ - -## VSCode -.vscode/ diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..3cc684225 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,38 @@ +# Sample .travis.yml for R projects. +# +# See README.md for instructions, or for more configuration options, +# see the wiki: +# https://github.com/craigcitro/r-travis/wiki + +language: c + +env: + global: + - R_BUILD_ARGS="--no-build-vignettes --no-manual" + - R_CHECK_ARGS="--no-build-vignettes --no-manual --as-cran" + - RunAllRcppTests="yes" + - CRAN="http://cran.us.r-project.org" + +before_install: + - curl -OL http://raw.github.com/craigcitro/r-travis/master/scripts/travis-tool.sh + - chmod 755 ./travis-tool.sh + - ./travis-tool.sh bootstrap + - sudo add-apt-repository -y ppa:edd/misc + - sudo apt-get update -q + +install: + - ./travis-tool.sh install_aptget r-cran-runit r-cran-inline r-cran-rbenchmark r-cran-highlight r-cran-pkgkitten + +script: + - ./travis-tool.sh run_tests + +after_failure: + - ./travis-tool.sh dump_logs + +notifications: + email: + on_success: change + on_failure: change + + + diff --git a/ChangeLog b/ChangeLog index 7805db621..1b20a0566 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5021 +1,3 @@ -2026-01-06 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version and date - * inst/include/Rcpp/config.h: Idem - - * vignettes/rmd/Rcpp.bib: Update package versions dates - * inst/bib/Rcpp.bib: Idem - -2026-01-04 Dirk Eddelbuettel - - * inst/include/RcppCommon.h: No longer require RCPP_USING_UNWIND_PROTECT - * inst/include/Rcpp/r/headers.h: Idem - * inst/include/Rcpp/api/meat/Rcpp_eval.h: Idem - * inst/tinytest/cpp/stack.cpp: No longer test with RCPP_USING_UNWIND_PROTECT - * inst/tinytest/test_interface.R: Idem - -2026-01-01 Dirk Eddelbuettel - - * R/Attributes.R: Additional or adjusted #nocov tags - * R/Rcpp.package.skeleton.R: Idem - * R/RcppLdpath.R: Idem - * R/asis.R: Idem - * R/inline.R: Idem - * inst/include/Rcpp/api/meat/Rcpp_eval.h: Idem - * inst/include/Rcpp/internal/caster.h: Idem - * inst/include/Rcpp/internal/export.h: Idem - * inst/include/Rcpp/proxy/NamesProxy.h: Idem - * inst/include/Rcpp/proxy/SlotProxy.h: Idem - * inst/include/Rcpp/vector/Vector.h: Idem - * inst/include/Rcpp/vector/proxy.h: Idem - * inst/include/Rcpp/vector/traits.h: Idem - * inst/include/Rcpp/Environment.h: Idem - * inst/include/Rcpp/Function.h: Idem - * inst/include/Rcpp/Module.h: Idem - * inst/include/Rcpp/S4.h: Idem - * inst/include/Rcpp/as.h: Idem - * inst/include/Rcpp/exceptions.h: Idem - * inst/include/Rcpp/r_cast.h: Idem - * src/attributes.cpp: Idem - * src/barrier.cpp: Idem - -2025-12-30 Dirk Eddelbuettel - - * tests/tinytest.R: Refine decision of when not to run all tests even - when development version number is seen - -2025-12-28 Dirk Eddelbuettel - - * README.md: Replace installation from drat section with r-universe - -2025-12-22 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version and date - * inst/include/Rcpp/config.h: Idem - - * inst/include/Rcpp/DataFrame.h (nrow): Simplified per #1430 discussion - relying on compact sequence representation removing use of ATTRIB - * inst/include/Rcpp/proxy/AttributeProxy.h (hasAttribute): For R - 4.6.0, rewritten using R_mapAttrib() avoiding to-be-removed ATTRIB() - -2025-12-21 Dirk Eddelbuettel - - * .github/workflows/docker.yaml: Add workflow_dispatch, update - checkout action - -2025-12-19 Dirk Eddelbuettel - - * man/RcppUnitTests.Rd: Removed outdated help page - -2025-12-17 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version and date - * inst/include/Rcpp/config.h: Idem - - * DESCRIPTION (Depends): Add 'R (>= 3.5.0)' - -2025-12-16 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version and date - * inst/include/Rcpp/config.h: Idem - - * src/barrier.cpp (dataptr): Remove check for 'R (>= 3.5.0)' - * inst/include/Rcpp/Rmath.h: Remove check for 'R (>= 3.1.2)' - * inst/include/Rcpp/Symbol.h: Remove check for 'R (>= 3.2.0)' - * inst/include/Rcpp/exceptions.h: Remove check for 'R (>= 3.5.0)' - * inst/include/Rcpp/r/headers.h: Idem - - * R/Attributes.R: Remove multiple checks for R version < 3.5.0 - * R/Rcpp.package.skeleton.R: Idem - * inst/tinytest/testRcppInterfaceUser/tests/tests.R: Remove one check - -2025-12-12 Dirk Eddelbuettel - - * inst/tinytest/test_system.R: Wrap suppressMessages() around three - tests for long-obsolete linker and compiler flags - - * inst/include/Rcpp/Environment.h: Replace use of Rf_findVarInFrame - with R_getVarEx (or R_getVar) if R 4.5.0 or later is used - * inst/include/Rcpp/Function.h: Idem - * src/barrier.cpp: Idem - -2025-12-10 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version and date - * inst/include/Rcpp/config.h: Idem - - * inst/include/Rcpp/Rmath.h: Do not access Rf_rnbeta - * inst/include/Rcpp/sugar/undoRmath.h: Remove #undef - -2025-12-06 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version and date - * inst/include/Rcpp/config.h: Idem - * inst/NEWS.Rd: Updated - -2025-12-04 Iñaki Ucar - - * inst/include/Rcpp/r/headers.h: Include - * inst/include/RcppCommon.h: Drop , not used anymore - and dropped from the API; drop , included above - * src/api.cpp: Drop , dropped from the API - -2025-12-03 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version and date - * inst/include/Rcpp/config.h: Idem - -2025-12-02 Dirk Eddelbuettel - - * R/loadRcppModules.R: Remove file with function deprecated years ago - * man/loadRcppModules-deprecated.Rd: Idem - * NAMESPACE: Remove reference to loadRcppModules() - * man/loadModule.Rd: Idem - * man/Rcpp-deprecated.Rd: Idem - * vignettes/rmd/Rcpp-modules.Rmd: Idem - -2025-12-01 Kevin Ushey - - * R/Attributes.R: Update OpenMP plugin for macOS - -2025-11-29 Dirk Eddelbuettel - - * R/RcppLdpath.R: Revisit deprecation warnings via 'message()' to be - turned into warning or deprecation in 12 or more months 'when suitable' - -2025-11-24 Dirk Eddelbuettel - - * inst/include/Rcpp/r/check_r_headers.h: Add RCPP_NO_R_HEADERS_CHECK - override to skip new check - -2025-11-23 Dirk Eddelbuettel - - * inst/include/Rcpp/r/check_r_headers.h: New header to check if R.h - or related R headers were installed first - * inst/include/RcppCommon.h: Call new header as first thing - -2025-11-12 Iñaki Ucar - - * inst/include/Rcpp/macros/mask.h: Lay the ground for Rf_error masking - with a warning at compilation time unless RCPP_NO_MASK_RF_ERROR is defined - * inst/include/RcppCommon.h: Include the previous file in the last place - * src/attributes.cpp: Use parentheses to protect call to Rf_error - * inst/tinytest/cpp/stack.cpp: Idem - * inst/tinytest/testRcppInterfaceExporter/src/RcppExports.cpp: Idem - -2025-11-04 Dirk Eddelbuettel - - * .github/workflows/macos.yaml (jobs): Roll macos-13 to macos-14 - -2025-11-01 Iñaki Ucar - - * inst/include/Rcpp/hash/IndexHash.h: Normalize values for all comparisons - * inst/include/Rcpp/hash/SelfHash.h: Idem - * inst/tinytest/test_sugar.R: Add test for signed zeroes - -2025-10-21 Iñaki Ucar - - * inst/include/Rcpp/exceptions_impl.h: Use __has_include to simplify checks - to enable demangling, making them robust for more platforms - -2025-10-13 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version and date - * inst/include/Rcpp/config.h: Idem - - * inst/tinytest/test_sugar.R: Simplify and generalize the August fix - as we no longer need to control for R-devel which has been corrected - -2025-09-04 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version and date - * inst/include/Rcpp/config.h: Idem - - * inst/include/Rcpp/internal/wrap.h (make_charsexp__impl__cstring): - Avoid a narrowing warning by casting explicitly - -2025-08-26 Dirk Eddelbuettel - - * inst/tinytest/test_sugar.R: For r-devel, use apply(x, DIM, mean, - na.rm=TRUE) instead of (row|col)Means for complex NA valued matrices - -2025-08-24 Dirk Eddelbuettel - - * .github/workflows/ci.yaml (jobs): Re-enable coverage, roll checkout - action to v5 - - * inst/tinytest/test_sugar.R: For now, park two tests of complex - matrix row and col means under R-devel, this could be a R-devel issue - -2025-07-20 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version and date - * inst/include/Rcpp/config.h: Idem - - * R/compilerCheck.R: Remove unused function - * man/compilerCheck.Rd: Remove its documentation - -2025-07-19 Dirk Eddelbuettel - - * vignettes/rmd/Rcpp.bib: Use DOI for R citation - * inst/bib/Rcpp.bib: Idem - -2025-07-18 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version and date - * inst/include/Rcpp/config.h: Idem - - * R/asis.R (asisWeave, asisTangle): Borrowed with thanks from R.rsp - and shortened / simplified to provide 'asis' vignette processor - * R/zzz.R (.onLoad): Register new vignette processor - * vignettes/*.asis: New files with vignette info from .Rnw files - * vignettes/pdf/*.pdf: Moved to directory vignettes/ - * vignettes/*.Rnw: Removed - * man/asisWeave.Rd: Documentation - -2025-07-01 Dirk Eddelbuettel - - * DESCRIPTION (Date, Version): Release 1.1.0 - - * inst/include/Rcpp/config.h: Idem - * inst/NEWS.Rd: Idem - * vignettes/rmd/Rcpp.bib: Idem - * inst/bib/Rcpp.bib: Idem - * vignettes/pdf/*: Rebuilt - -2025-06-25 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version and date - * inst/include/Rcpp/config.h: Idem - -2025-06-18 Dirk Eddelbuettel - - * vignettes/rmd/Rcpp.bib: Use doi references for CRAN packages, - update versions, update some package titles - * inst/bib/Rcpp.bib: Idem - * vignettes/pdf/*: Re-rendered - -2025-06-05 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version and date - * inst/include/Rcpp/config.h: Idem - -2025-06-02 Kevin Ushey - - * inst/include/Rcpp.h: Avoid copy when creating Language objects - * inst/include/Rcpp/Language.h: Idem - * inst/include/Rcpp/lgrow.h: Idem - * inst/tinytest/cpp/language.cpp: Idem - * inst/tinytest/test_language.R: Idem - -2025-05-27 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version and date - * inst/include/Rcpp/config.h: Idem - -2025-05-23 Dirk Eddelbuettel - - * inst/include/Rcpp/date_datetime/newDateVector.h: Add default - constructor - * inst/include/Rcpp/date_datetime/newDatetimeVector.h: Idem - - * inst/tinytest/test_date.R: Add tests - * inst/tinytest/cpp/dates.cpp: Idem - -2025-05-06 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version and date - * inst/include/Rcpp/config.h: Idem - - * R/Attributes.R: Support C++26 via plugin - -2025-05-05 Dirk Eddelbuettel - - * inst/tinytest/test_sugar.R: Condition four NA-related tests away on - arm64 on Linux too - - * .github/workflows/linuxarm.yaml (jobs): Add ubuntu-24.04-arm as - optional workflow_dispatch run - -2025-04-15 Dirk Eddelbuettel - - * docker/ci-4.4/Dockerfile: Added based on r-base:4.4.3 - * .github/workflows/ci.yaml (jobs): Add rcpp/ci-4.4 to matrix - -2025-03-31 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version and date - * inst/include/Rcpp/config.h: Idem - -2025-03-29 Iñaki Ucar - - * inst/include/Rcpp/traits/result_of.h: Reimplement traits::result_of using - std::result_of (up to C++14) or std::invoke_result (C++17 or later), which - supports previous use cases and enables lambdas - * inst/include/Rcpp/sugar/functions/sapply.h: Use new result_of interface - * inst/include/Rcpp/sugar/functions/lapply.h: Idem - * inst/include/Rcpp/sugar/functions/mapply/mapply_2.h: Idem - * inst/include/Rcpp/sugar/functions/mapply/mapply_3.h: Idem - * inst/include/Rcpp/sugar/matrix/outer.h: Idem - * inst/tinytest/cpp/sugar.cpp: New tests for previous sugar functions - * inst/tinytest/test_sugar.R: Idem - -2025-03-26 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version and date - * inst/include/Rcpp/config.h: Idem - -2025-03-26 Iñaki Ucar - - * inst/include/Rcpp/platform/compiler.h: Remove definitions of - RCPP_USING_UNORDERED_MAP and RCPP_USING_UNORDERED_SET - * inst/include/Rcpp/sugar/sets.h: Remove redefinition of macros - * inst/include/Rcpp/sugar/functions/self_match.h: Replace macros with - std::unordered_map and std::unordered_set respectively - * inst/include/Rcpp/sugar/functions/setdiff.h: Idem - * inst/include/Rcpp/sugar/functions/table.h: Idem - * inst/tinytest/cpp/wrap.cpp: Idem - -2025-03-24 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version and date - * inst/include/Rcpp/config.h: Idem - -2025-03-24 Iñaki Ucar - - * inst/include/Rcpp/exceptions.h: Include C+11 variadic template definitions - unconditionally - * inst/include/Rcpp/exceptions/cpp11/exceptions.h: Removed - * inst/include/Rcpp/exceptions/cpp98/exceptions.h: Idem - - * src/attributes.cpp: Remove obsolete pre-C+11 paths based on __cplusplus - define checks - * inst/tinytest/cpp/sugar.cpp: Idem - * inst/include/Rcpp/Language.h: Idem - * inst/include/Rcpp/StringTransformer.h: Idem - * inst/include/Rcpp/algorithm.h: Idem - * inst/include/Rcpp/utils/tinyformat.h: Idem - * inst/include/Rcpp/longlong.h: Idem, unconditional RCPP_HAS_LONG_LONG_TYPES - - * src/api.cpp: Remove explicit RCPP_HAS_LONG_LONG_TYPES as availability is - both implicit and ensured - * inst/include/Rcpp/algorithm.h: Idem - * inst/include/Rcpp/traits/is_arithmetic.h: Idem - * inst/include/Rcpp/traits/longlong.h: Idem - -2025-03-21 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version and date - * inst/include/Rcpp/config.h: Idem - - * inst/include/Rcpp/String.h: Remove explicit RCPP_USING_CXX11 as - use of C++11 (or newer) is both implicit and ensured - * inst/include/Rcpp/macros/dispatch.h: Idem - * inst/include/Rcpp/platform/compiler.h: Idem - * inst/include/Rcpp/unwindProtect.h: Idem - * inst/tinytest/cpp/wrap.cpp: Idem - * src/api.cpp: Idem - -2025-03-18 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version and date - * inst/include/Rcpp/config.h: Idem - - * inst/include/Rcpp/module/class.h: Use variadic templates unconditionally - * inst/include/Rcpp/grow.h: Idem - * inst/include/Rcpp/DottedPair.h: Idem - * inst/include/Rcpp/Vector.h: Idem - * inst/include/Rcpp/Function.h: Idem - * inst/include/Rcpp/internal/call.h: Idem - * inst/include/Rcpp/InternalFunctionWithStdFunction.h: Idem - * inst/include/Rcpp/Module.h: Idem - * inst/include/Rcpp/traits/index_sequence.h: Idem - * inst/include/Rcpp/traits/named_object.h: Idem - * inst/include/Rcpp/Language.h: Idem - * inst/include/Rcpp/DataFrame.h: Idem - * inst/include/Rcpp/PairList.h: Idem - * inst/include/Rcpp/InternalFunction.h: Idem - - * inst/include/Rcpp/module/Module_generated_class_constructor.h: Removed - * inst/include/Rcpp/module/Module_generated_class_factory.h: Idem - * inst/include/Rcpp/module/Module_generated_method.h: Idem - * inst/include/Rcpp/module/Module_generated_Pointer_method.h: Idem - * inst/include/Rcpp/generated/grow__pairlist.h: Idem - * inst/include/Rcpp/generated/DottedPair__ctors.h: Idem - * inst/include/Rcpp/generated/Vector__create.h: Idem - * inst/include/Rcpp/generated/Function__operator.h: Idem - * inst/include/Rcpp/generated/InternalFunctionWithStdFunction_call.h: Idem - * inst/include/Rcpp/module/Module_generated_Constructor.h: Idem - * inst/include/Rcpp/module/Module_generated_CppFunction.h: Idem - * inst/include/Rcpp/module/Module_generated_CppMethod.h: Idem - * inst/include/Rcpp/module/Module_generated_Factory.h: Idem - * inst/include/Rcpp/module/Module_generated_Pointer_CppMethod.h: Idem - * inst/include/Rcpp/module/Module_generated_class_signature.h: Idem - * inst/include/Rcpp/module/Module_generated_ctor_signature.h: Idem - * inst/include/Rcpp/module/Module_generated_function.h: Idem - * inst/include/Rcpp/module/Module_generated_get_signature.h: Idem - * inst/include/Rcpp/generated/Language__ctors.h: Idem - * inst/include/Rcpp/generated/DataFrame_generated.h: Idem - * inst/include/Rcpp/generated/Pairlist__ctors.h: Idem - * inst/include/Rcpp/generated/InternalFunction__ctors.h: Idem - - * inst/include/Rcpp/platform/compiler.h: No longer define HAS_VARIADIC_TEMPLATES - * src/api.cpp (rcpp_can_use_cxx0x): Return true unconditionally - -2025-03-15 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version and date - * inst/include/Rcpp/config.h: Idem - - * inst/include/Rcpp/platform/compiler.h: Simplified and shortened - establishing C++11 as baseline; further PRs to complete this - * inst/include/Rcpp/String.h: Unconditionally use std::hash with C++11 - * inst/include/Rcpp/wrap.h: Unconditionally use static_assert - * inst/include/Rcpp/sugar/functions/sapply.h: Use std::result_of - (with C++11 or C++14) or std::invoke_result (C++17 or later) - * inst/include/Rcpp/sugar/functions/table.h: Use std::map - * inst/include/Rcpp/sugar/sets.h: Use std::unordered_{set,map} - * man/evalCpp.Rd: Update example - * src/api.cpp: Simplify rcpp_capabilities assignment - -2025-03-13 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version and date - * inst/include/Rcpp/config.h: Idem - - * inst/include/Rcpp/Environment.h: Switch from R_lsInternal to - R_lsInternal3 as the former is now outlawed - -2025-03-10 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version and date - * inst/include/Rcpp/config.h: Idem - -2025-03-08 Dirk Eddelbuettel - - * inst/include/Rcpp/Function.h: Use R_ClosureEnv instead of - deprecated CLOENV if under R >= 4.5.0 - -2025-03-07 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version and date - * inst/include/Rcpp/config.h: Idem - - * src/barrier.cpp (dataptr): Replace remaining DATAPTR with - DATAPTR_RO for suitable R greater than 3.5.0 - -2025-02-11 Dirk Eddelbuettel - - * R/Rcpp.package.skeleton.R (Rcpp.package.skeleton): Support optional - argument 'github_user' to populate URL and BugReports if given - * man/Rcpp.package.skeleton.Rd: Document new optional argument - - * R/Rcpp.package.skeleton.R (Rcpp.package.skeleton): Default version - is now '0.0.1' and not '1.0' - * inst/tinytest/test_rcpp_package_skeleton.R: Adjust test accordingly - * inst/tinytest/test_expose_class.R: Idem - -2025-02-05 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version and date - * inst/include/Rcpp/config.h: Idem - -2025-01-31 Lev Kandel - - * inst/include/Rcpp/internal/wrap.h: Add support for std::string_view - * inst/include/Rcpp/traits/r_type_traits.h: Idem - * inst/include/Rcpp/traits/wrap_type_traits.h: Idem - * inst/include/RcppCommon.h: Include - * inst/tinytest/cpp/wrap.cpp: Add unit test for wrap(std::string_view) - * inst/tinytest/test_wrap.R: Idem - -2025-01-26 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version and date - * inst/include/Rcpp/config.h: Idem - -2025-01-25 Dirk Eddelbuettel - - * vignettes/rmd/Rcpp-libraries.Rdm: Add mention of PACKAGE_types.h - * vignettes/rmd/Rcpp.bib: Add AsioHeaders - * inst/bib/Rcpp.bib: Idem - -2025-01-18 Ben Bolker - - * inst/NEWS.Rd: fix trivial typos in NEWS file - -2025-01-11 Dirk Eddelbuettel - - * DESCRIPTION (Date, Version): Release 1.0.14 - - * inst/include/Rcpp/config.h: Idem - * inst/NEWS.Rd: Idem - * vignettes/rmd/Rcpp.bib: Idem - * inst/bib/Rcpp.bib: Idem - * vignettes/pdf/*: Rebuilt - -2025-01-01 Dirk Eddelbuettel - - * inst/include/Rcpp/Benchmark/Timer.h (R_NO_REMAP): Protect include - with preceding #ifndef now that R 4.5.0 will set this too - -2024-11-25 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version to 1.0.13.6 - * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem - - * inst/tinytest/test_date.R: Minor adjustment to datetime format test - following R Dev Day change for R bug 17350 (and issue #1347 here) - -2024-11-25 Simon Guest - - * src/attributes.cpp: fix CPP source having to be writable - -2024-11-03 Marco Colombo - - * vignettes/rmd/Rcpp-FAQ.Rmd: Fixed typos - * vignettes/rmd/Rcpp-attributes.Rmd: Idem - * vignettes/rmd/Rcpp-extending.Rmd: Idem - * vignettes/rmd/Rcpp-introduction.Rmd: Idem - * vignettes/rmd/Rcpp-libraries.Rmd: Idem - * vignettes/rmd/Rcpp-modules.Rmd: Idem - * vignettes/rmd/Rcpp-package.Rmd: Idem - * vignettes/rmd/Rcpp-quickref.Rmd: Idem - * vignettes/rmd/Rcpp-sugar.Rmd: Idem - -2024-11-02 Dirk Eddelbuettel - - * tests/tinytest.R: Minor code edit, removal of two no longer - required setters for tinytest - -2024-11-01 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version to 1.0.13.5 - * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem - -2024-10-31 Kevin Ushey - - * inst/include/Rcpp/r/compat.h: Require R (>= 4.5.0) for new APIs - -2024-10-26 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version to 1.0.13.4 - * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem - - * .github/workflows/ci.yaml (jobs): Roll checkout action to v4 - -2024-10-26 Gábor Csárdi - - * inst/include/Rcpp/exceptions_impl.h: check for DragonFlyBSD to fix - compilation - -2024-10-07 Iñaki Ucar - - * inst/include/Rcpp/platform/compiler.h: Uncomment - HAS_VARIADIC_TEMPLATES macro definition - * src/api.cpp: Simplify checks for variadic templates - * inst/include/Rcpp/DataFrame.h: Idem - * inst/include/Rcpp/DottedPair.h: Idem - * inst/include/Rcpp/Function.h: Idem - * inst/include/Rcpp/InternalFunctionWithStdFunction.h: Idem - * inst/include/Rcpp/Language.h: Idem - * inst/include/Rcpp/Pairlist.h: Idem - * inst/include/Rcpp/grow.h: Idem - * inst/include/Rcpp/internal/call.h: Idem - * inst/include/Rcpp/module/class.h: Idem - * inst/include/Rcpp/traits/index_sequence.h: Idem - * inst/include/Rcpp/traits/named_object.h: Idem - * inst/include/Rcpp/vector/Vector.h: Idem - * inst/include/Rcpp/Module.h: Idem + add missing is_void method - * inst/tinytest/test_module.R: Add test for void functions and - methods - -2024-10-04 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version to 1.0.13.3 - * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem - -2024-09-29 Dirk Eddelbuettel - - * inst/include/Rcpp/vector/Vector.h: Remove a cast as R_xlen_t - is returned now - -2024-09-17 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version - * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem - -2024-09-12 Iñaki Ucar - - * vignettes/.gitignore: Refinement to ignore more files under rmd/ - * vignettes/pdf/*: Rebuilt with Ghostscript 10.03.1 - * vignettes/*.pdf: Idem - -2024-08-31 Dirk Eddelbuettel - - * DESCRIPTION (Authors@R): Added - -2024-08-28 Dirk Eddelbuettel - - * R/Rcpp.package.skeleton.R: Create DESCRIPTION with Auhors@R file - * inst/tinytest/test_rcpp_package_skeleton.R: Adjust tests - -2024-08-20 Dirk Eddelbuettel - - * inst/tinytest/test_sugar.R: Skip one more NA related test on arm64 - and macOS as failure is seen at r-universe on arm64 - - * .github/workflows/macos.yaml: Add basic r-ci setup but dialed-down - to macOS only (as Linux is covered via multiple Docker setups) - -2024-08-19 Dirk Eddelbuettel - - * Contributing.md: Refreshed content - -2024-07-30 Dirk Eddelbuettel - - * vignettes/rmd/Rcpp-modules.Rmd (are): Add short two-sentence - illustration following GitHub issue #1322 - -2024-07-24 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version - * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem - -2024-07-11 Dirk Eddelbuettel - - * DESCRIPTION (Date, Version): Release 1.0.13 - - * inst/include/Rcpp/config.h: Idem - * inst/NEWS.Rd: Idem - * vignettes/rmd/Rcpp.bib: Idem - * inst/bib/Rcpp.bib: Idem - * vignettes/pdf/*: Rebuilt - -2024-07-07 Kevin Ushey - - * inst/include/Rcpp/internal/SEXP_Iterator.h: Avoid using VECTOR_PTR - * inst/include/Rcpp/vector/Subsetter.h: Avoid using STRING_PTR - * inst/include/RcppCommon.h: Include compatibility defines - * src/barrier.cpp: Avoid using {STRING/VECTOR}_PTR - * inst/include/Rcpp/r/compat.h: Include compatibility defines - -2024-07-05 Kevin Ushey - - * inst/include/Rcpp/Environment.h: Drop support for UserDefinedDatabase - [ merged 2024-07-22 after release of Rcpp 1.0.13 ] - - * inst/include/Rcpp/Language.h: Avoid using SET_TYPEOF - * inst/include/Rcpp/Pairlist.h: Idem - * inst/include/Rcpp/r_cast.h: Idem - [ merged 2024-07-24 after release of Rcpp 1.0.13 ] - -2024-06-22 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version - * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem - -2024-06-11 Kevin Ushey - - * inst/include/Rcpp/internal/r_vector.h: Use template specializations to - avoid DATAPTR usage - * inst/include/Rcpp/vector/traits.h: Implement bounds checks in - r_vector_cache access - * inst/tinytest/cpp/Vector.cpp: Add unit tests - * inst/tinytest/test_vector.R: Add unit tests - * tests/tinytest.R: Test in serial by default - -2024-06-02 Dirk Eddelbuettel - - * inst/include/Rcpp/internal/export.h: More R_xlen_t switching - * inst/include/Rcpp/vector/SubMatrix.h: Idem - * inst/include/Rcpp/vector/Vector.h: Idem - -2024-06-01 Dirk Eddelbuettel - - * inst/include/Rcpp/internal/Proxy_Iterator.h (Proxy_Iterator): - Switch to R_xlen_t ('clang++-17 -Wconversion -Wno-sign-conversion') - * inst/include/Rcpp/DataFrame.h: Idem - * inst/include/Rcpp/Vector.h: Idem - -2024-05-28 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version - * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem - -2024-05-27 Dirk Eddelbuettel - - * README.md: Remove link references to StackOverflow - * inst/NEWS.Rd: Idem - * inst/include/Rcpp/Module.h (S4_CppOverloadedMethods): Add cast to int - to avoid warnings under 'clang++-17 -Wconversion -Wno-sign-conversion' - * inst/include/Rcpp/vector/Vector.h (Vector): Idem - * inst/include/Rcpp/module/class.h: Switch variable to size_t to avoid - to avoid warnings under 'clang++-17 -Wconversion -Wno-sign-conversion' - * inst/tinytest/testRcppClass/src/init.c: Add void to signature - -2024-05-26 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version - * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem - -2024-05-23 Andrew Johnson - - * inst/include/Rcpp/: Added variadic templates to be used instead of - the generated code in `Rcpp/generated` and `Rcpp/module` when - compiling with C++11 or later. - -2024-05-18 Dirk Eddelbuettel - - * docker/ci-4.3/Dockerfile: Add rcpp/ci-4.3 container for R 4.3.* - * .github/workflows/ci.yaml (jobs): Add rcpp/ci-4.3 to matrix - -2024-05-16 Dirk Eddelbuettel - - * README.md: Use tinyverse.netlify.app for dependency badge - -2024-03-05 Dirk Eddelbuettel - - * docker/ci/Dockerfile: Switch the base container to r2u - * docker/plus/Dockerfile: Given r2u, install more binaries - - * README.md: Add r-universe badge - -2024-02-21 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version - * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem - - * inst/include/Rcpp/r/headers.h: Set R_NO_REMAP (and MAXELTSIZE) - only if not already defined (as will be needed with R 4.4.0) - -2024-01-09 Dirk Eddelbuettel - - * README.md: Update usage numbers - - * README.md: Remove StackOverflow badge which only works for - logged-in users and is unsuitable for the README - -2024-01-08 Dirk Eddelbuettel - - * DESCRIPTION (Date, Version): Release 1.0.12 - - * inst/include/Rcpp/config.h: Idem - * inst/NEWS.Rd: Idem - * vignettes/rmd/Rcpp.bib: Idem - * inst/bib/Rcpp.bib: Idem - * vignettes/pdf/*: Rebuilt - -2024-01-01 Dirk Eddelbuettel - - * vignettes/rmd/Rcpp.bib: Updated to current versions of cited packages - * inst/bib/Rcpp.bib: Idem - -2023-12-27 Dirk Eddelbuettel - - * src/api.cpp (type2name): Refine OBJSXP return - -2023-12-21 Dirk Eddelbuettel - - * src/api.cpp (type2name): Recognise OBJSXP added in R 4.4.0 - -2023-11-28 Dirk Eddelbuettel - - * inst/tinytest/testRcppInterfaceExporter/R/RcppExports.R: Regenerated - * inst/tinytest/testRcppInterfaceExporter/src/RcppExports.cpp: Idem - -2023-11-26 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version - * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem - - * src/attributes.cpp (generateCpp): Add a format string for Rf_error - call to not run afoul of -Wformat-security - -2023-11-24 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version - * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem - - * inst/include/Rcpp/iostream/Rstreambuf.h: Cast streamsize to int in - two spots - * inst/include/Rcpp/print.h (warningcall): Add missing '%s' format - -2023-11-11 Dirk Eddelbuettel - - * vignettes/rmd/Rcpp-FAQ.Rmd: Updated and edited - * vignettes/pdf/Rcpp-FAQ.pdf: Updated - * vignettes/rmd/Rcpp.bib: Updated - -2023-10-28 Dirk Eddelbuettel - - * vignettes/rmd/Rcpp-FAQ.Rmd: Updated and edited - * vignettes/pdf/Rcpp-FAQ.pdf: Updated - * vignettes/rmd/Rcpp.bib: Updated - -2023-10-27 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version - * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem - - * R/tools.R: Correct missing Rd macros (spotted by R-devel CMD check) - -2023-10-22 Aaron Lun - - * inst/include/Rcpp/vector/MatrixColumn.h: Cast integer index - to R_xlen_t to avoid integer overflow with large matrices. - * inst/include/Rcpp/vector/MatrixRow.h: Ditto. - * inst/include/Rcpp/vector/Vector.h: Remove stray cast to int - that causes overflow when returning the end iterator. - -2023-09-30 Dirk Eddelbuettel - - * vignettes/rmd/Rcpp-introduction.Rmd (Rcpp): Correct caption of - third figure (cf GitHub issue #1276) - * vignettes/pdf/Rcpp-introduction.pdf: Rebuilt - -2023-08-31 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version - * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem - -2023-08-29 Iñaki Ucar - - * R/Attributes.R: Ad-hoc fix for testthat's C entrypoint in - RcppExports.cpp - -2023-08-03 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version - * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem - -2023-08-03 Michael Chirico - - * src/attributes.cpp: Directly `#include ` for `std::endl` - * src/date.cpp: Directly `#include ` for `TRUE` and - `FALSE` - -2023-07-03 Dirk Eddelbuettel - - * DESCRIPTION (Date, Version): Release 1.0.11 - - * inst/include/Rcpp/config.h: Idem - * inst/NEWS.Rd: Idem - * vignettes/rmd/Rcpp.bib: Idem - * inst/bib/Rcpp.bib: Idem - * vignettes/pdf/*: Rebuilt - -2023-07-02 Dirk Eddelbuettel - - * README.md: Update usage numbers in Examples section - -2023-07-01 Dirk Eddelbuettel - - * docker/ci-dev/Dockerfile: Make 'rm' more robust as 'rm -f' - * docker/ci-4.2/Dockerfile: Add new container for R 4.2.3 - * .github/workflows/ci.yaml (jobs): Add entry for R 4.2.3 - -2023-06-12 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll micro version - * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem - - * README.md: Two URL updates for appease R CMD check - - * DESCRIPTION (Encoding): Somewhat belated addition - -2023-04-18 Dirk Eddelbuettel - - * README.md: Use app.codecov.io as base for codecov link - -2023-04-12 Dirk Eddelbuettel - - * .github/workflows/ci.yaml: Simplified container use - -2023-03-27 Dirk Eddelbuettel - - * .github/workflows/stale.yaml: Roll to v8 - -2023-03-27 Iñaki Ucar - - * R/Attributes.R: Remove command quoting, not needed anymore for system2() - * inst/tinytest/test_xptr.R: Update copyright - -2023-03-26 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem - - * inst/tinytest/test_stats.R: Revisit change from PR #1252; we now - use a slightly smaller tolerance to accomodate old and new value - - * inst/tinytest/test_sugar.R: Protect a small number of tests on NA - propagation from running on arm64/Darwin which requires special care - -2023-03-25 Iñaki Ucar - - * R/Attributes.R: Switch to system2 to be able to capture stderr on error - -2023-03-24 Dirk Eddelbuettel - - * docker/ci-dev/Dockerfile: During Debian freeze experimental repo is - renamed which leads to a hickup here so temporarily remove list file - -2023-03-24 Iñaki Ucar - - * inst/tinytest/test_xptr.R: Skip some tests on Windows - -2023-03-19 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem - - * src/attributes.cpp (RExportsGenerator::writeEnd): Replace a pair of - apostrophes with backticks in generated .Call() statemente - -2023-02-07 Dirk Eddelbuettel - - * inst/tinytest/test_stats.R: Use more accurate value in R 4.3.0 - -2023-02-06 Dirk Eddelbuettel - - * inst/CITATION: Update to new format preferred by r-devel - -2023-02-02 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem - - * inst/include/Rcpp/sugar/functions/sapply.h: Enable compilation - under C++20 (using clang++ and its C++ library) via invoke_result - -2023-01-29 Iñaki Ucar - - * inst/tinytest/test_xptr.R: Fix a couple of tests writing to stdout - -2023-01-24 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem - -2023-01-24 Lukasz Laniewski-Wollk - - * R/RcppLdpath.R: CxxFlags() now quotes only non-standard paths on linux - -2023-01-22 Dirk Eddelbuettel - - * DESCRIPTION (Date, Version): Release 1.0.10 - - * inst/include/Rcpp/config.h: Idem - * inst/NEWS.Rd: Idem - -2023-01-08 Dirk Eddelbuettel - - * inst/include/Rcpp/String.h: Address clang++-14 conversion warning - * inst/include/Rcpp/sugar/functions/mean.h: Idem - * inst/include/Rcpp/vector/Vector.h: Idem - * src/attributes.cpp: Idem - * src/date.cpp: Idem - -2022-12-29 Dirk Eddelbuettel - - * .github/workflows/docker.yaml (jobs): Update several actions - -2022-12-26 Dirk Eddelbuettel - - * .github/workflows/stale.yaml (jobs): Update actions/stale@v6 - -2022-11-14 Dirk Eddelbuettel - - * .github/workflows/ci.yaml (jobs): Update to actions/checkout@v3 - -2022-10-27 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem - -2022-10-27 Kevin Ushey - - * inst/tinytest/cpp/coerce.cpp: add coerce unit tests - * inst/tinytest/test_coerce.R: idem - -2022-10-25 Dirk Eddelbuettel - - * inst/include/Rcpp/internal/r_coerce.h (coerce_to_string): - Replace last remaining sprintf with snprintf - -2022-10-12 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem - - * R/Attributes.R (sourceCpp): Protect path to binary from spaces - -2022-10-06 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem - - * inst/tinytest/test_dataframe.R (test.DataFrame.PushZeroLength): Add - new test - * inst/tinytest/cpp/DataFrame.cpp (DataFrame_PushOnEmpty): C++ - support for new test - -2022-10-04 Dirk Eddelbuettel - - * inst/include/Rcpp/DataFrame.h (set_type_after_push): Allow zero-row - data.frame objects to be grown by push_{back,front}() - -2022-09-25 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem - -2022-09-23 Kevin Ushey - - * R/Module.R: Force 'finalize' method to be materialized - -2022-09-20 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - - * R/Attributes.R: Support C++20, C++23 and C++2b (for experimental / - incomplete support) via new plugins - -2022-07-27 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - -2022-07-23 Iñaki Ucar - - * inst/include/Rcpp/r/headers.h: Unwind protection is enabled by default - unless `RCPP_NO_UNWIND_PROTECT` is defined (`RCPP_USE_UNWIND_PROTECT` is - not checked anymore and has no effect) - * inst/include/Rcpp/vector/Vector.h: Switch evaluation to `Rcpp_eval` - * R/Attributes.R: `[[Rcpp::plugins(unwindProtect)]]` is deprecated - * inst/tinytest/cpp/stack.cpp: Adapted - * inst/tinytest/test_exceptions.R: Adapted - * inst/tinytest/test_interface.R: Adapted - * inst/tinytest/testRcppInterfaceExporter/src/config.h: Removed - -2022-07-10 Dirk Eddelbuettel - - * docker/ci-4.1/Dockerfile: Add Dockerfile for 4.1 series - * .github/workflows/ci.yaml: Add 4.1 to CI matrix - * .github/workflows/docker.yaml: Do not rebuild versioned ones - -2022-07-02 Dirk Eddelbuettel - - * DESCRIPTION (Date, Version): Release 1.0.9 - - * inst/include/Rcpp/config.h: Idem - * inst/NEWS.Rd: Idem - * vignettes/rmd/Rcpp.bib: Idem - * inst/bib/Rcpp.bib: Idem - * vignettes/pdf/*: Rebuilt - -2022-07-01 Dirk Eddelbuettel - - * man/dependsAttribute.Rd: Use https in URL - * man/exportAttribute.Rd: Idem - * man/interfacesAttribute.Rd: Idem - * DESCRIPTION (URL): Idem - * README.md: Idem, use Amazon page for Rcpp book - -2022-05-26 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - -2022-05-25 Dirk Eddelbuettel - - * inst/tinytest/test_string.R: Add C++11 conditioning for new unit tests - -2022-05-23 Dean Scarff - - * inst/include/Rcpp/String.h: Make less copies of strings via move - semantics and preserving the buffer/SEXP representation when copying - * inst/include/RcppCommon.h: include for std::move - * inst/tinytest/cpp/String.cpp: Add unit tests - * inst/tinytest/test_string.R: Add unit tests - -2022-05-12 Dirk Eddelbuettel - - * docker/ci/Dockerfile: Added xml2, also use more r-cran-* binaries - -2022-05-12 Marco Colombo - - * vignettes/rmd/Rcpp-FAQ.Rmd: Fixed typo - -2022-04-03 Dirk Eddelbuettel - - * vignettes/rmd/Rcpp-FAQ.Rmd: Add paragraph about Date(time) not - being aimed at parsing large quantities at once - * vignettes/pdf/Rcpp-FAQ.pdf: Idem - - * vignettes/rmd/Rcpp.bib: Add four entries - * inst/bib/Rcpp.bib: Idem - -2022-03-14 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - -2022-03-13 Iñaki Ucar - - * src/barrier.cpp: Untag tokens upon removal from the precious list, - so that the internal reference counter can be safely decremented by R - -2022-03-13 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - - * tests/tinytest.R: Disable full tests on four-digits release to not - exceed CRAN test time preference - -2022-03-10 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - - * inst/tinytest/cpp/sugar.cpp: Also conditionally replace - std::unary_function with std::function - * vignettes/rmd/Rcpp-sugar.Rmd: Replace std::unary_function example - with std::function (implicitly requiring C++ in vignette example) - * vignettes/rmd/Rcpp-FAQ.Rmd: Idem - -2022-03-09 Dirk Eddelbuettel - - * inst/include/Rcpp/Language.h: To quieten compilations, replace - std::(unary|binary)_function with std::function for C++11 or later - * inst/include/Rcpp/StringTransformer.he: Idem - -2022-01-21 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - -2022-01-20 Dirk Eddelbuettel - - * src/attributes.cpp: Make three small changes to permit compilation - under C++98 now (while we consider just turning to C++11 overall) - -2022-01-14 Dirk Eddelbuettel - - * inst/tinytest/test_packageversion.R: Comparison to 'dev' revision - version now tolerant of optional trailing zero (e.g. 1.0.8.0) - -2022-01-11 Dirk Eddelbuettel - - * DESCRIPTION (Date, Version): Release 1.0.8 - - * inst/include/Rcpp/config.h: Idem - * inst/NEWS.Rd: Idem - * vignettes/rmd/Rcpp.bib: Idem - * inst/bib/Rcpp.bib: Idem - * vignettes/pdf/*: Rebuilt - - * inst/include/Rcpp/r/headers.h: STRICT_R_HEADERS set by default - unless override RCPP_NO_STRICT_HEADERS is set (cf issue #1158) - -2022-01-10 Dirk Eddelbuettel - - * vignettes/rmd/Rcpp.bib: Updated CRAN and R references - * inst/bib/Rcpp.bib: Idem - * vignettes/rmd/getCurrentVersionsOfCitedPackages.R: Updated - -2022-01-01 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - - * inst/NEWS.Rd: Added entries for a few PRs since last release - - * vignettes/rmd/Rcpp.bib: Provide both url and doi entries - * inst/bib/Rcpp.bib: Idem - -2021-12-28 Dirk Eddelbuettel - - * README.md: Add section on performance - -2021-12-24 Dirk Eddelbuettel - - * README.md: Update usage counts - -2021-12-16 Dirk Eddelbuettel - - * vignettes/rmd/Rcpp.bib: Update JSS references to new doi scheme, - update http URL links to https - * inst/bib/Rcpp.bib: Idem - -2021-12-10 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - -2021-12-08 Dirk Eddelbuettel - - * inst/include/Rcpp/Rcpp: Added as new entry point - * inst/include/Rcpp/Light: Added as lighter-weight entry point - * inst/include/Rcpp/Lighter: Idem - * inst/include/Rcpp/Lightest: Idem - -2021-11-30 Dirk Eddelbuettel - - * README.md: Remove Travis badge - * .travis.yml: Removed - -2021-11-15 Dirk Eddelbuettel - - * docker/ci/Dockerfile: Minor cleanup - -2021-11-14 Dirk Eddelbuettel - - * R/RcppLdpath.R: Simplified as we no longer need to worry about CXX0X - -2021-11-11 Kevin Ushey - - * R/RcppLdpath.R: CxxFlags() now quotes its include path - -2021-10-15 Travers Ching - - * inst/tinytest/testRcppAttributePackage: Tests `signature` attribute - * inst/tinytest/test_attribute_package.R: Tests `signature` attribute - -2021-10-13 Dirk Eddelbuettel - - * README.md: Switch JSS url to doi form per JSS request - * man/Rcpp-package.Rd: Idem - * man/RcppLdFlags.Rd: Idem - * inst/CITATION: Only use doi entries in three citEntry blocks - -2021-10-11 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - - * .codecov.yml (comment): Disable codecov comments on PRs - -2021-10-10 Travers Ching - - * src/attributes.cpp: Add `signature` attribute and syntax checks - -2021-10-02 Dirk Eddelbuettel - - * .github/workflows/docker.yaml (jobs): Add container builder action - -2021-10-01 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - - * inst/NEWS.Rd: Updated - -2021-09-29 Iñaki Ucar - - * inst/include/Rcpp/XPtr.h: Check for new define - `RCPP_USE_FINALIZE_ON_EXIT` to flip the value of XPtr's `finalizeOnExit` - parameter from false (default) to true. - * inst/tinytest/test_xptr.R: Added test for this functionality. - -2021-09-27 Dirk Eddelbuettel - - * README.md: Added total downloads badge - -2021-09-06 Dirk Eddelbuettel - - * docker/ci-4.0/Dockerfile: Using R 4.0.5 to build ci-4.0 - * .github/workflows/ci.yaml (jobs): Also run against R 4.0.* - -2021-09-05 Dirk Eddelbuettel - - * inst/examples/Misc/piSugar.cpp (piSugar): Remove spurious call to - RNGScope we do not need with Rcpp Attributes - * inst/examples/RcppGibbs/RcppGibbs.R (Rgibbs): Comment on two uses - of RNGScope as historical in pre-Attributes code - * inst/examples/RcppGibbs/timeRNGs.R: Idem for one more - -2021-08-05 Dirk Eddelbuettel - - * inst/bib/Rcpp.bib: Use https for CRAN URLs - * vignettes/rmd/Rcpp.bib: Idem - -2021-07-25 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - -2021-07-24 Dirk Eddelbuettel - - * vignettes/rmd/Rcpp-FAQ.Rmd: New entry on growing vectors - -2021-07-08 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - - * cleanup: Check for optional vignettes/rmd before trying to access it - -2021-07-06 Dirk Eddelbuettel - - * DESCRIPTION (Date, Version): Release 1.0.7 - - * inst/include/Rcpp/config.h: Idem - * inst/NEWS.Rd: Idem - * vignettes/rmd/Rcpp.bib: Idem - * inst/bib/Rcpp.bib: Idem - * vignettes/pdf/*: Rebuilt - -2021-07-05 Iñaki Ucar - - * src/barrier.cpp (Rcpp_precious_remove): Protect from call with - wrong token when unloading modules compiled under earlier version - -2021-07-02 Dirk Eddelbuettel - - * inst/include/Rcpp/r/headers.h: Update notice as January 2022 - release will remove protection for STRICT_R_HEADERS making it default - -2021-05-27 Dirk Eddelbuettel - - * inst/tinytest/cpp/rcppversion.cpp (checkVersion): Allow for more - than four components of a development version number - * inst/tinytest/test_packageversion.R: Idem - * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Clarify in comment - -2021-05-13 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - -2021-05-09 Dirk Eddelbuettel - - * inst/include/RcppCommon.h: Add cfloat header - -2021-04-09 Dirk Eddelbuettel - - * inst/include/Rcpp/hash/IndexHash.h: Silence one comparison, update - use of unsigned int to uint32_t throughout - -2021-03-22 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - -2021-03-21 Dirk Eddelbuettel - - * inst/include/Rcpp/api/meat/message.h: Add wrapper for base::message - * inst/include/Rcpp/api/meat/meat.h: Include new file - * inst/tinytest/test_misc.R: Simple test - * inst/tinytest/cpp/misc.cpp (messageWrapper): Test support - -2021-02-23 Dirk Eddelbuettel - - * Contributing.md: Update unit test link to tinytest - -2021-02-08 Dirk Eddelbuettel - - * DESCRIPTION (Author): Add Inaki to the team - -2021-02-01 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - - * README.md: Mention the Rcpp drap repo and its release candidates in - installation section - -2021-01-30 Iñaki Ucar - - * inst/include/test_global_rostream.R: Added test new (optionally) - global Rcout and Rcerr objects - -2021-01-28 Iñaki Ucar - - * inst/include/Rcpp/iostream/Rstreambuf.h: Support for global - Rcout/Rcerr by defining `-DRCPP_USE_GLOBAL_ROSTREAM`; this mimics - std::cout/cerr; initialization code is automatically generated. - * inst/include/Rcpp/routines.h: Ditto - * src/api.cpp: Ditto - * src/attributes.cpp: Ditto - * src/rcpp_init.cpp: Ditto - -2021-01-21 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - - * inst/include/Rcpp/DataFrame.h: Remove unused variable - - * R/Attributes.R (sourceCpp): Support argument echo to be passed to - source() to silence optional R evaluation - -2021-01-19 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - - * inst/include/RcppCommon.h: Preverse existing API and offer new - token-based API alongside via Rcpp_Precious{Preserve,Release} - * inst/include/Rcpp/String.h: Use Rcpp_Precious{Preserve,Release} - * inst/include/Rcpp/storage/PreserveStorage.h: Ditto - -2021-01-17 Iñaki Ucar - - * inst/include/Rcpp/String.h: Use Rcpp_{Preserve,Release}Object - throughout which connects to Rcpp_precious_* routines - * inst/include/Rcpp/exceptions.h: Use Rcpp_ReleaseObject - * inst/include/Rcpp/routines.h: Several corrections and refinements - * inst/include/Rcpp/storage/PreserveStorage.h: Ditto - * inst/include/Rcpp/traits/named_object.h: Ditto - * inst/include/Rcpp/unwuindProtect.h: Ditto - * inst/include/RcppCommon.h: Ditto - * src/barrier.cpp: Ditto - -2021-01-17 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - - [ these were originally committed 17 May 2020 and have been rebased ] - * src/barrier.cpp: Implement Rcpp_precious_{init,teardown,preserve,remove} - * src/rcpp_init.c: Register cpp_precious_{init,teardown,preserve,remove} - and call from R_{init,unload}_Rcpp - * inst/include/Rcpp/routines.h: Declare Rcpp_precious_{init,teardown, - preserve,remove} - * inst/include/Rcpp/exceptions.h: Use Rcpp_precious_remove - * inst/include/Rcpp/traits/named_object.h: Use - Rcpp_precious_{preserve,remove} - * inst/include/Rcpp/unwuindProtect.h: Use Rcpp_precious_preserve - * inst/include/RcppCommon.h: Use Rcpp_precious_{preserve,remove} - -2021-01-16 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - - * tests/tinytest.R: Test for CODECOV when deciding to run extensive - tests or just a subset, and set CI=true to enable run full set - - * .github/workflows/stale.yaml: Run weekly instead of daily - - * src/attributes.cpp: Additional #nocov tag(s) - * R/Attributes.R: Idem - * R/Module.R: Idem - * R/Rcpp.package.skeleton.R: Idem - * R/RcppClass.R: Idem - * R/RcppLdpath.R: Idem - - * src/attributes.cpp: Support include files with dots in package name - -2021-01-14 Dirk Eddelbuettel - - * DESCRIPTION (Date, Version): Release 1.0.6 - - * inst/include/Rcpp/config.h: Idem - * inst/NEWS.Rd: Idem - * vignettes/rmd/Rcpp.bib: Idem - * inst/bib/Rcpp.bib: Idem - -2021-01-13 Dirk Eddelbuettel - - * vignettes/rmd/Rcpp.bib: Updated package versions - * inst/bib/Rcpp.bib: Idem - -2021-01-02 Dirk Eddelbuettel - - * R/Rcpp.package.skeleton.R: Wrap any() around grepl() - -2020-12-22 Dirk Eddelbuettel - - * .github/workflows/stale.yaml: Adding a staleness monitor labeling - and ultimately closing issues and PRs after suitably long windows - -2020-12-16 Dirk Eddelbuettel - - * inst/NEWS.Rd: Updated for recent activity - - * .github/workflows/ci.yaml: Add container-based CI runner - * README.md: Add new badge - -2020-11-06 Dirk Eddelbuettel - - * DESCRIPTION: More URL updates, e.g. http -> https - * README.md: Ditto - * inst/CITATION: Ditto - * man/Rcpp-package.Rd: Ditto - - * inst/CITATION: Change from PeerJ Preprint to TAS - -2020-10-25 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - - * inst/include/Rcpp/generated/InternalFunction__ctors.h: Switch XPtr - finalizer argument from false to true - -2020-10-22 Dirk Eddelbuettel - - * inst/include/Rcpp/lang.h: Remove spurious whitespace - - * vignettes/.gitignore: Refined to no longer ignore pdf files - * vignettes/pdf/*: Added - - * inst/NEWS.Rd: Updated for two PRs - -2020-10-21 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - -2020-10-19 Benjamin Christoffersen - - * src/attributes.cpp: Initialize two private bool variable in default - constructor to avoid santizer warning - -2020-08-20 Mattias Ellert - - * inst/include/Rcpp/lang.h: Remove obsolete and confusing comment - -2020-08-05 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - -2020-07-09 Walter Somerville - - * inst/include/Rcpp/DataFrame.h: Warn when data.frame has varying - length - * inst/tinyTest/cpp/DataFrame.cpp: Test added - * inst/tinyTest/test_dataframe.R: Idem - -2020-07-07 Walter Somerville - - * inst/include/Rcpp/DataFrame.h: Implement explict push_back and - push_front for DataFrame, which takes care to set the class and - row.names attributes. - * inst/tinyTest/test_dataframe.R: Add in tests for - push_back/push_front - * inst/tinyTest/cpp/DataFrame.cpp: Idem - -2020-07-06 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - -2020-07-06 Kevin Ushey - - * inst/include/Rcpp/module/class.h: EXTPTR_PTR -> R_ExternalPtrAddr - * src/api.cpp: Idem - * src/module.cpp: Idem - -2020-07-01 Dirk Eddelbuettel - - * DESCRIPTION (Date, Version): Release 1.0.5 - - * inst/include/Rcpp/config.h: Idem - * inst/NEWS.Rd: Idem - * vignettes/rmd/Rcpp.bib: Idem - * inst/bib/Rcpp.bib: Idem - -2020-06-27 Dirk Eddelbuettel - - * docker/ci/Dockerfile: Revert back to standard r-base container - * docker/plus/Dockerfile: Also install bit64 - -2020-06-19 Dirk Eddelbuettel - - * .travis.yml: Determine package name and version from DESCRIPTION, - switch to bionic - -2020-06-14 Dirk Eddelbuettel - - * inst/bib/Rcpp.bib: Add John's new 'S, R, and Data Science' article - * vignettes/rmd/Rcpp.bib: Idem - -2020-06-07 Dirk Eddelbuettel - - * .travis.yml (jobs): Replace R 3.4.3 with R 3.6.3 in matrix - -2020-06-05 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - - * R/Rcpp.package.skeleton.R: Remove a remaining NAMESPACE entry for - a temporary function symbol; ensure an exportPattern is set - -2020-05-18 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - -2020-05-17 Kevin Ushey - - * inst/include/Rcpp/String.h: Don't preserve returned SEXP in wrap - * inst/include/RcppCommon.h: Simplify - -2020-04-30 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - - * vignettes/rmd/Rcpp-libraries.Rmd: Add new vignette source - * vignettes/rmd/Rcpp.bib: Complete references - * inst/bib/Rcpp.bib: Idem - -2020-04-26 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - -2020-04-25 Dirk Eddelbuettel - - * inst/include/Rcpp/sugar/functions/sample.h: Replace R_alloc() with - a standard vector allocation to reduce memory consumption in sample - - * docker/ci/Dockerfile: Update for R 4.0.0 (with a temporary - diversion to rocker/r-base:4.0.0, and all-source installations) - - * vignettes/rmd/Makefile: Add bibtex call to JSS 2011 paper builds - -2020-04-16 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - -2020-04-15 Kevin Ushey - - * inst/include/Rcpp/String.h: Avoid 'debug' namespace collisions - * inst/include/Rcpp/macros/debug.h: Idem - * inst/include/Rcpp/macros/macros.h: Idem - -2020-04-15 Uwe Korn - - * inst/include/Rcpp/DataFrame.h: Explicit call to scalar std::abs - -2020-04-11 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - -2020-04-10 Kevin Ushey - - * inst/include/Rcpp/macros/macros.h: Safer definition of short_file_name - * inst/include/Rcpp/String.h: Idem - * inst/include/Rcpp/macros/debug.h: Idem - * src/api.cpp: Idem - -2020-04-10 Dirk Eddelbuettel - - * inst/tinytest/test_exceptions.R: Skip parts of file if on Solaris - -2020-04-02 Dirk Eddelbuettel - - * inst/NEWS.rd: Mark as patch release 1.0.4.6 - - * inst/tinytest/test_exceptions.R: If running skip remainder of file - on Windows to not trigger failed test - -2020-04-01 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - -2020-03-31 Dirk Eddelbuettel - - * docker/ci-dev/Dockerfile: Also install the 'codetools' package - -2020-03-31 Kevin Ushey - - * R/Attributes.R: Fix for sourceCpp() on Windows w/R-devel - -2020-03-28 Dirk Eddelbuettel - - * inst/examples/RcppGibbs/RcppGibbs_Updated.R: Updated example - -2020-03-24 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - - * inst/include/Rcpp/Environment.h: Added two Shield wrappers - around Rf_langX calls - -2020-03-23 Dirk Eddelbuettel - - * .travis.yml (script): Run coverage as parallel step - -2020-03-22 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - - * docker/ci-3.4/Dockerfile: Added - * docker/ci-3.5/Dockerfile: Idem - * docker/ci-dev/Dockerfile: Idem - - * .travis.yml (jobs): Expand to matrix - -2020-03-22 Mattias Ellert - - * inst/include/Rcpp/exceptions_impl.h: Add include guard, - Make sure RCPP_DEMANGLER_ENABLED is always defined, - Add missing inline qualifier - -2020-03-18 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - - * inst/include/Rcpp/lang.h: Define Rcpp_list{2,3,4,5} in the Rcpp - namespace - - * DESCRIPTION: Remove versioned depends on R (>= 3.0.0) from 2013 - -2020-03-17 Davis Vaughan - - * inst/include/Rcpp/lang.h: Inline Rcpp_list6() to support R 3.3. - -2020-03-17 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version (twice) - * inst/include/Rcpp/config.h: Idem - - * inst/NEWS.Rd: Updated - -2020-03-15 Kevin Ushey - - * inst/include/Rcpp/exceptions_impl.h: Ensure is included - into global namespace; refactor detection of demangler support - -2020-03-13 Dirk Eddelbuettel - - * DESCRIPTION (Date, Version): Release 1.0.4 - - * inst/include/Rcpp/config.h: Idem - * inst/NEWS.Rd: Idem - * vignettes/rmd/Rcpp.bib: Idem - * inst/bib/Rcpp.bib: Idem - -2020-03-12 Dirk Eddelbuettel - - * vignettes/rmd/Rcpp.bib: Updated to current package versions - * inst/bib/Rcpp.bib: Idem - -2020-02-24 Dirk Eddelbuettel - - * inst/include/Rcpp/exceptions_impl.h: Remove spurious semicolon - -2020-02-23 Dirk Eddelbuettel - - * inst/include/Rcpp/generated/Vector__create.h: Added #nocov tags - * inst/include/Rcpp/exceptions_impl.h: Idem - * src/api.cpp: Idem plus some whitespace realignment - -2020-02-13 Dirk Eddelbuettel - - * README.md: Add a Debian badge - -2020-02-12 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - - * README.md: Added indirect CRAN use badge - -2020-02-09 Joshua Pritikin - - * inst/include/Rcpp.h: Include exceptions_impl.h - * inst/include/Rcpp/exceptions.h: Make thread-safe - * inst/include/Rcpp/exceptions_impl.h: New home for code moved - from src/api.cpp - -2020-01-05 Dirk Eddelbuettel - - * inst/include/Rcpp/exceptions.h: A few more #nocov tags - * inst/include/Rcpp/generated/Vector__create.h: Idem, plus whitespace - -2020-01-04 Dirk Eddelbuettel - - * R/Attributes.R: A few more #nocov tags - -2020-01-01 Dirk Eddelbuettel - - * inst/include/Rcpp/module/Module.h: A few more #nocov tags - * inst/include/Rcpp/XPtr.h: Idem - * inst/include/Rcpp/vector/Vector.h: Idem - -2019-12-31 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - -2019-12-29 Qiang Kou - - * inst/include/Rcpp/vector/Matrix.h: Ensure scalar OP matrix do not - change right-hand side in operation - * inst/tinytest/test_matrix.R: New tests - * inst/tinytest/cpp/Matrix.cpp: Idem - -2019-12-20 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - -2019-12-18 Dirk Eddelbuettel - - * inst/include/Rcpp/XPtr.h: Additional null check, refactored - -2019-12-17 Kirill Müller - - * inst/include/Rcpp/XPtr.h: Clear external pointer before finalizer - -2019-12-17 Dirk Eddelbuettel - - * R/Attributes.R (sourceCpp): Very minor cosmetic changes - -2019-12-15 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - -2019-12-14 Dirk Eddelbuettel - - * R/Attributes.R (sourceCpp): Support new argument windowsDebugDLL to - create a debug DLL, supported on Windows only - * man/sourceCpp.Rd: Document it - - * src/date.cpp: A few more #nocov tage - -2019-12-13 Dirk Eddelbuettel - - * src/api.cpp: A few more #nocov tags - * src/attributes.cpp: Idem - * src/barrier.cpp: Idem - -2019-12-08 Dirk Eddelbuettel - - * tests/tinytest.R: Turn verbose tests on in dev and on Travis - - * inst/tinytest/test_client_package.R: Finer-grained skip messages - * inst/tinytest/test_module_client_package.R: Idem - * inst/tinytest/test_expose_class.R: Idem - * inst/tinytest/test_interface.R: Idem - * inst/tinytest/test_rcpp_package_skeleton.R: Idem - * inst/tinytest/test_reference.R: Idem - - * inst/tinytest/test_*.R: Streamlined initial test and sourceCpp call - - * src/attributes.cpp: Remove dangling '#nocov end' - -2019-12-07 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - - * inst/tinytest/test_binary_package.R: Finer-grained skip messages - - * inst/tinytest/test_misc.R: Add commented-out test that fails - * tests/tinytest.R: Minor edit - - * docker/ci/Dockerfile: Add curl and ssl -dev packages needed for covr - -2019-12-05 Dirk Eddelbuettel - - * vignettes/rmd/Rcpp-FAQ.Rmd (Rcpp): Add entry about "'dataptr' (or - 'enterRNGScope') not provided by Rcpp" recommending proper importFrom - -2019-12-03 Dirk Eddelbuettel - - * docker/ci/Dockerfile: Lighter builds as fewer Suggests: - * docker/plus/Dockerfile: Take packages moved from ci/Dockerfile - -2019-12-01 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - - * DESCRIPTION (Suggests): Remove knitr, rmarkdown, pinp - * DESCRIPTION (VignetteBuilder): Remove knitr - -2019-11-26 Dirk Eddelbuettel - - * inst/tinytest/test_embedded_r.R: Use sink to suppress noisy output, - reenable tests (still conditional on usual environment variable) - -2019-11-25 Dirk Eddelbuettel - - * inst/tinytest/cpp/Vector.cpp (no_op): Suppress compiler warning - -2019-11-24 Dirk Eddelbuettel - - * DESCRIPTION (Suggests): Add tinytest, remove RUnit - - * tests/doRUnit.R: Removed - * tests/tinytest.R: Added - - * tests/tinytest.R: Converted from RUnit to tinytest - * inst/tinytest/test_algorithm.R: Idem - * inst/tinytest/test_as.R: Idem - * inst/tinytest/test_binary_package.R: Idem (but inactive for now) - * inst/tinytest/test_client_package.R: Idem (but inactive for now) - * inst/tinytest/test_dataframe.R: Idem - * inst/tinytest/test_date.R: Idem (but condition two test sets on TZ) - * inst/tinytest/test_dispatch.R: Idem - * inst/tinytest/test_embedded.R: Idem - * inst/tinytest/test_environments.R: Idem - * inst/tinytest/test_exceptions.R: Idem - * inst/tinytest/test_exceptions_nocall.R: Idem - * inst/tinytest/test_expose_class.R: Idem - * inst/tinytest/test_function.R: Idem - * inst/tinytest/test_interface.R: Idem (but inactive for now) - * inst/tinytest/test_internal_function.R: Idem - * inst/tinytest/test_internal_function_cpp11.R: Idem - * inst/tinytest/test_language.R: Idem - * inst/tinytest/test_listof.R: Idem - * inst/tinytest/test_matrix.R: Idem - * inst/tinytest/test_misc.R: Idem - * inst/tinytest/test_modref.R: Idem - * inst/tinytest/test_module.R: Idem - * inst/tinytest/test_module_client_package.R: Idem - * inst/tinytest/test_na.R: Idem - * inst/tinytest/test_quickanddirty.R: Idem - * inst/tinytest/test_rcpp_package_skeleton.R: Idem - * inst/tinytest/test_reference.R: Idem - * inst/tinytest/test_rmath.R: Idem - * inst/tinytest/test_robject.R: Idem - * inst/tinytest/test_s4.R: Idem - * inst/tinytest/test_stack.R: Idem - * inst/tinytest/test_stats.R: Idem - * inst/tinytest/test_string.R: Idem - * inst/tinytest/test_subset.R: Idem - * inst/tinytest/test_sugar.R: Idem - * inst/tinytest/test_sugar_var.R: Idem - * inst/tinytest/test_support.R: Idem - * inst/tinytest/test_system.R: Idem - * inst/tinytest/test_table.R: Idem - * inst/tinytest/test_vector.R: Idem - * inst/tinytest/test_vector_old.R: Idem - * inst/tinytest/test_wrap.R: Idem - * inst/tinytest/test_wstring.R: Idem - * inst/tinytest/test_xptr.R: Idem - - * inst/tinytest/cpp/*: C++ support files for tests - * inst/tinytest/*: Other support files and directories from unitTests - - * R/unitTests.R: Removed as tied to RUnit setuo - - * inst/tinytest/test_attributes.R: Added test for error with - non-existing package in cppFunction - -2019-11-23 Dirk Eddelbuettel - - * docker/ci/Dockerfile: Add tinytest to ci Docker image - -2019-11-20 Dirk Eddelbuettel - - * R/Attributes.R: Test for and report unavailable 'LinkingTo' package - -2019-11-19 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - -2019-11-18 Kun Ren - - * src/attributes.cpp: Add invisible param to export attribute (#1024) - * vignettes/rmd/Rcpp-attributes.Rmd: Add an section of Returning - invisible object - -2019-11-13 Dirk Eddelbuettel - - * .github/ISSUE_TEMPLATE.md: Another small edit - * .github/PULL_REQUEST_TEMPLATE.md: Idem - -2019-11-13 Stephen Wade - - * inst/include/Rcpp/XPtr.h: Delete delegating ctor (follow-up #1012) - * inst/unitTests/runit.XPTr.R: Reinsert self-tag test on Windows - -2019-11-11 Dirk Eddelbuettel - - * inst/unitTests/runit.packageversion.R: New test - * inst/unitTests/cpp/rcppversion.cpp: Cpp portion of test - -2019-11-10 Dirk Eddelbuettel - - * .github/: Add files CONTRIBUTING.md, FUNDING.yml, ISSUE_TEMPLATE.md - and PULL_REQUEST_TEMPLATE.md - - * inst/include/Rcpp/config.h: Correct RCPP_VERSION and - RCPP_DEV_VERSION to 1.0.3 - -2019-11-09 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - -2019-11-09 TJ McKinley - - * R/Attributes.R: Correct how cppFunction() deals with multiple - depends arguments - -2019-11-08 Romain Francois - - * inst/include/Rcpp/lang.h: Safer Rcpp_list* and Rcpp_lang* - * inst/include/Rcpp/Function.h: Add Function.invoke() for operator() - * inst/include/Rcpp/generated/Function__operator.h: Safer - Function.operator() using Function.invoke() - -2019-11-08 Dirk Eddelbuettel - - * DESCRIPTION (Date, Version): Release 1.0.3 - - * inst/include/Rcpp/config.h: Idem - * inst/NEWS.Rd: Idem - * inst/bib/Rcpp.bib: Idem - * vignettes/Rcpp.bib: Idem - -2019-11-06 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - - * inst/include/Rcpp/XPtr.h: Provided fallback for old constructor - when C++11 is not available (follow-up to #1003) - * inst/unitTests/runit.XPTr.R (test.XPtr): On Windows (as a proxy for - old compilers) do not test new feature - - * tests/doRUnit.R: Protect printing to /tmp from Windows use - - * vignettes/rmd/Rcpp.bib: Updated - * inst/bib/Rcpp.bib: Idem - -2019-11-02 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - - * inst/include/Rcpp/Reference.h: Shield Rf_mkstring inside Rf_lang2 - * inst/include/Rcpp/Environment.h: Idem (inside Rf_lang4) - * inst/include/Rcpp/proxy/FieldProxy.h: Idem (inside Rf_lang3 and 4) - -2019-10-31 Romain Francois - - * inst/include/Rcpp/DataFrame.h: Protect temporaries from gc - * inst/include/Rcpp/Environment.h: Idem - * inst/include/Rcpp/r_cast.h: Idem - -2019-10-27 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - - * inst/unitTests/runit.exposeClass.R: Updated to pass with r-devel - - * vignettes/rmd/Rcpp-FAQ.Rmd: Two new short section on speedier - compilation and lack of exceptions / stop() across shared libraries - -2019-10-26 Dirk Eddelbuettel - - * vignettes/Rcpp-package.Rnw: Another wrapper - * vignettes/Rcpp-jss-2011.Rnw: Idem - - * vignettes/Makefile: Refinements - * vignettes/rmd/Makefile: Idem - - * cleanup: Removed bashism, added invocation of make clean - -2019-10-23 Dirk Eddelbuettel - - * vignettes/Rcpp-*.Rnw: Wrappers around pdf/*pdf - * vignettes/Makefile: Added - -2019-10-21 Dirk Eddelbuettel - - * vignettes/rmd/*: Moved from parent directory - * vignettes/pdf/*: New target directory - -2019-10-20 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - - * vignettes/Rcpp-FAQ.Rmd: Turn off knitr cache - * vignettes/Rcpp-introduction.Rmd: Idem - - * vignettes/Makefile: Add simple Makefile - * .Rbuildignore: Exclude vignettes/Makefile - -2019-10-19 Stephen Wade - - * inst/include/Rcpp/XPtr.h: XPtr constructor split up, a single - argument does not modify tags and protected data of the external pointer - * inst/unitTests/cpp/Xptr.cpp: Added test - * inst/unitTests/runit.XPtr.R: Idem - -2019-10-14 Dirk Eddelbuettel - - * README.md: Added CRAN + BioConductor badges for reverse depends, - -2019-10-11 Dirk Eddelbuettel - - * inst/include/Rcpp/exceptions.h: Condition use of typeid() on - absence of RCPP_NO_RTTI in two places - * inst/include/Rcpp/r/headers.h: RCPP_NO_RTTI implies RCPP_NO_MODULES - -2019-10-04 Dirk Eddelbuettel - - * vignettes/Rcpp-attributes.Rmd: Correct two unevaluated knitr C++ - chunks to mode 'Rcpp' rather than the (unregistered) C++ mode - * vignettes/Rcpp-extending.Rmd: Minor white-space tweak to avoid - paragraph-spacing warnings from latex and its mdframed style - * vignettes/Rcpp-modules.Rmd: Idem - * vignettes/Rcpp-sugar.Rmd: Idem - -2019-10-01 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - -2019-09-30 Kevin Ushey - - * inst/include/Rcpp.h: add RCPP_NO_MODULES - * inst/include/Rcpp/api/meat/is.h: Idem - * inst/include/Rcpp/api/meat/meat.h: Idem - -2019-09-28 Dirk Eddelbuettel - - * README.md: Add a stackoverflow tag to indicate where to ask questions, - also updated package counts on CRAN and BioC for Rcpp users - -2019-08-06 Riccardo Porreca - - * vignettes/Rcpp-modules.Rmd: Extensive review and edit improving the - Modules vignette - -2019-08-04 Dirk Eddelbuettel - - * README.md: Add thre doi badges - - * inst/NEWS.Rd: Two minor edits - -2019-07-21 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - -2019-07-21 Riccardo Porreca - - * R/Module.R: Use an explicit Rcpp:: in the initalize method for C++ - classes wrapped inside modules to ensure proper initialization - -2019-07-20 Dirk Eddelbuettel - - * DESCRIPTION: Release 1.0.2 - - * inst/include/Rcpp/config.h: Idem - * inst/NEWS.Rd: Idem - * inst/bib/Rcpp.bib: Idem - * vignettes/Rcpp.bib: Idem - -2019-07-18 Pierrick Roger - - * src/attributes.cpp: Correct parsing of default function values - * inst/unitTests/cpp/attributes.cpp: Added tests - * inst/unitTests/runit.attributes.R: Idem - -2019-07-16 Dirk Eddelbuettel - - * debian/: Removed, see https://salsa.debian.org/edd/r-base/ instead - -2019-07-04 Dirk Eddelbuettel - - * vignettes/Rcpp.bib: Updated - * inst/bib/Rcpp.bib: Idem - -2019-05-05 Dirk Eddelbuettel - - * .Rbuildignore: Small tweak - -2019-04-27 Dirk Eddelbuettel - - * R/Rcpp.package.skeleton.R (Rcpp.package.skeleton): Use getRcppVersion() - -2019-04-26 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - - * R/tools.R (getRcppVersion): More idiomatic code - -2019-04-25 Dirk Eddelbuettel - - * R/tools.R (getRcppVersion): Export R (and dev) package version - * man/getRcppVersion.Rd: Documentation for new function - - * inst/include/Rcpp/config.h (RCPP_VERSION_STRING): New version - and development version string #define - * src/api.cpp (getRcppVersionStrings): Expose new versions strings - * src/internal.h: Register new version string exporter - * src/rcpp_init.cpp (callEntries[]): Idem - - * inst/unitTests/runit.misc.R (test.getRcppVersion): test new function - -2019-03-23 Ralf Stubner - - * vignettes/Rcpp-modules.Rmd: Describe RCPP_EXPOSED_* macros - * vignettes/Rcpp-extending.Rmd: Reference Modules extensions - -2019-03-23 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - - * inst/NEWS.Rd: Updated - -2019-03-20 James J Balamuta - - * inst/include/Rcpp/sugar/functions/unique.h: Added decreasing - parameter to control sort. - * inst/unitTests/runit.sugar.R: Added sort_unique() tests - * inst/unitTests/cpp/sugar.cpp: Ditto - -2019-03-20 Dirk Eddelbuettel - - * src/date.cpp: Renamed from Date.cpp - * src/module.cpp: Renamed from Module.cpp - * src/rcpp_init.cpp: Renamed from Rcpp_init.cpp - -2019-03-19 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - - * tests/doRUnit.R: On Travis always set RunAllRcppTests - - * docker/ci/Dockerfile: Set environment variables container-wide - -2019-03-18 Dirk Eddelbuettel - - * inst/include/Rcpp/macros/macros.h (END_RCPP_RETURN_ERROR): Add - UNPROTECT to reference nprot, also check for stop_sym - -2019-03-17 Dirk Eddelbuettel - - * DESCRIPTION: Release 1.0.1 - - * inst/include/Rcpp/config.h: Idem - * inst/NEWS.Rd: Idem - * inst/bib/Rcpp.bib: Idem - * vignettes/Rcpp.bib: Idem - -2019-03-16 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - - * inst/unitTests/runit.sugar.R: Set the sample() behaviour to R 3.5.0 - as R 3.6.0 has a breaking change (for the better) - -2019-03-13 Romain François - - * inst/include/Rcpp/macros/macros.h: Add UNPROTECT to please rchk - -2019-03-12 Romain François - - * inst/include/Rcpp/api/meat/proxy.h: AttributeProxy::set() with - Shield<> and a few related uses of Shield<> to please rchk - * inst/include/Rcpp/clone.h: Idem - * inst/include/Rcpp/proxy/AttributeProxy.h: Idem - * inst/include/Rcpp/proxy/NamesProxy.h: Idem - * inst/include/Rcpp/vector/Matrix.h: Idem - * inst/include/Rcpp/vector/Vector.h: Idem - -2019-02-25 Dirk Eddelbuettel - - * .travis.yml (after_success): Setting CODECOV_TOKEN to reenable - codecov.io coverage as detailed by Ralf in GitHub issue #941 - -2019-02-16 Dirk Eddelbuettel - - * inst/include/Rcpp/sugar/functions/cbind.h: Converted CRLF to CR - -2019-02-15 Dirk Eddelbuettel - - * inst/README: Moved stale file to local/ - * inst/THANKS: Idem - -2019-02-13 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): New minor version - -2019-02-11 Kevin Ushey - - * R/Attributes.R: better handle pre-existing RcppExports.cpp, - RcppExports.R when calling compileAttributes() - -2019-02-09 Ralf Stubner - - * Rcpp-modules.Rmd: Added example for .factory - -2019-01-31 Dirk Eddelbuettel - - * inst/include/Rcpp/protection/Shelter.h (Rcpp): Only increase - nprotected count if object is not NULL (suggested by Stepan Sindelar) - -2018-12-26 Zhuoer Dong - - * vignettes/Rcpp-quickref.Rmd: Fix three bugs: use `Named()`, define - `glob`, `glob.ls(TRUE)`. - -2018-12-01 Dirk Eddelbuettel - - * R/Attributes.R: Added new 'c++2a' plugin for '-std=c++2a' - compilation standard supported by g++ 8 or later - -2018-11-11 Dirk Eddelbuettel - - * inst/include/Rcpp/vector/Subsetter.h (check_indices): More - informative error message as suggested by KK - -2018-11-09 William Nolan - - * inst/include/Rcpp/vector/Subsetter.h: Fixed to use R_xlen_t instead - of int for indexing and added warning when indexing by IntegerVector - (only for large enough vectors) - -2018-11-05 Dirk Eddelbuettel - - * DESCRIPTION (Date, Version): Version 1.0, and happy 10th birthday! - - * inst/include/Rcpp/config.h: Idem - * inst/NEWS.Rd: Idem - * inst/bib/Rcpp.bib: Idem - * vignettes/Rcpp.bib: Idem - -2018-11-04 Dirk Eddelbuettel - - * DESCRIPTION (Date, Version): Roll minor version - * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem - - * README.md: Updated stated package and test numbers - -2018-10-25 Kevin Ushey - - * inst/include/Rcpp/String.h: Use Rf_mkCharLenCE() as appropriate - * inst/unitTests/cpp/String.cpp: Add unit tests - * inst/unitTests/runit.String.R: Add unit tests - -2018-10-12 Dirk Eddelbuettel - - * DESCRIPTION (Date, Version): Roll minor version - * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem - - * tests/doRUnit.R: Simplified to something similar to what - RcppArmadillo (and other packages) had for a while now - - * vignettes/Rcpp-unitTests.Rnw: Removed as less useful now - -2018-10-08 JJ Allaire - - * R/Attributes.R: Sort the files scanned for attributes in the C locale - for stable output across systems. - -2018-10-07 Ralf Stubner - - * vignettes/Rcpp-extending.Rmd: Correct EXPORT to EXPOSED in displays - of the corresponding macro, and remove two spurious semicolons - -2018-10-02 Dirk Eddelbuettel - - * DESCRIPTION (Date, Version): Roll minor version - * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem - -2018-10-02 Romain Francois - - * inst/include/Rcpp/vector/Matrix.h: Init nrow in Matrix(no_init) ctor - * inst/unitTests/runit.Matrix.R: New test - * inst/unitTests/cpp/Matrix.cpp: Idem - -2018-09-30 Dirk Eddelbuettel - - * man/RcppUnitTests.Rd: Remove \details{} with conditional code which - R-devel (as of Sep 28) warns about as empty - -2018-09-28 Dirk Eddelbuettel - - * .travis.yml (env): Set distinct build and check options to skip - tests of vignettes - -2018-09-27 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - - * inst/include/Rcpp/date_datetime/Date.h: Remove the empty destructor - to make g++-9 (prerelease) happy [CRAN request] - - * inst/unitTests/runit.Matrix.R: Correct typo - -2018-09-27 Romain Francois - - * inst/include/Rcpp/vector/Matrix.h: Fix Matrix(no_init(int,int)) - constructor - * inst/unitTests/runit.Matrix.R: test for above - * inst/unitTests/cpp/Matrix.cpp: same - -2018-09-26 Dirk Eddelbuettel - - * docker/ci/Dockerfile: Set env var RunAllRcppTests=yes - * .travis.yml: Do not set env var here as needed in Docker - -2018-09-21 Dirk Eddelbuettel - - * DESCRIPTION: Release 0.12.19 - * inst/NEWS.Rd: Idem - * inst/bib/Rcpp.bib: Idem - * vignettes/Rcpp.bib: Idem - * inst/include/Rcpp/config.h: Idem - - * R/RcppLdpath.R (RcppLdPath, RcppLdFlags, CxxFlags, RcppCxx0xFlags): - After discussion with CRAN, do not mark as .Deprecated() as too many - packages are involved. This will need to be phased in more slowly. - -2018-09-20 Dirk Eddelbuettel - - * vignettes/Rcpp-FAQ.Rmd: Set 'eval=FALSE' on another - RcppArmadillo example to not create a build-time dependency - -2018-09-18 JJ Allaire - - * src/attributes.cpp: Add support for [[Rcpp::init]] attribute - * vignettes/Rcpp-attributes.Rmd: Documentation for [[Rcpp::init]] - attribute - -2018-09-17 Dirk Eddelbuettel - - * inst/include/Rcpp/r/headers.h: Define STRICT_R_HEADERS, but until - September 2019 protect by defining RCPP_NO_STRICT_HEADERS - - * .travis.yml (env): Switch to rcpp/ci for ci use - -2018-09-15 Dirk Eddelbuettel - - * docker/ci/Dockerfile: Move Dockerfile to docker/ci - * docker/run/Dockerfile: Add deployment Dockerfile - * docker/plus/Dockerfile: Add 'plus-sized' Dockerfile suitable for - different add-on packages requiring Rcpp{Armadillo,Eigen,GSL} or BH - -2018-09-02 Dirk Eddelbuettel - - * .travis.yml: Switch to rcpp/rcpp-testing container - -2018-08-29 Dirk Eddelbuettel - - * .travis.yml: Use Dockerfile - -2018-08-28 Dirk Eddelbuettel - - * docker/Dockerfile: Add Dockerfile for use by Travis CI - -2018-08-27 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - - * man/Rcpp-deprecated.Rd: Fix two-char typo/thinko in \link{} - -2018-07-29 Dirk Eddelbuettel - - * README.md: Refreshed via some edits and updates - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - -2018-07-28 Dirk Eddelbuettel - - * R/RcppLdpath.R (RcppLdPath, RcppLdFlags, CxxFlags, RcppLdFlags) - (RcppCxx0xFlags): Marked as deprecated - - * man/Rcpp-deprecated.Rd: Add exported functions LdFlags() and - RcppLdFlags() as deprecated - * man/RcppLdFlags.Rd: Idem - -2018-07-27 Dirk Eddelbuettel - - * man/loadRcppModules-deprecated.Rd: Fix typo; was deprecated in - 0.12.5, not 0.16.5 which does not exist - -2018-07-26 Dirk Eddelbuettel - - * vignettes/Rcpp-FAQ.Rmd: Use collapse: true - * vignettes/Rcpp-introduction.Rmd: Idem - -2018-07-25 Dirk Eddelbuettel - - * vignettes/Rcpp-extending.Rmd: Use collapse: true - -2018-07-24 Martin Lysy - - * R/loadRcppClass.R: Search in R module for 'Class' instead of - 'CppClass'. - * R/exposeClass.R: Fixed 'rename' argument to work as expected. - * inst/unitTests/runit.exposeClass.R: Added unit tests for the - above. - -2018-07-23 Dirk Eddelbuettel - - * inst/bib/Rcpp.bib: More updates - * vignettes/Rcpp.bib: Idem - -2018-07-21 Dirk Eddelbuettel - - * DESCRIPTION: Release 0.12.18 - * inst/NEWS.Rd: Idem - * inst/bib/Rcpp.bib: Idem - * vignettes/Rcpp.bib: Idem - * inst/include/Rcpp/config.h: Idem - - * vignettes/Rcpp.bib: Updated other references - * inst/bib/Rcpp.bib: Idem - - * inst/unitTests/runit.sugar.R: Additional min, max unit tests - * inst/unitTests/cpp/sugar.cpp: Idem - -2018-07-20 Dirk Eddelbuettel - - * inst/include/Rcpp/sugar/functions/max.h: Also consider case of an - empty vector - * inst/include/Rcpp/sugar/functions/min.h: Idem - -2018-07-19 Jack Wasey - - * inst/include/Rcpp/r_cast.h: Error and abort if debugging for STRSXP -2018-07-24 Martin Lysy - * R/loadRcppClass.R: Search in R module for 'Class' instead of 'CppClass'. - * R/exposeClass.R: Fixed 'rename' argument to work as expected. - * inst/unitTests/runit.exposeClass.R: Added unit tests for the above. - -2018-07-12 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - -2018-07-12 Jack Wasey - - * R/Attributes.R: Use case-insensitive sort of filenames to make - RcppExports more deterministic - -2018-07-10 Lionel Henry - - * inst/include/Rcpp/exceptions.h: Move LongjumpException from the - Rcpp::internal namespace to the public Rcpp namespace. If you have a - catch-all statement like `catch (...)`, be sure to catch and rethrow - Rcpp::LongjumpException to prevent the R longjump from being ignored. - * inst/include/Rcpp/macros/macros.h (VOID_END_RCPP): idem - * src/attributes.cpp: idem - -2018-07-09 Dirk Eddelbuettel - - * src/Date.cpp: Skip 'tm_gmtoff' on AIX as well (thanks to PR 876 - by @ayappanec) - -2018-07-05 Lionel Henry - - * inst/include/Rcpp/api/meat/Rcpp_eval.h: Rename `RCPP_PROTECTED_EVAL` - to `RCPP_USE_UNWIND_PROTECT` because the new API is now more general - than just evaluation of R code. - * inst/NEWS.Rd: idem - * inst/unitTests/runit.interface.R: idem - * R/unit.tests.R (unitTestSetup): Pass extra arguments to sourceCpp() - for easier debugging. - - * R/Attributes.R (.plugins[["unwindProtect"]]): You can now add - `[[Rcpp::plugins(unwindProtect)]]` in one of your source file to enable - the new unwind-protect mechanism easily. It appends - `-DRCPP_USE_UNWIND_PROTECT` to `PKG_CPPFLAGS`. - - This is safer than using a `#define` because it ensures unwind-protect - is enabled in all compilation units, including RcppExports.cpp. - - * inst/unitTests/cpp/stack.cpp: Use new plugin to enable unwind-protect. - -2018-06-22 Kevin Ushey - - * inst/include/Rcpp/api/meat/Rcpp_eval.h: Ensure R_BaseEnv is used - -2018-06-21 Lionel Henry - - * inst/include/Rcpp/api/meat/unwind.h: Extract unwind protection from - Rcpp::Rcpp_fast_eval() into Rcpp::unwindProtect(). Use this function - whenever you need to call a C function that might longjump, for instance - a function from R's C API. Rcpp::unwindProtect() will protect your C++ - stack and throw a Rcpp::internal::LongJump exception to ensure all - destructors are called. The R longjump is then resumed once it is safe - to do so. This function powers Rcpp_fast_eval(). - - You can use Rcpp::unwindProtect() in two ways. First with a C-like - callback interface that takes a `SEXP (*)(void* data)` function pointer - and a `void*` data argument that is passed to the function. Second, if - you have C++11 enabled, Rcpp::unwindProtect() implements an - `std::function` overload. You can pass any function object - or lambda function with the right signature. - * inst/include/Rcpp/api/meat/Rcpp_eval.h: Idem - -2018-06-15 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - -2018-06-13 Filip Schouwenaars - - * inst/unitTests/runit.embeddedR.R: Evaluate in environment derived - of baseenv - -2018-06-11 Romain Francois - - * inst/include/Rcpp/exceptions.h: Control call and stack display - after exception / stop - * inst/unitTests/cpp/Exceptions_nocall.cpp: new test - * inst/unitTests/runit.Exceptions_nocall.R: idem - -2018-06-09 Qiang Kou - - * inst/include/Rcpp/DataFrame.h: Use Rcpp_fast_eval, not Rcpp_eval - * inst/include/Rcpp/Environment.h: Idem - * inst/include/Rcpp/Function.h: Idem - * inst/include/Rcpp/Language.h: Idem - * inst/include/Rcpp/Module.h: Idem - * inst/include/Rcpp/Reference.h: Idem - * inst/include/Rcpp/exceptions.h: Idem - * inst/include/Rcpp/generated/Function__operator.h: Idem - * inst/include/Rcpp/proxy/FieldProxy.h: Idem - * inst/include/Rcpp/proxy/NamesProxy.h: Idem - * inst/include/Rcpp/r_cast.h: Idem - * inst/include/Rcpp/vector/Vector.h: Idem - * inst/examples/SugarPerformance/sugarBenchmarks.R: Idem - * inst/unitTests/cpp/language.c: Idem - * inst/unitTests/cpp/misc.c: Idem - * src/barrier.c: Idem - -2018-06-09 Dirk Eddelbuettel - - * inst/unitTests/runit.embeddedR.R: Suspend test for now - -2018-06-08 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h: Idem - - * Contributing.md: Minor update coding style - -2018-06-07 Kevin Ushey - - * inst/include/Rcpp/config.h: bump dev version - -2018-06-06 Kevin Ushey - - * inst/include/Rcpp/RNGScope.h: Allow suspension of RNG synchronization - * inst/include/Rcpp/routines.h: Idem - * src/Rcpp_init.cpp: Idem - * src/api.cpp: Idem - - * inst/include/Rcpp/api/meat/Rcpp_eval.h: Evaluate in base env - -2018-06-05 Jack Wasey - - * inst/include/Rcpp/r_cast.h: Error and abort if debugging - -2018-06-02 Lionel Henry - - * inst/unitTests/runit.interface.R: New test for the case where - the client package was compiled without protected evaluation - enabled. On R 3.5, longjump exceptions thrown from imported - functions are still caught and dealt with properly by the client - package. - - * inst/unitTests/runit.interface.R: Test both Rcpp_eval() and - Rcpp_fast_eval(). - -2018-06-01 Lionel Henry - - * inst/unitTests/runit.interface.R: New tests for interfaces and unwind. - These tests build two packages, and that exports a function via - Rcpp::interfaces(cpp) and the other that calls it. The attributes are - regenerated and the packages rebuilt each time the tests are run. The - tests check in particular that the C++ stack is properly unwound when a - long jump occurs. - -2018-06-01 Romain Francois - - * inst/include/Rcpp/Environment.h: Make Environment::new_child() const - -2018-05-31 Lionel Henry - - * inst/include/Rcpp/api/meat/Rcpp_eval.h: Fix protected evaluation. - - Setting `RCPP_PROTECTED_EVAL` before including Rcpp.h enables a new R - 3.5 API for safe evaluation of R code. R longjumps are now correctly - intercepted and rethrown. Thanks to this the C++ stack is now safely - unwound when a longjump is detected while calling into R code. This - includes the following cases: thrown errors, caught condition of any - class, long return, restart invokation, debugger exit. Note that this is - still experimental! - - When `RCPP_PROTECTED_EVAL` is enabled, Rcpp_eval() uses the - protect-unwind API under the hood in order to gain safety. It is fully - backward-compatibile and still catches errors and interrupts to rethrow - them as typed C++ exceptions. If you don't need to catch those, consider - using Rcpp_fast_eval() instead to avoid the catching overhead. - - Rcpp_fast_eval() is a wrapper around Rf_eval(). Unlike Rcpp_eval(), it - does not evaluate R code within tryCatch() and thus avoids the overhead - of wrapping and evaluating the expression in a tryCatch() call. When - Rcpp is compiled with a lower version than R 3.5, Rcpp_fast_eval() falls - back to Rf_eval() without any protection from long jumps, even when - `RCPP_PROTECTED_EVAL` is set. Either add R 3.5 to your `Depends` or make - sure the legacy Rcpp_eval() function is called instead of Rcpp_fast_eval() - when your package is compiled with an older version of R. - - Note that Rcpp_fast_eval() behaves a bit differently to Rcpp_eval(). The - former has the semantics of the C function Rf_eval() whereas the latter - behaves like the R function base::eval(). This has subtle implications - for control flow. For instance evaluating a return() expression within a - frame environment returns from that frame rather than from the - Rcpp_eval() call. - - * inst/include/Rcpp/macros/macros.h: Leave the try/catch scope before - resuming jump to ensure proper destruction of the exception reference. - - * inst/include/Rcpp/exceptions.h: Functions to create and check a - longjump sentinel. This sentinel is used as return value in contexts - where it is not safe to resume a jump (i.e. in the glue code of cpp - interfaces). - - * inst/include/Rcpp/macros/macros.h: Return a longjump sentinel in - END_RCPP_RETURN_ERROR. - - * src/attributes.cpp: Detect longjump sentinels and resume jump. - -2018-05-27 Romain Francois - - * inst/include/Rcpp/vector/string_proxy.h: Make - StringProxy::operator== const - * inst/unitTests/cpp/Vector.cpp: New test - * inst/unitTests/runit.Vector.R: Idem - -2018-05-09 Filip Schouwenaars - - * R/Attributes.R: Set local environment in source() - * inst/unitTests/cpp/embeddedR.cpp: New test - * inst/unitTests/runit.embeddedR.R: Idem - -2018-05-09 Dirk Eddelbuettel - - * DESCRIPTION: Release 0.12.17 - * inst/NEWS.Rd: Release 0.12.17 - * inst/bib/Rcpp.bib: Release 0.12.17 - * vignettes/Rcpp.bib: Release 0.12.17 - * inst/include/Rcpp/config.h: Release 0.12.17 - - * debian/*: Changes for Debian release of 0.12.16 - -2018-05-05 Dirk Eddelbuettel - - * vignettes/Rcpp-FAQ.Rmd: Also mention TAS paper - * vignettes/Rcpp-introduction.Rmd: Idem - * vignettes/Rcpp-jss-2011.Rnw: Idem - -2018-05-04 Romain Francois - - * inst/include/Rcpp/String.h: Extend StoragePolicy support - * inst/include/Rcpp/vector/00_forward_proxy.h: Idem - * inst/include/Rcpp/vector/Vector.h: Idem - * inst/include/Rcpp/vector/const_generic_proxy.h: Idem - * inst/include/Rcpp/vector/const_string_proxy.h: Idem - * inst/include/Rcpp/vector/generic_proxy.h: Idem - * inst/include/Rcpp/vector/proxy.h: Idem - * inst/include/Rcpp/vector/string_proxy.h: Idem - * inst/include/Rcpp/vector/traits.h: Idem - - * inst/unitTests/cpp/Vector.cpp: New test - * inst/unitTests/runit.Vector.R: Idem - -2018-04-25 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - -2018-04-25 Romain Francois - - * inst/include/Rcpp/Benchmark/Timer.h: If defined, undefine FALSE - -2018-04-17 Ralf Stubner - - * vignettes/Rcpp-attributes.Rmd: Replace back-quote with straight quote - * vignettes/Rcpp-modules.Rmd: Idem - -2018-04-02 Dirk Eddelbuettel - - * .editorconfig: Added support for editorconfig.org - * .clang_format: Removed - * .dir-locals.el: Removed - -2018-03-31 Dirk Eddelbuettel - - * inst/include/Rcpp/sprintf.h (Rcpp): Remove parens [gcc8 warning] - - * vignettes/Rcpp-attributes.Rmd: Update link to JSS intro vignette - * vignettes/Rcpp-modules.Rmd: Idem - -2018-03-21 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - -2018-03-18 Kevin Ushey - - * inst/include/Rcpp/stats/random/random.h: No inheritance from RNGScope - -2018-03-14 Dirk Eddelbuettel - - * vignettes/Rcpp-FAQ.Rmd: Correct a double-quote (thanks, Joris Meys) - -2018-03-08 Peter Hickey - - * vignettes/Rcpp-attributes.Rmd: Correct stray backslash - -2018-03-08 Dirk Eddelbuettel - - * DESCRIPTION: Release 0.12.16 - * inst/NEWS.Rd: Release 0.12.16 - * inst/bib/Rcpp.bib: Release 0.12.16 - * vignettes/Rcpp.bib: Release 0.12.16 - * inst/include/Rcpp/config.h: Release 0.12.16 - - * debian/*: Changes for Debian release of 0.12.16 - -2018-02-07 Kevin Ushey - - * inst/include/Rcpp/longlong.h: Revised and more general logic for long - long on 64bit Windows etc via C++11 and as int64_t alias where possible - -2018-03-01 Dirk Eddelbuettel - - * inst/include/Rcpp/sugar/functions/complex.h (Rcpp): Remove RCPP_HYPOT - macro and use ::hypot() throught as it is provided with C99 - - * inst/include/Rcpp/sugar/undoRmath.h: Also uncomment pythag here - -2018-02-28 Dirk Eddelbuettel - - * inst/include/Rcpp/Rmath.h (R): Rf_pythag has been remove in R 2.14.0 - so comment-out the R::pythag wrapper (per request of Brian Ripley) - -2018-02-26 Kevin Ushey - - * src/api.cpp: Always set / put RNG state when calling Rcpp function - -2018-02-25 Dirk Eddelbuettel - - * vignettes/Rcpp.bib: Updated - * inst/bib/Rcpp.bib: Idem - - * vignettes/Rcpp-FAQ.Rmd (Note): Expand conda answer by adding link - -2018-02-14 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): New minor version - -2018-02-14 Kirill Müller - - * R/Attributes.R: Code compiled with cppFunction() uses .Call instead - of .Primitive(".Call"), #795 - -2018-02-07 Kevin Ushey - - * inst/include/Rcpp/longlong.h: Allow long long on 64bit Windows - -2018-01-21 Dirk Eddelbuettel - - * README.md: Added new section 'Support' - - * vignettes/Rcpp-FAQ.Rmd (vignette): Uppercase index to 'Rcpp-FAQ'; - removed reference to Gmane which sadly is no more - -2018-01-19 Dirk Eddelbuettel - - * vignettes/Rcpp-FAQ.Rmd (Note): Document the conda package - `gxx_linux-64` as helpful in that environment - -2018-01-16 Dirk Eddelbuettel - - * DESCRIPTION: Release 0.12.15 - * inst/NEWS.Rd: Release 0.12.15 - * inst/bib/Rcpp.bib: Release 0.12.15 - * vignettes/Rcpp.bib: Release 0.12.15 - * inst/include/Rcpp/config.h: Release 0.12.15 - - * debian/*: Changes for Debian release of 0.12.15 - -2018-01-15 Dirk Eddelbuettel - - * inst/include/RcppCommon.h: Check for new #define RCPP_USE_UNWIND_PROTECT - and unset if defined, this is being be used to "park" code from #789 - * inst/include/Rcpp/Environment.h: Ifdef #789 via RCPP_USE_UNWIND_PROTECT - * inst/include/Rcpp/Language.h: Idem - * inst/include/Rcpp/api/meat/Rcpp_eval.h: Idem - * inst/include/Rcpp/exceptions.h: Idem - * inst/include/Rcpp/macros/macros.h: Idem - - * inst/unitTests/runit.stack.R: Ensure test is not running - -2018-01-14 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): New minor version 0.12.14.8 - - * inst/include/Rcpp/traits/is_na.h (Rcpp): Also speed up - Rcpp::is_na - -2018-01-14 Lionel Henry - - * inst/unitTests/cpp/stack.cpp: Move stack unwinding tests from misc.cpp - * inst/unitTests/runit.stack.R: Move stack unwinding tests from misc.R; - disaggregate stack unwinding tests; also disable for now - -2018-01-11 Kirill Müller - - * inst/include/Rcpp/traits/is_na.h: Speed up Rcpp::is_na() - -2018-01-09 Iñaki Ucar - - * inst/include/Rcpp/vector/proxy.h: Improve support for NVCC, the CUDA - compiler, by making three more methods const - -2018-01-06 Kendon Bell - - * src/api.cpp: Allow for compilation on ANDROID - -2017-12-21 Dirk Eddelbuettel - - * DESCRIPTION (Date, Version): Updated minor version and date - -2017-12-21 Kirill Müller - - * inst/include/Rcpp/internal/wrap.h: Appease gcc-7 with fall-through - * inst/include/Rcpp/macros/unroll.h: Idem - -2017-12-20 Kirill Müller - - * inst/include/Rcpp/utils/tinyformat.h: Update to new upstream - c42f/tinyformat@8f60162, simplify future updates by separating - Rcpp-specific changes (issue #786). - -2017-12-19 Kevin Ushey - - * inst/include/Rcpp/internal/na.h: Remove 'clever' NA / NaN checks - -2017-12-16 Dirk Eddelbuettel - - * DESCRIPTION (Date, Version): Updated minor version and date - -2017-12-13 Lionel Henry - - * inst/include/Rcpp/api/meat/Rcpp_eval.h: Add Rcpp_fast_eval() for safe - and fast evaluation of R code using the new protect-unwind API in R 3.5. - [ This is however disabled for release 0.12.15. ] - - * inst/include/Rcpp/exceptions.h: Add LongjumpException and - resumeJump() to support Rcpp_fast_eval(). - - * inst/include/Rcpp/macros/macros.h: Catch LongjumpException and call - resumeJump(). If resumeJump() doesn't jump (on old R versions), throw an - R error (this normally should not happen). - - * inst/include/RcppCommon.h: Add Rcpp_fast_eval() to the public API and - internal::Rcpp_eval_impl() to the private API. - - * inst/include/Rcpp/Environment.h: Use safe evaluation - * inst/include/Rcpp/Language.h: idem - -2017-12-05 Kevin Ushey - - * inst/include/Rcpp/Environment.h: Use public R APIs - * inst/include/Rcpp/api/meat/Environment.h: Idem - -2017-12-04 Kevin Ushey - - * inst/include/Rcpp/RObject.h: Protect temporary wrapped SEXPs - * inst/include/Rcpp/api/meat/DataFrame.h: Idem - * inst/include/Rcpp/api/meat/Environment.h: Idem - * inst/include/Rcpp/api/meat/proxy.h: Idem - * inst/include/Rcpp/proxy/ProtectedProxy.h: Idem - * inst/include/Rcpp/vector/generic_proxy.h: Idem - -2017-12-03 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): New minor version - - * inst/include/Rcpp/sugar/functions/is_na.h: Correct test for NA to work - with new as well as old Date(time)Vectors - - * inst/unitTests/cpp/dates.cpp (has_na): Added tests - * inst/unitTests/runit.Date.R (test.NA): Idem - -2017-11-30 James J Balamuta - - * src/attributes.cpp: Fixed missing Rcpp namespace in export interface - generation - -2017-11-25 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - - * inst/include/Rcpp/exceptions/cpp11/exceptions.h: Ensure Rf_format gets - a format string - * inst/include/Rcpp/exceptions/cpp98/exceptions.h (Rcpp): Ditto - -2017-11-18 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - - * vignettes/Rcpp-FAQ.Rmd: Use Rcpp::Rcpp.plugin.maker(), not ':::' - -2017-11-17 Dirk Eddelbuettel - - * DESCRIPTION: Release 0.12.14 - * inst/NEWS.Rd: Release 0.12.14 - * inst/bib/Rcpp.bib: Release 0.12.14 - * vignettes/Rcpp.bib: Release 0.12.14 - * inst/include/Rcpp/config.h: Release 0.12.14 - -2017-11-04 Dirk Eddelbuettel - - * vignettes/Rcpp-FAQ.Rmd: Add 'skip_final_break: true' toggle - * vignettes/Rcpp-attributes.Rmd: Idem - * vignettes/Rcpp-extending.Rmd: Idem - * vignettes/Rcpp-modules.Rmd: Idem - * vignettes/Rcpp-sugar.Rmd: Idem - -2017-10-30 Dirk Eddelbuettel - - * inst/include/Rcpp.h: Unless RCPP_FORCE_OLD_DATE_DATETIME_VECTORS is - defined, define RCPP_NEW_DATE_DATETIME_VECTORS to switch to new date and - datetime vector as announced in release 0.12.8 one year ago - -2017-10-03 Dirk Eddelbuettel - - * inst/include/Rcpp/iostream/Rstreambuf.h: White-space edits - -2017-10-02 Kirill Müller - - * inst/include/Rcpp/iostream/Rstreambuf.h: Embed buffer class instance - in Rostream to not require run-time allocation, and please Coverity - -2017-09-29 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - - * DESCRIPTION (Description): Add per suggestion by CRAN - - * inst/CITATION: Add PeerJ article, add doi info, reindent - -2017-09-26 Daniel C. Dillon - - * inst/include/Rcpp/vector/MatrixRow.h: Added cbegin() / cend() to - MatrixRow, and fixing return types - * inst/include/Rcpp/vector/VectorBase.h: Ditto - -2017-09-24 Dirk Eddelbuettel - - * DESCRIPTION: Release 0.12.13 - * inst/NEWS.Rd: Release 0.12.13 - * inst/bib/Rcpp.bib: Release 0.12.13 - * inst/include/Rcpp/config.h: Release 0.12.13 - -2017-09-23 Dirk Eddelbuettel - - * inst/bib/Rcpp.bib: Updated references - * viignettes/Rcpp.bib: Idem - -2017-09-21 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - - * vignettes/Rcpp-FAQ.Rmd (Rcpp): Add entry for 'symbols not found' error - requiring two runs of compileAttributes - -2017-09-20 James J Balamuta - - * vignettes/rcpp-docs.cls: Removed - -2017-09-20 Dirk Eddelbuettel - - * vignettes/Rcpp-FAQ.Rmd: Modified formatting and cleaned a bit more. - * vignettes/Rcpp-sugar.Rmd: Idem - * vignettes/Rcpp-introduction.Rmd: Added new PeerJ preprint - -2017-09-19 James J Balamuta - - * vignettes/Rcpp-FAQ.Rmd: Formatted and cleaned up vignette. - * vignettes/Rcpp-sugar.Rmd: Idem - -2017-09-19 Dirk Eddelbuettel - - * vignettes/Rcpp-attributes.Rmd: Formatted and cleaned up vignette. - * vignettes/Rcpp-extending.Rmd: Idem - * vignettes/Rcpp-modules.Rmd: Idem - * vignettes/Rcpp-package.Rmd: Idem - * vignettes/Rcpp-quickref.Rmd: Idem - -2017-09-18 James J Balamuta - - * DESCRIPTION (Suggests): Added rmarkdown, knitr, and pinp dependencies - * .travis.yml: idem - * vignettes/Rcpp-quickref.Rmd: Translated vignette from highlight/sweave - to RMarkdown for use with the pinp template. - * vignettes/Rcpp-sugar.Rmd: Idem - * vignettes/Rcpp-package.Rmd: Idem - * vignettes/Rcpp-modules.Rmd: Idem - * vignettes/Rcpp-FAQ.Rmd: Idem - * vignettes/Rcpp-extending.Rmd: Idem - * vignettes/Rcpp-attributes.Rmd: Idem - -2017-09-18 Daniel C. Dillon - - * inst/include/Rcpp/vector/MatrixRow.h: Added cbegin() and cend() to - the class along with a framework for proper const-correctness in the - future. - -2017-09-03 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - -2017-09-02 James J Balamuta - - * inst/include/Rcpp/vector/VectorBase.h: Defined both iterator AND - const_iterator for future considerations. Currently, as before, only - const_iterator is available (though it used to be called iterator). - Added cbegin() and cend() functions. We should revisit whether there - should be a non-const iterator on VectorBase in the future. - - * inst/include/Rcpp/vector/Matrix.h: Added cbegin() and cend() - functions. Iterator defintions inherited from Vector are appropriate. - - * inst/include/Rcpp/vector/MatrixColumn.h: Added cbegin() and cend() - functions. Iterator definitions inherited from Vector are appropriate - because Matrix is column-major. - - * inst/include/Rcpp/vector/Vector.h: Added cbegin() and cend() - functions. Iterators are appropriate minus the problem with the const - proxy class of objects (which may or may not actually be const depending - on which one). - - * inst/include/Rcpp/vector/traits.h: Removed (accidentally) some some - trailing whitespace on lines. - -2017-09-02 Dirk Eddelbuettel - - * DESCRIPTION (Version): Roll minor version - - * vignettes/Rcpp-jss-2011.Rnw: Renamed again from Rcpp-introduction-2011, - added reference to new Rcpp-introduction - - * inst/bib/Rcpp.bib: Merged bibliography from new vignette; also added - PeerJ Preprint with new Rcpp Introduction - -2017-09-01 Dirk Eddelbuettel - - * vignettes/Rcpp-introduction.Rnw: New introductory vignette from PeerJ - preprints but typeset 'more nicely' - - * vignettes/rcpp-docs.cls: New LaTeX style file derived from pnas-new - and its supporting files - - * vignettes/figures/: Three support figures for new vignette - * vignettes/intro2Rcpp.bib: New bibliography - - * vignettes/Rcpp-introduction-2011.Rnw: Renamed from from Rcpp-introduction - -2017-08-26 Dirk Eddelbuettel - - * .travis.yml (before_install): Use https for curl fetch - -2017-08-14 James J Balamuta - - * vignettes/Rcpp-FAQ.Rnw: Sunset macOS documentation dealing with - toolchains by redirecting to the R Installation and Administration manual - * vignettes/.gitignore: Added various LaTeX build artifacts to ignore. - -2017-08-05 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version and date - - * inst/include/Rcpp/XPtr.h: Whitespace only-changes - -2017-08-04 Lei Yu - - * inst/include/Rcpp/Module.h: Correct one closing parenthesis - -2017-07-13 Dirk Eddelbuettel - - * DESCRIPTION: Release 0.12.12 - * inst/NEWS.Rd: Release 0.12.12 - * inst/bib/Rcpp.bib: Release 0.12.12 - * inst/include/Rcpp/config.h: Release 0.12.12 - - * README.md: Updated counts for dependents and tests - - * debian/*: Changes for Debian release of 0.12.12 - -2017-07-10 Jeff Pollock - - * inst/include/Rcpp/Module.h: Avoid unused variable warning - * inst/include/Rcpp/Module_generated_Constructor.h: Ditto - -2017-07-09 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Ditto - - * inst/NEWS.Rd: Added missing entries - -2017-07-08 Kirill Müller - - * inst/include/Rcpp/vector/no_init.h: Accept R_xlen_t instead of int - - * inst/include/Rcpp/internal/wrap.h: Use R_xlen_t not int in loop unroll - * inst/include/Rcpp/macros/unroll.h: Ditto - * inst/include/Rcpp/vector/Vector.h: Ditto - -2017-07-05 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Ditto - -2017-07-02 JJ Allaire - - * src/attributes.cpp: Generate C++ native routines with underscore - prefix to avoid export when standard exportPattern is used in NAMESPACE - -2017-06-29 JJ Allaire - - * src/attributes.cpp: Replace dot (".") with underscore ("_") in package - names when generating native routine registrations. - -2017-06-27 Jeroen Ooms - - * inst/include/RcppCommon.h: Support attribute_visible macro - -2017-06-17 Kirill Müller - - * inst/include/Rcpp/Dimension.h: Explicit cast to int - - * inst/include/Rcpp/exceptions.h: Don't declare unused arguments - * src/attributes.cpp: Ditto - -2017-06-14 JJ Allaire - - * src/attributes.cpp: Add Shield around parameters in Rcpp::interfaces - -2017-06-07 Dirk Eddelbuettel - - * README.md: Use alternates for img.shields.io GPL-2+ badges - -2017-06-06 Yu Gong - - * src/api.cpp: Also permit compilation under Haiku-OS - -2017-06-04 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - - * man/Rcpp.plugin.maker.Rd: Update manual page to additional Imports - argument - -2017-06-02 JJ Allaire - - * src/attributes.cpp: Automatically register init functions for - RcppModules - * R/Rcpp.package.skeleton.R: compileAttributes only after all code is - generated - -2017-06-01 JJ Allaire - - * src/attributes.cpp: Fix registration for exports with name attribute. - -2017-05-30 Dirk Eddelbuettel - - * inst/include/Rcpp/utils/tinyformat.h: Added missing newline - -2017-05-23 JJ Allaire - - * R/Attributes.R: Execute tools::package_native_routine_registration_skeleton - within package rather than current working directory. - * src/attributes.cpp: Execute tools::package_native_routine_registration_skeleton - within package rather than current working directory. - -2017-05-22 Dirk Eddelbuettel - - * R/inline.R (Rcpp.plugin.maker): Whitespace changes - -2017-05-20 Dirk Eddelbuettel - - * DESCRIPTION: Release 0.12.11 - * inst/NEWS.Rd: Release 0.12.11 - * inst/bib/Rcpp.bib: Release 0.12.11 - * inst/include/Rcpp/config.h: Release 0.12.11 - - * README.md: Updated counts for dependents and tests - - * debian/*: Changes for Debian release of 0.12.10 - -2017-05-19 Dirk Eddelbuettel - - * inst/NEWS.Rd: Removed one duplicate entry - * inst/include/Rcpp/api/meat/Rcpp_eval.h (Rcpp): Minor whitespace changes - -2017-05-18 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll Date and Version once more - * inst/NEWS.Rd: Updated - - * R/Attributes.R (.plugins[["openmp"]]): Fix typo in comment - - * src/attributes.cpp (Rcpp): Use size_t (twice) to suppress nags from g++ - -2017-05-16 JJ Allaire - - * R/Attributes.R: Automatically generate native routine registrations. - * src/attributes.cpp: Automatically generate native routine registrations. - * R/Rcpp.package.skeleton.R: Don't generate native routines when creating - a package using attributes. - -2017-05-09 Dirk Eddelbuettel - - * R/Rcpp.package.skeleton.R (Rcpp.package.skeleton): Under R 3.4.0, run - tools::package_native_routine_registration_skeleton to create src/init.c - -2017-05-07 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version again - - * inst/include/Rcpp/module/Module_Property.h: Remove two typed exception - specifications which upset g++ 7.1 or higher - -2017-05-05 Kirill Müller - - * inst/include/Rcpp/date_datetime/Date.h: Suppress -Wconversion warnings - * inst/include/Rcpp/date_datetime/Datetime.h: Idem - * inst/include/Rcpp/date_datetime/newDateVector.h: Idem - * inst/include/Rcpp/date_datetime/newDatetimeVector.h: Idem - * inst/include/Rcpp/sugar/functions/rowSums.h: Idem - * inst/include/Rcpp/sugar/functions/sample.h: Idem - * inst/include/Rcpp/sugar/functions/strings/trimws.h: Idem - -2017-04-26 Dirk Eddelbuettel - - * inst/include/Rcpp/exceptions.h (string_to_try_error): Protect result - from Rf_mkString - -2017-04-25 Dirk Eddelbuettel - - * R/Attributes.R (.plugins[["cpp11"]]): If R 3.4.0 or newer is used, set - USE_CXX11 (instead of the older USE_CXX1X); - (.plugins[["cpp14"]]): similarly updated for C++14 - (.plugins[["cpp17"]]): similarly updated for C++17 - (.plugins[["cpp98"]]): added - -2017-04-22 Nathan Russell - - * inst/include/Rcpp/sugar/functions/strings/trimws.h: Added sugar - function trimws with unit tests - * inst/include/Rcpp/sugar/functions/strings/strings.h: Idem - * inst/unitTests/cpp/sugar.cpp: Idem - * inst/unitTests/runit.sugar.R: Idem - -2017-04-20 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem - - * inst/include/Rcpp/exceptions/cpp98/exceptions.h - (RCPP_ADVANCED_EXCEPTION_CLASS): Suppressing some warnings - -2017-04-20 James J Balamuta - - * inst/include/Rcpp/api/meat/DottedPairImpl.h: Corrected format - specifier from '%s' to '%i'. - -2017-04-18 James J Balamuta - - * inst/include/Rcpp/vector/Matrix.h: Corrected exception throws from - not_compatible to not_a_matrix. - * inst/include/Rcpp/S4.h: Fixed documentation detailing exception class - throw. - * inst/include/Rcpp/Environment.h: Improved error handling messages - * inst/include/Rcpp/Function.h: idem - * inst/include/Rcpp/Promise.h: idem - * inst/include/Rcpp/String.h: idem - * inst/include/Rcpp/Symbol.h: idem - * inst/include/Rcpp/XPtr.h: idem - * inst/include/Rcpp/as.h: idem - * inst/include/Rcpp/r_cast.h: idem - * inst/include/Rcpp/api/meat/DottedPairImpl.h: idem - * inst/include/Rcpp/internal/export.h: idem - * inst/include/Rcpp/proxy/DottedPairProxy.h: idem - * inst/include/Rcpp/proxy/SlotProxy.h: idem - * inst/include/Rcpp/vector/MatrixColumn.h: idem - * inst/include/Rcpp/vector/MatrixRow.h: idem - * inst/include/Rcpp/vector/Vector.h: idem - -2017-04-17 James J Balamuta - - * inst/include/Rcpp/Rcpp/exceptions/cpp11/exceptions.h: Removed - semicolons from RCPP_ADVANCED_EXCEPTION_CLASS to quiet 'extra ;' - -Wpedantic - * inst/include/Rcpp/exceptions.h: Modified exceptions macros to support - a default string and removed generated stop, warning from file. - * inst/include/Rcpp/Rcpp/exceptions/cpp98/exceptions.h: Contains - generated RCPP_ADVANCED_EXCEPTION_CLASS macro, stop & warning. - * inst/include/Rcpp/Rcpp/exceptions/cpp11/exceptions.h: idem but - for variadic versions. - * inst/include/Rcpp/utils/tinyformat.h: Enabled ability to use variadic - tinyformat function if c++11 is detected. - -2017-04-14 James J Balamuta - - * inst/include/Rcpp/utils/tinyformat.h: Refreshed tinyformat.h against - May 13, 2016 upstream, retained local mods. - -2017-04-14 Kirill Müller - - * inst/include/Rcpp/macros/macros.h: Remove unused variable warning in - BEGIN_RCPP macro - - * inst/include/Rcpp/DataFrame.h: Explicitly call parent constructor - - * inst/include/Rcpp/sugar/functions/rep.h: Remove variable name in - function declaration to suppress unused argument warning - * src/Rcpp_init.cpp: Ditto - * src/attributes.cpp: Ditto - -2017-04-11 Dirk Eddelbuettel - - * inst/inst/unitTests/testRcppClass/src/init.c (R_init_testRcppClass): Call - R_registerRoutines() and R_useDynamicSymbols(); also ensure - _rcpp_module_boot_* is registered for each module - * inst/unitTests/testRcppClass/NAMESPACE: Added registration - - * inst/unitTests/testRcppClass/DESCRIPTION (Title): Title case - - * inst/unitTests/testRcppClass/R/rcpp_hello_world.R (rcpp_hello_world): - Call the renamed C++ function - * inst/unitTests/testRcppClass/src/rcpp_hello_world.cpp (rcpp_hello_world_cpp): - Renamed C++ function to be distinct from R function calling it - * inst/unitTests/testRcppClass/src/rcpp_hello_world.h: Ditto - * inst/unitTests/testRcppClass/man/rcpp_hello_world.Rd: Alias renamed - C++ function - -2017-04-09 Dirk Eddelbuettel - - * inst/unitTests/testRcppModule/src/init.c (R_init_testRcppModule): Call - R_registerRoutines() and R_useDynamicSymbols(); also ensure - _rcpp_module_boot_* is registered for each module - * inst/unitTests/testRcppModule/NAMESPACE: Added registration - - * inst/unitTests/testRcppModule/DESCRIPTION (Title): Title case - - * inst/unitTests/testRcppModule/R/rcpp_hello_world.R (rcpp_hello_world): - Call the renamed C++ function - * inst/unitTests/testRcppModule/src/rcpp_hello_world.cpp (rcpp_hello_world_cpp): - Renamed C++ function to be distinct from R function calling it - * inst/unitTests/testRcppModule/src/rcpp_hello_world.h: Ditto - * inst/unitTests/testRcppModule/man/rcpp_hello_world.Rd: Alias renamed - C++ function - - * inst/unitTests/testRcppModule/man/Rcpp_modules_examples.Rd: Alias - renamed modules - * inst/unitTests/testRcppModule/tests/modules.R: Call renamed module - -2017-04-03 Jim Hester - - * inst/include/Rcpp/exceptions.h: Added support for throwing - exceptions without call stacks. - * inst/include/Rcpp/macros/macros.h: Idem - * inst/unitTests/cpp/exceptions.cpp: Idem - * inst/unitTests/runit.exceptions.R: Idem - -2017-03-28 James J Balamuta - - * inst/vignettes/Rcpp-FAQ.Rnw: Added "Known Issues" section to FAQ - -2017-03-25 Dirk Eddelbuettel - - * LICENSE: Added - * .Rbuildignore: Do not include LICENSE in package - -2017-03-17 Dirk Eddelbuettel - - * DESCRIPTION: Release 0.12.10 - * inst/NEWS.Rd: Release 0.12.10 - * inst/bib/Rcpp.bib: Release 0.12.10 - * inst/include/Rcpp/config.h: Release 0.12.10 - - * README.md: Updated counts for dependents and tests - - * debian/*: Changes for Debian release of 0.12.10 - -2017-03-15 Jeroen Ooms - - * inst/include/Rcpp/XPtr.h: added finalizeOnExit parameter - -2017-02-28 Dirk Eddelbuettel - - * src/Rcpp_init.cpp (R_init_Rcpp): Call R_useDynamicSymbols() - - * DESCRIPTION (Version, Date): New minor version - -2017-02-25 Dirk Eddelbuettel - - * vignettes/Rcpp-FAQ.Rnw: New subsection on C++11, C++14, C++17 - -2017-02-17 Dirk Eddelbuettel - - * R/tools.R: More #nocov - * inst/include/Rcpp/internal/r_vector.h: Idem - -2017-02-15 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): New minor version - -2017-02-14 Iñaki Ucar - - * inst/include/Rcpp/iostream/Rstreambuf.h: Fixed single-character handling - (pull request #649, fixes issue #647) - -2017-02-13 Dirk Eddelbuettel - - * R/Attributes.R (.plugins[["cpp17"]]): New plugin - (.plugins[["cpp1z"]]): Idem - -2017-02-04 Daniel C. Dillon - - * inst/include/Rcpp/algorithm.h: Improved setup for Intel's icc - -2017-01-31 Dirk Eddelbuettel - - * DESCRIPTION (Date, Version): Roll minor version - - * inst/include/Rcpp/algorithm.h: Allow algorithm.h to be compiler under - Intel's compiler, add copyright header and include guard - -2017-01-31 Nathan Russell - - * inst/include/Rcpp/sugar/matrix/upper_tri.h: Inherit from MatrixBase - and use correct comparators in get() to fix segfault - * inst/include/Rcpp/sugar/matrix/lower_tri.h: Idem - * inst/unitTests/cpp/sugar.cpp: Added unit tests for upper_tri and - lower_tri - * inst/unitTests/runit.sugar.R: Idem - -2017-01-23 James J Balamuta - - * inst/include/Rcpp/DataFrame.h: Corrected return type for column size. - -2017-01-22 Dirk Eddelbuettel - - * inst/include/Rcpp/DataFrame.h: Simplified and removed deprecation language. - -2017-01-21 James J Balamuta - - * inst/include/Rcpp/DataFrame.h: Added alias for column and row size - * inst/unitTests/runit.DataFrame.R: Added unit tests for aliases - * inst/unitTests/cpp/DataFrame.cpp: Idem - -2017-01-17 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version and Date - - * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Roll minor - - * src/Date.cpp (Rcpp): Do not access tm_gmtoff on Solaris - -2017-01-14 Dirk Eddelbuettel - - * DESCRIPTION: Release 0.12.9 - * inst/NEWS.Rd: Release 0.12.9 - * inst/bib/Rcpp.bib: Release 0.12.9 - * inst/include/Rcpp/config.h: Release 0.12.9 - - * README.md: Updated counts for dependents and tests - - * debian/*: Changes for Debian release of 0.12.9 - -2017-01-13 Dirk Eddelbuettel - - * inst/include/Rcpp/exceptions.h: Added more #nocov tags - * inst/include/Rcpp/api/bones/wrap_extra_steps.h: Idem - * inst/include/Rcpp/iostream/Rstreambuf.h: Idem - * inst/include/Rcpp/traits/named_object.h: Idem - * inst/include/Rcpp/r_cast.h: Idem - * src/Module.cpp: Idem - -2017-01-12 Dirk Eddelbuettel - - * inst/bib/Rcpp.bib: Moved from vignettes/ directory - * R/bib.R (bib): Idem - - * vignettes/Rcpp-FAQ.Rnw: Evaluate \Sexpr{Rcpp:::bib()} - * vignettes/Rcpp-attributes.Rnw: Idem - * vignettes/Rcpp-extending.Rnw: Idem - * vignettes/Rcpp-introduction.Rnw: Idem - * vignettes/Rcpp-modules.Rnw: Idem - * vignettes/Rcpp-packages.Rnw: Idem - * vignettes/Rcpp-sugar.Rnw: Idem - - * inst/unitTests/runit.misc.R (test.bib): New test - - * R/exceptions.R: Added #nocov - -2017-01-11 Dirk Eddelbuettel - - * vignettes/Rcpp.bib: Updated references - - * src/attributes.cpp (Rcpp): Correct typos in #nocov tags, added tags - -2017-01-07 James J Balamuta - - * inst/include/Rcpp/sugar/functions/complex.h: Added Arg() function - * inst/unitTests/runit.sugar.R: Added Arg() unit test to complex list - * inst/unitTests/cpp/sugar.cpp: Idem - -2017-01-06 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Mark new minor version - - * src/attributes.cpp: Additional nocov tags - -2017-01-04 Dirk Eddelbuettel - - * src/Date.cpp (Rcpp): Protect assignment to tm_gmtoff to not being - under MinGW; could potentially bite other too-limited systems - - * inst/unitTests/runit.Date.R (test.Datetime.formating): Do not set TZ - when running test, only set digits option - -2017-01-01 Dirk Eddelbuettel - - * inst/unitTests/runit.Date.R (test.mktime, test.gmtime): New tests - * inst/unitTests/cpp/dates.cpp (test_mktime, test_gmtime): Idem - -2016-12-31 Dirk Eddelbuettel - - * inst/include/Rcpp/vector/Matrix.h: Minor simplification - -2016-12-31 James J Balamuta - - * inst/include/Rcpp/vector/Matrix.h: Fixed non-symmetric case of matrix - fills by switching to a loop based solution from iterator. - * inst/unitTests/runit.Matrix.R: Added unit tests for diagonally - filling matrices. - * inst/unitTests/cpp/Matrix.cpp: Idem - -2016-12-30 Dirk Eddelbuettel - - * src/Date.cpp: Synchronized internal code with R - - * inst/unitTests/cpp/dates.cpp (gmtime_mktime): New test - * inst/unitTests/runit.Date.R (test.mktime_gmtime): Idem - -2016-12-26 Dirk Eddelbuettel - - * R/Attributes.R: Added #nocov markers - * R/Module.R: Idem - * R/exposeClass.R: Idem, added copyright header - -2016-12-25 Dirk Eddelbuettel - - * DESCRIPTION (Date, Version): Roll minor version - - * src/api.cpp: Added #nocov markers - * src/Rcpp_init.cpp: Idem - * src/Date.cpp: Date - -2016-12-14 Nathan Russell - - * inst/include/Rcpp/sugar/functions/sample.h: Use vector instead of - manual memory management. - -2016-12-13 Nathan Russell - - * inst/include/Rcpp/sugar/functions/sample.h: Use malloc.h instead of - alloca.h when building on Windows - * inst/include/Rcpp/date_datetime/Date.h: Include time.h when building - on Windows - * inst/include/Rcpp/date_datetime/Datetime.h: Idem - -2016-12-12 Dirk Eddelbuettel - - * inst/include/Rcpp/sugar/functions/sample.h: In case sample.h from the - RcppArmadillo extensions was included, skip this file - -2016-12-10 Nathan Russell - - * inst/include/Rcpp/sugar/functions/sample.h: New function - sample() - * inst/include/Rcpp/sugar/functions/functions.h: Idem - * inst/unitTests/cpp/sugar.cpp: Unit tests for sample() - * inst/unitTests/runit.sugar.R: Idem - -2016-12-10 Dirk Eddelbuettel - - * R/loadRcppModules.R: Added #nocov tags - * R/loadModule.R: Ditto - - * R/unit.tests.R (test): Adjusted one #nocov tag - -2016-12-09 Dirk Eddelbuettel - - * R/00_classes.R: Added #nocov tags - * R/01_show.R: Ditto - * R/02_completion.R: Ditto - * R/03_prompt.R: Ditto - -2016-12-07 Dirk Eddelbuettel - - * inst/include/Rcpp/vector/Matrix.h: Add 'using ...' to disambiguate size() - -2016-12-04 Dirk Eddelbuettel - - * .codecov.yml (comment): Enable more verbose codecov.io reports - -2016-12-03 Dirk Eddelbuettel - - * inst/unitTests/cpp/dates.cpp (Datetime_format): Additional ostream tests - * inst/unitTests/runit.Date.R (test.Date.formating): Ditto - - * inst/unitTests/runit.system.R (test.RcppCxx): New tests - - * R/RcppLdpath.R (canUseCXX0X): Simplified as we can now rely on more - modern compilers; underlying C++ code has not been present for a while - - * R/compilerCheck.R (compilerCheck): Added some #nocov tags - * R/unit.tests.R (test, gctortureRUnitTest): Ditto - * R/zzz.R (.onLoad): Ditto - -2016-11-29 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll minor version to 0.12.8.2 - -2016-11-28 Dirk Eddelbuettel - - * inst/unitTests/cpp/dates.cpp (Date_format, Datetime_format): New tests - * inst/unitTests/runit.Date.R (test.Date.formating): Ditto - (test.Datetime.formating): Ditto - - * inst/unitTests/runit.sugar.R (test.intersect): Added sort() around - call to Sugar's intersect to ensure sorted output with g++-6.* - -2016-11-27 Dirk Eddelbuettel - - * inst/include/Rcpp/date_datetime/Date.h (format, operator<<): Added - * inst/include/Rcpp/date_datetime/Datetime.h (format, operator<<): Ditto - * inst/include/Rcpp/date_datetime/newDateVector.h (operator<<): Ditto - * inst/include/Rcpp/date_datetime/newDatetimeVector.h (operator<<): Ditto - -2016-11-23 Dirk Eddelbuettel - - * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Set minor version - -2016-11-22 Dirk Eddelbuettel - - * DESCRIPTION (Date, Version): Roll minor version - - * inst/include/Rcpp/date_datetime/newDatetimeVector.h (Rcpp): Small - correction concerning timezone attribute to ctor from RTYPE - -2016-11-22 Jim Hester - - * inst/src/api.cpp: Cleanup to stack message parseing - * inst/unitTests/cpp/exceptions.cpp: Unit tests for cleanup - * inst/unitTests/runit.exceptions.R: Ditto - -2016-11-19 James J Balamuta - - * inst/unitTests/runit.environments.R: Added environment find unit tests - as well as a symbol access test for environment get. - * inst/unitTests/cpp/Environment.cpp: Idem - -2016-11-18 James J Balamuta - - * vignettes/Rcpp-extending: Switched to attributes and - added external class pointer macro notes by MathurinD - -2016-11-16 Dirk Eddelbuettel - - * DESCRIPTION: Release 0.12.8 - * inst/NEWS.Rd: Release 0.12.8 - * vignettes/Rcpp.bib: Release 0.12.8 - * inst/include/Rcpp/config.h: Release 0.12.8 - - * README.md: Updated counts for dependents and tests - - * debian/*: Changes for Debian release of 0.12.8 - -2016-11-15 Dirk Eddelbuettel - - * DESCRIPTION: Nathan Russell added to Authors - -2016-11-14 Jim Hester - - * inst/include/Rcpp/exceptions.h: Improved exception call stack - * inst/include/Rcpp/routines.h: Ditto - * inst/src/api.cpp: Ditto - - * R/exections.R: Print and format method for stack straces - - * inst/unitTests/runit.exceptions.R: Unit tests - * inst/unitTests/cpp/exceptions.cpp: Ditto - -2016-11-13 Dirk Eddelbuettel - - * R/Attributes.R (mergeIntoBuildEnv): Correct 'empty' return - -2016-11-10 Dirk Eddelbuettel - - * inst/include/Rcpp/date_datetime/newDateVector.h: Added constructor - using VectorBase<> - -2016-11-05 Daniel C. Dillon - - * inst/include/Rcpp/date_datetime/newDatetimeVector.h: Added constructor - to instantiate newDatetimeVector from VectorBase. - -2016-11-04 Nathan Russell - - * inst/include/Rcpp/macros/dispatch.h: Modify variadic macros - to not use GNU extensions - * DESCRIPTION: roll minor version - -2016-11-03 Nathan Russell - - * inst/include/Rcpp/hash/IndexHash.h: Add casts to eliminate - signed / unsigned comparison warning - * inst/include/Rcpp/hash/SelfHash.h: Idem - * inst/unitTests/cpp/sugar.cpp: Added unit tests for sugar function - unique() - * inst/unitTests/runit.sugar.R: Idem - -2016-10-30 Dirk Eddelbuettel - - * src/api.cpp: New capabilities field for new date(time) vectors - * inst/unitTests/runit.Date.R (test.DatetimeVector.ctor): Differentiate - in test as case of 'Inf' is handling differently by new and old datetime - classes (and passed through as is by new ones which is better) - * inst/unitTests/runit.InternalFunctionCPP11.R: Small cosmetic edit - -2016-10-24 Qiang Kou - - * inst/include/Rcpp/sugar/Range.h : fix range sugar ambiguity - * inst/unitTests/cpp/sugar.cpp: range sugar unit test - * inst/unitTests/runit.sugar.R: range sugar unit test - -2016-10-24 Nathan Russell - - * inst/include/Rcpp/vector/MatrixBase.h: Change sugar - functions eye(), ones(), and zeros() into static methods - in MatrixBase - * inst/include/Rcpp/traits/one_type.h: Idem - * inst/include/Rcpp/traits/traits.h: Idem - * inst/unitTests/cpp/Matrix.cpp: Idem - * inst/unitTests/runit.Matrix.R: Idem - -2016-10-24 Qiang Kou - - * inst/include/Rcpp/sugar/Range.h: Range sugar uses R_xlen_t as start/end type - -2016-10-23 Nathan Russell - - * inst/include/Rcpp/sugar/matrix/eye.h: New functions - eye(), ones(), and zeros() - * inst/include/Rcpp/sugar/matrix/matrix_functions.h: Idem - * inst/unitTests/cpp/sugar.cpp: Unit tests for new functions - * inst/unitTests/runit.sugar.R: Idem - * inst/unitTests/runit.dispatch.R (test.ExpressionVector): Use - expression rather than parse, correct typo - -2016-10-22 Qiang Kou - - * inst/include/Rcpp/hash/IndexHash.h: change hashing function to return unsigned int - * inst/include/Rcpp/hash/SelfHash.h: Ditto - -2016-10-21 Qiang Kou - - * inst/include/Rcpp/barrier.h: Change string_elt/vector_elt to accept R_xlen_t - * inst/include/Rcpp/routines.h: Ditto - * src/barrier.cpp: Ditto - -2016-10-19 Dirk Eddelbuettel - - * inst/include/Rcpp/date_datetime/Datetime.h (Rcpp): Additional - operator+ for int argument - -2016-10-18 Dirk Eddelbuettel - - * inst/include/Rcpp/date_datetime/Date.h (Rcpp): Add operator double() - * inst/include/Rcpp/date_datetime/Datetime.h (Rcpp): Ditto - -2016-10-17 Dirk Eddelbuettel - - * inst/include/Rcpp/date_datetime/newDatetimeVector.h (Rcpp): Allow - setting of timezone attribute; default not-set leads to local as in R - -2016-10-16 Dirk Eddelbuettel - - * inst/include/Rcpp.h (RCPP_NEW_DATE_DATETIME_VECTORS): Add a new - compile-time #define to switch between 'old' (existing) and 'new' - DateVector and DatimeVector classes. Currently uses 'new' for testing - plan to switch to proper deprecation schedule. - - * inst/include/Rcpp/date_datetime/date_datetime.h: New header file (and - directory) regrouping all Date and Datetime headers, scalar and vector - - * inst/include/Rcpp/date_datetime/Date.h: Moved one directory down - * inst/include/Rcpp/date_datetime/Datetime.h: Ditto - * inst/include/Rcpp/date_datetime/oldDateVector.h: Moved and renamed - * inst/include/Rcpp/date_datetime/oldDatetimeVector.h: Ditto - - * inst/include/Rcpp/date_datetime/newDateVector.h: New implementation - inheriting from NumericVector, still optional - * inst/include/Rcpp/date_datetime/newDatetimeVector.h: Ditto - -2016-09-05 Dirk Eddelbuettel - - * DESCRIPTION (Version): Roll minor version - * cleanup: Clean two more file type from vignettes/ - -2016-09-04 Nathan Russell - - * inst/include/Rcpp/sugar/functions/rowSums.h: New functions - rowSums(), colSums(), rowMeans(), and colMeans() - * inst/include/Rcpp/sugar/functions/functions.h: Idem - * inst/unitTests/cpp/sugar.cpp: Unit tests for new functions - * inst/unitTests/runit.sugar.R: Idem - -2016-09-04 Dirk Eddelbuettel - - * DESCRIPTION: Release 0.12.7 - * inst/NEWS.Rd: Release 0.12.7 - * vignettes/Rcpp.bib: Release 0.12.7 - * inst/include/Rcpp/config.h: Release 0.12.7 - - * README.md: Updated counts for dependents and tests - - * debian/*: Changes for Debian release of 0.12.7 - -2016-09-02 Simon Dirmeier - - * src/attributes.cpp: Remove leading underscore in header guard - -2016-08-14 James J Balamuta - - * inst/examples/FastLM/lmGSL.R: Updated example to use new GSL templates - -2016-08-11 Dirk Eddelbuettel - - * .travis.yml: Switch to using run.sh for Travis CI - -2016-08-09 Artem Klevtsov - - * inst/include/Rcpp/macros/dispatch.h: Add variadic conditional macro - when C++11 compiler used - * ints/include/unitTests/cpp/dispatch.cpp: Add unit tests for - RCPP_RETURN_VECTOR and RCPP_RETURN_MATRIX macro - * ints/include/unitTests/runit.dispatch.R: Idem - -2016-08-05 James J Balamuta - - * inst/examples/FastLM/fastLMviaArmadillo.r: format fix - * inst/examples/FastLM/lmGSL.R: Updated example to use - Rcpp attributes instead of cxxfunction - * inst/examples/FastLM/lmArmadillo.R: Idem - * inst/examples/functionCallback/newApiExample.r: Idem - * inst/examples/RcppInline/RcppInlineExample.r: Idem - * inst/examples/RcppInline/RcppInlineWithLibsExamples.r: Idem - * inst/examples/RcppInline/UncaughtExceptions.r: Idem - * inst/examples/RcppInline/external_pointer.r: Idem - -2016-08-04 James J Balamuta - - * src/attributes.cpp: Correct variable re-declaration - * inst/examples/RcppGibbs/RcppGibbs.R: Updated example to use Rcpp - attributes instead of cxxfunction - * inst/examples/RcppGibbs/timeRNGs.R: Idem - -2016-08-03 Dirk Eddelbuettel - - * .gitattributes: Added to have ChangeLog and NEWS.Rd merge via union - -2016-08-02 James J Balamuta - - * R/Rcpp.package.skeleton.R: Added autogeneration warning - * src/attributes.cpp: Fixed invalid C++ Identifiers and modified export - header to warn against hand edits - * vignettes/Rcpp-package.Rnw: Updated code generation snippets - * man/Rcpp.package.skeleton.Rd: Add warning on hand edits to the - autogenerated RcppExports files. - * man/compileAttributes.Rd: Idem - -2016-08-02 Qiang Kou - - * inst/include/Rcpp/String.h: CE_UTF8 as default encoding - * inst/unitTests/cpp/String.cpp: Update unit test - * inst/unitTests/runit.String.R: Idem - -2016-08-01 Nathan Russell - - * inst/include/Rcpp/vector/Vector.h: Added decreasing option for Vector - sort - * inst/include/Rcpp/internal/NAComparator.h: Idem - * inst/unitTests/cpp/Vector.cpp: Idem - * inst/unitTests/runit.Vector.R: Idem - -2016-07-31 Qiang Kou - - * inst/examples/SugarPerformance/sugarBenchmarks.R: Remove usage of Rf_eval - * inst/include/Rcpp/Environment.h: Idem - * inst/include/Rcpp/Module.h: Idem - * inst/include/Rcpp/exceptions.h: Idem - * inst/include/Rcpp/proxy/FieldProxy.h: Idem - * inst/include/Rcpp/r_cast.h: Idem - * inst/unitTests/cpp/language.cpp: Idem - * src/barrier.cpp: Idem - -2016-07-24 Dirk Eddelbuettel - - * inst/unitTests/cpp/rmath.cpp: Added RNG unit tests for sugar variants - * inst/unitTests/runit.rmath.R: Idem - -2016-07-22 James J Balamuta - - * inst/unitTests/cpp/rmath.cpp: Added unit tests for Rmath RNGs - * inst/unitTests/runit.rmath.R: idem - * inst/include/Rcpp/Environment.h: Added get() & find() that accept - a symbol - * inst/include/Rcpp.h: Modified header load order so that Symbol.h - is now placed before Environment.h - -2016-07-21 Dirk Eddelbuettel - - * DESCRIPTION (Version): Roll minor release - -2016-07-18 Kevin Ushey - - * inst/include/Rcpp/r/headers.h: Ensure NORET macro is set appropriately - -2016-07-18 Dirk Eddelbuettel - - * DESCRIPTION: Release 0.12.6 - * inst/NEWS.Rd: Release 0.12.6 - * vignettes/Rcpp.bib: Release 0.12.6, RProtoBuf updates - * inst/include/Rcpp/config.h: Release 0.12.6 - - * README.md: Updated counts for dependents and tests - - * debian/*: Changes for Debian release of 0.12.5 - -2016-07-17 James J Balamuta - - * vignettes/Rcpp-quickref.Rnw: Added sections on Rcpp attributes and - plugins. Facelifts on important notes, inline, environments, and calling - R functions. - -2016-07-16 Daniel C. Dillon - - * Added a const_interator typedef to VectorBase - -2016-07-15 James J Balamuta - - * vignettes/Rcpp-FAQ.Rnw: Added section on default function parameters - -2016-07-15 Dirk Eddelbuettel - - * vignettes/Rcpp-FAQ.Rnw: Also point to Rcpp-attributes in Question 1 - -2016-07-13 Dirk Eddelbuettel - - * NAMESPACE: Add import for glob2rx to please R CMD check - * man/cppFunction.Rd: line break below 90 columns to please R CMD check - -2016-07-11 J.J. Allaire - - * R/Attributes.R Add cacheDir argument to sourceCpp to enable caching of - shared libraries across R sessions - * src/attributes.cpp Add cacheDir argument to sourceCpp to enable caching of - shared libraries across R sessions - * man/sourceCpp.Rd: Document new cacheDir option - * man/cppFunction.Rd: Idem - * man/evalFunction.Rd: Idem - -2016-07-10 Nathan Russell - - * inst/include/Rcpp/algorithm.h: Accomodate clang compiler - -2016-07-03 Dirk Eddelbuettel - - * DESCRIPTION (Version): Rolling minor version - -2016-07-02 Qiang Kou - - * src/attributes.cpp: Replace '.' in package names - -2016-06-23 Dirk Eddelbuettel - - * DESCRIPTION (Version): Rolling minor version - - * inst/include/Rcpp/exceptions.h (Rcpp): Also expose Rf_warningcall() - within Rcpp namespace (without leading Rf_) - -2016-06-20 Qin Wenfeng - - * inst/include/Rcpp/exceptions.h: add RCPP_USING_UTF8_ERROR_STRING macro - to use UTF-8 encoding exception string in R - -2016-06-14 Artem Klevtsov - - * inst/include/Rcpp/sugar/functions/na_omit.h: Improve na_omit for - vectors without NA - * inst/unitTests/cpp/sugar.cpp: Add unit test for the na_omit - * inst/unitTests/runit.sugar.R: Ditto - -2016-06-02 Kirill Müller - - * inst/include/Rcpp/algorithm.h: Use "long long" only if available - * inst/include/Rcpp/exceptions.h: Annotate stop() with NORET - -2016-05-18 Daniel C. Dillon - - * inst/include/Rcpp/algorithm.h: New approach for sugar - - * inst/unitTests/cpp/algorithm.cpp: Unit test support - * inst/unitTests/runit.algorithm.R: Ditto - -2016-05-17 Dirk Eddelbuettel - - * DESCRIPTION (Version): Rolling minor version - -2016-05-16 Qiang Kou - - * inst/include/Rcpp/String.h: Correct string replacement - * inst/unitTests/runit.String.R: Unit test - -2016-05-16 Daniel C. Dillon - - * inst/include/Rcpp/sugar/functions/max.h: Fixing constness - * inst/include/Rcpp/sugar/functions/min.h: Ditto - -2016-05-15 Daniel C. Dillon - - * inst/include/Rcpp/vector/Matrix.h: Correcting ambiguities in - Vector/Matrix and scalar operations - * inst/include/Rcpp/sugar/operators/divides.h: Ditto - * inst/include/Rcpp/sugar/operators/minus.h: Ditto - * inst/include/Rcpp/sugar/operators/plus.h: Ditto - * inst/include/Rcpp/sugar/operators/times.h: Ditto - -2016-05-14 Dirk Eddelbuettel - - * DESCRIPTION: Release 0.12.5 - * inst/NEWS.Rd: Release 0.12.5 - * vignettes/Rcpp.bib: Release 0.12.5 - * inst/include/Rcpp/config.h: Release 0.12.5 - - * debian/*: Changes for Debian release of 0.12.5 - - * vignettes/Rcpp.bib: Updated references - -2016-05-13 Dirk Eddelbuettel - - * DESCRIPTION: Rolled minor version - - * R/compilerCheck.R: Minimal R function to check g++ version sufficiency - * man/compilerCheck.Rd: Documentation - -2016-05-11 Dirk Eddelbuettel - - * R/Rcpp.package.skeleton.R: Modified to create a package without notes, - warnings, or error even pkgKitten is not available - - * R/Rcpp.package.skeleton.R (.playWithPerPackageHelpPage): Added new - helper function to be used when pkgKitten is not available - * inst/skeleton/manual-page-stub.Rd: Stub for per-package help page used - when pkgKitten is not available - -2016-05-10 Dirk Eddelbuettel - - * R/Rcpp.package.skeleton.R: Also correct Title: and Description: to - satisfy R CMD check in R-release and (current) R-devel - -2016-05-08 Dirk Eddelbuettel - - * inst/unitTests/cpp/Matrix.cpp: Made four scalar/matrix tests less - ambiguous for overloads by using double as scalar - -2016-05-06 Dirk Eddelbuettel - - * R/loadRcppModules.R (loadRcppModules): Add call to .Deprecated - pointing out that loadModule is preferred - * man/Rcpp-deprecated.Rd: Added to list deprecated functions - * man/loadRcppModules-deprecated.Rd: Renamed to -deprecated, added link - to loadModule which is the preferred method - - * vignettes/Rcpp-modules.Rnw: Updated with respect to loadRcppModules - deprecation and loadModule being preferred - -2016-04-15 Kevin Ushey - - * src/attributes.cpp: Add a missing 'winslash = "/"' - -2016-04-14 J.J. Allaire - - * src/attributes.cpp: Correct handling of dependent file paths on - Windows (use winslash = "/") - -2016-04-13 Dirk Eddelbuettel - - * DESCRIPTION (Version): Rolling minor version and Date - -2016-04-11 Ben Goodrich - - * R/Module.R: Avoid calling as.character() on C++Object to prevent race - -2016-04-02 Dirk Eddelbuettel - - * DESCRIPTION: Rolled to minor version 0.12.4.3 - * inst/include/Rcpp/config.h: Ditto - - * ChangeLog: Added entries for PRs 453 and 454 - * inst/NEWS.Rd: Add two missing \item uses - - * R/Module.R: Rename copy to copyObject to avoid function name collisions - * inst/unitTests/runit.Module.R: Ditto - * man/copyObject.Rd: Ditto - * inst/NEWS.Rd: Ditto - * NAMESPACE: Ditto - - * inst/unitTests/runit.environments.R: Skip test.environment.child test - -2016-03-31 Romain Francois - - * R/Modules.R: New top-level functions copy, destruct and is_destructed - * NAMESPACE: New functions copy, destruct and is_destructed exported - * man/copy.Rd: New manual page - * man/destruct.Rd: Ditto - - * inst/include/Rcpp/module/class.h: Add copy constructortor + destructor - * inst/include/Rcpp/module/class_Base.h: Ditto - * src/Module.cpp: Ditto - * src/Rcpp_init.cpp: Ditto - * src/internal.h: Ditto - - * inst/include/Rcpp/traits/traits.h: New trait detecting copy contructor - * inst/include/Rcpp/traits/has_copy_constructor.h: Ditto - - * inst/unitTests/runit.Module.R: Test new copy constructor and destructor - * inst/unitTests/cpp/Module.cpp: Ditto - -2016-03-29 Daniel C. Dillon - - * inst/include/Rcpp/String.h: Correct Rcpp::String for Rcpp::Nullable - -2016-03-27 Qin Wenfeng - - * R/Attributes.R: Support new R 3.3.0 Windows toolchain - -2016-03-26 Dirk Eddelbuettel - - * DESCRIPTION: Rolled Date and minor Version - -2016-03-23 Sergio Marques - - * src/api.cpp: Also check a flag __MUSL__ to accomodate Alpine - -2016-03-22 Dirk Eddelbuettel - - * DESCRIPTION: Release 0.12.4 - * inst/NEWS.Rd: Release 0.12.4 - * vignettes/Rcpp.bib: Release 0.12.4 - * inst/include/Rcpp/config.h: Release 0.12.4 - - * debian/*: Changes for Debian release of 0.12.4 - -2016-03-19 Dirk Eddelbuettel - - * README.md: Use canonical CRAN URL to please R-devel CMD check - -2016-03-12 Nathan Russell - - * inst/include/Rcpp/sugar/functions/cbind.h: Undefine MakeBindable macro - after use - -2016-03-12 Nathan Russell - - * inst/include/Rcpp/sugar/functions/cbind.h: New cbind() function - * inst/include/Rcpp/sugar/functions/functions.h: Idem - * inst/unitTests/cpp/sugar.cpp: Unit tests for cbind() - * inst/unitTests/runit.sugar.R: Idem - -2016-03-09 Colin Gillespie - - * vignettes/Rcpp-sugar.Rnw: Correct typos and indentation - -2016-03-09 Dirk Eddelbuettel - - * inst/include/Rcpp/stats/random/rlogis.h: Updated Emacs header and - copyright, aligned indentation - * inst/include/Rcpp/stats/random/rnbinom.h: Idem - * inst/include/Rcpp/stats/random/rnbinom_mu.h: Idem - * inst/include/Rcpp/stats/random/rnchisq.h: Idem - * inst/include/Rcpp/stats/random/rnorm.h: Idem - * inst/include/Rcpp/stats/random/rt.h: Idem - * inst/include/Rcpp/stats/random/runif.h: Idem - * inst/include/Rcpp/stats/random/rweibull.h: Idem - * inst/include/Rcpp/stats/random/random.h: Idem - * inst/include/Rcpp/stats/random/rcauchy.h: Idem - * inst/include/Rcpp/stats/random/rchisq.h: Idem - * inst/include/Rcpp/stats/random/rexp.h: Idem - * inst/include/Rcpp/stats/random/rf.h: Idem - * inst/include/Rcpp/stats/random/rgeom.h: Idem - * inst/include/Rcpp/stats/random/rlnorm.h: Idem - * inst/include/Rcpp/stats/random/rbeta.h: Idem - * inst/include/Rcpp/stats/random/rbinom.h: Idem - * inst/include/Rcpp/stats/random/rgamma.h: Idem - * inst/include/Rcpp/stats/random/rhyper.h: Idem - * inst/include/Rcpp/stats/random/rpois.h: Idem - * inst/include/Rcpp/stats/random/rsignrank.h: Idem - * inst/include/Rcpp/stats/random/rwilcox.h: Idem - -2016-03-07 Dirk Eddelbuettel - - * inst/include/Rcpp/stats/beta.h: Updated Emacs header and copyright - * inst/include/Rcpp/stats/binom.h: Idem - * inst/include/Rcpp/stats/cauchy.h: Idem - * inst/include/Rcpp/stats/chisq.h: Idem - * inst/include/Rcpp/stats/f.h: Idem - * inst/include/Rcpp/stats/gamma.h: Idem - * inst/include/Rcpp/stats/geom.h: Idem - * inst/include/Rcpp/stats/hyper.h: Idem - * inst/include/Rcpp/stats/nbeta.h: Idem - * inst/include/Rcpp/stats/nbinom.h: Idem - * inst/include/Rcpp/stats/nbinom_mu.h: Idem - * inst/include/Rcpp/stats/nchisq.h: Idem - * inst/include/Rcpp/stats/nf.h: Idem - * inst/include/Rcpp/stats/nt.h: Idem - * inst/include/Rcpp/stats/pois.h: Idem - * inst/include/Rcpp/stats/stats.h: Idem - * inst/include/Rcpp/stats/t.h: Idem - * inst/include/Rcpp/stats/unif.h: Idem - * inst/include/Rcpp/stats/dpq/dpq.h: Idem - -2016-03-05 Dirk Eddelbuettel - - * inst/include/Rcpp/stats/exp.h: Replaced initial Emacs header line with - current one, ran M-x untabify, streamlined indentation, update copyright - * inst/include/Rcpp/stats/lnorm.h: Idem - * inst/include/Rcpp/stats/logis.h: Idem - * inst/include/Rcpp/stats/norm.h: Idem - * inst/include/Rcpp/stats/weibull.h: Idem - -2016-03-04 Dirk Eddelbuettel - - * inst/unitTests/runit.Function.R: Switched to '/usr/bin/env r' - * inst/unitTests/runit.table.R: Idem - * inst/unitTests/runit.as.R: Idem - * inst/unitTests/runit.Date.R: Idem - * inst/unitTests/runit.misc.R: Idem - * inst/unitTests/runit.Language.R: Idem - * inst/unitTests/runit.subset.R: Idem - * inst/unitTests/runit.wrap.R: Idem - * inst/unitTests/runit.sugar.R: Idem - * inst/unitTests/runit.na.R: Idem - * inst/unitTests/runit.String.R: Idem - * inst/unitTests/runit.Vector.R: Idem - * inst/unitTests/runit.environments.R: Idem - * inst/unitTests/runit.Reference.R: Idem - * inst/unitTests/runit.Matrix.R: Idem - * inst/unitTests/runit.client.package.R: Idem - * inst/unitTests/runit.binary.package.R: Idem - * inst/unitTests/runit.support.R: Idem - * inst/unitTests/runit.S4.R: Idem - * inst/unitTests/runit.RObject.R: Idem - * inst/unitTests/runit.modref.R: Idem - * inst/unitTests/runit.InternalFunctionCPP11.R: Idem - * inst/unitTests/runit.attributes.R: Idem - * inst/unitTests/runit.sugar.var.R: Idem - * inst/unitTests/runit.Module.R: Idem - * inst/unitTests/runit.XPTr.R: Idem - * inst/unitTests/runit.Module.client.package.R: Idem - * inst/unitTests/runit.stats.R: Idem - * inst/unitTests/runit.rmath.R: Idem - * inst/unitTests/runit.DataFrame.R: Idem - * inst/unitTests/runit.wstring.R: Idem - * inst/unitTests/runit.InternalFunction.R: Idem - -2016-03-03 Dirk Eddelbuettel - - * inst/examples/FastLM/benchmarkLongley.r: Switched to '/usr/bin/env r' - * inst/examples/FastLM/fastLMviaArmadillo.r: Idem - * inst/examples/FastLM/fastLMviaGSL.r: Idem - * inst/examples/FastLM/lmArmadillo.R: Idem - * inst/examples/FastLM/lmGSL.R: Idem - * inst/examples/FastLM/benchmark.r: Idem - * inst/examples/ConvolveBenchmarks/exampleRCode.r: Idem - -2016-02-27 Dirk Eddelbuettel - - * inst/examples/RcppInline/RcppInlineWithLibsExamples.r: Switched to - using '/usr/bin/env r', switch to using 'cxxfunction' and RcppGSL plugin - - * inst/examples/RcppInline/external_pointer.r: Switched to '/usr/bin/env r' - * inst/examples/RcppInline/RcppInlineExample.r: Idem - * inst/examples/ConvolveBenchmarks/overhead.r: Idem - - * inst/include/Rcpp/Fast.h (Rcpp): Undo two const declarations - -2016-02-23 Dirk Eddelbuettel - - * inst/examples/OpenMP/OpenMPandInline.r: Switched to '/usr/bin/env r' - * inst/examples/RcppInline/RcppSimpleExample.r: Idem - * inst/examples/RcppInline/RObject.r: Idem - * inst/examples/RcppInline/UncaughtExceptions.r: Idem - -2016-02-21 Dirk Eddelbuettel - - * inst/examples/functionCallback/newApiExample.r (vecfunc): Switched to - using '/usr/bin/env r', switch to using 'cxxfunction' - - * inst/examples/Misc/fibonacci.r: Switched to using '/usr/bin/env r', - added explicit load of Rcpp package - - * inst/examples/Misc/newFib.r: Switched to using '/usr/bin/env r' - * inst/examples/Misc/ifelseLooped.r: Idem - * inst/examples/Misc/piBySimulation.r: Idem - * inst/examples/SugarPerformance/sugarBenchmarks.r: Idem - -2016-02-16 Dirk Eddelbuettel - - * vignettes/Rcpp-FAQ.Rnw: Added answer on fixed-size limit of arguments - -2016-02-07 Dirk Eddelbuettel - - * R/Attributes.R (sourceCppFunction): Use fully matched seq(along.with=...) - - * vignettes/Rcpp-FAQ.Rnw: Added a table of contents - -2016-02-06 James J Balamuta - - * vignettes/Rcpp-FAQ.Rnw (Rcpp): Additional material, and corrections, - for use on OS X - -2016-01-30 Qiang Kou - - * inst/include/Rcpp/vector/Subsetter.h: Fix the error under gc - * inst/unitTests/cpp/Vector.cpp : Add tests - * inst/unitTests/runit.Vector.R : Idem - -2016-01-29 Dirk Eddelbuettel - - * vignettes/Rcpp-FAQ.Rnw (Rcpp): Add new entry about required TeXlive - installation to build vignettes (issue #422) - -2016-01-22 Dirk Eddelbuettel - - * DESCRIPTION (Version): Mark as 0.12.3.1 - -2016-01-22 Daniel C. Dillon - - * R/Attributes.R: Add plugin for cpp14 - -2016-01-18 Daniel C. Dillon - - * inst/include/Rcpp/Nullable.h: Add isUsable() - * inst/unitTests/cpp/misc.cpp: Add tests - * inst/unitTests/runit.misc.R: Idem - -2016-01-17 Nathan Russell - - * inst/include/Rcpp/sugar/functions/median.h: New function - * inst/unitTests/cpp/sugar.cpp: Add tests - * inst/unitTests/runit.sugar.R: Idem - -2016-01-17 Daniel C. Dillon - - * inst/include/Rcpp/Nullable.h: Add as() and clone() - * inst/unitTests/cpp/misc.cpp: Add tests - * inst/unitTests/runit.misc.R: Idem - -2016-01-13 Kirill Mueller - - * inst/include/Rcpp/Nullable.h: Added const support - * inst/unitTests/cpp/misc.cpp: Added tests for const support - -2016-01-10 Dirk Eddelbuettel - - * DESCRIPTION: Release 0.12.3 - * inst/NEWS.Rd: Release 0.12.3 - * vignettes/Rcpp.bib: Release 0.12.3 - * inst/include/Rcpp/config.h: Release 0.12.3 - - * debian/*: Changes for Debian release of 0.12.3 - - * vignettes/Rcpp.bib: Updated all CRAN reference to current versions - -2016-01-09 Dirk Eddelbuettel - - * Contributing.md: Added to GitHub repo - - * .Rbuildignore: Ensure Contributing.md is not in R package, also - removed two old entries - -2015-12-29 Joshua Pritikin - - * inst/include/Rcpp/Module.h: Initialize base class in copy ctor - * inst/include/Rcpp/macros/interface.h: Idem - -2015-12-12 Qiang Kou - - * inst/include/Rcpp/String.h: std::hash - * inst/unitTests/cpp/wrap.cpp: Unit tests - * inst/unitTests/runit.wrap.R: Unit tests - -2015-12-04 Qiang Kou - - * inst/include/Rcpp/vector/Matrix.h: Add math operators between matrix - and scalar - * inst/unitTests/runit.Matrix.R: Unit tests - * inst/unitTests/cpp/Matrix.cpp: Unit tests - -2015-11-27 Daniel C. Dillon - - * inst/include/Rcpp/vector/proxy.h: const_iterators for CharacterVector - now work analogously to iterators - * inst/include/Rcpp/vector/const_generic_proxy.h: Idem - * inst/include/Rcpp/vector/const_string_proxy.h: Idem - * inst/include/Rcpp/vector/traits.h: Idem - - * inst/unitTests/cpp/Vector.cpp: Tests for above - * inst/unitTests/runit.Vector.R: Idem - - [ All this was commited on Sep 5 but only merged Nov 27 ] - -2015-11-25 JJ Allaire - - * src/attributes.cpp: Avoid invalid function names when - generating C++ interfaces. - -2015-11-15 Kazuki Fukui > - - * src/attributes.cpp: Insert extra space around & in interface - -2015-11-14 Dirk Eddelbuettel - - * .travis.yml: Add token for secure Slack & Travis integration - -2015-11-14 Dirk Eddelbuettel - - * DESCRIPTION: Release 0.12.2 - * inst/NEWS.Rd: Release 0.12.2 - * vignettes/Rcpp.bib: Release 0.12.2 - * inst/include/Rcpp/config.h: Release 0.12.2 - - * debian/*: Changes for Debian release of 0.12.2 - - * vignettes/Rcpp.bib: Updated all CRAN reference to current versions - -2015-11-13 Dirk Eddelbuettel - - * inst/include/Rcpp/complex.h: Define a header guard for dplyr to - prevent errorneous redefinition of operator<<() via dplyr - -2015-11-11 Dirk Eddelbuettel - - * inst/include/Rcpp/vector/Matrix.h: Further simplification - -2015-11-11 Qiang Kou - - * include/Rcpp/complex.h: operator<< for Rcomplex - -2015-11-10 Dirk Eddelbuettel - - * inst/include/Rcpp/vector/Matrix.h: Added transpose for character - matrices as well - - * inst/unitTests/runit.Matrix.R: New unit tests - * inst/unitTests/cpp/Matrix.cpp: Ditto - -2015-11-08 Dirk Eddelbuettel - - * inst/include/Rcpp/vector/Matrix.h: Matrix transpose is now a free - function for both INTSXP and REALSXP - - * inst/unitTests/runit.Matrix.R: New unit tests - * inst/unitTests/cpp/Matrix.cpp: Ditto - -2015-11-08 Daniel C. Dillon - - * inst/include/Rcpp/Nullable.h: No longer prevent assignment of - R_NilValue to Nullable<> in function signatures - - * inst/include/Rcpp/vector/Matrix.h: Use showpoint in operator<<() - -2015-11-07 Dirk Eddelbuettel - - * inst/include/Rcpp/vector/Matrix.h: Beginnings of a Matrix transpose - -2015-11-06 Kevin Ushey - - * inst/include/Rcpp/vector/Subsetter.h: Add sugar math operators - * inst/unitTests/runit.subset.R: Unit tests - * inst/unitTests/cpp/Subset.cpp: Unit tests - * inst/NEWS.Rd: NEWS entry - -2015-11-01 Qiang Kou - - * inst/include/Rcpp/vector/MatrixColumn.h: Fix overflow - -2015-11-01 Dirk Eddelbuettel - - * DESCRIPTION: Roll Version: to 0.12.1.4 - -2015-10-30 Nathan Russell - - * inst/include/Rcpp/sugar/functions/cummax.h: New sugar function - * inst/include/Rcpp/sugar/functions/cummin.h: New sugar function - * inst/include/Rcpp/sugar/functions/cumprod.h: New sugar function - * inst/unitTests/cpp/sugar.cpp: Unit test support for new functions - * inst/unitTests/runit.sugar.R: Ditto - -2015-10-08 Tianqi Chen - - * inst/include/Rcpp/api/meat/is.h: Enhance the check for Rcpp Module - objects (PR #381 fixing #380) - -2015-10-01 JJ Allaire - - * src/attributes.cpp: Enable export of C++ interface for functions that - return void - -2015-09-28 Dirk Eddelbuettel - - * inst/NEWS.Rd: GitHub pull requests and issues are now linked - - * src/barrier.cpp: Use SET_STRING_ELT() on LHS (with thanks to Luke) - -2015-09-21 Dirk Eddelbuettel - - * inst/include/Rcpp/String.h: Before assigning ensure we received - exactly one string argument - -2015-09-10 Dirk Eddelbuettel - - * DESCRIPTION: Release 0.12.1 - * inst/NEWS.Rd: Release 0.12.1 - * vignettes/Rcpp.bib: Release 0.12.1 - * inst/include/Rcpp/config.h: Release 0.12.1 - - * debian/*: Changes for Debian release of 0.12.1 - -2015-09-09 Dirk Eddelbuettel - - * vignettes/Rcpp-attributes.Rnw: Less harsh grey border around code - * vignettes/Rcpp-*.Rnw: Ditto - - * inst/include/Rcpp/String.h: More comparison operators - -2015-09-08 Daniel C. Dillon - - * inst/include/Rcpp/vector/string_proxy.h: More comparison operators - * inst/include/Rcpp/vector/const_string_proxy.h: More comparison operators - -2015-09-08 Florian Plaza Onate - - * inst/include/Rcpp/Dimension.h: Correct creation and access of large - matrices - * inst/include/Rcpp/vector/Matrix.h: Ditto - -2015-09-07 Dirk Eddelbuettel - - * inst/include/Rcpp/Nullable.h: New class for objects which may be NULL - * inst/unitTests/cpp/Vector.cpp: Unit tests for Nullable - * inst/unitTests/runit.Vector.R: Ditto - -2015-09-06 Daniel C. Dillon - - * inst/include/Rcpp/String.h: Make strings and string_proxies comparable - * inst/unitTests/cpp/String.cpp: Unit tests for above - * inst/unitTests/runit.String.R: Ditto - -2015-09-05 Daniel C. Dillon - - * inst/include/Rcpp/vector/Matrix.h: Matrix now has appropriate operator<< - * inst/include/Rcpp/vector/Vector.h: Vector now has appropriate operator<< - * inst/unitTests/cpp/Vector.cpp: Unit tests for above - -2015-09-01 Florian Plaza Onate - - * inst/include/Rcpp/vector/Subsetter.h: Allow logical subsets to be - assigned to a vector of size 1 - (pull request #349, discussed in issue #345) - * inst/unitTests/cpp/Subset.cpp: Add unit test for above - * inst/unitTests/runit.subset.R: Ditto - -2015-08-31 Dirk Eddelbuettel - - * DESCRIPTION (Version, Date): Roll Version and Date - -2015-08-30 Dirk Eddelbuettel - - * vignettes/Rcpp.bib: Updated RcppGSL entry - -2015-08-29 Dirk Eddelbuettel - - * vignettes/Rcpp.bib: Add RcppZiggurat entry - - * inst/include/Rcpp/utils/tinyformat.h: Updated to current upstream - version keeping our local modifications / adaptations (PR #357) - -2015-08-29 Qiang Kou - - * inst/include/Rcpp/vector/Subsetter.h: Enable logical subsetting on - both LHS and RHS, eg 'a[b > 3] = b[b > 3]' (pull request #352 addressing - issue #345) - * inst/unitTests/cpp/Subset.cpp: Ditto - * inst/unitTests/runit.subset.R: Unit tests for above - -2015-08-26 Dirk Eddelbuettel - - * inst/unitTests/testRcppClass/src/rcpp_module.cpp: Renamed Module - 'World' to 'RcppClassWorld' to avoid multiple modules with same name - (pull request #351, fixed issue #350) - - * inst/unitTests/testRcppClass/man/Rcpp_class_examples.Rd: Ditto - * inst/unitTests/testRcppClass/R/load.R: Ditto - * inst/unitTests/testRcppClass/NAMESPACE: Ditto - * inst/unitTests/runit.Module.client.package.R: Re-enable test - - * inst/unitTests/testRcppModule/src/rcpp_module.cpp: Renamed Module - 'World' to 'RcppModuleWorld' to avoid multiple modules with same name - - * inst/unitTests/cpp/modref.cpp: Rename 'World' to 'ModRefWorld' - * inst/unitTests/runit.modref.R (test.modRef): Ditto - - * inst/unitTests/cpp/Module.cpp: Rename 'World' to 'ModuleWorld' - * inst/unitTests/runit.Module.R (test.Module): Ditto - -2015-08-25 Kurt Hornik - - * R/loadModule.R: For now=TRUE, always set .botched to FALSE which - corresponds to the case of the methods package being in the search path - * inst/include/Rcpp/Reference.h: Call call with the internal Namespace - -2015-08-24 Dirk Eddelbuettel - - * vignettes/Rcpp.bib: Updated R / R Core references - -2015-08-23 Romain Francois - - * inst/include/Rcpp/Benchmark/Timer.h: Silence 'g++ -pedantic' by - replaceing one R_xlen_t by size_t (pull request #348) - -2015-08-19 Florian Plaza Onate - * inst/include/Rcpp/vector/Vector.h: Add 'at' methods which implement - accessors with bounds cheking (pull request #342, fixes issue #341) - * inst/include/Rcpp/vector/Matrix.h: Ditto - * inst/unitTests/cpp/Vector.cpp: Add unit tests for at acessors - * inst/unitTests/cpp/Matrix.cpp: Ditto - * inst/unitTests/runit.Vector.R: Ditto - * inst/unitTests/runit.Matrix.R: Ditto - -2015-08-18 Dirk Eddelbuettel - - * inst/unitTests/runit.Module.client.package.R: Disabled for bad - interaction of Rcpp Modules and R 3.2.2 - -2015-08-15 Florian Plaza Onate - - * inst/include/Rcpp/vector/converter.h: Correct conversion from const - char argument (pull request #344, fixes issue #343) - -2015-08-14 Florian Plaza Onate - - * inst/include/Rcpp/vector/DimNameProxy.h: Add assignment operator, - refactor code, update error message formatting (pull request #339) - -2015-08-05 Kevin Ushey - - * src/api.cpp: use `_WIN32` instead of `WIN32` - -2015-08-02 Dirk Eddelbuettel - - * R/Attributes.R (sourceCpp): In no-rebuild-needed case, also set a - default directory restoration via on.exit() (pull request #335, - addressing issue #309) - -2015-07-24 Dirk Eddelbuettel - - * DESCRIPTION: Release 0.12.0 - * inst/NEWS.Rd: Release 0.12.0 - * vignettes/Rcpp.bib: Release 0.12.0 - * inst/include/Rcpp/config.h: Release 0.12.0 - - * debian/*: Changes for Debian release of 0.12.0 - -2015-07-23 Dirk Eddelbuettel - - * inst/include/Rcpp/Symbol.h: Use Rf_installChar(x) instead of - Rf_install(CHAR(X)) if R 3.2.0 or later is used - -2015-07-07 Qiang Kou - - * src/include/Rcpp/String.h: Ensure proper initialization of String - objects from two constructors - * inst/unitTests/cpp/String.cpp: New unit test - * inst/unitTests/runit.String.R: Ditto - -2015-07-21 Kevin Ushey - - * inst/include/Rcpp/api/meat/Rcpp_eval.h: don't use 'CDDDR' - -2015-07-20 Dirk Eddelbuettel - - * DESCRIPTION: Rolled minor Date and Version - - * R/Attributes.R: Use explicit 'utils::assignInMyNamespace' - - * R/Rcpp.package.skeleton.R: Use explicit 'utils::package.skeleton' - -2015-07-17 JJ Allaire - - * Rcpp.Rproj: don't use devtools mode in RStudio (enables the - Test Package command to invoke the RUnit based test-suite) - * src/attributes.cpp: Correctly handle signature termination - characters ('{' or ';') contained in quotes - -2015-07-16 Kevin Ushey - - * inst/include/Rcpp/api/meat/Rcpp_eval.h: Don't use 'R_ToplevelExec'; - ensure Rcpp_eval respects previously established handlers. Capture - errors + interrupts with R-level 'tryCatch'. - * inst/NEWS.Rd: Add news entry - -2015-07-14 JJ Allaire - - * src/attributes.cpp: fix crash on second call to sourceCpp - -2015-07-07 Qiang Kou - - * src/include/Rcpp/String.h: Use Rcpp_PreserveObject and - Rcpp_ReplaceObject to protect underlying SEXP inside String objects - -2015-07-07 Matt P. Dziubinski - - * inst/include/Rcpp/sugar/functions/var.h: Variance -- changed from - the unstable formula back to the stable (two-pass) formula, fixed - support for complex numbers (formula correction). - * inst/unitTests/runit.sugar.var.R: Added tests for complex variance - computation, applied simple code refactoring. - -2015-07-04 Dirk Eddelbuettel - - * vignettes/Rcpp.bib: Updated reference to several CRAN packages - -2015-07-02 Kevin Ushey - - * .clang_format: Added - -2015-06-25 Kevin Ushey - - * inst/include/Rcpp/api/meat/Rcpp_eval.h: reset error after Rcpp_eval - * inst/unitTests/cpp/Function.cpp: unit tests - * inst/unitTests/runit.Function.R: unit tests - * inst/include/Rcpp/Function.h: catch empty error messages - * inst/include/Rcpp/api/meat/Rcpp_eval.h: protect call - -2015-06-24 Qiang Kou - - * inst/include/Rcpp/String.h: Support encodings - * src/String.cpp: Ditto - * inst/unitTests/runit.String.R: Add unit tests - -2015-06-18 Dirk Eddelbuettel - - * R/Attributes.R (evalCpp): Add support for plugings argument - * man/evalCpp.Rd: Document argument - -2015-06-07 JJ Allaire - - * src/attributes.cpp: Don't load sourceCpp dynamic library if it's - already been loaded - -2015-06-05 Dirk Eddelbuettel - - * R/Rcpp.package.skeleton.R (Rcpp.package.skeleton): Remove - `character.only=TRUE` from `requireNamespace()` as it happens to flip - the boolean value too - -2015-06-03 Qiang Kou - - * inst/include/Rcpp/*: Finish changing R_len_t to R_xlen_t - * src/*: Ditto - -2014-05-27 Romain Francois - - * inst/include/Rcpp/DataFrame.h: Safe DataFram constructor - -2015-05-16 Qiang Kou - - * inst/include/Rcpp/*: Begin changing R_len_t to R_xlen_t - * src/*: Ditto - -2015-05-17 Matt P. Dziubinski - - * inst/include/Rcpp/platform/compiler.h: Added RCPP_USING_CXX0X_OR_LATER - * inst/include/Rcpp/sugar/functions/sapply.h: Updated to support lambda functions - -2015-05-01 Kevin Ushey - - * vignettes/Rcpp-FAQ.Rnw: Notes on installing gfortran - -2015-05-01 Dirk Eddelbuettel - - * DESCRIPTION: Release 0.11.6 - * inst/NEWS.Rd: Release 0.11.6 - * inst/include/Rcpp/config.h: Release 0.11.6 - - * debian/*: Changes for Debian release of 0.11.6 - -2015-04-27 JJ Allaire - - * src/Module.cpp: Revert parts of PR291 pertaining to Modules and {BEGIN/END}_RCPP - * inst/include/Rcpp/api/meat/module/Module.h: Ditto - * inst/include/Rcpp/InternalFunctionWithStdFunction.h: Ditto - * inst/include/Rcpp/module/Module_generated_CppFunction.h: Ditto - * inst/include/Rcpp/module/class.h: Ditto - -2014-04-25 Romain Francois - - * inst/include/Rcpp/vector/Vector.h: update the parameterization of Vector cache - * inst/include/Rcpp/vector/traits.h: ... - * inst/include/Rcpp/vector/00_forward_proxy.h: ... - * inst/unitTests/runit.Vector.R: test for above changes - * inst/unitTests/cpp/Vector.cpp: ... - -2015-04-22 Kevin Ushey - - * inst/include/Rcpp/utils/tinyformat.h: don't use C++11 features - -2015-04-14 Dirk Eddelbuettel - - * .travis.yml (sudo): Adding 'sudo: required' to force older Travis backend - -2014-04-14 Romain Francois - - * inst/include/Rcpp/api/meat/is.h: added is__simple - * inst/include/Rcpp/config.h: not using floating point arithmetic in preprocessor - -2015-04-12 Dirk Eddelbuettel - - * vignettes/Rcpp-FAQ.Rnw: Also load Rcpp to make cppFunction visible - -2014-04-11 Romain Francois - - * inst/include/Rcpp/macros/macros.h: Reworked BEGIN_RCPP and END_RCPP - * inst/include/Rcpp/*: Removed BEGIN_RCPP and END_RCPP from a few files - * src/Module.cpp: But added here - -2015-04-19 Jonathan Marshall - - * inst/include/Rcpp/vector/string_proxy.h: Adds empty() constructor - * inst/include/Rcpp/vector/const_string_proxy.h: Ditto - -2015-03-18 Dmitrii Meleshko - - * inst/include/Rcpp/vector/Matrix.h: Added default ctor for 0x0 matrix - -2015-03-18 JJ Allaire - - * R/Attributes.R: Revert to use of gcc 4.6.3 with Rtools 3.3 - -2015-03-16 JJ Allaire - - * src/attributes.cpp: Fix failing local include test (normalize path of - base source file so comparisons work on Windows). - -2015-03-15 Dirk Eddelbuettel - - * R/Attributes.R (.rtoolsPath): Replace trimws() use with a local variant - -2015-03-11 JJ Allaire - - * R/Attributes.R: Rtools 3.3 is now located and used for compilation under R 3.2. - -2015-03-11 Kevin Ushey - - * inst/include/RcppCommon.h: Move headers into major/minor protection - * inst/include/Rcpp/r/headers.h: New file - 2015-03-04 Dirk Eddelbuettel * DESCRIPTION: Release 0.11.5 @@ -5762,24 +744,24 @@ 2014-01-23 Dirk Eddelbuettel - * inst/announce/ANNOUNCE-0.11.0.txt: Added for next release + * inst/announce/ANNOUNCE-0.11.0.txt: Added for next release 2014-01-21 Dirk Eddelbuettel - * R/Rcpp.package.skeleton.R: Update skeleton package to add proper - Imports: to DESCRIPTION, and importFrom() to NAMESPACE + * R/Rcpp.package.skeleton.R: Update skeleton package to add proper + Imports: to DESCRIPTION, and importFrom() to NAMESPACE 2014-01-19 Kevin Ushey - * inst/include/Rcpp/api/meat/Vector.h: Add missing UNPROTECT in - push_back_name__impl + * inst/include/Rcpp/api/meat/Vector.h: Add missing UNPROTECT in + push_back_name__impl 2014-01-18 Kevin Ushey - * inst/unitTests/runit.S4.R: Add a test for ctor from slot proxy - * inst/unitTests/cpp/S4.cpp: Add a test for ctor from slot proxy - * inst/include/Rcpp/vector/Vector.h: Add missing r_cast to vector - ctor from proxy + * inst/unitTests/runit.S4.R: Add a test for ctor from slot proxy + * inst/unitTests/cpp/S4.cpp: Add a test for ctor from slot proxy + * inst/include/Rcpp/vector/Vector.h: Add missing r_cast to vector + ctor from proxy 2014-01-18 JJ Allaire @@ -5788,14 +770,14 @@ 2014-01-18 Kevin Ushey - * inst/unitTests/cpp/Matrix.cpp: Add unit test - * inst/unitTests/runit.Matrix.R: Add unit test - * inst/include/Rcpp/api/meat/Matrix.h: Bug fix in operator= + * inst/unitTests/cpp/Matrix.cpp: Add unit test + * inst/unitTests/runit.Matrix.R: Add unit test + * inst/include/Rcpp/api/meat/Matrix.h: Bug fix in operator= 2014-01-17 Dirk Eddelbuettel - * R/RcppLdpath.R (RcppCxxFlags): Restore function to supply values - for include files for packages not yet converted to LinkingTo: + * R/RcppLdpath.R (RcppCxxFlags): Restore function to supply values + for include files for packages not yet converted to LinkingTo: 2014-01-16 JJ Allaire @@ -5806,7 +788,7 @@ 2014-01-15 Dirk Eddelbuettel - * inst/include/Rcpp/exceptions.h: Move stop() into Rcpp namespace + * inst/include/Rcpp/exceptions.h: Move stop() into Rcpp namespace 2014-01-03 JJ Allaire @@ -5820,7 +802,7 @@ 2013-12-31 Dirk Eddelbuettel - * vignettes/Rcpp.bib: Updated CRAN package references + * vignettes/Rcpp.bib: Updated CRAN package references 2013-12-20 Kevin Ushey diff --git a/Contributing.md b/Contributing.md deleted file mode 100644 index e57f25b99..000000000 --- a/Contributing.md +++ /dev/null @@ -1,78 +0,0 @@ - -## Contributing to Rcpp - -Interested in contributing? Great! We really welcome bug reports and pull -requests that expand and improve the functionality of Rcpp from all -contributors. - -### Reporting an Issue - -When reporting an issue, the most important thing you can provide is a -[reproducible example](http://www.sscce.org/). Please include the smallest -possible example that illustrates the issue -- when possible, provide a snippet -of C++ code that can be run using `Rcpp::sourceCpp()`; if it's not possible or -feasible to provide such an example, provide clear instructions on how to -reproduce the problem. The less effort it takes to reproduce an issue, the more -likely a contributor will be able to investigate the issue + resolve the -problem. Also see this StackOverflow answer on -[creating a reproducible example](http://stackoverflow.com/a/5963610/143305). - -Issues that cannot be reproduced are unlikely to receive attention, as it is -often difficult, if not impossible, to ascertain whether Rcpp is truly the -culprit, or what part of Rcpp could be responsible. - -Please also supply the output of `sessionInfo()` when reporting an issue. - -### Submitting a Pull Request - -Considering submitting a pull request? It is strongly recommended that you first -post an issue outlining some motivation for your pull request to ensure that -some discussion around the appropriate resolution for the issue occurs first. - -We would prefer it if your PR also included -[unit tests](https://github.com/RcppCore/Rcpp/tree/master/inst/tinytest). Additions -to the [ChangeLog](https://github.com/RcppCore/Rcpp/blob/master/ChangeLog) and -[NEWS](https://github.com/RcppCore/Rcpp/blob/master/inst/NEWS.Rd) are also -appreciated. - -Please note that C++ code in Rcpp must adhere to the prvailing C++ standards -as selected by the current R version ("R-release") and the upcoming R version -("R-devel"). These days, _Modern C++_ is well supported provided recent -compilers are used. As of 2024, R has supported C++17 for the past two -release cycles. We tend to be a little more conservative with Rcpp and still -support C++98 / C++11 as we know some users may be confronted with ancient -compilers. - -### Coding Style - -It would be nice if the contributed code followed existing conventions for -whitespace and indentation. We mostly follow the R Core style for with four -spaces, and curlies where K&R would put them. Our -[editorconfig](https://editorconfig.org/) [configuration -file](https://github.com/RcppCore/Rcpp/blob/master/.editorconfig) selects -reasonable defaults. - -### Asking Questions - -Please direct general questions to the -[Rcpp-devel](http://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel) -mailing list (preferred, note that only subscribers can post), or post an -issue at GitHub. - -Are you a new user of Rcpp? You might find the -[vignettes](https://cran.r-project.org/package=Rcpp) helpful in getting -acquainted with the functionality Rcpp provides. The -[Rcpp Gallery](http://gallery.rcpp.org/) contains a large number of examples. - -### Copyright - -Rcpp is released as a [CRAN](https://cran.r-project.org/package=Rcpp) package, -licensed under the -[GPL-2](http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html) (or later) -[Open Source](https://opensource.org) / -[Free Software](http://www.gnu.org/philosophy/free-sw.en.html) -license -- just like R itself. Aggregated works, i.e. code linking to R such as -Rcpp will always be under this license. Your contribution has to be under a -compatible licence. And to simplify matters, we strongly prefer contributions -under the same terms of the GPL (>= 2) and will in general assume this license -unless explicitly stated otherwise. diff --git a/DESCRIPTION b/DESCRIPTION index 2226dd2c6..dc9263bc7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,39 +1,23 @@ Package: Rcpp Title: Seamless R and C++ Integration -Version: 1.1.0.14 -Date: 2026-01-06 -Authors@R: c(person("Dirk", "Eddelbuettel", role = c("aut", "cre"), email = "edd@debian.org", - comment = c(ORCID = "0000-0001-6419-907X")), - person("Romain", "Francois", role = "aut", - comment = c(ORCID = "0000-0002-2444-4226")), - person("JJ", "Allaire", role = "aut", - comment = c(ORCID = "0000-0003-0174-9868")), - person("Kevin", "Ushey", role = "aut", - comment = c(ORCID = "0000-0003-2880-7407")), - person("Qiang", "Kou", role = "aut", - comment = c(ORCID = "0000-0001-6786-5453")), - person("Nathan", "Russell", role = "aut"), - person("Iñaki", "Ucar", role = "aut", - comment = c(ORCID = "0000-0001-6403-5550")), - person("Doug", "Bates", role = "aut", - comment = c(ORCID = "0000-0001-8316-9503")), - person("John", "Chambers", role = "aut")) -Description: The 'Rcpp' package provides R functions as well as C++ classes which +Version: 0.11.5.1 +Date: 2015-03-08 +Author: Dirk Eddelbuettel, Romain Francois, JJ Allaire, Kevin Ushey, + Douglas Bates, and John Chambers +Maintainer: Dirk Eddelbuettel +Description: The Rcpp package provides R functions as well as C++ classes which offer a seamless integration of R and C++. Many R data types and objects can be mapped back and forth to C++ equivalents which facilitates both writing of new - code as well as easier integration of third-party libraries. Documentation - about 'Rcpp' is provided by several vignettes included in this package, via the - 'Rcpp Gallery' site at , the paper by Eddelbuettel and - Francois (2011, ), the book by Eddelbuettel (2013, - ) and the paper by Eddelbuettel and Balamuta (2018, - ); see 'citation("Rcpp")' for details. -Depends: R (>= 3.5.0) -Imports: methods, utils -Suggests: tinytest, inline, rbenchmark, pkgKitten (>= 0.1.2) -URL: https://www.rcpp.org, https://dirk.eddelbuettel.com/code/rcpp.html, https://github.com/RcppCore/Rcpp + code as well as easier integration of third-party libraries. Documentation + about Rcpp is provided by several vignettes included in this package, via the + Rcpp Gallery site at http://gallery.rcpp.org, the paper by Eddelbuettel and + Francois (2011, JSS), and the book by Eddelbuettel (2013, Springer); see + 'citation("Rcpp")' for details on these last two. +Depends: R (>= 3.0.0) +Imports: methods +Suggests: RUnit, inline, rbenchmark, highlight, pkgKitten (>= 0.1.2) +VignetteBuilder: highlight +URL: http://www.rcpp.org, http://dirk.eddelbuettel.com/code/rcpp.html, https://github.com/RcppCore/Rcpp License: GPL (>= 2) BugReports: https://github.com/RcppCore/Rcpp/issues -MailingList: rcpp-devel@lists.r-forge.r-project.org -RoxygenNote: 6.1.1 -Encoding: UTF-8 -VignetteBuilder: Rcpp +MailingList: Please send questions and comments regarding Rcpp to rcpp-devel@lists.r-forge.r-project.org diff --git a/LICENSE b/LICENSE deleted file mode 100644 index d159169d1..000000000 --- a/LICENSE +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/NAMESPACE b/NAMESPACE index 9f6fdf377..adcfb06d9 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,8 +1,7 @@ useDynLib(Rcpp, .registration = TRUE) import(methods) -importFrom(utils, capture.output, assignInNamespace, .DollarNames, prompt, - packageDescription, package.skeleton, glob2rx) +importFrom(utils, capture.output, assignInNamespace, .DollarNames, prompt, packageDescription) exportClasses(Module, "C++Field", "C++OverloadedMethods", @@ -16,6 +15,7 @@ exportMethods(prompt, show, .DollarNames, initialize, "formals<-") export(Module, Rcpp.package.skeleton, populate, + loadRcppModules, setRcppClass, loadRcppClass, loadModule, @@ -25,16 +25,15 @@ export(Module, sourceCpp, compileAttributes, registerPlugin, - RcppLdFlags, # deprecated since Rcpp 0.12.19 released Sep 2018 - LdFlags, # deprecated since Rcpp 0.12.19 released Sep 2018 + RcppLdFlags, + LdFlags, demangle, sizeof, cpp_object_initializer, - cpp_object_dummy, - Rcpp.plugin.maker, - getRcppVersion) -S3method(print, bytes) -S3method(format, Rcpp_stack_trace) -S3method(str, Rcpp_stack_trace) -S3method(print, Rcpp_stack_trace) + cpp_object_dummy, + Rcpp.plugin.maker + ) +S3method( print, bytes ) exportClass(RcppClass) + + diff --git a/R/00_classes.R b/R/00_classes.R index 589d3a836..39b82e04e 100644 --- a/R/00_classes.R +++ b/R/00_classes.R @@ -1,4 +1,4 @@ -# Copyright (C) 2010 - 2016 John Chambers, Dirk Eddelbuettel and Romain Francois +# Copyright (C) 2010 - 2012 John Chambers, Dirk Eddelbuettel and Romain Francois # # This file is part of Rcpp. # @@ -16,7 +16,7 @@ # along with Rcpp. If not, see . # anticipating a change in R 2.16.0 -setClass( "refClassGeneratorFunction" ) # #nocov start +setClass( "refClassGeneratorFunction" ) setClassUnion("refGenerator", c("refObjectGenerator", "refClassGeneratorFunction")) ## "Module" class as an environment with "pointer", "moduleName", @@ -106,4 +106,4 @@ setClass( "C++Function", fun } setGeneric( "formals<-" ) -setMethod( "formals<-", "C++Function", .cppfunction_formals_gets ) # #nocov end +setMethod( "formals<-", "C++Function", .cppfunction_formals_gets ) diff --git a/R/01_show.R b/R/01_show.R index 7d88ebcc4..4f9a8045d 100644 --- a/R/01_show.R +++ b/R/01_show.R @@ -1,4 +1,4 @@ -# Copyright (C) 2010 - 2016 John Chambers, Dirk Eddelbuettel and Romain Francois +# Copyright (C) 2010 - 2012 John Chambers, Dirk Eddelbuettel and Romain Francois # # This file is part of Rcpp. # @@ -15,7 +15,7 @@ # You should have received a copy of the GNU General Public License # along with Rcpp. If not, see . -setMethod( "show", "C++Object", function(object){ # #nocov start +setMethod( "show", "C++Object", function(object){ env <- as.environment(object) pointer <- get(".pointer", envir = env) cppclass <- get(".cppclass", envir = env) @@ -120,5 +120,5 @@ setMethod( "show", "Module", function( object ){ txt <- sprintf( "%15s ", names(info) ) writeLines( txt ) } -} ) # #nocov end +} ) diff --git a/R/02_completion.R b/R/02_completion.R index abd8ba0ca..e3ea7487d 100644 --- a/R/02_completion.R +++ b/R/02_completion.R @@ -1,4 +1,4 @@ -# Copyright (C) 2010 - 2016 John Chambers, Dirk Eddelbuettel and Romain Francois +# Copyright (C) 2010 - 2011 John Chambers, Dirk Eddelbuettel and Romain Francois # # This file is part of Rcpp. # @@ -15,7 +15,7 @@ # You should have received a copy of the GNU General Public License # along with Rcpp. If not, see . -setGeneric( ".DollarNames" ) # #nocov start +setGeneric( ".DollarNames" ) .DollarNames.Module <- function(x, pattern){ pointer <- .getModulePointer( x ) if(identical(pointer, .badModulePointer)) { @@ -40,4 +40,4 @@ setMethod( "complete", "C++Object", function(x){ grep( pattern, complete(x), value = TRUE ) } setMethod( ".DollarNames", "C++Object", `.DollarNames.C++Object` ) - # #nocov end + diff --git a/R/03_prompt.R b/R/03_prompt.R index 13c1d9ff5..bcb839c67 100644 --- a/R/03_prompt.R +++ b/R/03_prompt.R @@ -1,4 +1,4 @@ -# Copyright (C) 2010 - 2016 John Chambers, Dirk Eddelbuettel and Romain Francois +# Copyright (C) 2010 - 2011 John Chambers, Dirk Eddelbuettel and Romain Francois # # This file is part of Rcpp. # @@ -15,7 +15,7 @@ # You should have received a copy of the GNU General Public License # along with Rcpp. If not, see . -setGeneric( "functions", function(object, ...) standardGeneric( "functions" ) ) # #nocov start +setGeneric( "functions", function(object, ...) standardGeneric( "functions" ) ) setMethod( "functions", "Module", function(object, ...){ pointer <- .getModulePointer(object) if(identical(pointer, .badModulePointer)) @@ -59,5 +59,5 @@ setMethod( "prompt", "Module", function(object, filename = NULL, name = NULL, .. writeLines( lines, filename ) invisible(NULL) -} ) # nocov end +} ) diff --git a/R/Attributes.R b/R/Attributes.R index f34e83b17..0951e7f12 100644 --- a/R/Attributes.R +++ b/R/Attributes.R @@ -1,6 +1,4 @@ - -# Copyright (C) 2012 - 2022 JJ Allaire, Dirk Eddelbuettel and Romain Francois -# Copyright (C) 2023 - 2026 JJ Allaire, Dirk Eddelbuettel, Romain Francois and Iñaki Ucar +# Copyright (C) 2012 JJ Allaire, Dirk Eddelbuettel and Romain Francois # # This file is part of Rcpp. # @@ -24,26 +22,15 @@ sourceCpp <- function(file = "", env = globalenv(), embeddedR = TRUE, rebuild = FALSE, - cacheDir = getOption("rcpp.cache.dir", tempdir()), - cleanupCacheDir = FALSE, showOutput = verbose, verbose = getOption("verbose"), - dryRun = FALSE, - windowsDebugDLL = FALSE, - echo = TRUE) { - - # use an architecture/version specific subdirectory of the cacheDir - # (since cached dynlibs can now perist across sessions we need to be - # sure to invalidate them when R or Rcpp versions change) - cacheDir <- path.expand(cacheDir) - cacheDir <- .sourceCppPlatformCacheDir(cacheDir) - cacheDir <- normalizePath(cacheDir) + dryRun = FALSE) { # resolve code into a file if necessary. also track the working # directory to source the R embedded code chunk within if (!missing(code)) { rWorkingDir <- getwd() - file <- tempfile(fileext = ".cpp", tmpdir = cacheDir) + file <- tempfile(fileext = ".cpp") con <- file(file, open = "w") writeLines(code, con) close(con) @@ -55,37 +42,29 @@ sourceCpp <- function(file = "", file <- normalizePath(file, winslash = "/") # error if the file extension isn't one supported by R CMD SHLIB - if (! tools::file_ext(file) %in% c("cc", "cpp")) { # #nocov start + if (! tools::file_ext(file) %in% c("cc", "cpp")) { stop("The filename '", basename(file), "' does not have an ", "extension of .cc or .cpp so cannot be compiled.") - } # #nocov end + } # validate that there are no spaces in the path on windows - if (.Platform$OS.type == "windows") { # #nocov start + if (.Platform$OS.type == "windows") { if (grepl(' ', basename(file), fixed=TRUE)) { stop("The filename '", basename(file), "' contains spaces. This ", "is not permitted.") } - } else { - if (windowsDebugDLL) { - if (verbose) { - message("The 'windowsDebugDLL' toggle is ignored on ", - "non-Windows platforms.") - } - windowsDebugDLL <- FALSE # now we do not need to deal with OS choice below - } # #nocov end } # get the context (does code generation as necessary) context <- .Call("sourceCppContext", PACKAGE="Rcpp", - file, code, rebuild, cacheDir, .Platform) + file, code, rebuild, .Platform) # perform a build if necessary if (context$buildRequired || rebuild) { # print output for verbose mode if (verbose) - .printVerboseOutput(context) # #nocov + .printVerboseOutput(context) # variables used to hold completed state (passed to completed hook) succeeded <- FALSE @@ -109,51 +88,42 @@ sourceCpp <- function(file = "", # the build environment fromCode <- !missing(code) if (!.callBuildHook(context$cppSourcePath, fromCode, showOutput)) { - .restoreEnvironment(envRestore) # #nocov start + .restoreEnvironment(envRestore) setwd(cwd) return (invisible(NULL)) - } # #nocov end + } # on.exit handler calls hook and restores environment and working dir on.exit({ if (!succeeded) - .showBuildFailureDiagnostics() # #nocov + .showBuildFailureDiagnostics() .callBuildCompleteHook(succeeded, output) setwd(cwd) .restoreEnvironment(envRestore) }) # unload and delete existing dylib if necessary - if (file.exists(context$previousDynlibPath)) { # #nocov start - try(silent=TRUE, dyn.unload(context$previousDynlibPath)) + if (file.exists(context$previousDynlibPath)) { + try(silent=T, dyn.unload(context$previousDynlibPath)) file.remove(context$previousDynlibPath) - } # #nocov end - - # grab components we need to build command - r <- file.path(R.home("bin"), "R") - lib <- context$dynlibFilename - deps <- context$cppDependencySourcePaths - src <- context$cppSourceFilename + } # prepare the command (output if we are in showOutput mode) - args <- c( - "CMD", "SHLIB", - if (windowsDebugDLL) "-d", - if (rebuild) "--preclean", - if (dryRun) "--dry-run", - "-o", shQuote(lib), - if (length(deps)) - paste(shQuote(deps), collapse = " "), - shQuote(src) - ) - + cmd <- paste(R.home(component="bin"), .Platform$file.sep, "R ", + "CMD SHLIB ", + "-o ", shQuote(context$dynlibFilename), " ", + ifelse(rebuild, "--preclean ", ""), + ifelse(dryRun, "--dry-run ", ""), + paste(shQuote(context$cppDependencySourcePaths), + collapse = " "), " ", + shQuote(context$cppSourceFilename), " ", + sep="") if (showOutput) - cat(paste(c(r, args), collapse = " "), "\n") # #nocov + cat(cmd, "\n") # execute the build -- suppressWarnings b/c when showOutput = FALSE # we are going to explicitly check for an error and print the output - so <- if (showOutput) "" else TRUE - result <- suppressWarnings(system2(r, args, stdout = so, stderr = so)) + result <- suppressWarnings(system(cmd, intern = !showOutput)) # check build results if(!showOutput) { @@ -163,37 +133,33 @@ sourceCpp <- function(file = "", # examine status status <- attr(result, "status") if (!is.null(status)) { - cat(result, sep = "\n") # #nocov start + cat(result, sep = "\n") succeeded <- FALSE stop("Error ", status, " occurred building shared library.") } else if (!file.exists(context$dynlibFilename)) { cat(result, sep = "\n") succeeded <- FALSE - stop("Error occurred building shared library.") # #nocov end + stop("Error occurred building shared library.") } else { succeeded <- TRUE } } - else if (!identical(as.character(result), "0")) { # #nocov start + else if (!identical(as.character(result), "0")) { succeeded <- FALSE stop("Error ", result, " occurred building shared library.") } else { - succeeded <- TRUE # #nocov end + succeeded <- TRUE } } else { - cwd <- getwd() - on.exit({ - setwd(cwd) - }) - if (verbose) # #nocov start + if (verbose) cat("\nNo rebuild required (use rebuild = TRUE to ", "force a rebuild)\n\n", sep="") } # return immediately if this was a dry run if (dryRun) - return(invisible(NULL)) # #nocov end + return(invisible(NULL)) # load the module if we have exported symbols if (length(context$exportedFunctions) > 0 || length(context$modules) > 0) { @@ -207,48 +173,21 @@ sourceCpp <- function(file = "", scriptPath <- file.path(context$buildDirectory, context$rSourceFilename) source(scriptPath, local = env) - } else if (getOption("rcpp.warnNoExports", default=TRUE)) { # #nocov start + } else if (getOption("rcpp.warnNoExports", default=TRUE)) { warning("No Rcpp::export attributes or RCPP_MODULE declarations ", - "found in source") # #nocov end + "found in source") } # source the embeddedR if (embeddedR && (length(context$embeddedR) > 0)) { srcConn <- textConnection(context$embeddedR) setwd(rWorkingDir) # will be reset by previous on.exit handler - source(file = srcConn, local = env, echo = echo) + source(file=srcConn, echo=TRUE) } - # cleanup the cache dir if requested - if (cleanupCacheDir) - cleanupSourceCppCache(cacheDir, context$cppSourcePath, context$buildDirectory) # #nocov - # return (invisibly) a list containing exported functions and modules invisible(list(functions = context$exportedFunctions, - modules = context$modules, - cppSourcePath = context$cppSourcePath, - buildDirectory = context$buildDirectory)) -} - - -# Cleanup a directory used as the cache for a sourceCpp compilation. This will -# remove all files from the cache directory that aren't a result of the -# compilation that yielded the passed buildDirectory. -cleanupSourceCppCache <- function(cacheDir, cppSourcePath, buildDirectory) { - # normalize cpp source path and build directory # #nocov start - cppSourcePath <- normalizePath(cppSourcePath) - buildDirectory <- normalizePath(buildDirectory) - - # determine the parent dir that was used for the compilation then collect all the - # *.cpp files and subdirectories therein - cacheFiles <- list.files(cacheDir, pattern = glob2rx("*.cpp"), recursive = FALSE, full.names = TRUE) - cacheFiles <- c(cacheFiles, list.dirs(cacheDir, recursive = FALSE, full.names = TRUE)) - cacheFiles <- normalizePath(cacheFiles) - - # determine the list of tiles that were not yielded by the passed sourceCpp - # result and remove them - oldCacheFiles <- cacheFiles[!cacheFiles %in% c(cppSourcePath, buildDirectory)] - unlink(oldCacheFiles, recursive = TRUE) # #nocov end + modules = context$modules)) } # Define a single C++ function @@ -258,17 +197,15 @@ cppFunction <- function(code, includes = character(), env = parent.frame(), rebuild = FALSE, - cacheDir = getOption("rcpp.cache.dir", tempdir()), showOutput = verbose, - verbose = getOption("verbose"), - echo = TRUE) { + verbose = getOption("verbose")) { # process depends - if (!is.null(depends) && length(depends) > 0) { # #nocov start - depends <- paste(depends, collapse=", ") + if (!is.null(depends) && length(depends) > 0) { + depends <- paste(depends, sep=", ") scaffolding <- paste("// [[Rcpp::depends(", depends, ")]]", sep="") scaffolding <- c(scaffolding, "", .linkingToIncludes(depends, FALSE), - recursive=TRUE) # #nocov end + recursive=TRUE) } else { scaffolding <- "#include " @@ -276,7 +213,7 @@ cppFunction <- function(code, # process plugins if (!is.null(plugins) && length(plugins) > 0) { - plugins <- paste(plugins, sep=", ") # #nocov start + plugins <- paste(plugins, sep=", ") pluginsAttrib <- paste("// [[Rcpp::plugins(", plugins, ")]]", sep="") scaffolding <- c(scaffolding, pluginsAttrib) @@ -285,7 +222,7 @@ cppFunction <- function(code, plugin <- .findPlugin(pluginName) settings <- plugin() scaffolding <- c(scaffolding, settings$includes, recursive=TRUE) - } # #nocov end + } } # remainder of scaffolding @@ -301,7 +238,7 @@ cppFunction <- function(code, code <- paste(c(scaffolding, code, recursive = T), collapse="\n") # print the generated code if we are in verbose mode - if (verbose) { # #nocov start + if (verbose) { cat("\nGenerated code for function definition:", "\n--------------------------------------------------------\n\n") cat(code) @@ -312,20 +249,18 @@ cppFunction <- function(code, # then create a new one (the caller can get a hold of the function # via the return value) if (is.null(env)) - env <- new.env() # #nocov end + env <- new.env() exported <- sourceCpp(code = code, env = env, rebuild = rebuild, - cacheDir = cacheDir, showOutput = showOutput, - verbose = verbose, - echo = echo) + verbose = verbose) # verify that a single function was exported and return it if (length(exported$functions) == 0) - stop("No function definition found") # #nocov + stop("No function definition found") else if (length(exported$functions) > 1) - stop("More than one function definition") # #nocov + stop("More than one function definition") else { functionName <- exported$functions[[1]] invisible(get(functionName, env)) @@ -333,7 +268,7 @@ cppFunction <- function(code, } .type_manipulate <- function( what = "DEMANGLE", class = NULL ) { - function( type = "int", ... ){ # #nocov start + function( type = "int", ... ){ code <- sprintf( ' SEXP manipulate_this_type(){ typedef %s type ; @@ -347,35 +282,32 @@ cppFunction <- function(code, class(res) <- class } res - } # #nocov end + } } demangle <- .type_manipulate( "DEMANGLE" ) sizeof <- .type_manipulate( "sizeof", "bytes" ) -print.bytes <- function( x, ...){ # #nocov start +print.bytes <- function( x, ...){ writeLines( sprintf( "%d bytes (%d bits)", x, 8 * x ) ) invisible( x ) -} # #nocov end +} # Evaluate a simple c++ expression evalCpp <- function(code, depends = character(), - plugins = character(), includes = character(), rebuild = FALSE, - cacheDir = getOption("rcpp.cache.dir", tempdir()), showOutput = verbose, verbose = getOption( "verbose" ) ){ - # #nocov start + code <- sprintf( "SEXP get_value(){ return wrap( %s ) ; }", code ) env <- new.env() - cppFunction(code, depends = depends, plugins = plugins, - includes = includes, env = env, - rebuild = rebuild, cacheDir = cacheDir, showOutput = showOutput, verbose = verbose ) + cppFunction(code, depends = depends, includes = includes, env = env, + rebuild = rebuild, showOutput = showOutput, verbose = verbose ) fun <- env[["get_value"]] - fun() # #nocov end + fun() } areMacrosDefined <- function(names, @@ -417,7 +349,7 @@ compileAttributes <- function(pkgdir = ".", verbose = getOption("verbose")) { pkgdir <- normalizePath(pkgdir, winslash = "/") descFile <- file.path(pkgdir,"DESCRIPTION") if (!file.exists(descFile)) - stop("pkgdir must refer to the directory containing an R package") # #nocov + stop("pkgdir must refer to the directory containing an R package") pkgDesc <- read.dcf(descFile)[1,] pkgname = .readPkgDescField(pkgDesc, "Package") depends <- c(.readPkgDescField(pkgDesc, "Depends", character()), @@ -425,38 +357,19 @@ compileAttributes <- function(pkgdir = ".", verbose = getOption("verbose")) { .readPkgDescField(pkgDesc, "LinkingTo", character())) depends <- unique(.splitDepends(depends)) depends <- depends[depends != "R"] - - # check the NAMESPACE file to see if dynamic registration is enabled - namespaceFile <- file.path(pkgdir, "NAMESPACE") - if (!file.exists(namespaceFile)) - stop("pkgdir must refer to the directory containing an R package") # #nocov - pkgNamespace <- readLines(namespaceFile, warn = FALSE) - registration <- any(grepl("^\\s*useDynLib.*\\.registration\\s*=\\s*TRUE.*$", pkgNamespace)) - + # determine source directory srcDir <- file.path(pkgdir, "src") if (!file.exists(srcDir)) - return (FALSE) # #nocov + return (FALSE) # create R directory if it doesn't already exist rDir <- file.path(pkgdir, "R") if (!file.exists(rDir)) - dir.create(rDir) # #nocov - - # remove the old RcppExports.R file - unlink(file.path(rDir, "RcppExports.R")) + dir.create(rDir) # get a list of all source files - cppFiles <- list.files(srcDir, pattern = "\\.((c(c|pp)?)|(h(pp)?))$", ignore.case = TRUE) - - # don't include RcppExports.cpp - cppFiles <- setdiff(cppFiles, "RcppExports.cpp") - - # locale independent sort for stable output - locale <- Sys.getlocale(category = "LC_COLLATE") - Sys.setlocale(category = "LC_COLLATE", locale = "C") - cppFiles <- sort(cppFiles) - Sys.setlocale(category = "LC_COLLATE", locale = locale) + cppFiles <- list.files(srcDir, pattern = "\\.((c(c|pp))|(h(pp)?))$") # derive base names (will be used for modules) cppFileBasenames <- tools::file_path_sans_ext(cppFiles) @@ -475,35 +388,36 @@ compileAttributes <- function(pkgdir = ".", verbose = getOption("verbose")) { pkgHeader <- c(paste0(pkgname, ".h"), typesHeader) pkgHeaderPath <- file.path(pkgdir, "inst", "include", pkgHeader) pkgHeader <- pkgHeader[file.exists(pkgHeaderPath)] - if (length(pkgHeader) > 0) { # #nocov start + if (length(pkgHeader) > 0) { pkgInclude <- paste("#include \"../inst/include/", pkgHeader, "\"", sep="") includes <- c(pkgInclude, includes) - } # #nocov end + } # if a _types file is in src then include it pkgHeader <- typesHeader pkgHeaderPath <- file.path(pkgdir, "src", pkgHeader) pkgHeader <- pkgHeader[file.exists(pkgHeaderPath)] if (length(pkgHeader) > 0) - includes <- c(paste0("#include \"", pkgHeader ,"\""), includes) # #nocov + includes <- c(paste0("#include \"", pkgHeader ,"\""), includes) # generate exports invisible(.Call("compileAttributes", PACKAGE="Rcpp", - pkgdir, pkgname, depends, registration, cppFiles, cppFileBasenames, + pkgdir, pkgname, depends, cppFiles, cppFileBasenames, includes, verbose, .Platform)) } # setup plugins environment .plugins <- new.env() -# built-in C++98 plugin -.plugins[["cpp98"]] <- function() { - list(env = list(USE_CXX98 = "yes")) -} - # built-in C++11 plugin +# built-in C++11 plugin .plugins[["cpp11"]] <- function() { - list(env = list(USE_CXX11 = "yes")) + if (getRversion() >= "3.1") + list(env = list(USE_CXX1X = "yes")) + else if (.Platform$OS.type == "windows") + list(env = list(PKG_CXXFLAGS = "-std=c++0x")) + else + list(env = list(PKG_CXXFLAGS ="-std=c++11")) } # built-in C++11 plugin for older g++ compiler @@ -511,144 +425,20 @@ compileAttributes <- function(pkgdir = ".", verbose = getOption("verbose")) { list(env = list(PKG_CXXFLAGS ="-std=c++0x")) } -## built-in C++14 plugin for C++14 standard -## this is the default in g++-6.1 and later -## per https://gcc.gnu.org/projects/cxx-status.html#cxx14 -.plugins[["cpp14"]] <- function() { - list(env = list(USE_CXX14 = "yes")) -} - # built-in C++1y plugin for C++14 and C++17 standard under development .plugins[["cpp1y"]] <- function() { list(env = list(PKG_CXXFLAGS ="-std=c++1y")) } -# built-in C++17 plugin for C++17 standard (g++-6 or later) -.plugins[["cpp17"]] <- function() { - list(env = list(USE_CXX17 = "yes")) -} - -# built-in C++20 plugin for C++20 -.plugins[["cpp20"]] <- function() { - if (getRversion() >= "4.2") # with recent R versions, R can decide - list(env = list(USE_CXX20 = "yes")) - else - list(env = list(PKG_CXXFLAGS ="-std=c++20")) -} - -# built-in C++23 plugin for C++23 -.plugins[["cpp23"]] <- function() { - if (getRversion() >= "4.3") # with recent R versions, R can decide - list(env = list(USE_CXX23 = "yes")) - else - list(env = list(PKG_CXXFLAGS ="-std=c++23")) -} - -# built-in C++26 plugin for C++26 -.plugins[["cpp26"]] <- function() { - if (getRversion() >= "4.5") # with recent R versions, R can decide - list(env = list(USE_CXX26 = "yes")) - else - list(env = list(PKG_CXXFLAGS ="-std=c++26")) -} - -## built-in C++1z plugin for C++17 standard under development -## note that as of Feb 2017 this is taken to be a moving target -## see https://gcc.gnu.org/projects/cxx-status.html -.plugins[["cpp1z"]] <- function() { - list(env = list(PKG_CXXFLAGS ="-std=c++1z")) -} - -## built-in C++2a plugin for g++ 8 and later -## cf https://gcc.gnu.org/projects/cxx-status.html as of Dec 2018 -.plugins[["cpp2a"]] <- function() { - list(env = list(PKG_CXXFLAGS ="-std=c++2a")) -} - -## built-in C++2b plugin for compilers without C++23 support -.plugins[["cpp2b"]] <- function() { - list(env = list(PKG_CXXFLAGS ="-std=c++2b")) -} - -.openmpPluginDefault <- function() { - list(env = list(PKG_CXXFLAGS = "-fopenmp", PKG_LIBS = "-fopenmp")) # #nocov start -} - -.openmpPluginDarwin <- function() { - - # generate a test script for compilation - script <- tempfile("openmp-detect-", fileext = ".cpp") - writeLines("", con = script) - on.exit(unlink(script, force = TRUE), add = TRUE) - - # get the C++ compiler from R - r <- file.path(R.home("bin"), "R") - output <- tryCatch( - system2(r, c("CMD", "SHLIB", "--dry-run", shQuote(script)), stdout = TRUE), - condition = identity - ) - if (inherits(output, "condition")) - return(.openmpPluginDefault()) - - # extract the compiler invocation from the shlib output - # use some heuristics here... - index <- grep("make would use", output) - compile <- output[[index + 1L]] - - # use everything up to the first include flag, which is normally - # the R headers from CPPFLAGS - idx <- regexpr(" -I", compile, fixed = TRUE) - cxx <- substring(compile, 1L, idx - 1L) - - # check the compiler version - command <- paste(cxx, "--version") - version <- tryCatch( - system(command, intern = TRUE), - condition = identity - ) - if (inherits(version, "condition")) - return(.openmpPluginDefault()) - - # if we're using Apple clang, use alternate flags - # assume libomp was installed following https://mac.r-project.org/openmp/ - if (any(grepl("Apple clang", version))) { - cxxflags <- "-Xclang -fopenmp" - libs <- "-lomp" - } - - # if we're using Homebrew clang, add in libomp include paths - else if (any(grepl("Homebrew clang", version))) { - machine <- Sys.info()[["machine"]] - prefix <- if (machine == "arm64") "/opt/homebrew" else "/usr/local" - cxxflags <- sprintf("-I%s/opt/libomp/include -fopenmp", prefix) - libs <- sprintf("-L%s/opt/libomp/lib -fopenmp", prefix) - - # otherwise, use default -fopenmp flags for other compilers (LLVM clang; gcc) - } else { - cxxflags <- "-fopenmp" - libs <- "-fopenmp" - } - - list(env = list(PKG_CXXFLAGS = cxxflags, PKG_LIBS = libs)) # #nocov end - -} - -## built-in OpenMP plugin -.plugins[["openmp"]] <- if (Sys.info()[["sysname"]] == "Darwin") { - .openmpPluginDarwin -} else { - .openmpPluginDefault +## built-in OpenMP++11 plugin +.plugins[["openmp"]] <- function() { + list(env = list(PKG_CXXFLAGS="-fopenmp", + PKG_LIBS="-fopenmp")) } -.plugins[["unwindProtect"]] <- function() { # nocov start - warning("unwindProtect is enabled by default and this plugin is deprecated.", - " It will be removed in a future version of Rcpp.") - list() -} # nocov end - # register a plugin registerPlugin <- function(name, plugin) { - .plugins[[name]] <- plugin # #nocov + .plugins[[name]] <- plugin } @@ -659,10 +449,10 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) { body <- quote( CALL_PLACEHOLDER ( EXTERNALNAME, ARG ) )[ c(1:2, rep(3, length(args))) ] - for (i in seq(along.with = args)) + for (i in seq(along = args)) body[[i+2]] <- as.symbol(args[i]) - body[[1L]] <- quote(.Call) + body[[1L]] <- .Call body[[2L]] <- getNativeSymbolInfo(symbol, dll)$address if (isVoid) @@ -675,7 +465,7 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) { # Print verbose output -.printVerboseOutput <- function(context) { # #nocov start +.printVerboseOutput <- function(context) { cat("\nGenerated extern \"C\" functions", "\n--------------------------------------------------------\n") @@ -690,7 +480,7 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) { cat("\nBuilding shared library", "\n--------------------------------------------------------\n", "\nDIR: ", context$buildDirectory, "\n\n", sep="") -} # #nocov end +} # Add LinkingTo dependencies if the sourceFile is in a package .getSourceCppDependencies <- function(depends, sourceFile) { @@ -698,11 +488,11 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) { # If the source file is in a package then simulate it being built # within the package by including it's LinkingTo dependencies, # the src directory (.), and the inst/include directory - if (.isPackageSourceFile(sourceFile)) { # #nocov start + if (.isPackageSourceFile(sourceFile)) { descFile <- file.path(dirname(sourceFile), "..", "DESCRIPTION") DESCRIPTION <- read.dcf(descFile, all = TRUE) linkingTo <- .parseLinkingTo(DESCRIPTION$LinkingTo) - unique(c(depends, linkingTo)) # #nocov end + unique(c(depends, linkingTo)) } else { depends } @@ -717,19 +507,19 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) { # Error if a package is not currently available .validatePackages <- function(depends, sourceFilename) { unavailable <- depends[!depends %in% .packages(all.available=TRUE)] - if (length(unavailable) > 0) { # #nocov start + if (length(unavailable) > 0) { stop(paste("Package '", unavailable[[1]], "' referenced from ", "Rcpp::depends in source file ", sourceFilename, " is not available.", sep=""), - call. = FALSE) # #nocov end + call. = FALSE) } } # Split the depends field of a package description .splitDepends <- function(x) { if (!length(x)) - return(character()) # #nocov + return(character()) x <- unlist(strsplit(x, ",")) x <- sub("[[:space:]]+$", "", x) x <- unique(sub("^[[:space:]]*(.*)", "\\1", x)) @@ -746,19 +536,19 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) { # Get the inline plugin for the specified package (return NULL if none found) -.getInlinePlugin <- function(package) { # #nocov start +.getInlinePlugin <- function(package) { tryCatch(get("inlineCxxPlugin", asNamespace(package), inherits = FALSE), error = function(e) NULL) -} # #nocov end +} # Lookup a plugin .findPlugin <- function(pluginName) { plugin <- .plugins[[pluginName]] if (is.null(plugin)) - stop("Inline plugin '", pluginName, "' could not be found ", # #nocov start + stop("Inline plugin '", pluginName, "' could not be found ", "within the Rcpp package. You should be ", - "sure to call registerPlugin before using a plugin.") # #nocov end + "sure to call registerPlugin before using a plugin.") return(plugin) } @@ -777,15 +567,15 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) { # protect against null or empty string if (is.null(value) || !nzchar(value)) - return(invisible(NULL)) + return; # if it doesn't exist already just set it if (is.null(buildEnv[[name]])) { buildEnv[[name]] <<- value } # if it's not identical then append - else if (!identical(buildEnv[[name]], value)) { # #nocov - buildEnv[[name]] <<- paste(buildEnv[[name]], value) # #nocov + else if (!identical(buildEnv[[name]], value)) { + buildEnv[[name]] <<- paste(buildEnv[[name]], value); } else { # it already exists and it's the same value, this @@ -813,14 +603,14 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) { # add packages to linkingTo and introspect for plugins for (package in depends) { - # #nocov start + # add a LinkingTo for this package linkingToPackages <- unique(c(linkingToPackages, package)) # see if the package exports a plugin plugin <- .getInlinePlugin(package) if (!is.null(plugin)) - setDependenciesFromPlugin(plugin) # #nocov end + setDependenciesFromPlugin(plugin) } # process plugins @@ -837,18 +627,18 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) { # set CLINK_CPPFLAGS based on the LinkingTo dependencies buildEnv$CLINK_CPPFLAGS <- .buildClinkCppFlags(linkingToPackages) - # add the source file's directory to the compilation + # add the source file's directory to the compliation srcDir <- dirname(sourceFile) srcDir <- asBuildPath(srcDir) buildDirs <- srcDir - + # if the source file is in a package then add inst/include - if (.isPackageSourceFile(sourceFile)) { # #nocov start + if (.isPackageSourceFile(sourceFile)) { incDir <- file.path(dirname(sourceFile), "..", "inst", "include") incDir <- asBuildPath(incDir) - buildDirs <- c(buildDirs, incDir) # #nocov end + buildDirs <- c(buildDirs, incDir) } - + # set CLINK_CPPFLAGS with directory flags dirFlags <- paste0('-I"', buildDirs, '"', collapse=" ") buildEnv$CLINK_CPPFLAGS <- paste(buildEnv$CLINK_CPPFLAGS, @@ -865,10 +655,10 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) { # on windows see if we need to add Rtools to the path # (don't do this for RStudio since it has it's own handling) if (identical(Sys.info()[['sysname']], "Windows") && - !nzchar(Sys.getenv("RSTUDIO"))) { # #nocov start - env <- .environmentWithRtools() - for (var in names(env)) - buildEnv[[var]] <- env[[var]] # #nocov end + !nzchar(Sys.getenv("RSTUDIO"))) { + path <- .pathWithRtools() + if (!is.null(path)) + buildEnv$PATH <- path } # create restore list @@ -886,8 +676,8 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) { # If we don't have the GNU toolchain already on the path then see if # we can find Rtools and add it to the path -.environmentWithRtools <- function() { - # #nocov start +.pathWithRtools <- function() { + # Only proceed if we don't have the required tools on the path hasRtools <- nzchar(Sys.which("ls.exe")) && nzchar(Sys.which("gcc.exe")) if (!hasRtools) { @@ -901,51 +691,30 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) { # If we found the key examine it if (!is.null(key)) { - # Check version + # Check version -- we only support 2.15 and 2.16 right now ver <- key$`Current Version` - if (ver %in% (c("2.15", "2.16", "3.0", "3.1", "3.2", "3.3", "3.4"))) { - # See if the InstallPath leads to the expected directories - # R version 3.3.0 alpha (2016-03-25 r70378) - isGcc49 <- ver %in% c("3.3", "3.4") && as.numeric(R.Version()$`svn rev`) >= 70378 + if (identical("2.15", ver) || identical("2.16", ver) || + identical("3.0", ver) || identical("3.1", ver) || + identical("3.2", ver)) { + # See if the InstallPath leads to the expected directories rToolsPath <- key$`InstallPath` if (!is.null(rToolsPath)) { - # add appropriate path entries - path <- file.path(rToolsPath, "bin", fsep="\\") - if (!isGcc49) - path <- c(path, file.path(rToolsPath, "gcc-4.6.3", "bin", fsep="\\")) - - # if they all exist then return a list with modified - # environment variables for the compilation - if (all(file.exists(path))) { - env <- list() - path <- paste(path, collapse = .Platform$path.sep) - env$PATH <- paste(path, Sys.getenv("PATH"), sep=.Platform$path.sep) - if (isGcc49) { - env$RTOOLS <- .rtoolsPath(rToolsPath) - env$BINPREF <- file.path(env$RTOOLS, "mingw_$(WIN)/bin//", fsep = "/") - } - return(env) - } + + # Return modified PATH if execpted directories exist + binPath <- file.path(rToolsPath, "bin", fsep="\\") + gccPath <- file.path(rToolsPath, "gcc-4.6.3", "bin", fsep="\\") + if (file.exists(binPath) && file.exists(gccPath)) + return(paste(binPath, + gccPath, + Sys.getenv("PATH"), + sep=.Platform$path.sep)) } } } } - return(NULL) # #nocov end -} - - -# Ensure that the path is suitable for passing as an RTOOLS -# environment variable -.rtoolsPath <- function(path) { - path <- gsub("\\\\", "/", path) # #nocov start - ## R 3.2.0 or later only: path <- trimws(path) - .localsub <- function(re, x) sub(re, "", x, perl = TRUE) - path <- .localsub("[ \t\r\n]+$", .localsub("^[ \t\r\n]+", path)) - if (substring(path, nchar(path)) != "/") - path <- paste(path, "/", sep="") - path # #nocov end + return(NULL) } @@ -966,7 +735,7 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) { # variables to reset setVars <- restore[!is.na(restore)] if (length(setVars)) - do.call(Sys.setenv, setVars) # #nocov + do.call(Sys.setenv, setVars) # variables to remove removeVars <- names(restore[is.na(restore)]) @@ -985,7 +754,7 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) { for (fun in .getHooksList("sourceCpp.onBuild")) { - if (is.character(fun)) # #nocov start + if (is.character(fun)) fun <- get(fun) # allow the hook to cancel the build (errors in the hook explicitly @@ -994,7 +763,7 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) { error = function(e) TRUE) if (!continue) - return (FALSE) # #nocov end + return (FALSE) } return (TRUE) @@ -1013,10 +782,10 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) { # Call the hooks in reverse order to align sequencing with onBuild for (fun in .getHooksList("sourceCpp.onBuildComplete")) { - if (is.character(fun)) # #nocov start + if (is.character(fun)) fun <- get(fun) - try(fun(succeeded, output)) # #nocov end + try(fun(succeeded, output)) } } @@ -1025,7 +794,7 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) { .getHooksList <- function(name) { hooks <- getHook(name) if (!is.list(hooks)) - hooks <- list(hooks) # #nocov + hooks <- list(hooks) hooks } @@ -1039,7 +808,7 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) { # This field can be NULL or empty -- in that case just return Rcpp.h if (is.null(linkingTo) || !nzchar(linkingTo)) - return (c("#include ")) # #nocov + return (c("#include ")) # Look for Rcpp inline plugins within the list or LinkedTo packages include.before <- character() @@ -1052,7 +821,7 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) { next # see if there is a plugin that we can extract includes from - plugin <- .getInlinePlugin(package) # #nocov start + plugin <- .getInlinePlugin(package) if (!is.null(plugin)) { includes <- .pluginIncludes(plugin) if (!is.null(includes)) { @@ -1063,18 +832,13 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) { # otherwise check for standard Rcpp::interfaces generated include else if (!pluginsOnly) { pkgPath <- find.package(package, NULL, quiet=TRUE) - if (length(pkgPath) == 0) { - stop(paste("Package '", package, "' referenced from ", - "LinkingTo directive is not available.", sep=""), - call. = FALSE) - } pkgHeader <- paste(package, ".h", sep="") pkgHeaderPath <- file.path(pkgPath, "include", pkgHeader) if (file.exists(pkgHeaderPath)) { pkgInclude <- paste("#include <", pkgHeader, ">", sep="") include.after <- c(include.after, pkgInclude) } - } # #nocov end + } } # return the includes @@ -1087,7 +851,7 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) { # we verify that the plugin was created using Rcpp.plugin.maker and then # use that assumption to correctly extract include.before and include.after .pluginIncludes <- function(plugin) { - # #nocov start + # First determine the standard suffix of an Rcpp plugin by calling # Rcpp.plugin.maker. If the plugin$includes has this suffix we know # it's an Rcpp plugin @@ -1117,14 +881,14 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) { after <- after[nzchar(after)] # return before and after - list(before = before, after = after) # #nocov end + list(before = before, after = after) } # Parse a LinkingTo field into a character vector .parseLinkingTo <- function(linkingTo) { if (is.null(linkingTo)) - return (character()) # #nocov + return (character()) linkingTo <- strsplit(linkingTo, "\\s*\\,")[[1]] result <- gsub("\\s", "", linkingTo) @@ -1133,7 +897,7 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) { # show diagnostics for failed builds .showBuildFailureDiagnostics <- function() { - # #nocov start + # RStudio does it's own diagnostics so only do this for other environments if (nzchar(Sys.getenv("RSTUDIO"))) return(); @@ -1158,14 +922,14 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) { "including a C++ compiler.\n", sep="") } message(msg) - } # #nocov end + } } # check if R development tools are installed (cache successful result) .hasDevelTools <- FALSE .checkDevelTools <- function() { - if (!.hasDevelTools) { # #nocov start + if (!.hasDevelTools) { # create temp source file tempFile <- file.path(tempdir(), "foo.c") cat("void foo() {}\n", file = tempFile) @@ -1181,7 +945,7 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) { result <- suppressWarnings(system(cmd, ignore.stderr = TRUE, intern = TRUE)) - utils::assignInMyNamespace(".hasDevelTools", is.null(attr(result, "status"))) + assignInMyNamespace(".hasDevelTools", is.null(attr(result, "status"))) # if we build successfully then remove the shared library if (.hasDevelTools) { @@ -1190,140 +954,5 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) { unlink(lib) } } - .hasDevelTools # #nocov end -} - - -# insert a dynlib entry into the cache -.sourceCppDynlibInsert <- function(cacheDir, file, code, dynlib) { - cache <- .sourceCppDynlibReadCache(cacheDir) - index <- .sourceCppFindCacheEntryIndex(cache, file, code) - if (is.null(index)) - index <- length(cache) + 1 - cache[[index]] <- list(file = file, code = code, dynlib = dynlib) - .sourceCppDynlibWriteCache(cacheDir, cache) -} - -# attempt to lookup a dynlib entry from the cache -.sourceCppDynlibLookup <- function(cacheDir, file, code) { - cache <- .sourceCppDynlibReadCache(cacheDir) - index <- .sourceCppFindCacheEntryIndex(cache, file, code) - if (!is.null(index)) - cache[[index]]$dynlib - else - list() -} - -# write the cache to disk -.sourceCppDynlibWriteCache <- function(cacheDir, cache) { - index_file <- file.path(cacheDir, "cache.rds") - save(cache, file = index_file, compress = FALSE) -} - -# read the cache from disk -.sourceCppDynlibReadCache <- function(cacheDir) { - index_file <- file.path(cacheDir, "cache.rds") - if (file.exists(index_file)) { - load(file = index_file) - get("cache") - } else { - list() - } -} - -# search the cache for an entry that matches the file or code argument -.sourceCppFindCacheEntryIndex <- function(cache, file, code) { - - if (length(cache) > 0) { - for (i in 1:length(cache)) { - entry <- cache[[i]] - if ((nzchar(file) && identical(file, entry$file)) || - (nzchar(code) && identical(code, entry$code))) { - if (file.exists(entry$dynlib$cppSourcePath)) - return(i) - } - } - } - - # none found - NULL -} - -# generate an R version / Rcpp version specific cache dir for dynlibs -.sourceCppPlatformCacheDir <- function(cacheDir) { - - dir <- file.path(cacheDir, - paste("sourceCpp", - R.version$platform, - utils::packageVersion("Rcpp"), - sep = "-")) - if (!utils::file_test("-d", dir)) - dir.create(dir, recursive = TRUE) - - dir -} - -# generate a unique token for a cacheDir -.sourceCppDynlibUniqueToken <- function(cacheDir) { - # read existing token (or create a new one) - token_file <- file.path(cacheDir, "token.rds") - if (file.exists(token_file)) - load(file = token_file) - else - token <- 0 - - # increment - token <- token + 1 - - # write it - save(token, file = token_file) - - # return it as a string - as.character(token) -} - -.extraRoutineRegistrations <- function(targetFile, routines) { - - declarations = character() - call_entries = character() - - # we are running R 3.4 or higher so we can use an internal utility function - # to automatically discover additional native routines that require registration - - # determine the package directory - pkgdir <- dirname(dirname(targetFile)) - - # get the generated code from R - con <- textConnection(object = NULL, open = "w") - on.exit(close(con), add = TRUE) - tools::package_native_routine_registration_skeleton( - dir = pkgdir, - con = con, - character_only = FALSE - ) - code <- textConnectionValue(con) - - # look for lines containing call entries - matches <- regexec('^\\s+\\{"([^"]+)",.*$', code) - matches <- regmatches(code, matches) - matches <- Filter(x = matches, function(x) { - length(x) > 0 # #nocov start - }) - for (match in matches) { - routine <- match[[2]] - if (!routine %in% routines) { - declaration <- grep(sprintf("^extern .* %s\\(.*$", routine), code, - value = TRUE) - # FIXME: maybe we should extend this to *any* routine? - # or is there any case in which `void *` is not SEXP for a .Call? - if (routine == "run_testthat_tests") - declaration <- gsub("void *", "SEXP", declaration, fixed=TRUE) - declarations <- c(declarations, sub("^extern", "RcppExport", declaration)) - call_entries <- c(call_entries, match[[1]]) # #nocov end - } - } - - # return extra declaratiosn and call entries - list(declarations = declarations, - call_entries = call_entries) + .hasDevelTools } diff --git a/R/Module.R b/R/Module.R index 10c3cadce..be2ca972e 100644 --- a/R/Module.R +++ b/R/Module.R @@ -1,4 +1,4 @@ -# Copyright (C) 2010 - 2026 John Chambers, Dirk Eddelbuettel and Romain Francois +# Copyright (C) 2010 - 2014 John Chambers, Dirk Eddelbuettel and Romain Francois # # This file is part of Rcpp. # @@ -16,15 +16,15 @@ # along with Rcpp. If not, see . internal_function <- function(pointer){ - f <- function(xp){ - force(xp) - function(...){ - .External( InternalFunction_invoke, xp, ... ) - } - } - o <- new( "C++Function", f(pointer) ) - o@pointer <- pointer - o + f <- function(xp){ + force(xp) + function(...){ + .External( InternalFunction_invoke, xp, ... ) + } + } + o <- new( "C++Function", f(pointer) ) + o@pointer <- pointer + o } setMethod("$", "C++Class", function(x, name) { @@ -41,12 +41,12 @@ setMethod("$", "C++Class", function(x, name) { .getModulePointer <- function(module, mustStart = TRUE) { pointer <- get("pointer", envir = as.environment(module)) - if(is.null(pointer) && mustStart) { # #nocov start - ## should be (except for bug noted in identical()) - ## if(identical(pointer, .badModulePointer) && mustStart) { + if(is.null(pointer) && mustStart) { +## should be (except for bug noted in identical()) +## if(identical(pointer, .badModulePointer) && mustStart) { Module(module, mustStart = TRUE) # will either initialize pointer or throw error pointer <- get("pointer", envir = as.environment(module)) - } # #nocov end + } pointer } @@ -62,77 +62,75 @@ setMethod("initialize", "Module", assign("packageName", packageName, envir = env) assign("moduleName", moduleName, envir = env) if(length(list(...)) > 0) { - .Object <- callNextMethod(.Object, ...) # #nocov + .Object <- callNextMethod(.Object, ...) } .Object }) .get_Module_function <- function(x, name, pointer = .getModulePointer(x) ){ pointer <- .getModulePointer(x) - info <- .Call( Module__get_function, pointer, name ) - fun_ptr <- info[[1L]] - is_void <- info[[2L]] - doc <- info[[3L]] - sign <- info[[4L]] - formal_args <- info[[5L]] - nargs <- info[[6L]] - f <- function(...) NULL - if( nargs == 0L ) formals(f) <- NULL - stuff <- list( fun_pointer = fun_ptr, InternalFunction_invoke = InternalFunction_invoke ) - body(f) <- if( nargs == 0L ){ - if( is_void ) { - substitute( { # #nocov start - .External( InternalFunction_invoke, fun_pointer) - invisible(NULL) - }, stuff ) # #nocov end - } else { - substitute( { - .External( InternalFunction_invoke, fun_pointer) - }, stuff ) - } - } else { - if( is_void ) { - substitute( { # #nocov start - .External( InternalFunction_invoke, fun_pointer, ... ) - invisible(NULL) - }, stuff ) # #nocov end - } else { - substitute( { - .External( InternalFunction_invoke, fun_pointer, ... ) - }, stuff ) - } - } - out <- new( "C++Function", f, pointer = fun_ptr, docstring = doc, signature = sign ) - if( ! is.null( formal_args ) ){ - formals( out ) <- formal_args # #nocov - } - out + info <- .Call( Module__get_function, pointer, name ) + fun_ptr <- info[[1L]] + is_void <- info[[2L]] + doc <- info[[3L]] + sign <- info[[4L]] + formal_args <- info[[5L]] + nargs <- info[[6L]] + f <- function(...) NULL + if( nargs == 0L ) formals(f) <- NULL + stuff <- list( fun_pointer = fun_ptr, InternalFunction_invoke = InternalFunction_invoke ) + body(f) <- if( nargs == 0L ){ + if( is_void ) { + substitute( { + .External( InternalFunction_invoke, fun_pointer) + invisible(NULL) + }, stuff ) + } else { + substitute( { + .External( InternalFunction_invoke, fun_pointer) + }, stuff ) + } + } else { + if( is_void ) { + substitute( { + .External( InternalFunction_invoke, fun_pointer, ... ) + invisible(NULL) + }, stuff ) + } else { + substitute( { + .External( InternalFunction_invoke, fun_pointer, ... ) + }, stuff ) + } + } + out <- new( "C++Function", f, pointer = fun_ptr, docstring = doc, signature = sign ) + if( ! is.null( formal_args ) ){ + formals( out ) <- formal_args + } + out } .get_Module_Class <- function( x, name, pointer = .getModulePointer(x) ){ value <- .Call( Module__get_class, pointer, name ) - value@generator <- get("refClassGenerators", envir=x)[[value@.Data]] + value@generator <- get("refClassGenerators",envir=x)[[as.character(value)]] value } -setMethod( "$", "Module", function(x, name){ # #nocov start +setMethod( "$", "Module", function(x, name){ pointer <- .getModulePointer(x) storage <- get( "storage", envir = as.environment(x) ) storage[[ name ]] -} ) # #nocov end +} ) new_CppObject_xp <- function(module, pointer, ...) { - .External( class__newInstance, module, pointer, ... ) + .External( class__newInstance, module, pointer, ... ) } -new_dummyObject <- function(...) # #nocov - .External( class__dummyInstance, ...) # #nocov +new_dummyObject <- function(...) + .External( class__dummyInstance, ...) # class method for $initialize cpp_object_initializer <- function(.self, .refClassDef, ..., .object_pointer){ - # force finalize method to be materialized - invisible(.self$finalize) selfEnv <- as.environment(.self) ## generate the C++-side object and store its pointer, etc. ## access the private fields in the fieldPrototypes env. @@ -144,7 +142,7 @@ cpp_object_initializer <- function(.self, .refClassDef, ..., .object_pointer){ .self } -cpp_object_dummy <- function(.self, .refClassDef) { # #nocov start +cpp_object_dummy <- function(.self, .refClassDef) { selfEnv <- as.environment(.self) ## like initializer but a dummy for the case of no default ## constructor. Will throw an error if the object is used. @@ -154,7 +152,7 @@ cpp_object_dummy <- function(.self, .refClassDef) { # #nocov start assign(".pointer", pointer, envir = selfEnv) assign(".cppclass", fields$.pointer, envir = selfEnv) .self -} # #nocov end +} cpp_object_maker <- function(typeid, pointer){ Class <- .classes_map[[ typeid ]] @@ -162,11 +160,11 @@ cpp_object_maker <- function(typeid, pointer){ } Module <- function( module, PACKAGE = methods::getPackageName(where), where = topenv(parent.frame()), mustStart = FALSE ) { - if (inherits(module, "DLLInfo") && missing(mustStart)) mustStart <- TRUE # #nocov - if (inherits(module, "Module")) { + if(inherits(module, "DLLInfo") && missing(mustStart)) mustStart <- TRUE + if(inherits(module, "Module")) { xp <- .getModulePointer(module, FALSE) if(!missing(PACKAGE)) - warning("ignoring PACKAGE argument in favor of internal package from Module object") # #nocov + warning("ignoring PACKAGE argument in favor of internal package from Module object") env <- as.environment(module) # not needed from R 2.12.0 PACKAGE <- get("packageName", envir = env) moduleName <- get("moduleName", envir = env) @@ -180,10 +178,10 @@ Module <- function( module, PACKAGE = methods::getPackageName(where), where = to ## perhaps keep a vector of all known module pointers ## [John] One technique is to initialize the pointer to a known value ## and just check whether it's been reset from that (bad) value - xp <- module # #nocov start + xp <- module moduleName <- .Call( Module__name, xp ) module <- methods::new("Module", pointer = xp, packageName = PACKAGE, - moduleName = moduleName) # #nocov end + moduleName = moduleName) } else if(is.character(module)) { moduleName <- module xp <- .badModulePointer @@ -218,7 +216,7 @@ Module <- function( module, PACKAGE = methods::getPackageName(where), where = to for( i in seq_along(classes) ){ CLASS <- classes[[i]] - clname <- CLASS@.Data + clname <- as.character(CLASS) fields <- cpp_fields( CLASS, where ) methods <- cpp_refMethods(CLASS, where) @@ -231,12 +229,12 @@ Module <- function( module, PACKAGE = methods::getPackageName(where), where = to # just to make codetools happy .self <- .refClassDef <- NULL generator$methods(initialize = - if (cpp_hasDefaultConstructor(CLASS)) - function(...) Rcpp::cpp_object_initializer(.self,.refClassDef, ...) + if(cpp_hasDefaultConstructor(CLASS)) + function(...) cpp_object_initializer(.self,.refClassDef, ...) else function(...) { - if (nargs()) Rcpp::cpp_object_initializer(.self,.refClassDef, ...) - else Rcpp::cpp_object_dummy(.self, .refClassDef) # #nocov + if(nargs()) cpp_object_initializer(.self,.refClassDef, ...) + else cpp_object_dummy(.self, .refClassDef) } ) rm( .self, .refClassDef ) @@ -252,7 +250,7 @@ Module <- function( module, PACKAGE = methods::getPackageName(where), where = to # [romain] : should this be promoted to reference classes # perhaps with better handling of j and ... arguments - if( any( grepl( "^[[]", names(CLASS@methods) ) ) ){ # #nocov start + if( any( grepl( "^[[]", names(CLASS@methods) ) ) ){ if( "[[" %in% names( CLASS@methods ) ){ methods::setMethod( "[[", clname, function(x, i, j, ..., exact = TRUE){ x$`[[`( i ) @@ -265,11 +263,11 @@ Module <- function( module, PACKAGE = methods::getPackageName(where), where = to x } , where = where ) } - } # #nocov end + } # promoting show to S4 if( any( grepl( "show", names(CLASS@methods) ) ) ){ - setMethod( "show", clname, function(object) object$show(), where = where ) # #nocov + setMethod( "show", clname, function(object) object$show(), where = where ) } } @@ -279,18 +277,18 @@ Module <- function( module, PACKAGE = methods::getPackageName(where), where = to for( i in seq_along(classes) ){ CLASS <- classes[[i]] - clname <- CLASS@.Data + clname <- as.character(CLASS) demangled_name <- sub( "^Rcpp_", "", clname ) .classes_map[[ CLASS@typeid ]] <- storage[[ demangled_name ]] <- .get_Module_Class( module, demangled_name, xp ) # exposing enums values as CLASS.VALUE # (should really be CLASS$value but I don't know how to do it) if( length( CLASS@enums ) ){ - for( enum in CLASS@enums ){ # #nocov start + for( enum in CLASS@enums ){ for( i in 1:length(enum) ){ storage[[ paste( demangled_name, ".", names(enum)[i], sep = "" ) ]] <- enum[i] } - } # #nocov end + } } } @@ -302,7 +300,7 @@ Module <- function( module, PACKAGE = methods::getPackageName(where), where = to # register as(FROM, TO) methods converter_rx <- "^[.]___converter___(.*)___(.*)$" - if( length( matches <- grep( converter_rx, functions ) ) ){ # #nocov start + if( length( matches <- grep( converter_rx, functions ) ) ){ for( i in matches ){ fun <- functions[i] from <- sub( converter_rx, "\\1", fun ) @@ -313,7 +311,7 @@ Module <- function( module, PACKAGE = methods::getPackageName(where), where = to ) setAs( from, to, converter, where = where ) } - } # #nocov end + } } @@ -321,7 +319,7 @@ Module <- function( module, PACKAGE = methods::getPackageName(where), where = to module } -dealWith <- function( x ) if(isTRUE(x[[1]])) invisible(NULL) else x[[2]] # #nocov +dealWith <- function( x ) if(isTRUE(x[[1]])) invisible(NULL) else x[[2]] method_wrapper <- function( METHOD, where ){ noargs <- all( METHOD$nargs == 0 ) @@ -359,11 +357,11 @@ method_wrapper <- function( METHOD, where ){ } else { # some are void, some are not, so the voidness is part of the result # we get from internally and we need to deal with it - substitute( # #nocov start - { - docstring - dealWith( .External(CppMethod__invoke, class_pointer, pointer, .pointer ) ) - } , stuff ) # #nocov end + substitute( + { + docstring + dealWith( .External(CppMethod__invoke, class_pointer, pointer, .pointer ) ) + } , stuff ) } } else { if( all( METHOD$void ) ){ @@ -385,33 +383,33 @@ method_wrapper <- function( METHOD, where ){ } else { # some are void, some are not, so the voidness is part of the result # we get from internally and we need to deal with it - substitute( # #nocov start - { - docstring - dealWith( .External(CppMethod__invoke, class_pointer, pointer, .pointer, ...) ) - } , stuff ) # #nocov end + substitute( + { + docstring + dealWith( .External(CppMethod__invoke, class_pointer, pointer, .pointer, ...) ) + } , stuff ) } } body(f, where) <- extCall f - } + } ## create a named list of the R methods to invoke C++ methods ## from the C++ class with pointer xp cpp_refMethods <- function(CLASS, where) { finalizer <- eval( substitute( - function(){ - .Call( CppObject__finalize, class_pointer , .pointer ) - }, - list( - CLASS = CLASS@pointer, - CppObject__finalize = CppObject__finalize, - class_pointer = CLASS@pointer - ) - ) ) - mets <- c( - sapply( CLASS@methods, method_wrapper, where = where ), - "finalize" = finalizer - ) + function(){ + .Call( CppObject__finalize, class_pointer , .pointer ) + }, + list( + CLASS = CLASS@pointer, + CppObject__finalize = CppObject__finalize, + class_pointer = CLASS@pointer + ) + ) ) + mets <- c( + sapply( CLASS@methods, method_wrapper, where = where ), + "finalize" = finalizer + ) mets } @@ -438,6 +436,5 @@ cpp_fields <- function( CLASS, where){ sapply( CLASS@fields, binding_maker, where = where ) } -.CppClassName <- function(name) { - paste0("Rcpp_",name) # #nocov -} +.CppClassName <- function(name) + paste0("Rcpp_",name) diff --git a/R/Rcpp.package.skeleton.R b/R/Rcpp.package.skeleton.R index d8c989b50..c74b60679 100644 --- a/R/Rcpp.package.skeleton.R +++ b/R/Rcpp.package.skeleton.R @@ -1,4 +1,6 @@ -# Copyright (C) 2009 - 2026 Dirk Eddelbuettel and Romain Francois +# -*- tab-width: 4; -*- + +# Copyright (C) 2009 - 2015 Dirk Eddelbuettel and Romain Francois # # This file is part of Rcpp. # @@ -24,101 +26,82 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(), maintainer = if (missing(author)) "Your Name" else author, email = "your@email.com", - githubuser = NA_character_, license = "GPL (>= 2)") { - - havePkgKitten <- requireNamespace("pkgKitten", quietly=TRUE) + + havePkgKitten <- requireNamespace("pkgKitten", quietly=TRUE, character.only=TRUE) call <- match.call() call[[1]] <- as.name("package.skeleton") env <- parent.frame(1) - if (!is.character(cpp_files)) - stop("'cpp_files' must be a character vector") # #nocov + if (!is.character(cpp_files)) + stop("'cpp_files' must be a character vector") - if (!length(list)) { - fake <- TRUE - assign("Rcpp.fake.fun", function() {}, envir = env) - if (example_code && !isTRUE(attributes)) { - assign("rcpp_hello_world", function() {}, envir = env) - remove_hello_world <- TRUE - } else { + if (!length(list)) { + fake <- TRUE + assign("Rcpp.fake.fun", function() {}, envir = env) + if (example_code && !isTRUE(attributes)) { + assign("rcpp_hello_world", function() {}, envir = env) + remove_hello_world <- TRUE + } else { remove_hello_world <- FALSE - } - } else { + } + } else { if (example_code && !isTRUE(attributes)) { - if (!"rcpp_hello_world" %in% list) { # #nocov start + if (!"rcpp_hello_world" %in% list) { assign( "rcpp_hello_world", function() {}, envir = env) call[["list"]] <- as.call(c(as.name("c"), as.list(c("rcpp_hello_world", list)))) } - remove_hello_world <- TRUE # #nocov end - } else { - remove_hello_world <- FALSE - } - fake <- FALSE - } + remove_hello_world <- TRUE + } else { + remove_hello_world <- FALSE + } + fake <- FALSE + } ## first let the traditional version do its business - ## remove Rcpp specific arguments + ## remove Rcpp specific arguments - call <- call[ c(1L, which(names(call) %in% names(formals(package.skeleton)))) ] + call <- call[ c(1L, which(names(call) %in% names(formals(package.skeleton)))) ] - if (fake) { - call[["list"]] <- c(if(isTRUE(example_code) + if (fake) { + call[["list"]] <- c(if(isTRUE(example_code) && !isTRUE(attributes)) "rcpp_hello_world", "Rcpp.fake.fun") - } + } - tryCatch(eval(call, envir = env), error = function(e){ - stop(sprintf("error while calling `package.skeleton` : %s", conditionMessage(e))) # #nocov - }) + tryCatch(eval(call, envir = env), error = function(e){ + stop(sprintf("error while calling `package.skeleton` : %s", conditionMessage(e))) + }) - message("\nAdding Rcpp settings") + message("\nAdding Rcpp settings") - ## now pick things up - root <- file.path(path, name) + ## now pick things up + root <- file.path(path, name) - # Add Rcpp to the DESCRIPTION - DESCRIPTION <- file.path(root, "DESCRIPTION") - if (file.exists(DESCRIPTION)) { - imports <- c(if (isTRUE(module)) "methods", sprintf("Rcpp (>= %s)", getRcppVersion())) - splitname <- strsplit(author, " ")[[1]] - x <- cbind(read.dcf(DESCRIPTION, fields = c("Package", "Type", "Title", "Version", "Date", - "Description", "License")), + # Add Rcpp to the DESCRIPTION + DESCRIPTION <- file.path(root, "DESCRIPTION") + if (file.exists(DESCRIPTION)) { + imports <- c(if (isTRUE(module)) "methods", + sprintf("Rcpp (>= %s)", packageDescription("Rcpp")[["Version"]])) + x <- cbind(read.dcf(DESCRIPTION), "Imports" = paste(imports, collapse = ", "), - "LinkingTo" = "Rcpp", - "Authors@R" = sprintf("person(\"%s\", \"%s\", role = c(\"aut\", \"cre\"), email = \"%s\")", - paste(splitname[-length(splitname)], collapse=" "), - splitname[length(splitname)], - email)) - fields_written <- c("Package", "Type", "Title", "Version", "Date", - "Authors@R", "Description", "License", "Imports", "LinkingTo") - if (!is.na(githubuser)) { # #nocov start - x <- cbind(x, matrix("", 1, 1, dimnames=list("", "URL"))) - x[1, "URL"] <- paste0("https://github.com/", githubuser, "/", name) - x <- cbind(x, matrix("", 1, 1, dimnames=list("", "BugReports"))) - x[1, "BugReports"] <- paste0("https://github.com/", githubuser, "/", name, "/issues") - - fields_written <- c("Package", "Type", "Title", "Version", "Date", - "Authors@R", "Description", "URL", "BugReports", - "License", "Imports", "LinkingTo") - } # #nocov end - - x[, "License"] <- license - x[, "Title"] <- "Concise Summary of What the Package Does" - x[, "Description"] <- "More about what it does (maybe more than one line)." - x[, "Version"] <- "0.0.1" - message( " >> added Imports: Rcpp" ) - message( " >> added LinkingTo: Rcpp" ) - write.dcf(x[1, fields_written, drop = FALSE], file = DESCRIPTION) - } - - ## add useDynLib and importFrom to NAMESPACE - NAMESPACE <- file.path(root, "NAMESPACE") + "LinkingTo" = "Rcpp") + x[, "Author"] <- author + x[, "Maintainer"] <- sprintf("%s <%s>", maintainer, email) + x[, "License"] <- license + message( " >> added Imports: Rcpp" ) + message( " >> added LinkingTo: Rcpp" ) + write.dcf(x, file = DESCRIPTION) + + } + + ## add useDynLib and importFrom to NAMESPACE + NAMESPACE <- file.path(root, "NAMESPACE") lines <- readLines(NAMESPACE) ns <- file(NAMESPACE, open="w") - if (!any(grepl("useDynLib", lines))) { - lines <- c(sprintf( "useDynLib(%s, .registration=TRUE)", name), lines) + if (! grepl("useDynLib", lines)) { + lines <- c(sprintf( "useDynLib(%s)", name), lines) writeLines(lines, con = ns) message(" >> added useDynLib directive to NAMESPACE" ) } @@ -129,130 +112,100 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(), writeLines('importFrom(Rcpp, evalCpp)', ns) message(" >> added importFrom(Rcpp, evalCpp) directive to NAMESPACE" ) } - if (!any(grepl("^exportPattern", lines))) { - writeLines("exportPattern(\"^[[:alpha:]]+\")", ns) - } close( ns ) - ## update the package description help page + ## update the package description help page if (havePkgKitten) { # if pkgKitten is available, use it - pkgKitten::playWithPerPackageHelpPage(name, path, maintainer, email) # #nocov + pkgKitten::playWithPerPackageHelpPage(name, path, maintainer, email) } else { - .playWithPerPackageHelpPage(name, path, maintainer, email) # #nocov - } - - ## lay things out in the src directory - src <- file.path(root, "src") - if (!file.exists(src)) { - dir.create(src) - } - skeleton <- system.file("skeleton", package = "Rcpp") - - if (length(cpp_files) > 0L) { - for (file in cpp_files) { # #nocov start - file.copy(file, src) - message(" >> copied ", file, " to src directory" ) # #nocov end + package_help_page <- file.path(root, "man", sprintf( "%s-package.Rd", name)) + if (file.exists(package_help_page)) { + lines <- readLines(package_help_page) + lines <- gsub("What license is it under?", license, lines, fixed = TRUE) + lines <- gsub("Who to complain to ", + sprintf( "%s <%s>", maintainer, email), + lines, fixed = TRUE) + lines <- gsub( "Who wrote it", author, lines, fixed = TRUE) + writeLines(lines, package_help_page) } } - - if (example_code) { - if (isTRUE(attributes)) { - file.copy(file.path( skeleton, "rcpp_hello_world_attributes.cpp"), + + ## lay things out in the src directory + src <- file.path(root, "src") + if (!file.exists(src)) { + dir.create(src) + } + skeleton <- system.file("skeleton", package = "Rcpp") + + if (length(cpp_files) > 0L) { + for (file in cpp_files) { + file.copy(file, src) + message(" >> copied ", file, " to src directory" ) + } + compileAttributes(root) + } + + if (example_code) { + if (isTRUE(attributes)) { + file.copy(file.path( skeleton, "rcpp_hello_world_attributes.cpp"), file.path( src, "rcpp_hello_world.cpp")) - message(" >> added example src file using Rcpp attributes") - } else { - header <- readLines(file.path(skeleton, "rcpp_hello_world.h")) - header <- gsub("@PKG@", name, header, fixed = TRUE) - writeLines(header , file.path(src, "rcpp_hello_world.h")) - message(" >> added example header file using Rcpp classes") - - file.copy(file.path(skeleton, "rcpp_hello_world.cpp"), src) - message(" >> added example src file using Rcpp classes") - - rcode <- readLines(file.path( skeleton, "rcpp_hello_world.R")) - rcode <- gsub("@PKG@", name, rcode, fixed = TRUE) - writeLines( rcode , file.path( root, "R", "rcpp_hello_world.R")) - message(" >> added example R file calling the C++ example") - } - - hello.Rd <- file.path(root, "man", "rcpp_hello_world.Rd") - unlink(hello.Rd) - file.copy(system.file("skeleton", "rcpp_hello_world.Rd", package = "Rcpp"), hello.Rd) - message( " >> added Rd file for rcpp_hello_world") - } - - if (isTRUE(module)) { - file.copy(system.file("skeleton", "rcpp_module.cpp", package="Rcpp"), + message(" >> added example src file using Rcpp attributes") + compileAttributes(root) + message(" >> compiled Rcpp attributes") + } else { + header <- readLines(file.path(skeleton, "rcpp_hello_world.h")) + header <- gsub("@PKG@", name, header, fixed = TRUE) + writeLines(header , file.path(src, "rcpp_hello_world.h")) + message(" >> added example header file using Rcpp classes") + + file.copy(file.path(skeleton, "rcpp_hello_world.cpp"), src) + message(" >> added example src file using Rcpp classes") + + rcode <- readLines(file.path( skeleton, "rcpp_hello_world.R")) + rcode <- gsub("@PKG@", name, rcode, fixed = TRUE) + writeLines( rcode , file.path( root, "R", "rcpp_hello_world.R")) + message(" >> added example R file calling the C++ example") + } + + hello.Rd <- file.path(root, "man", "rcpp_hello_world.Rd") + unlink(hello.Rd) + file.copy(system.file("skeleton", "rcpp_hello_world.Rd", package = "Rcpp"), hello.Rd) + message( " >> added Rd file for rcpp_hello_world") + } + + if (isTRUE(module)) { + file.copy(system.file("skeleton", "rcpp_module.cpp", package="Rcpp"), file.path(root, "src")) - file.copy(system.file("skeleton", "Num.cpp", package="Rcpp"), + file.copy(system.file("skeleton", "Num.cpp", package="Rcpp"), file.path(root, "src")) - file.copy(system.file("skeleton", "stdVector.cpp", package="Rcpp"), + file.copy(system.file("skeleton", "stdVector.cpp", package="Rcpp"), file.path(root, "src")) - file.copy(system.file("skeleton", "zzz.R", package ="Rcpp"), + file.copy(system.file("skeleton", "zzz.R", package ="Rcpp"), file.path(root, "R")) - file.copy(system.file("skeleton", "Rcpp_modules_examples.Rd", package ="Rcpp"), + file.copy(system.file("skeleton", "Rcpp_modules_examples.Rd", package ="Rcpp"), file.path(root, "man")) - message(" >> copied the example module file ") - } - - # generate native routines if we aren't using attributes (which already generate - # them automatically) and we have at least R 3.4 - if (!attributes) { - con <- file(file.path(src, "init.c"), "wt") - tools::package_native_routine_registration_skeleton(root, con=con) - close(con) - message(" >> created init.c for package registration") - } + message(" >> copied the example module file ") + } - lines <- readLines(package.doc <- file.path( root, "man", sprintf("%s-package.Rd", name))) - lines <- sub("~~ simple examples", "%% ~~ simple examples", lines) + lines <- readLines(package.doc <- file.path( root, "man", sprintf("%s-package.Rd", name))) + lines <- sub("~~ simple examples", "%% ~~ simple examples", lines) - lines <- lines[! grepl("~~ package title", lines)] - lines <- lines[! grepl("~~ The author and", lines)] - lines <- sub("Who wrote it", author, lines ) - lines <- sub("Who to complain to.*", sprintf("%s <%s>", maintainer, email), lines) + lines <- lines[! grepl("~~ package title", lines)] + lines <- lines[! grepl("~~ The author and", lines)] + lines <- sub("Who wrote it", author, lines ) + lines <- sub("Who to complain to.*", sprintf("%s <%s>", maintainer, email), lines) - writeLines(lines, package.doc) + writeLines(lines, package.doc) - if (fake) { - rm("Rcpp.fake.fun", envir = env) - unlink(file.path(root, "R" , "Rcpp.fake.fun.R")) - unlink(file.path(root, "man", "Rcpp.fake.fun.Rd")) + if (fake) { + rm("Rcpp.fake.fun", envir = env) + unlink(file.path(root, "R" , "Rcpp.fake.fun.R")) + unlink(file.path(root, "man", "Rcpp.fake.fun.Rd")) + } - ## cleansing NAMESPACE of fake function entry - lines <- readLines(NAMESPACE) - lines <- lines[!grepl("^export.*fake\\.fun", lines)] - writeLines(lines, NAMESPACE) - } + if (isTRUE(remove_hello_world)) { + rm("rcpp_hello_world", envir = env) + } - if (isTRUE(remove_hello_world)) { - rm("rcpp_hello_world", envir = env) - } - - if (attributes) { - compileAttributes(root) - message(" >> compiled Rcpp attributes ") - } - - invisible(NULL) -} - -## Borrowed with love from pkgKitten, and modified slightly -.playWithPerPackageHelpPage <- function(name = "anRpackage", - path = ".", - maintainer = "Your Name", - email = "your@mail.com") { - root <- file.path(path, name) # #nocov start - helptgt <- file.path(root, "man", sprintf( "%s-package.Rd", name)) - helpsrc <- system.file("skeleton", "manual-page-stub.Rd", package="Rcpp") - ## update the package description help page - if (file.exists(helpsrc)) { - lines <- readLines(helpsrc) - lines <- gsub("__placeholder__", name, lines, fixed = TRUE) - lines <- gsub("Who to complain to ", - sprintf( "%s <%s>", maintainer, email), - lines, fixed = TRUE) - writeLines(lines, helptgt) - } - invisible(NULL) # #nocov end + invisible(NULL) } diff --git a/R/RcppClass.R b/R/RcppClass.R index 1bd60f8c3..fa1d1cf2c 100644 --- a/R/RcppClass.R +++ b/R/RcppClass.R @@ -1,4 +1,4 @@ -# Copyright (C) 2010 - 2021 John Chambers, Dirk Eddelbuettel and Romain Francois +# Copyright (C) 2010 - 2012 John Chambers, Dirk Eddelbuettel and Romain Francois # # This file is part of Rcpp. # @@ -26,8 +26,8 @@ setRcppClass <- function(Class, CppClass, ...) { myCall <- match.call() myCall[[1]] <- quote(Rcpp::loadRcppClass) - if (!missing(module) && moduleIsLoaded(module, where)) # eval now - eval.parent(myCall) # #nocov + if(!missing(module) && moduleIsLoaded(module, where)) # eval now + eval.parent(myCall) else { f <- function(NS)NULL myCall$where = as.name("NS") @@ -46,20 +46,20 @@ loadRcppClass <- function(Class, CppClass = Class, ...) { if(isBotchedSession()) { - value <- setRefClass(Class, fields = fields, methods = methods, contains = contains, where = where, ...) # kludge -- see loadModule.R #nocov start + value <- setRefClass(Class, fields = fields, methods = methods, contains = contains, where = where, ...) # kludge -- see loadModule.R if(is.character(saveAs) && length(saveAs) == 1) assign(saveAs, value, envir = where) - return(value) # #nocov end + return(value) } mod <- loadModule(module, NULL, env = where, loadNow = TRUE) storage <- get("storage", envir = as.environment(mod)) - if(exists(Class, envir = storage, inherits = FALSE)) { - cppclassinfo <- get(Class, envir = storage) + if(exists(CppClass, envir = storage, inherits = FALSE)) { + cppclassinfo <- get(CppClass, envir = storage) if(!is(cppclassinfo, "C++Class")) - stop(gettextf("Object \"%s\" in module \"%s\" is not a C++ class description", Class, module)) # #nocov + stop(gettextf("Object \"%s\" in module \"%s\" is not a C++ class description", CppClass, module)) } else - stop(gettextf("No object \"%s\" in module \"%s\"", Class, module)) # #nocov + stop(gettextf("No object \"%s\" in module \"%s\"", CppClass, module)) allmethods <- .makeCppMethods(methods, cppclassinfo, where) allfields <- .makeCppFields(fields, cppclassinfo, where) value <- setRefClass(Class, fields = allfields, @@ -124,7 +124,7 @@ loadRcppClass <- function(Class, CppClass = Class, cppArgs <- !nzchar(argNames) .CppObject <<- do.call(.CppGenerator$new, args[cppArgs]) for(i in seq_along(args)[!cppArgs]) - field(argNames[[i]], args[[i]]) # #nocov + field(argNames[[i]], args[[i]]) } ), fields = list( @@ -135,7 +135,7 @@ loadRcppClass <- function(Class, CppClass = Class, .RcppClass$methods(show = function () { - cat("Rcpp class object of class ", classLabel(class(.self)), # #nocov start + cat("Rcpp class object of class ", classLabel(class(.self)), "\n", sep = "") fields <- names(.refClassDef@fieldClasses) if(".CppObject" %in% fields) { @@ -150,5 +150,8 @@ loadRcppClass <- function(Class, CppClass = Class, } }, objectPointer = function() - .CppObject$.pointer # #nocov end + .CppObject$.pointer ) + + + diff --git a/R/RcppLdpath.R b/R/RcppLdpath.R index d8acb323e..8233b266e 100644 --- a/R/RcppLdpath.R +++ b/R/RcppLdpath.R @@ -1,4 +1,4 @@ -# Copyright (C) 2010 - 2026 Dirk Eddelbuettel and Romain Francois +# Copyright (C) 2010 - 2013 Dirk Eddelbuettel and Romain Francois # # This file is part of Rcpp. # @@ -20,20 +20,9 @@ Rcpp.system.file <- function(...){ tools::file_path_as_absolute( base::system.file( ..., package = "Rcpp" ) ) } -## quote path if non-standard characters are used -Rcpp.quoteNonStandard <- function(path) { - ## On unix, check if path has only characters that do not need quoting - noquote <- .Platform$OS.type == "unix" && grepl("^[[:alnum:]/._~+@%-]*$", path) - ## If no quoting needed return unchanged else quote input - if (noquote) path else shQuote(path) # #nocov -} - ## Use R's internal knowledge of path settings to find the lib/ directory ## plus optinally an arch-specific directory on system building multi-arch RcppLdPath <- function() { - #.Deprecated(msg=paste("This function is now deprecated as it has not", - # "been needed since 2013.")) - message("'RcppLdPath' has not been needed since 2013 (!!) and may get removed in 2027. Please update your 'Makevars'.") "" } @@ -44,38 +33,29 @@ RcppLdPath <- function() { ## Updated Jan 2010: We now default to static linking but allow the use ## of rpath on Linux if static==FALSE has been chosen ## Note that this is probably being called from LdFlags() -## Updated Nov 2013: We no longer build a library. This should be deprecated. -RcppLdFlags <- function() { - #.Deprecated(msg=paste("This function is now deprecated as it has not", - # "been needed since 2013.")) - message("'RcppLdFlags' has not been needed since 2013 (!!) and may get removed in 2027. Please update your 'Makevars'.") - "" -} +## Updated Nov 2013: We no longer build a library. This should be deprecated. +RcppLdFlags <- function() { "" } # indicates if Rcpp was compiled with GCC >= 4.3 -canUseCXX0X <- function() { TRUE } # .Call( "canUseCXX0X", PACKAGE = "Rcpp" ) +canUseCXX0X <- function() .Call( "canUseCXX0X", PACKAGE = "Rcpp" ) ## Provide compiler flags -- i.e. -I/path/to/Rcpp.h RcppCxxFlags <- function(cxx0x=FALSE) { + # path <- RcppLdPath() path <- Rcpp.system.file( "include" ) if (.Platform$OS.type=="windows") { - path <- asBuildPath(path) # #nocov + path <- asBuildPath(path) } - paste0('-I', Rcpp.quoteNonStandard(path)) + paste("-I", path, if (cxx0x && canUseCXX0X()) " -std=c++0x" else "", sep="") } ## Shorter names, and call cat() directly ## CxxFlags defaults to no using c++0x extensions are these are considered non-portable -CxxFlags <- function(cxx0x=FALSE) { # #nocov start - #.Deprecated(msg=paste("This function is now deprecated as R uses minimally", - # "viable compilers om all platforme.")) - message("'CxxFlags' has not been needed since 2013 (!!) and may get removed in 2027. Please update your 'Makevars'.") - cat(RcppCxxFlags(cxx0x=cxx0x)) # #nocov end +CxxFlags <- function(cxx0x=FALSE) { + cat(RcppCxxFlags(cxx0x=cxx0x)) } - ## LdFlags defaults to static linking on the non-Linux platforms Windows and OS X LdFlags <- function() { - message("'LdFlags' has not been needed since 2013 (!!) and may get removed in 2027. Please update your 'Makevars'.") cat(RcppLdFlags()) } @@ -84,16 +64,11 @@ RcppCapabilities <- capabilities <- function() .Call( rcpp_capabilities ) # compile, load and call the cxx0x.c script to identify whether # the compiler is GCC >= 4.3 -RcppCxx0xFlags <- function() { # #nocov start - #.Deprecated(msg=paste("This function is now deprecated as R uses minimally", - # "viable compilers om all platforme.")) - message("'RcppCxx0xFlags' has not been needed since 2013 (!!) and may get removed in 2027. Please update your 'Makevars'.") +RcppCxx0xFlags <- function(){ script <- Rcpp.system.file( "discovery", "cxx0x.R" ) flag <- capture.output( source( script ) ) flag } -Cxx0xFlags <- function() { - message("'Cxx0xFlags' has not been needed since 2013 (!!) and may get removed in 2027. Please update your 'Makevars'.") - cat(RcppCxx0xFlags()) # #nocov end -} +Cxx0xFlags <- function() cat( RcppCxx0xFlags() ) + diff --git a/R/asis.R b/R/asis.R deleted file mode 100644 index 5fede4fc5..000000000 --- a/R/asis.R +++ /dev/null @@ -1,56 +0,0 @@ -## These two functions are borrowed with grateful appreciation from the R.rsp package -## by Henrik Bengtsson licensed under LGPL (>= 2.1) and somewhat simplified / shortened -## feature-reduced here. Please see the R.rsp for a full-featured version and documentation - -##' Simple \sQuote{asis} Vignette Processor -##' -##' To pass pre-made pdf vignettes through \dQuote{as is}, a simple vignette -##' process is added. It is derived from the more feature-complete one in the \pkg{R.rsp} -##' package. To use it, add files named like the pdf file plus an appended \code{.asis} -##' with the vignette metainformation and register the vignette processor, see the examples. -##' -##' @title Process pdf vignettes \sQuote{asis} -##' @name asisWeave -##' @param file character Filename to be processed -##' @param ... dots Currently ignored -##' @param pattern character A regular expression describing the filename pattern -##' @return The respective filename is returned, invisibly -##' @author Henrik Bengtsson for the original versions in package \pkg{R.rsp}, -##' Dirk Eddelbuettel for the shortened ones used here -##' @examples -##' # To register this vignette engine in another package, add -##' # \code{VignetteBuilder: Rcpp} as well as \code{Suggests: Rcpp} to \code{DESCRIPTION} -##' # which uses the registration this package provides via -##' \dontrun{tools::vignetteEngine("asis", package = pkgname, pattern = "[.](pdf|html)[.]asis$", -##' weave = asisWeave, tangle = asisTangle)} -##' -##' # Use a .asis file as in the Rcpp package, for example Rcpp-FAQ.pdf.asis has these lines: -##' # %\VignetteIndexEntry{Rcpp-FAQ} -##' # %\VignetteKeywords{Rcpp, FAQ, R, Cpp} -##' # %\VignettePackage{Rcpp} -##' # %\VignetteEncoding{UTF-8} -##' # %\VignetteEngine{Rcpp::asis} -asisWeave <- function (file, ...) { # #nocov start - output <- tools::file_path_sans_ext(basename(file)) - if (!file.exists(output)) { - outputS <- file.path("..", "inst", "doc", output) - if (file.exists(outputS)) { - file.copy(outputS, output, overwrite = TRUE) - output <- outputS - } else { - stop("No file to process", call. = FALSE) - } - } - Sys.setFileTime(output, time = Sys.time()) - invisible(output) -} - -##' @rdname asisWeave -asisTangle <- function (file, ..., pattern = "(|[.][^.]*)[.]asis$") { - workdir <- "." - filename <- basename(file) - fullname <- gsub(pattern, "", filename) - filenameR <- sprintf("%s.R", fullname) - cat(sprintf("### This is an R script tangled from '%s'\n", filename), file = filenameR) - invisible(filenameR) -} # #nocov end diff --git a/R/bib.R b/R/bib.R index 1fc731569..844fe5ad0 100644 --- a/R/bib.R +++ b/R/bib.R @@ -1,4 +1,4 @@ -# Copyright (C) 2010 - 2017 Dirk Eddelbuettel and Romain Francois +# Copyright (C) 2010 - 2012 Dirk Eddelbuettel and Romain Francois # # This file is part of Rcpp. # @@ -16,5 +16,5 @@ # along with Rcpp. If not, see . bib <- function() { - sub("\\.bib$", "", system.file("bib", "Rcpp.bib", package = "Rcpp")) + sub("\\.bib$", "", system.file( "doc", "Rcpp.bib", package = "Rcpp" ) ) } diff --git a/R/exceptions.R b/R/exceptions.R index 3d1e07164..852c8db75 100644 --- a/R/exceptions.R +++ b/R/exceptions.R @@ -1,4 +1,4 @@ -# Copyright (C) 2009 - 2017 Dirk Eddelbuettel and Romain Francois +# Copyright (C) 2009 - 2012 Dirk Eddelbuettel and Romain Francois # # This file is part of Rcpp. # @@ -15,34 +15,22 @@ # You should have received a copy of the GNU General Public License # along with Rcpp. If not, see . -.rcpp_error_recorder <- function(e) { - invisible(.Call(rcpp_error_recorder, e)) # #nocov +.rcpp_error_recorder <- function(e){ + invisible( .Call( rcpp_error_recorder, e ) ) } .warningsEnv <- new.env() .warningsEnv$warnings <- character() .rcpp_warning_recorder <- function(w){ - .warningsEnv$warnings <- append(.warningsEnv$warnings, w$message) # #nocov - invokeRestart("muffleWarning") # #nocov + .warningsEnv$warnings <- append(.warningsEnv$warnings, w$message) + invokeRestart("muffleWarning") } .rcpp_collect_warnings <- function() { - warnings <- .warningsEnv$warnings # #nocov start + warnings <- .warningsEnv$warnings .warningsEnv$warnings <- character() - warnings # #nocov end + warnings } -print.Rcpp_stack_trace <- function(x, ...) { - cat(format(x, ...)) # #nocov -} - -str.Rcpp_stack_trace <- function(object, ...) { - cat(format(object, ...)) # #nocov -} -format.Rcpp_stack_trace <- function(x, ...) { - paste0( # #nocov start - if (nzchar(x$file)) paste0(x$file, ":", x$line), - "\n ", paste(collapse = "\n ", seq_along(x$stack), ":", x$stack), "\n") -} # #nocov end diff --git a/R/exposeClass.R b/R/exposeClass.R index 3c30bbeea..5757b25e8 100644 --- a/R/exposeClass.R +++ b/R/exposeClass.R @@ -1,21 +1,4 @@ -# Copyright (C) 2013 - 2016 John Chambers, Dirk Eddelbuettel and Romain Francois -# -# This file is part of Rcpp. -# -# Rcpp is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# Rcpp is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Rcpp. If not, see . - -.stdHeader <- c( # #nocov start +.stdHeader <- c( "#include ", "using namespace Rcpp ;" ) @@ -92,7 +75,7 @@ exposeClass <- function(class, constructors, fields, methods, } if(is.character(file)) { ## are we in a package directory? Writable, searchable src subdirectory: - if(file.access("src",3)==0 && (basename(file) == file)) + if(file.access("src",3)==0) cfile <- file.path("src", file) else cfile <- file @@ -107,7 +90,7 @@ exposeClass <- function(class, constructors, fields, methods, if(identical(Rfile, TRUE)) Rfile <- sprintf("%sClass.R",class) if(is.character(Rfile)) { - if(file.access("R",3)==0 && (basename(file) == file)) # in a package directory + if(file.access("R",3)==0) # in a package directory Rfile <- file.path("R", Rfile) Rcon <- file(Rfile, "w") msg <- sprintf("Wrote R file \"%s\"",Rfile) @@ -136,17 +119,16 @@ exposeClass <- function(class, constructors, fields, methods, } writeLines("", mcon) flds <- .specifyItems(fields) - nm <- fnm <- names(flds) + nm <- names(flds) rdOnly <- nm %in% readOnly macros <- ifelse(rdOnly, ".field_readonly", ".field") test <- nm %in% rename if(any(test)) - nm[test] <- newnames[match(nm[test], rename)] + nm[test] <- newnames[match(nm[test], newnames)] ns <- NULL for(i in seq_along(nm)) { typei <- flds[[i]] - fldi <- fnm[i] - nmi <- nm[[i]] + nmi <- fldi <- nm[[i]] macroi <- macros[[i]] if(!length(typei) || identical(typei, "")) ## direct field writeLines(sprintf(" %s(\"%s\", &%s::%s)", @@ -172,7 +154,7 @@ exposeClass <- function(class, constructors, fields, methods, nm <- mds <- names(sigs) test <- nm %in% rename if(any(test)) - nm[test] <- newnames[match(nm[test], rename)] + nm[test] <- newnames[match(nm[test], newnames)] for(i in seq_along(nm)) { sigi <- sigs[[i]] nmi <- nm[[i]] @@ -201,15 +183,15 @@ exposeClass <- function(class, constructors, fields, methods, if(missing(CppClass)) CppString <- "" else - CppString <- paste0(", \"",CppClass, "\"") + CppString <- paste(",",dQuote(CppClass)) if(missing(module)) ModString <- "" else - ModString <- paste0(", module = \"", module, "\"") + ModString <- paste(", module =", dQuote(module)) writeLines(sprintf("%s <- setRcppClass(\"%s\"%s%s)", class, class, CppString,ModString), Rcon) } -} # #nocov end +} diff --git a/R/inline.R b/R/inline.R index 165c615ed..61d5bc0ea 100644 --- a/R/inline.R +++ b/R/inline.R @@ -1,4 +1,4 @@ -# Copyright (C) 2009 - 2026 Dirk Eddelbuettel and Romain Francois +# Copyright (C) 2009 - 2013 Dirk Eddelbuettel and Romain Francois # # This file is part of Rcpp. # @@ -15,17 +15,18 @@ # You should have received a copy of the GNU General Public License # along with Rcpp. If not, see . -Rcpp.plugin.maker <- function(include.before = "", - include.after = "", - LinkingTo = unique(c(package, "Rcpp")), - Depends = unique(c(package, "Rcpp")), - Imports = unique(c(package, "Rcpp")), - libs = "", - Makevars = NULL , - Makevars.win = NULL, - package = "Rcpp") { - function(...) { - includes <- sprintf("%s +Rcpp.plugin.maker <- function( + include.before = "", + include.after = "", + LinkingTo = unique( c( package, "Rcpp" ) ), + Depends = unique( c( package, "Rcpp" ) ), + libs = "", + Makevars = NULL , + Makevars.win = NULL, + package = "Rcpp" +){ + function( ... ){ +includes <- sprintf( "%s #include %s @@ -37,19 +38,23 @@ Rcpp.plugin.maker <- function(include.before = "", #define END_RCPP #endif -using namespace Rcpp;", include.before, include.after) - out <- list(env = list( PKG_LIBS = libs ), - includes = includes, - LinkingTo = LinkingTo , - body = function( x ) { - sprintf( "BEGIN_RCPP\n%s\nEND_RCPP", x ) # #nocov - }, - Depends = Depends, - Imports = Imports) - if (!is.null(Makevars)) out$Makevars <- Makevars - if (!is.null(Makevars.win)) out$Makevars.win <- Makevars.win +using namespace Rcpp; +", include.before, include.after ) + + out <- list( + env = list( PKG_LIBS = libs ), + includes = includes, + LinkingTo = LinkingTo , + body = function( x ){ + sprintf( "BEGIN_RCPP\n%s\nEND_RCPP", x ) + }, + Depends = Depends + ) + if( !is.null(Makevars ) ) out$Makevars <- Makevars + if( !is.null(Makevars.win ) ) out$Makevars.win <- Makevars.win out - } +} } inlineCxxPlugin <- Rcpp.plugin.maker() + diff --git a/R/loadModule.R b/R/loadModule.R index 82d2dcda1..ff04c60fb 100644 --- a/R/loadModule.R +++ b/R/loadModule.R @@ -1,4 +1,4 @@ -# Copyright (C) 2010 - 2026 John Chambers, Dirk Eddelbuettel and Romain Francois +# Copyright (C) 2010 - 2012 John Chambers, Dirk Eddelbuettel and Romain Francois # # This file is part of Rcpp. # @@ -28,7 +28,7 @@ isBotchedSession <- function() assignAs } -.DummyModule <- function(name, what) { # #nocov start +.DummyModule <- function(name, what) { value <- new.env() storage <- new.env() assign("storage", storage, envir = value) @@ -37,7 +37,7 @@ isBotchedSession <- function() for(el in allNames) assign(el, NULL, envir = storage) value -} # #nocov end +} .moduleMetaName <- function(name) methods::methodsPackageMetaName("Mod",name) @@ -54,12 +54,12 @@ loadModule <- function( module, what = character(), loadNow, if(exists(metaName, envir = env, inherits = FALSE)) loadM <- get(metaName, envir = env) } - else if(is(module, "Module")) { # #nocov start + else if(is(module, "Module")) { loadM <- as.environment(module) module <- get(loadM, "moduleName") } else - stop(gettextf("Argument \"module\" should be a module or the name of a module: got an object of class \"%s\"", class(module))) # #nocov end + stop(gettextf("Argument \"module\" should be a module or the name of a module: got an object of class \"%s\"", class(module))) if(missing(loadNow)) { # test it if(is.null(loadM)) loadM <- tryCatch(Module( module, mustStart = TRUE, where = env ), @@ -67,17 +67,15 @@ loadModule <- function( module, what = character(), loadNow, loadNow <- !is(loadM, "error") } if(loadNow) { - ## .botched <- isBotchedSession() - .botched <- FALSE - + .botched <- isBotchedSession() if(is.null(loadM)) loadM <- tryCatch(Module( module, mustStart = TRUE, where = env ), error = function(e)e) if(is(loadM, "error")) { - if(.botched) # #nocov start + if(.botched) return(.DummyModule(module, what)) stop(gettextf("Unable to load module \"%s\": %s", - as(module, "character"), loadM$message)) # #nocov end + as(module, "character"), loadM$message)) } if(!exists(metaName, envir = env, inherits =FALSE)) assign(metaName, loadM, envir = env) @@ -90,7 +88,7 @@ loadModule <- function( module, what = character(), loadNow, what <- objects(storage) missingObjs <- !sapply(what, function(symb) exists(symb, envir = storage, inherits = FALSE)) if(any(missingObjs)) { - if(.botched) { # #nocov start + if(.botched) { for(el in what[missingObjs]) assign(el, NULL, envir = storage) } @@ -99,12 +97,12 @@ loadModule <- function( module, what = character(), loadNow, paste0('"', what[missingObjs], '"', collapse = ", "), as.character(module))) what <- what[!missingObjs] - } # #nocov end + } } assignAs <- .moduleNames(what) for( i in seq_along(what) ) { if(.botched) - assign(assignAs[[i]], NULL, envir = storage) # #nocov + assign(assignAs[[i]], NULL, envir = storage) else assign(assignAs[[i]], get(what[[i]], envir = storage), envir = env) } @@ -117,6 +115,7 @@ loadModule <- function( module, what = character(), loadNow, myCall$loadNow <- TRUE body(f, envir = env) <- myCall setLoadAction(f, where = env) - invisible(myCall) # #nocov + invisible(myCall) } } + diff --git a/R/loadRcppModules.R b/R/loadRcppModules.R new file mode 100644 index 000000000..d894f6bd4 --- /dev/null +++ b/R/loadRcppModules.R @@ -0,0 +1,56 @@ +# Copyright (C) 2010 - 2012 John Chambers, Dirk Eddelbuettel and Romain Francois +# +# This file is part of Rcpp. +# +# Rcpp is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# Rcpp is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Rcpp. If not, see . + +loadRcppModules <- function(direct=TRUE){ + ## hunt for the namespace of the package that calls this + calls <- sys.calls() + w <- which( sapply( calls, function(call){ + identical( call[[1L]], as.name( "runHook" ) ) + } ) ) + if( !length(w) ) + stop( "loadRcppModules can only be used within a .onLoad function" ) + w <- w[ length(w) ] + call <- calls[[w]] + if( !identical( call[[2L]], ".onLoad" ) ) + stop( "loadRcppModules can only be used within a .onLoad function" ) + f <- sys.frame( w ) + ns <- get("env", f ) + if( !isNamespace( ns ) ) + stop( "loadRcppModules not called from a namespace" ) + pkg <- get( "pkgname", f ) + lib <- get( "libname", f ) + + ## look for declared modules in the DESCRIPTION fields + description <- packageDescription(pkg, lib.loc=lib) + modules <- description[["RcppModules"]] + if( !is.null( modules ) ){ + modules <- strsplit( modules, "[[:space:]]*,[[:space:]]*")[[1L]] + for( m in modules ){ + tryCatch( { + mod <- Module( m, pkg, mustStart = TRUE) + if(isTRUE(direct)){ + populate( mod, ns ) + } else { + forceAssignInNamespace( m, mod, ns ) + } + assign(.moduleMetaName(m), mod, envir = ns) + }, error = function(e){ + stop( sprintf( "failed to load module %s from package %s\n%s", m, pkg, conditionMessage(e) ) ) + }) + } + } +} diff --git a/R/tools.R b/R/tools.R index 28fd3ca4a..9b3696d63 100644 --- a/R/tools.R +++ b/R/tools.R @@ -1,4 +1,4 @@ -# Copyright (C) 2010 - 2019 Dirk Eddelbuettel and Romain Francois +# Copyright (C) 2010 - 2012 Dirk Eddelbuettel and Romain Francois # # This file is part of Rcpp. # @@ -15,61 +15,36 @@ # You should have received a copy of the GNU General Public License # along with Rcpp. If not, see . -externalptr_address <- function(xp) { - .Call(as_character_externalptr, xp) # #nocov +externalptr_address <- function(xp){ + .Call( as_character_externalptr, xp ) } # just like assignInNamespace but first checks that the binding exists -forceAssignInNamespace <- function(x, value, env) { - is_ns <- isNamespace(env) - unlocker <- get("unlockBinding", baseenv()) - if (is_ns && exists(x, env) && bindingIsLocked(x, env)) { - unlocker(x, env) # #nocov +forceAssignInNamespace <- function( x, value, env ){ + is_ns <- isNamespace( env ) + unlocker <- get( "unlockBinding", baseenv() ) + if( is_ns && exists( x, env ) && bindingIsLocked(x, env ) ){ + unlocker( x, env ) } - assign(x, value, env) - if (is_ns) { - lockBinding(x, env) # #nocov + assign( x, value, env ) + if( is_ns ){ + lockBinding( x, env ) } } # Transform a path for passing to the build system on the command line. -# Leave paths alone for posix. For Windows, mirror the behavior of the +# Leave paths alone for posix. For Windows, mirror the behavior of the # R package build system by starting with the fully resolved absolute path, -# transforming it to a short path name if it contains spaces, and then +# transforming it to a short path name if it contains spaces, and then # converting backslashes to forward slashes asBuildPath <- function(path) { - + if (.Platform$OS.type == "windows") { - path <- normalizePath(path) # #nocov start + path <- normalizePath(path) if (grepl(' ', path, fixed=TRUE)) path <- utils::shortPathName(path) - path <- gsub("\\\\", "/", path) # #nocov end + path <- gsub("\\\\", "/", path) } - + return(path) } - - -##' Helper function to report the package version of the R installation. -##' -##' While \code{packageVersion(Rcpp)} exports the version registers in -##' \code{DESCRIPTION}, this version does get incremented more easily -##' during development and can therefore be higher than the released -##' version. The actual \code{#define} long used at the C++ level -##' corresponds more to an \sQuote{API Version} which is now provided -##' by this function, and use for example in the package skeleton -##' generator. -##' -##' @title Export the Rcpp (API) Package Version -##' @param devel An logical value indicating if the development or -##' release version number should be returned, default is release. -##' @return A \code{package_version} object with either the release -##' or development version. -##' @author Dirk Eddelbuettel -##' @seealso \code{\link{packageVersion}}, -##' \code{\link{Rcpp.package.skeleton}} -##' @examples getRcppVersion() -getRcppVersion <- function(devel = FALSE) { - rcpp <- .Call("getRcppVersionStrings", PACKAGE="Rcpp") - package_version(rcpp[if(devel) 2 else 1]) -} diff --git a/R/unit.tests.R b/R/unit.tests.R new file mode 100644 index 000000000..204a857c0 --- /dev/null +++ b/R/unit.tests.R @@ -0,0 +1,140 @@ +# Copyright (C) 2010 - 2015 Dirk Eddelbuettel, Romain Francois and Kevin Ushey +# +# This file is part of Rcpp. +# +# Rcpp is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# Rcpp is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Rcpp. If not, see . + +test <- function(output=if(file.exists("/tmp")) "/tmp" else getwd(), + gctorture=FALSE, + gctorture.exclude="runit.Module.client.package.R") { + + if (requireNamespace("RUnit")) { + + if (gctorture) { + + message("Running tests with gctorture(TRUE)") + if (length(gctorture.exclude)) { + message("The following tests will be excluded:\n", + paste(">>", gctorture.exclude, collapse="\n") + ) + } + + unitTestsDir <- system.file("unitTests", package="Rcpp") + files <- list.files( + unitTestsDir, + recursive=TRUE + ) + files <- setdiff(files, gctorture.exclude) + dirs <- list.dirs(unitTestsDir, full.names=FALSE) + testDir <- file.path( tempdir(), "RcppTests" ) + for (dir in file.path(testDir, dirs)) dir.create(dir) + + copySuccess <- sapply(files, function(file) { + file.copy( + file.path(unitTestsDir, file), + file.path(testDir, file) + ) + }) + + if (!all(copySuccess)) { + stop("Could not copy test files to temporary directory") + } + + ## Modify all the test files that were copied + testFiles <- list.files(testDir, pattern="^runit", full.names=TRUE) + for (file in testFiles) gctortureRUnitTest(file) + + ## Ensure we can read and parse each file + for (file in testFiles) { + tryCatch( parse(text=readLines(file)), + error=function(e) { + "could not parse test file" + } + ) + } + + } else { + testDir <- system.file("unitTests", package = "Rcpp") + } + + testSuite <- RUnit::defineTestSuite(name="Rcpp Unit Tests", + dirs=testDir, + testFuncRegexp = "^[Tt]est.+") + + ## if someoone calls Rcpp::test(), he/she wants all tests + Sys.setenv("RunAllRcppTests"="yes") + + ## Run tests + tests <- RUnit::runTestSuite(testSuite) + + ## Print results + RUnit::printTextProtocol(tests) + + return(tests) + } + + stop("Running unit tests requires the 'RUnit' package.") +} + +unitTestSetup <- function(file, packages=NULL, + pathToRcppTests=system.file("unitTests", package = "Rcpp")) { + function() { + if (! is.null(packages)) { + for (p in packages) { + suppressMessages(require(p, character.only=TRUE)) + } + } + sourceCpp(file.path(pathToRcppTests, "cpp", file)) + } +} + +gctortureRUnitTest <- function(file) { + + test <- readLines(file) + + ## TODO: handle '{', '}' within quotes + findMatchingBrace <- function(test, start, balance=1) { + line <- test[start] + if (start > length(test)) { + stop("error") + } + if (balance > 0) { + balance <- balance + + sum(gregexpr("{", line, fixed=TRUE)[[1]] > 0) - + sum(gregexpr("}", line, fixed=TRUE)[[1]] > 0) + return( findMatchingBrace(test, start+1, balance) ) + } + return(start - 1) + } + + ## Find the lines defining unit tests + testStarts <- grep("^[[:space:]]*[Tt]est\\.+", test) + + ## Get the line with the closing brace + testEnds <- sapply(testStarts, function(ind) { + findMatchingBrace(test, ind + 1) + }) + stopifnot( length(testStarts) == length(testEnds) ) + + ## Modify the function definition by wrapping it in gctorture + for (i in seq_along(testStarts)) { + start <- testStarts[i] + end <- testEnds[i] + test[start] <- paste( test[start], "gctorture(TRUE);" ) + test[end] <- paste("gctorture(FALSE); }") + } + + cat(test, file=file, sep="\n") + +} diff --git a/R/zzz.R b/R/zzz.R index 6dd34beff..1b23cd948 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -1,4 +1,4 @@ -# Copyright (C) 2009 - 2025 Dirk Eddelbuettel and Romain Francois +# Copyright (C) 2009 - 2013 Dirk Eddelbuettel and Romain Francois # # This file is part of Rcpp. # @@ -20,8 +20,7 @@ .classes_map <- new.env() .onLoad <- function(libname, pkgname){ - new_dummyObject(.dummyInstancePointer) # nocov start - - tools::vignetteEngine("asis", package = pkgname, pattern = "[.](pdf|html)[.]asis$", - weave = asisWeave, tangle = asisTangle) # nocov end + new_dummyObject(.dummyInstancePointer); } + + diff --git a/README.md b/README.md index b7bd39c3a..754750b2d 100644 --- a/README.md +++ b/README.md @@ -1,186 +1,91 @@ -## Rcpp: Seamless R and C++ Integration - -[![CI](https://github.com/RcppCore/Rcpp/workflows/ci/badge.svg)](https://github.com/RcppCore/Rcpp/actions?query=workflow%3Aci) -[![License](https://eddelbuettel.github.io/badges/GPL2+.svg)](https://www.gnu.org/licenses/gpl-2.0.html) -[![CRAN](https://www.r-pkg.org/badges/version/Rcpp)](https://cran.r-project.org/package=Rcpp) -[![Dependencies](https://tinyverse.netlify.app/badge/Rcpp)](https://cran.r-project.org/package=Rcpp) -[![Coverage Status](https://codecov.io/gh/RcppCore/Rcpp/graph/badge.svg)](https://app.codecov.io/github/RcppCore/Rcpp?branch=master) -[![Debian package](https://img.shields.io/debian/v/r-cran-rcpp/sid?color=brightgreen)](https://packages.debian.org/sid/r-cran-rcpp) -[![r-universe](https://rcppcore.r-universe.dev/badges/Rcpp)](https://rcppcore.r-universe.dev/Rcpp) -[![Last Commit](https://img.shields.io/github/last-commit/RcppCore/Rcpp)](https://github.com/RcppCore/Rcpp) -[![Downloads (monthly)](https://cranlogs.r-pkg.org/badges/Rcpp?color=brightgreen)](https://www.r-pkg.org/pkg/Rcpp) -[![Downloads (total)](https://cranlogs.r-pkg.org/badges/grand-total/Rcpp?color=brightgreen)](https://www.r-pkg.org/pkg/Rcpp) -[![CRAN use](https://jangorecki.gitlab.io/rdeps/Rcpp/CRAN_usage.svg?sanitize=true)](https://cran.r-project.org/package=Rcpp) -[![CRAN indirect](https://jangorecki.gitlab.io/rdeps/Rcpp/indirect_usage.svg?sanitize=true)](https://cran.r-project.org/package=Rcpp) -[![BioConductor use](https://jangorecki.gitlab.io/rdeps/Rcpp/BioC_usage.svg?sanitize=true)](https://cran.r-project.org/package=Rcpp) -[![JSS](https://img.shields.io/badge/JSS-10.18637%2Fjss.v040.i08-brightgreen)](https://doi.org/10.18637/jss.v040.i08) -[![Springer useR!](https://img.shields.io/badge/Springer%20useR!-10.1007%2F978--1--4614--6868--4-brightgreen)](https://www.amazon.com/gp/product/1461468671/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1461468671&linkCode=as2&tag=rcpp-20&linkId=3P5LNUWOAQ2YMEJ6) -[![TAS](https://img.shields.io/badge/TAS-10.1080%2F00031305.2017.1375990-brightgreen)](https://doi.org/10.1080/00031305.2017.1375990) - -### Synopsis - -The [Rcpp package](https://cran.r-project.org/package=Rcpp) integrates R and C++ via R functions and a (header-only) C++ library. - -All underlying R types and objects, _i.e._, everything a `SEXP` represents internally -in R, are matched to corresponding C++ objects. This covers anything from vectors, -matrices or lists to environments, functions and more. Each `SEXP` variant is -automatically mapped to a dedicated C++ class. For example, numeric vectors are -represented as instances of the `Rcpp::NumericVector` class, environments are -represented as instances of `Rcpp::Environment`, functions are represented as -`Rcpp::Function`, etc ... The -[Rcpp-introduction](https://cran.r-project.org/package=Rcpp/vignettes/Rcpp-introduction.pdf) -vignette (now published as a -[TAS paper](https://doi.org/10.1080/00031305.2017.1375990); an -[earlier introduction](https://cran.r-project.org/package=Rcpp/vignettes/Rcpp-jss-2011.pdf) -was also published as a [JSS paper](https://doi.org/10.18637/jss.v040.i08) -provides a good entry point to Rcpp as do the [Rcpp -website](https://www.rcpp.org), the [Rcpp -page](https://dirk.eddelbuettel.com/code/rcpp.html) and the [Rcpp -Gallery](https://gallery.rcpp.org). Full documentation is provided by the -[Rcpp book](https://www.amazon.com/gp/product/1461468671/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1461468671&linkCode=as2&tag=rcpp-20&linkId=3P5LNUWOAQ2YMEJ6). - -Other highlights: - -- The conversion from C++ to R and back is driven by the templates `Rcpp::wrap` +## Rcpp [![Build Status](https://travis-ci.org/RcppCore/Rcpp.png)](https://travis-ci.org/RcppCore/Rcpp) [![License](http://img.shields.io/badge/license-GPL%20%28%3E=%202%29-brightgreen.svg?style=flat)](http://www.gnu.org/licenses/gpl-2.0.html) + +### Seamless R and C++ Integration + +The [Rcpp package](http://cran.r-project.org/package=Rcpp) provides R functions as and a C++ library +facilitating the integration of R and C++ + +R data types (`SEXP`) are matched to C++ objects in a class hierarchy. All R +types are supported (vectors, functions, environment, etc ...) and each +type is mapped to a dedicated class. For example, numeric vectors are +represented as instances of the Rcpp::NumericVector class, environments are +represented as instances of Rcpp::Environment, functions are represented as +Rcpp::Function, etc ... +The +[Rcpp-introduction](http://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-introduction.pdf) +vignette (also published as a [JSS paper](http://www.jstatsoft.org/v40/i08/)) provides a good +entry point to Rcpp as do the [Rcpp website](http://www.rcpp.org), the +[Rcpp page](http://dirk.eddelbuettel.com/code/rcpp.html) and the +[Rcpp Gallery](http://gallery.rcpp.org). Full documentation +is provided by the [Rcpp book](http://www.rcpp.org/book/). + +Conversion from C++ to R and back is driven by the templates `Rcpp::wrap` and `Rcpp::as` which are highly flexible and extensible, as documented -in the [Rcpp-extending](https://cran.r-project.org/package=Rcpp/vignettes/Rcpp-extending.pdf) vignette. +in the [Rcpp-extending](http://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-extending.pdf) vignette. -- Rcpp also provides Rcpp modules, a framework that allows exposing -C++ functions and classes to the R level. The [Rcpp-modules](https://cran.r-project.org/package=Rcpp/vignettes/Rcpp-modules.pdf) vignette -details the current set of features of Rcpp-modules. +Rcpp also provides Rcpp modules, a framework that allows exposing +C++ functions and classes to the R level. The [Rcpp-modules](http://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-modules.pdf) vignette +details the current set of features of Rcpp-modules. -- Rcpp includes a concept called Rcpp sugar that brings many R functions +Rcpp includes a concept called Rcpp sugar that brings many R functions into C++. Sugar takes advantage of lazy evaluation and expression templates to achieve great performance while exposing a syntax that is much nicer -to use than the equivalent low-level loop code. The [Rcpp-sugar](https://cran.r-project.org/package=Rcpp/vignettes/Rcpp-sugar.pdf) +to use than the equivalent low-level loop code. The [Rcpp-sugar](http://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-sugar.pdf) gives an overview of the feature. -- Rcpp attributes provide a high-level syntax for declaring C++ +Rcpp attributes provide a high-level syntax for declaring C++ functions as callable from R and automatically generating the code required to invoke them. Attributes are intended to facilitate both interactive use of C++ within R sessions as well as to support R package development. Attributes are built on top of Rcpp modules and their implementation is based on previous work in the inline package. -See the [Rcpp-atttributes](https://cran.r-project.org/package=Rcpp/vignettes/Rcpp-attributes.pdf) vignettes for more details. - -### Documentation - -The package ships with ten pdf vignettes, including a [recent introduction to -Rcpp](https://cran.r-project.org/package=Rcpp/vignettes/Rcpp-introduction.pdf) now -published as a [paper in -TAS](https://doi.org/10.1080/00031305.2017.1375990) (and as a -[preprint in PeerJ](https://peerj.com/preprints/3188/)). Also available is an -[earlier -introduction](https://cran.r-project.org/package=Rcpp/vignettes/Rcpp-jss-2011.pdf) -which was published as a [JSS paper](https://doi.org/10.18637/jss.v040.i08). - -Among the other vignettes are the [Rcpp -FAQ](https://cran.r-project.org/package=Rcpp/vignettes/Rcpp-FAQ.pdf) and the -introduction to [Rcpp -Attributes](https://cran.r-project.org/package=Rcpp/vignettes/Rcpp-attributes.pdf). -Additional documentation is available via the [Rcpp book](https://www.amazon.com/gp/product/1461468671/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1461468671&linkCode=as2&tag=rcpp-20&linkId=3P5LNUWOAQ2YMEJ6) -by Eddelbuettel (2013, Springer); see 'citation("Rcpp")' for details. - -### Performance - -Rcpp follows the C++ motto of _"you pay only for what you use"_ and imposes -no _run-time_ performance penalty: Rcpp outperforms related packages in -direct comparison, see for example [this repo for -details](https://github.com/eddelbuettel/ldlasb). - -Compile-time performance can be tuned by selecting components. But it is also -worth noting that use of [`ccache`](https://ccache.dev/) will (strongly) -dominate all such possible component choices, we have [previously -recommended](https://dirk.eddelbuettel.com/blog/2017/11/27/) its use. +See the [Rcpp-atttributes](http://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-attributes.pdf) vignettes for more details. + +### Documentation + +The package ships with nine pdf vignettes. + +Additional documentation is available via the +[JSS paper](http://www.jstatsoft.org/v40/i08/) by Eddelbuettel and +Francois (2011, JSS) paper (corresponding to the 'intro' vignette) +and the [book](http://www.rcpp.org/book) by Eddelbuettel (2013, Springer); +see 'citation("Rcpp")' for details. ### Examples -The [Rcpp Gallery](https://gallery.rcpp.org) showcases over one hundred fully -documented and working examples. The -[package RcppExamples](https://cran.r-project.org/package=RcppExamples) contains a few basic -examples covering the core data types. +The [Rcpp Gallery](http://gallery.rcpp.org) showcases over 80 fully documented +and working examples. -A number of examples are included, as are well over one thousand unit tests which provide -additional usage examples. +A number of examples are included as are over 900 unit tests in over 460 unit +test functions provide additional usage examples. + +The [CRAN](http://cran.r-project.org) network contains +(as over early 2015) well over 300 packages which also provide usage +examples, with another 40+ as part of [BioConductor](http://www.bioconductor.org). An earlier version of Rcpp, containing what we now call the 'classic Rcpp API' was written during 2005 and 2006 by Dominick Samperi. This code has been factored out of Rcpp into the package RcppClassic, and it is still -available for code relying on the older interface. New development should +available for code relying on the older interface. New development should always use this Rcpp package instead. -Other usage examples are provided by packages using Rcpp. As of early July -2025, there are 3043 [CRAN](https://cran.r-project.org) packages using Rcpp -(corresponding to 13.6% of all packages, and 61.3% of packages containing -compiled code), a further 271 [BioConductor](https://www.bioconductor.org) -packages in its current release as well as an unknown number of GitHub, -Bitbucket, R-Forge, ... repositories using Rcpp. All these packages provide -usage examples for Rcpp. The package is in widespread use and has been -downloaded over 100.6 million times (per the partial logs from the cloud mirrors -of CRAN). - ### Installation -#### CRAN - -Rcpp released on CRAN are carefully tested and curated. CRAN ensures they interoperate -with all other CRAN package on all test environment. The released and tested versions -are available via all mirrors of [CRAN](https://cran.r-project.org) network, and can be -installed from within R via +Released and tested versions of Rcpp are available via the +[CRAN](http://cran.r-project.org) network, and can be installed from within R via ```R install.packages("Rcpp") ``` -#### Release Candidates - -We generally make interim _candidate_ releases available via the [r-universe -page](https://rcppcore.r-universe.dev/Rcpp). It provides a standard R repository which -corresponds to the current main branch in the source repository. Both binary and source -versions can be installed via - -```R -install.packages("Rcpp", repos = c("https://rcppcore.r-universe.dev", - "https://cloud.r-project.org")) -``` - -where other repos can be set as needed. - -Testing the release candidates prior to the actual release helps. Please run -this if you can. - -#### Source - To install from source, ensure you have a complete package development environment for R as discussed in the relevant documentation; also see questions 1.2 and 1.3 in the -[Rcpp-FAQ](https://cran.r-project.org/package=Rcpp/vignettes/Rcpp-FAQ.pdf). - -#### Less Common Versions and Platforms - -If you want to run Rcpp on another (not-tested on CRAN) platform, or on releases -older than the previous release, we suggest you do your due diligence and test -accordingly. Rcpp is provided by an all-volunteer team with finite resources. -We work hard to test Rcpp with several thousand CRAN packages using it---but -we cannot test on outdated versions of R or your OS. - -### Support - -The best place for questions is the -[Rcpp-devel](https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel) -mailing list hosted at R-forge. Note that in order to keep spam down, you must -be a subscriber in order to post. One can also consult the list archives to see -if your question has been asked before. - -The [issue tickets at the GitHub repo](https://github.com/RcppCore/Rcpp/issues) -are the primary bug reporting interface. As with the other web resources, -previous issues can be searched as well. - +[Rcpp-FAQ](http://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-FAQ.pdf). ### Authors -Dirk Eddelbuettel, Romain Francois, JJ Allaire, Kevin Ushey, Qiang Kou, -Nathan Russell, Iñaki Ucar, Doug Bates, and John Chambers +Dirk Eddelbuettel, Romain Francois, JJ Allaire, Kevin Ushey, Doug Bates, and John Chambers ### License diff --git a/Rcpp.Rproj b/Rcpp.Rproj index 8b300884d..566bd78d2 100644 --- a/Rcpp.Rproj +++ b/Rcpp.Rproj @@ -13,7 +13,7 @@ RnwWeave: Sweave LaTeX: pdfLaTeX AutoAppendNewline: Yes -StripTrailingWhitespace: Yes BuildType: Package +PackageUseDevtools: Yes PackageInstallArgs: --no-multiarch --with-keep.source diff --git a/cleanup b/cleanup index e334f7c5c..6d1b22e8c 100755 --- a/cleanup +++ b/cleanup @@ -1,4 +1,3 @@ -#!/bin/sh #cd inst/doc && rm -f index.html *.tex *.bbl *.blg *.aux *.out *.log && cd - @@ -26,16 +25,10 @@ rm -f confdefs.h config.log config.status \ src/symbols.rds \ inst/unitTests/testRcppClass/src/symbols.rds \ vignettes/*.aux vignettes/*.log vignettes/*.out \ - vignettes/*.tex vignettes/*.bbl vignettes/*.blg \ - vignettes/*.toc vignettes/*.tpt vignettes/*.xwm + vignettes/*.tex vignettes/*.bbl vignettes/*.blg rm -rf autom4te.cache inst/lib/ inst/doc/man/ inst/doc/html/ inst/doc/latex/ \ - inst/doc/auto inst/bib/auto inst/doc/Rcpp-*/auto/ src-* vignettes/auto \ - inst/tinytest/testRcppAttributePackage/inst \ - inst/tinytest/testRcppAttributePackage/R + inst/doc/auto inst/doc/Rcpp-*/auto/ src-* vignettes/auto find . -name \*~ -exec rm {} \; find . -name \*.flc -exec rm {} \; - -(test -d vignettes/ && cd vignettes/ && test -f Makefile && make clean && cd -) >/dev/null -(test -d vignettes/rmd && cd vignettes/rmd/ && test -f Makefile && make clean && cd -) >/dev/null diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 000000000..a71770b4a --- /dev/null +++ b/debian/changelog @@ -0,0 +1,409 @@ +rcpp (0.11.5-1) unstable; urgency=low + + * New upstream release + + -- Dirk Eddelbuettel Wed, 04 Mar 2015 14:30:22 -0600 + +rcpp (0.11.4-1) unstable; urgency=low + + * New upstream release + + * debian/control: Set Build-Depends: to current R version + + -- Dirk Eddelbuettel Sat, 24 Jan 2015 14:52:51 -0600 + +rcpp (0.11.3-1) unstable; urgency=low + + * New upstream release + + * debian/control: New (Build-)Depends: on r-cran-pkgkitten + + * debian/control: Set Build-Depends: to current R version + * debian/control: Set Standards-Version: to current version + + -- Dirk Eddelbuettel Mon, 29 Sep 2014 19:54:50 -0500 + +rcpp (0.11.2-1) unstable; urgency=low + + * New release + + * debian/control: Set Build-Depends: to current R version + + -- Dirk Eddelbuettel Fri, 06 Jun 2014 18:09:54 -0500 + +rcpp (0.11.1-1) unstable; urgency=low + + * New release + + * debian/control: Set Build-Depends: to current R version + + -- Dirk Eddelbuettel Thu, 13 Mar 2014 20:20:11 -0500 + +rcpp (0.11.0-1) unstable; urgency=low + + * New release + + -- Dirk Eddelbuettel Sun, 02 Feb 2014 08:22:46 -0600 + +rcpp (0.10.6-1) unstable; urgency=low + + * New release + * debian/control: Set Build-Depends: to current R version + * debian/control: Set Standards-Version: to current version + * debian/control: Add 'r-cran-codetools' to Build-Depends (as it is + used at preparation for LazyLoading stage) + + -- Dirk Eddelbuettel Tue, 29 Oct 2013 09:42:30 -0500 + +rcpp (0.10.5-1) unstable; urgency=low + + * New release + + * debian/control: Set Build-Depends: to current R version + + -- Dirk Eddelbuettel Sat, 28 Sep 2013 07:28:48 -0500 + +rcpp (0.10.4-1) unstable; urgency=low + + * New release + + * debian/control: Set Build-Depends: to current R version + + -- Dirk Eddelbuettel Sun, 23 Jun 2013 09:02:24 -0500 + +rcpp (0.10.3-2) unstable; urgency=low + + * debian/control: Set Build-Depends: to current R version + + * (Re-)building with R 3.0.0 (beta) + + -- Dirk Eddelbuettel Sat, 30 Mar 2013 18:04:44 -0500 + +rcpp (0.10.3-1) unstable; urgency=low + + * New release + + * src/Timer.cpp: Changed to permit *BSD builds (Closes: #697032) + + -- Dirk Eddelbuettel Sat, 23 Mar 2013 07:42:26 -0500 + +rcpp (0.10.2-1) unstable; urgency=low + + * New release + + -- Dirk Eddelbuettel Fri, 21 Dec 2012 06:22:53 -0600 + +rcpp (0.10.1-1) unstable; urgency=low + + * New release + + * inst/include/Rcpp/iostream/Rostream.h: Additional fix that didn't make + it into 0.10.1 + + -- Dirk Eddelbuettel Tue, 27 Nov 2012 08:20:54 -0600 + +rcpp (0.10.0-1) unstable; urgency=low + + * New release + + -- Dirk Eddelbuettel Tue, 13 Nov 2012 19:55:10 -0600 + +rcpp (0.9.15-1) unstable; urgency=low + + * New release + + -- Dirk Eddelbuettel Sat, 13 Oct 2012 16:01:04 -0500 + +rcpp (0.9.14-1) unstable; urgency=low + + * New release + + -- Dirk Eddelbuettel Sun, 30 Sep 2012 08:07:51 -0500 + +rcpp (0.9.13-1) unstable; urgency=low + + * New release + + -- Dirk Eddelbuettel Thu, 28 Jun 2012 21:20:47 -0500 + +rcpp (0.9.12-1) unstable; urgency=low + + * New release + + -- Dirk Eddelbuettel Sat, 23 Jun 2012 11:20:06 -0500 + +rcpp (0.9.11-1) unstable; urgency=low + + * New release + + * debian/control: Set Build-Depends: to current R version + * debian/control: Change Depends to ${R:Depends} + * debian/control: Set Standards-Version: to current version + + -- Dirk Eddelbuettel Fri, 22 Jun 2012 06:22:00 -0500 + +rcpp (0.9.10-1) unstable; urgency=low + + * New release + + * debian/control: Updated (Build-)Depends: to current R version + + -- Dirk Eddelbuettel Wed, 15 Feb 2012 07:10:16 -0600 + +rcpp (0.9.9-1) unstable; urgency=low + + * New release + + -- Dirk Eddelbuettel Sun, 25 Dec 2011 09:30:03 -0600 + +rcpp (0.9.8-1) unstable; urgency=low + + * New release + + * debian/control: Updated Standard-Versions: to current version + * debian/control: Updated (Build-)Depends: to current R version + + -- Dirk Eddelbuettel Wed, 21 Dec 2011 10:50:09 -0600 + +rcpp (0.9.7-1) unstable; urgency=low + + * New release + + -- Dirk Eddelbuettel Thu, 29 Sep 2011 14:53:21 -0500 + +rcpp (0.9.6-1) unstable; urgency=low + + * New release + + -- Dirk Eddelbuettel Tue, 26 Jul 2011 19:18:20 -0500 + +rcpp (0.9.5-1) unstable; urgency=low + + * New release + + -- Dirk Eddelbuettel Tue, 05 Jul 2011 21:14:26 -0500 + +rcpp (0.9.4-1) unstable; urgency=low + + * New release + + -- Dirk Eddelbuettel Tue, 12 Apr 2011 10:12:37 -0500 + +rcpp (0.9.3-1) unstable; urgency=low + + * New release + + -- Dirk Eddelbuettel Tue, 05 Apr 2011 12:11:12 -0500 + +rcpp (0.9.2-1) unstable; urgency=low + + * New release + + -- Dirk Eddelbuettel Wed, 23 Feb 2011 13:58:14 -0600 + +rcpp (0.9.1-1) unstable; urgency=low + + * New release + + -- Dirk Eddelbuettel Mon, 14 Feb 2011 06:54:24 -0600 + +rcpp (0.9.0-1) unstable; urgency=low + + * New release + + -- Dirk Eddelbuettel Sun, 19 Dec 2010 18:35:01 -0600 + +rcpp (0.8.9-1) unstable; urgency=low + + * New release + + -- Dirk Eddelbuettel Sat, 27 Nov 2010 22:53:27 -0600 + +rcpp (0.8.8-1) unstable; urgency=low + + * New release + + -- Dirk Eddelbuettel Mon, 01 Nov 2010 17:16:36 -0500 + +rcpp (0.8.7-1) unstable; urgency=low + + * New release + + -- Dirk Eddelbuettel Fri, 15 Oct 2010 05:12:31 -0500 + +rcpp (0.8.6-1) unstable; urgency=low + + * New release + + -- Dirk Eddelbuettel Thu, 09 Sep 2010 12:21:21 -0500 + +rcpp (0.8.5-1) unstable; urgency=low + + * New release + + -- Dirk Eddelbuettel Sun, 25 Jul 2010 11:34:27 -0500 + +rcpp (0.8.4-1) unstable; urgency=low + + * New release + + -- Dirk Eddelbuettel Fri, 09 Jul 2010 09:39:20 -0500 + +rcpp (0.8.3-1) unstable; urgency=low + + * New release + + -- Dirk Eddelbuettel Sun, 27 Jun 2010 16:40:23 -0500 + +rcpp (0.8.2-1) unstable; urgency=low + + * New release + + -- Dirk Eddelbuettel Wed, 09 Jun 2010 11:03:23 -0500 + +rcpp (0.8.1-1) unstable; urgency=low + + * New release + + -- Dirk Eddelbuettel Tue, 08 Jun 2010 05:18:34 -0500 + +rcpp (0.8.0-1) unstable; urgency=low + + * New release + + -- Dirk Eddelbuettel Mon, 17 May 2010 06:41:54 -0500 + +rcpp (0.7.12-1) unstable; urgency=low + + * New release + + -- Dirk Eddelbuettel Fri, 16 Apr 2010 06:23:46 -0500 + +rcpp (0.7.11-1) unstable; urgency=low + + * New release + + -- Dirk Eddelbuettel Fri, 26 Mar 2010 15:14:58 -0500 + +rcpp (0.7.10-1) unstable; urgency=low + + * New release + + -- Dirk Eddelbuettel Mon, 15 Mar 2010 14:58:40 -0500 + +rcpp (0.7.9-1) unstable; urgency=low + + * New release + + -- Dirk Eddelbuettel Fri, 12 Mar 2010 12:25:52 -0600 + +rcpp (0.7.8-1) unstable; urgency=low + + * New release + + -- Dirk Eddelbuettel Tue, 09 Mar 2010 11:39:12 -0600 + +rcpp (0.7.7-1) unstable; urgency=low + + * New release + + -- Dirk Eddelbuettel Sun, 14 Feb 2010 11:53:46 -0600 + +rcpp (0.7.6-1) unstable; urgency=low + + * New release + + -- Dirk Eddelbuettel Fri, 12 Feb 2010 21:50:34 -0600 + +rcpp (0.7.5-1) unstable; urgency=low + + * New release + + -- Dirk Eddelbuettel Mon, 08 Feb 2010 09:36:13 -0600 + +rcpp (0.7.4-1) unstable; urgency=low + + * New release + + -- Dirk Eddelbuettel Sat, 30 Jan 2010 14:36:24 -0600 + +rcpp (0.7.3-1) unstable; urgency=low + + * New release + + -- Dirk Eddelbuettel Thu, 21 Jan 2010 20:42:07 -0600 + +rcpp (0.7.2-1) unstable; urgency=low + + * New release + + -- Dirk Eddelbuettel Tue, 12 Jan 2010 20:41:16 -0600 + +rcpp (0.7.1-1) unstable; urgency=low + + * New release + + -- Dirk Eddelbuettel Sat, 02 Jan 2010 15:38:09 -0600 + +rcpp (0.7.0-1) unstable; urgency=low + + * New release + + * debian/control: Added littler to Depends: as examples use it [lintian] + + -- Dirk Eddelbuettel Sat, 19 Dec 2009 14:18:32 -0600 + +rcpp (0.6.8-1) unstable; urgency=low + + * New release + + -- Dirk Eddelbuettel Tue, 10 Nov 2009 07:34:07 -0600 + +rcpp (0.6.7-1) unstable; urgency=low + + * New release + + * debian/control: Updated Standard-Versions: to current version + * debian/control: Updated (Build-)Depends: to current R version + + -- Dirk Eddelbuettel Sun, 08 Nov 2009 19:22:53 -0600 + +rcpp (0.6.6-1) unstable; urgency=low + + * New release + + * debian/control: Updated Standard-Versions: to current version + * debian/control: Updated (Build-)Depends: to current R version + + -- Dirk Eddelbuettel Mon, 03 Aug 2009 14:55:48 -0500 + +rcpp (0.6.5-1) unstable; urgency=low + + * New release + + * COPYING: Added license file (Closes: #522202) + + -- Dirk Eddelbuettel Wed, 01 Apr 2009 21:34:33 -0500 + +rcpp (0.6.4-1) unstable; urgency=low + + * New release + + * debian/r-cran-rcpp.lintian-overrides: Added to suppress lintian + warnings over Doxygen-generated png files + + -- Dirk Eddelbuettel Sun, 01 Mar 2009 17:41:58 -0600 + +rcpp (0.6.3-1) unstable; urgency=low + + * New release + + -- Dirk Eddelbuettel Fri, 09 Jan 2009 20:41:35 -0600 + +rcpp (0.6.2-1) unstable; urgency=low + + * Initial Debian release (Closes: #507941) + + -- Dirk Eddelbuettel Fri, 05 Dec 2008 19:58:31 -0600 + + diff --git a/inst/tinytest/testRcppPackage/debian/compat b/debian/compat similarity index 100% rename from inst/tinytest/testRcppPackage/debian/compat rename to debian/compat diff --git a/debian/control b/debian/control new file mode 100644 index 000000000..e7e461a9d --- /dev/null +++ b/debian/control @@ -0,0 +1,22 @@ +Source: rcpp +Section: gnu-r +Priority: optional +Maintainer: Dirk Eddelbuettel +Build-Depends: debhelper (>= 7.0.0), r-base-dev (>= 3.1.2), cdbs, r-cran-codetools, r-cran-pkgkitten +Standards-Version: 3.9.6 +Homepage: http://dirk.eddelbuettel.com/code/rcpp.html + +Package: r-cran-rcpp +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, ${R:Depends}, littler, r-cran-pkgkitten +Suggests: r-cran-inline +Description: GNU R package for Seamless R and C++ Integration + The Rcpp package provides R functions as well as C++ classes which + offer a seamless integration of R and C++. Many R data types and objects can be + mapped back and forth to C++ equivalents which facilitates both writing of new + code as well as easier integration of third-party libraries. Documentation + about Rcpp is provided by several vignettes included in this package, via the + Rcpp Gallery site at http://gallery.rcpp.org, the paper by Eddelbuettel and + Francois (2011, JSS), and the book by Eddelbuettel (2013, Springer); see + 'citation("Rcpp")' for details on these last two. + diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 000000000..ce62ff85f --- /dev/null +++ b/debian/copyright @@ -0,0 +1,57 @@ +This is the Debian GNU/Linux r-cran-rcpp package of Rcpp, an +R / C++ interface package. Rcpp was written by Dominick Samperi, +Dirk Eddelbuettel and Romain Francois. + +This package was created by Dirk Eddelbuettel . +The sources were downloaded from the main CRAN site + http://cran.r-project.org/src/contrib/ +and are also available from all CRAN mirrors as e.g. + http://cran.us.r-project.org/src/contrib/ +as well the GitHub repo + http://github.com/RcppCore/Rcpp + +The package was renamed from its upstream name 'Rcpp' to +'r-cran-rcpp' to fit the pattern of CRAN (and non-CRAN) packages for +R. + +Copyright (C) 2005 - 2006 Dominick Samperi +Copyright (C) 2008 Dirk Eddelbuettel +Copyright (C) 2009 - 2013 Dirk Eddelbuettel and Romain Francois + +Portions Copyright (C) 2008 Simon Urbanek +Portions Copyright (C) 2010 Doug Bates +Portions Copyright (C) 2010 John M Chambers + +License: GPL-2 + +On a Debian GNU/Linux system, the GPL license (version 2) is included +in the file /usr/share/common-licenses/GPL-2. + +For reference, the upstream DESCRIPTION file is included below: + + Package: Rcpp + Title: Rcpp R/C++ interface package + Version: 0.7.3 + Date: $Date: 2010-01-18 13:08:15 -0600 (Mon, 18 Jan 2010) $ + Author: Dirk Eddelbuettel and Romain Francois, with contributions + by Simon Urbanek and David Reiss; based on code written during + 2005 and 2006 by Dominick Samperi + Maintainer: Dirk Eddelbuettel + Description: R/C++ interface classes and examples + The Rcpp library maps data types betweeen R and C++, and includes support + for R types real, integer, character, vector, matrix, Date, datetime (i.e. + POSIXct) at microsecond resolution, data frame, and function. Transfer to and + from simple SEXP objects is particular easy. Calling R functions from C++ is + also supported. + . + C++ code can be 'inlined' by using the 'inline' package which will create a + C++ function and compile, link and load it given the 'inlined' character + argument which makes C++ integration very easy. + . + Several examples are included. + Depends: R (>= 2.0.0) + Suggests: inline (>= 0.3.4), RUnit + SystemRequirements: None + URL: http://dirk.eddelbuettel.com/code/rcpp.html, + http://romainfrancois.blog.free.fr/index.php?category/R-package/Rcpp + License: GPL (>= 2) diff --git a/debian/r-cran-rcpp.lintian-overrides b/debian/r-cran-rcpp.lintian-overrides new file mode 100644 index 000000000..cee8f9431 --- /dev/null +++ b/debian/r-cran-rcpp.lintian-overrides @@ -0,0 +1,84 @@ +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.RObject.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.XPTr.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.environments.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.evaluator.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.exceptions.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.RObject.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.XPTr.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.environments.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.evaluator.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.exceptions.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/examples/ConvolveBenchmarks/convolve2.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/examples/ConvolveBenchmarks/exampleRCode.r +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.CharacterVector.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.ComplexVector.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.ExpressionVector.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.Function.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.GenericVector.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.IntegerVector.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.Language.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.NumericVector.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.Pairlist.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.RawVector.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.S4.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.Symbol.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.as.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.wrap.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/discovery/cxx0x.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.RcppDate.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.RcppDatetime.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.RcppMatrix.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.RcppMatrixView.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.RcppParams.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.RcppResultSet.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.RcppVector.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.RcppVectorView.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.clone.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.traits.R +r-cran-rcpp: script-uses-bin-env usr/lib/R/site-library/Rcpp/discovery/cxx0x.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.Column.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.Matrix.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.Row.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.macros.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.Argument.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.RcppFrame.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.Vector.create.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.DataFrame.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.Dimension.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.Formula.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.client.package.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.Module.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.complex.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.Date.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.Datetime.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.sugar.R +r-cran-rcpp: executable-not-elf-or-script ./usr/lib/R/site-library/Rcpp/examples/SugarPerformance/sugarBenchmarks.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.RcppMisc.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.Vector.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.misc.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.stats.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/examples/ConvolveBenchmarks/buildAndRun.sh +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/examples/ConvolveBenchmarks/overhead.r +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/examples/functionCallback/buildAndRun.sh +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.Module.client.package.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.modref.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.support.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/examples/Misc/ifelseLooped.r +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/examples/OpenMP/OpenMPandInline.r +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.int64.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.rcout.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.sugarOps.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/examples/Misc/newFib.r +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.rmath.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.String.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.wstring.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.Reference.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/examples/ConvolveBenchmarks/overhead.sh +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.na.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.subset.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.table.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.attributes.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.InternalFunction.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.InternalFunctionCPP11.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.binary.package.R +r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.sugar.var.R diff --git a/debian/rules b/debian/rules new file mode 100755 index 000000000..611c94bb6 --- /dev/null +++ b/debian/rules @@ -0,0 +1,6 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# debian/rules file for the Debian/GNU Linux rcpp package +# Copyright 2003-2013 by Dirk Eddelbuettel + +include /usr/share/R/debian/r-cran.mk diff --git a/inst/tinytest/testRcppPackage/debian/source/format b/debian/source/format similarity index 100% rename from inst/tinytest/testRcppPackage/debian/source/format rename to debian/source/format diff --git a/debian/watch b/debian/watch new file mode 100644 index 000000000..79f94fe40 --- /dev/null +++ b/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://cran.r-project.org/src/contrib/Rcpp_([-\d\.]*)\.tar.gz diff --git a/docker/ci-3.4/Dockerfile b/docker/ci-3.4/Dockerfile deleted file mode 100644 index fc4508a2e..000000000 --- a/docker/ci-3.4/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -## Emacs, make this -*- mode: sh; -*- - -FROM r-base:3.4.4 - -LABEL org.label-schema.license="GPL-2.0" \ - org.label-schema.vcs-url="https://github.com/RcppCore/Rcpp" \ - maintainer="Dirk Eddelbuettel " - -RUN apt-get update \ - && apt-get install -y --no-install-recommends \ - git \ - && install.r inline pkgKitten rbenchmark tinytest - -ENV _R_CHECK_FORCE_SUGGESTS_ FALSE -ENV _R_CHECK_TESTS_NLINES_ 0 -ENV RunAllRcppTests yes - -CMD ["bash"] diff --git a/docker/ci-3.5/Dockerfile b/docker/ci-3.5/Dockerfile deleted file mode 100644 index 601ad219e..000000000 --- a/docker/ci-3.5/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -## Emacs, make this -*- mode: sh; -*- - -FROM r-base:3.5.3 - -LABEL org.label-schema.license="GPL-2.0" \ - org.label-schema.vcs-url="https://github.com/RcppCore/Rcpp" \ - maintainer="Dirk Eddelbuettel " - -RUN apt-get update \ - && apt-get install -y --no-install-recommends git \ - && install.r inline pkgKitten rbenchmark tinytest - -ENV _R_CHECK_FORCE_SUGGESTS_ FALSE -ENV _R_CHECK_TESTS_NLINES_ 0 -ENV RunAllRcppTests yes - -CMD ["bash"] diff --git a/docker/ci-3.6/Dockerfile b/docker/ci-3.6/Dockerfile deleted file mode 100644 index ba31bd715..000000000 --- a/docker/ci-3.6/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -## Emacs, make this -*- mode: sh; -*- - -FROM r-base:3.6.3 - -LABEL org.label-schema.license="GPL-2.0" \ - org.label-schema.vcs-url="https://github.com/RcppCore/Rcpp" \ - maintainer="Dirk Eddelbuettel " - -RUN apt-get update \ - && apt-get install -y --no-install-recommends git \ - && install.r inline pkgKitten rbenchmark tinytest - -ENV _R_CHECK_FORCE_SUGGESTS_ FALSE -ENV _R_CHECK_TESTS_NLINES_ 0 -ENV RunAllRcppTests yes - -CMD ["bash"] diff --git a/docker/ci-4.0/Dockerfile b/docker/ci-4.0/Dockerfile deleted file mode 100644 index a4247878f..000000000 --- a/docker/ci-4.0/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -## Emacs, make this -*- mode: sh; -*- - -FROM r-base:4.0.5 - -LABEL org.label-schema.license="GPL-2.0" \ - org.label-schema.vcs-url="https://github.com/RcppCore/Rcpp" \ - maintainer="Dirk Eddelbuettel " - -RUN apt-get update \ - && apt-get install -y --no-install-recommends git \ - && install.r inline pkgKitten rbenchmark tinytest - -ENV _R_CHECK_FORCE_SUGGESTS_ FALSE -ENV _R_CHECK_TESTS_NLINES_ 0 -ENV RunAllRcppTests yes - -CMD ["bash"] diff --git a/docker/ci-4.1/Dockerfile b/docker/ci-4.1/Dockerfile deleted file mode 100644 index 9c73b601d..000000000 --- a/docker/ci-4.1/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -## Emacs, make this -*- mode: sh; -*- - -FROM r-base:4.1.3 - -LABEL org.label-schema.license="GPL-2.0" \ - org.label-schema.vcs-url="https://github.com/RcppCore/Rcpp" \ - maintainer="Dirk Eddelbuettel " - -RUN apt-get update \ - && apt-get install -y --no-install-recommends git \ - && install.r inline pkgKitten rbenchmark tinytest - -ENV _R_CHECK_FORCE_SUGGESTS_ FALSE -ENV _R_CHECK_TESTS_NLINES_ 0 -ENV RunAllRcppTests yes - -CMD ["bash"] diff --git a/docker/ci-4.2/Dockerfile b/docker/ci-4.2/Dockerfile deleted file mode 100644 index 01cecbc16..000000000 --- a/docker/ci-4.2/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -## Emacs, make this -*- mode: sh; -*- - -FROM r-base:4.2.3 - -LABEL org.label-schema.license="GPL-2.0" \ - org.label-schema.vcs-url="https://github.com/RcppCore/Rcpp" \ - maintainer="Dirk Eddelbuettel " - -RUN apt-get update \ - && apt-get install -y --no-install-recommends git \ - && install.r inline pkgKitten rbenchmark tinytest - -ENV _R_CHECK_FORCE_SUGGESTS_ FALSE -ENV _R_CHECK_TESTS_NLINES_ 0 -ENV RunAllRcppTests yes - -CMD ["bash"] diff --git a/docker/ci-4.3/Dockerfile b/docker/ci-4.3/Dockerfile deleted file mode 100644 index 34e2ed8d9..000000000 --- a/docker/ci-4.3/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -## Emacs, make this -*- mode: sh; -*- - -FROM r-base:4.3.3 - -LABEL org.label-schema.license="GPL-2.0" \ - org.label-schema.vcs-url="https://github.com/RcppCore/Rcpp" \ - maintainer="Dirk Eddelbuettel " - -RUN apt-get update \ - && apt-get install -y --no-install-recommends git \ - && install.r inline pkgKitten rbenchmark tinytest - -ENV _R_CHECK_FORCE_SUGGESTS_ FALSE -ENV _R_CHECK_TESTS_NLINES_ 0 -ENV RunAllRcppTests yes - -CMD ["bash"] diff --git a/docker/ci-4.4/Dockerfile b/docker/ci-4.4/Dockerfile deleted file mode 100644 index dd50e1f7d..000000000 --- a/docker/ci-4.4/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -## Emacs, make this -*- mode: sh; -*- - -FROM r-base:4.4.3 - -LABEL org.label-schema.license="GPL-2.0" \ - org.label-schema.vcs-url="https://github.com/RcppCore/Rcpp" \ - maintainer="Dirk Eddelbuettel " - -RUN apt-get update \ - && apt-get install -y --no-install-recommends git \ - && install.r inline pkgKitten rbenchmark tinytest - -ENV _R_CHECK_FORCE_SUGGESTS_=FALSE -ENV _R_CHECK_TESTS_NLINES_=0 -ENV RunAllRcppTests=yes - -CMD ["bash"] diff --git a/docker/ci-dev/Dockerfile b/docker/ci-dev/Dockerfile deleted file mode 100644 index 66d8cb71f..000000000 --- a/docker/ci-dev/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -## Emacs, make this -*- mode: sh; -*- - -FROM rocker/drd - -LABEL org.label-schema.license="GPL-2.0" \ - org.label-schema.vcs-url="https://github.com/RcppCore/Rcpp" \ - maintainer="Dirk Eddelbuettel " - -RUN rm -f /etc/apt/sources.list.d/experimental.list \ - && apt update -y \ - && apt install -y --no-install-recommends git \ - && RDscript -e 'install.packages(c("codetools", "inline", "pkgKitten", "rbenchmark", "tinytest"))' - -ENV _R_CHECK_FORCE_SUGGESTS_ FALSE -ENV _R_CHECK_TESTS_NLINES_ 0 -ENV RunAllRcppTests yes - -CMD ["bash"] diff --git a/docker/ci/Dockerfile b/docker/ci/Dockerfile deleted file mode 100644 index 494c47d67..000000000 --- a/docker/ci/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -## Emacs, make this -*- mode: sh; -*- - -FROM rocker/r2u:latest - -LABEL org.label-schema.license="GPL-2.0" \ - org.label-schema.vcs-url="https://github.com/RcppCore/Rcpp" \ - maintainer="Dirk Eddelbuettel " - -RUN apt-get update \ - && apt-get install -y --no-install-recommends \ - libcurl4-openssl-dev \ - libssl-dev \ - r-cran-covr \ - r-cran-inline \ - r-cran-pkgkitten \ - r-cran-tinytest \ - r-cran-xml2 \ - git \ - && install.r rbenchmark - -ENV _R_CHECK_FORCE_SUGGESTS_ FALSE -ENV _R_CHECK_TESTS_NLINES_ 0 -ENV RunAllRcppTests yes - -CMD ["bash"] diff --git a/docker/plus/Dockerfile b/docker/plus/Dockerfile deleted file mode 100644 index 22504eaa8..000000000 --- a/docker/plus/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -## Emacs, make this -*- mode: sh; -*- - -FROM rcpp/run - -LABEL org.label-schema.license="GPL-2.0" \ - org.label-schema.vcs-url="https://github.com/RcppCore/Rcpp" \ - maintainer="Dirk Eddelbuettel " - -RUN apt-get update \ - && apt-get install -y --no-install-recommends \ - r-cran-bh \ - r-cran-bit64 \ - r-cran-curl \ - r-cran-httr \ - r-cran-knitr \ - r-cran-lazyeval \ - r-cran-microbenchmark \ - r-cran-openssl \ - r-cran-pinp \ - r-cran-rcpparmadillo \ - r-cran-rcppeigen \ - r-cran-rcppgsl \ - r-cran-rmarkdown \ - r-cran-runit \ - r-cran-withr - -CMD ["bash"] diff --git a/docker/run/Dockerfile b/docker/run/Dockerfile deleted file mode 100644 index 179f730a9..000000000 --- a/docker/run/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -## Emacs, make this -*- mode: sh; -*- - -FROM rcpp/ci - -LABEL org.label-schema.license="GPL-2.0" \ - org.label-schema.vcs-url="https://github.com/RcppCore/Rcpp" \ - maintainer="Dirk Eddelbuettel " - -## If on CRAN, install the latest version from CRAN -RUN install.r Rcpp - -## Alternatively, install from Github (after first installing remotes) -#RUN install.r remotes && installGithub.r RcppCore/Rcpp - -CMD ["bash"] diff --git a/inst/CITATION b/inst/CITATION index 3e761e663..49f85fcba 100644 --- a/inst/CITATION +++ b/inst/CITATION @@ -1,41 +1,32 @@ -bibentry("Manual", - other = unlist(citation(auto = meta), recursive = FALSE)) +citHeader("To cite Rcpp in publications use:") -bibentry("Article", - title = "{Rcpp}: Seamless {R} and {C++} Integration", - author = c(person("Dirk", "Eddelbuettel", - email = "edd@debian.org", - comment = c(ORCID = "0000-0001-6419-907X")), - person("Romain", "Fran\\c{c}ois")), - journal = "Journal of Statistical Software", - year = "2011", - volume = "40", - number = "8", - pages = "1--18", - doi = "10.18637/jss.v040.i08") +citEntry(entry = "Article", + title = "{Rcpp}: Seamless {R} and {C++} Integration", + author = personList(as.person("Dirk Eddelbuettel"), + as.person("Romain Fran\\c{c}ois")), + journal = "Journal of Statistical Software", + year = "2011", + volume = "40", + number = "8", + pages = "1--18", + url = "http://www.jstatsoft.org/v40/i08/", -bibentry("Book", - title = "Seamless {R} and {C++} Integration with {Rcpp}", - author = person("Dirk", "Eddelbuettel", - email = "edd@debian.org", - comment = c(ORCID = "0000-0001-6419-907X")), - publisher = "Springer", - address = "New York", - year = 2013, - note = "ISBN 978-1-4614-6867-7", - doi = "10.1007/978-1-4614-6868-4") + textVersion = + paste("Dirk Eddelbuettel and Romain Francois (2011).", + "Rcpp: Seamless R and C++ Integration.", + "Journal of Statistical Software, 40(8), 1-18.", + "URL http://www.jstatsoft.org/v40/i08/.") +) -bibentry("Article", - title = "{Extending {R} with {C++}: A Brief Introduction to {Rcpp}}", - author = c(person("Dirk", "Eddelbuettel", - email = "edd@debian.org", - comment = c(ORCID = "0000-0001-6419-907X")), - person("James Joseph", "Balamuta", - email = "balamut2@illinois.edu", - comment = c(ORCID = "0000-0003-2826-8458"))), - journal = "The American Statistician", - year = "2018", - volume = "72", - number = "1", - pages = "28-36", - doi = "10.1080/00031305.2017.1375990") +citEntry(entry = "Book", + title = "Seamless {R} and {C++} Integration with {Rcpp}", + author = personList(as.person("Dirk Eddelbuettel")), + publisher = "Springer", + address = "New York", + year = 2013, + note = "ISBN 978-1-4614-6867-7", + + textVersion = paste("Eddelbuettel, Dirk (2013)", + "Seamless R and C++ Integration with Rcpp.", + "Springer, New York. ISBN 978-1-4614-6867-7.") +) diff --git a/inst/NEWS.Rd b/inst/NEWS.Rd index fc57a2e39..9a8b1691d 100644 --- a/inst/NEWS.Rd +++ b/inst/NEWS.Rd @@ -1,1543 +1,6 @@ \name{NEWS} -\title{News for Package \pkg{Rcpp}} -\newcommand{\ghpr}{\href{https://github.com/RcppCore/Rcpp/pull/#1}{##1}} -\newcommand{\ghit}{\href{https://github.com/RcppCore/Rcpp/issues/#1}{##1}} - -\section{Changes in Rcpp release version 1.1.1 (2026-01-xx)}{ - \itemize{ - \item Changes in Rcpp API: - \itemize{ - \item An unused old R function for a compiler version check has been - removed after checking no known package uses it (Dirk in \ghpr{1395}) - \item A narrowing warning is avoided via a cast (Dirk in \ghpr{1398}) - \item Demangling checks have been simplified (Iñaki in \ghpr{1401} - addressing \ghit{1400}) - \item The treatment of signed zeros is now improved in the Sugar code - (Iñaki in \ghpr{1404}) - \item Preparations for phasing out use of \code{Rf_error} have been - made (Iñaki in \ghpr{1407}) - \item The long-deprecated function \code{loadRcppModules()} has been - removed (Dirk in \ghpr{1416} closing \ghit{1415}) - \item Some non-API includes from R were refactored to accommodate - R-devel changes (Iñaki in \ghpr{1418} addressing \ghit{1417}) - \item An accessor to \code{Rf_rnbeta} has been removed (Dirk in - \ghpr{1419} also addressing \ghit{1420}) - \item Code accessing non-API \code{Rf_findVarInFrame} now uses - \code{R_getVarEx} (Dirk in \ghpr{1423} fixing \ghit{1421}) - \item Code conditional on the R version now expects at least R 3.5.0; - older code has been removed (Dirk in \ghpr{1426} fixing \ghit{1425}) - \item The non-API \code{ATTRIB} entry point to the R API is no longer - used (Dirk in \ghpr{1430} addressing \ghit{1429}) - \item The unwind-protect mechanism is now used unconditionally (Dirk - in \ghpr{1437} closing \ghit{1436}) - } - \item Changes in Rcpp Attributes: - \itemize{ - \item The OpenMP plugin has been generalized for different macOS - compiler installations (Kevin in \ghpr{1414}) - } - \item Changes in Rcpp Documentation: - \itemize{ - \item Vignettes are now processed via a new "asis" processor adopted - from \pkg{R.rsp} (Dirk in \ghpr{1394} fixing \ghit{1393}) - \item R is now cited via its DOI (Dirk) - \item A (very) stale help page has been removed (Dirk in \ghpr{1428} - fixing \ghit{1427}) - \item The main README.md was updated emphasizing r-universe in favor of - the local drat repos (Dirk in \ghpr{1431}) - } - \item Changes in Rcpp Deployment: - \itemize{ - \item A temporary change in R-devel concerning NA part in complex variables - was accommodated, and then reverted (Dirk in \ghpr{1399} fixing \ghit{1397}) - \item The macOS CI runners now use macos-14 (Dirk in \ghpr{1405}) - \item A message is shown if \code{R.h} is included before Rcpp headers - as this can lead to errors (Dirk in \ghpr{1411} closing \ghit{1410}) - \item Old helper functions use \code{message()} to signal they are not used, - deprecation and removal to follow (Dirk in \ghpr{1413} closing - \ghit{1412}) - \item Three tests were being silenced following \ghpr{1413} (Dirk in - \ghpr{1422}) - \item The heuristic whether to run all available tests was refined - (Dirk in \ghpr{1434} addressing \ghit{1433}) - \item Coverage has been tweaked via additional \code{#nocov} tags (Dirk - in \ghpr{1435}) - } - } -} - -\section{Changes in Rcpp release version 1.1.0 (2025-07-01)}{ - \itemize{ - \item Changes in Rcpp API: - \itemize{ - \item C++11 is now the required minimal C++ standard - \item The \code{std::string_view} type is now covered by \code{wrap()} - (Lev Kandel in \ghpr{1356} as discussed in \ghit{1357}) - \item A last remaining \code{DATAPTR} use has been converted to - \code{DATAPTR_RO} (Dirk in \ghpr{1359}) - \item Under R 4.5.0 or later, \code{R_ClosureEnv} is used instead of - \code{CLOENV} (Dirk in \ghpr{1361} fixing \ghpr{1360}) - \item Use of \code{lsInternal} switched to \code{lsInternal3} (Dirk in - #1362) - \item Removed compiler detection macro in a header cleanup setting - C++11 as the minunum (Dirk in \ghpr{1364} closing \ghit{1363}) - \item Variadic templates are now used onconditionally given C++11 (Dirk - in \ghpr{1367} closing \ghit{1366}) - \item Remove \code{RCPP_USING_CXX11} as a \code{#define} as C++11 is - now a given (Dirk in \ghpr{1369}) - \item Additional cleanup for \code{__cplusplus} checks (Iñaki in - \ghpr{1371} fixing \ghit{1370}) - \item Unordered set construction no longer needs a macro for the - pre-C++11 case (Iñaki in \ghpr{1372}) - \item Lambdas are supported in a Rcpp Sugar functions (Iñaki in \ghpr{1373}) - \item The Date(time)Vector classes now have default ctor (Dirk in - \ghpr{1385} closing \ghpr{1384}) - \item Fixed an issue where Rcpp::Language would duplicate its arguments - (Kevin in \ghpr{1388}, fixing \ghit{1386}) - } - \item Changes in Rcpp Attributes: - \itemize{ - \item The C++26 standard now has plugin support (Dirk in \ghpr{1381} - closing \ghit{1380}) - } - \item Changes in Rcpp Documentation: - \itemize{ - \item Several typos were correct in the NEWS file (Ben Bolker in - \ghpr{1354}) - \item The Rcpp Libraries vignette mentions \code{PACKAGE_types.h} to - declare types used in \code{RcppExports.cpp} (Dirk in \ghpr{1355}) - \item The vignettes bibliography file was updated to current package - versions, and now uses doi references (Dirk in \ghpr{1389}) - } - \item Changes in Rcpp Deployment: - \itemize{ - \item \code{Rcpp.package.skeleton()} creates \sQuote{URL} and - \sQuote{BugReports} if given a GitHub username (Dirk in \ghpr{1358}) - \item R 4.4.* has been added to the CI matrix (Dirk in \ghpr{1376}) - \item Tests involving NA propagation are skipped under linux-arm64 as - they are under macos-arm (Dirk in \ghpr{1379} closing \ghit{1378}) - } - } -} - -\section{Changes in Rcpp release version 1.0.14 (2025-01-11)}{ - \itemize{ - \item Changes in Rcpp API: - \itemize{ - \item Support for user-defined databases has been removed (Kevin in - \ghpr{1314} fixing \ghit{1313}) - \item The \code{SET_TYPEOF} function and macro is no longer used (Kevin - in \ghpr{1315} fixing \ghit{1312}) - \item An erroneous cast to \code{int} affecting large return object - has been removed (Dirk in \ghpr{1335} fixing \ghpr{1334}) - \item Compilation on DragonFlyBSD is now supported (Gábor Csárdi in - \ghpr{1338}) - \item Use read-only \code{VECTOR_PTR} and \code{STRING_PTR} only - with R 4.5.0 or later (Kevin in \ghpr{1342} fixing \ghit{1341}) - } - \item Changes in Rcpp Attributes: - \itemize{ - \item The \code{sourceCpp()} function can now handle input files with - read-only modes (Simon Guest in \ghpr{1346} fixing \ghit{1345}) - } - \item Changes in Rcpp Deployment: - \itemize{ - \item One unit tests for arm64 macOS has been adjusted; a macOS - continuous integration runner was added (Dirk in \ghpr{1324}) - \item Authors@R is now used in DESCRIPTION as mandated by CRAN, the - \code{Rcpp.package.skeleton()} function also creates it (Dirk in - \ghpr{1325} and \ghpr{1327}) - \item A single datetime format test has been adjusted to match a change - in R-devel (Dirk in \ghpr{1348} fixing \ghit{1347}) - } - \item Changes in Rcpp Documentation: - \itemize{ - \item The Rcpp Modules vignette was extended slightly following - \ghit{1322} (Dirk) - \item Pdf vignettes have been regenerated under Ghostscript 10.03.1 to - avoid a false positive by a Windows virus scanner (Iñaki in - \ghpr{1331}) - \item A (large) number of (old) typos have been corrected in the - vignettes (Marco Colombo in \ghpr{1344}) - } - } -} - -\section{Changes in Rcpp 'hot-fix' release version 1.0.13-1 (2024-11-01)}{ - \itemize{ - \item Changes in Rcpp API: - \itemize{ - \item Use read-only \code{VECTOR_PTR} and \code{STRING_PTR} only with - with R 4.5.0 or later (Kevin in \ghpr{1342} fixing \ghit{1341}) - } - \item Changes in Rcpp Deployment: - \itemize{ - \item Authors@R is now used in DESCRIPTION as mandated by CRAN - } - } -} - -\section{Changes in Rcpp release version 1.0.13 (2024-07-11)}{ - \itemize{ - \item Changes in Rcpp API: - \itemize{ - \item Set R_NO_REMAP if not already defined (Dirk in \ghpr{1296}) - \item Add variadic templates to be used instead of generated code - (Andrew Johnson in \ghpr{1303}) - \item Count variables were switches to \code{size_t} to avoid warnings - about conversion-narrowing (Dirk in \ghpr{1307}) - \item Rcpp now avoids the usage of the (non-API) DATAPTR function when - accessing the contents of Rcpp Vector objects where possible. (Kevin in - \ghpr{1310}) - \item Rcpp now emits an R warning on out-of-bounds Vector accesses. This - may become an error in a future Rcpp release. (Kevin in \ghpr{1310}) - \item Switch \code{VECTOR_PTR} and \code{STRING_PTR} to new API-compliant - \code{RO} variants (Kevin in \ghpr{1317} fixing \ghit{1316}) - } - \item Changes in Rcpp Deployment: - \itemize{ - \item Small updates to the CI test containers have been made (\ghpr{1304}) - } - } -} - -\section{Changes in Rcpp release version 1.0.12 (2024-01-08)}{ - \itemize{ - \item Changes in Rcpp API: - \itemize{ - \item Missing header includes as spotted by some recent tools were - added in two places (Michael Chirico in \ghpr{1272} closing - \ghit{1271}). - \item Casts to avoid integer overflow in matrix row/col selections - have been added (Aaron Lun \ghpr{1281}). - \item Three print format correction uncovered by R-devel were - applied with thanks to Tomas Kalibera (Dirk in \ghpr{1285}). - \item Correct a print format correction in the RcppExports glue code - (Dirk in \ghpr{1288} fixing \ghit{1287}). - \item The upcoming \code{OBJSXP} addition to R 4.4.0 is supported in - the \code{type2name} mapper (Dirk and Iñaki in \ghpr{1293}). - } - \item Changes in Rcpp Attributes: - \itemize{ - \item Generated interface code from base R that fails under LTO is now - corrected (Iñaki in \ghpr{1274} fixing a StackOverflow issue). - } - \item Changes in Rcpp Documentation: - \itemize{ - \item The caption for third figure in the introductory vignette has - been corrected (Dirk in \ghpr{1277} fixing \ghit{1276}). - \item A small formatting issue was correct in an Rd file as - noticed by R-devel (Dirk in \ghpr{1282}). - \item The Rcpp FAQ vignette has been updated (Dirk in \ghpr{1284}). - \item The \code{Rcpp.bib} file has been refreshed to current package - versions. - } - \item Changes in Rcpp Deployment: - \itemize{ - \item The RcppExports file for an included test package has been - updated (Dirk in \ghpr{1289}). - } - } -} - -\section{Changes in Rcpp release version 1.0.11 (2023-07-03)}{ - \itemize{ - \item Changes in Rcpp API: - \itemize{ - \item \code{Rcpp:::CxxFlags()} now quotes only non-standard include path - on linux (Lukasz in \ghpr{1243} closing \ghit{1242}). - \item Two unit tests no longer accidentally bark on stdout (Dirk and - Iñaki in \ghpr{1245}). - \item Compilation under C++20 using \pkg{clang++} and its standard - library is enabled (Dirk in \ghpr{1248} closing \ghit{1244}). - \item Use backticks in a generated \code{.Call()} statement in - \code{RcppExports.R} (Dirk \ghpr{1256} closing \ghit{1255}). - \item Switch to \code{system2()} to capture standard error messages in - error cases (Iñaki in \ghpr{1259} and \ghpr{1261} fixing \ghit{1257}). - } - \item Changes in Rcpp Documentation: - \itemize{ - \item The CITATION file format has been updated (Dirk in \ghpr{1250} - fixing \ghit{1249}). - } - \item Changes in Rcpp Deployment: - \itemize{ - \item A test for \code{qnorm} now uses the more accurate value from R - 4.3.0 (Dirk in \ghpr{1252} and \ghpr{1260} fixing \ghit{1251}). - \item Skip tests with path issues on Windows (Iñaki in \ghpr{1258}). - \item Container deployment in continuous integrations was - improved. (Iñaki and Dirk in \ghpr{1264}, Dirk in \ghpr{1269}). - \item Several files receives minor edits to please \code{R CMD check} - from r-devel (Dirk in \ghpr{1267}). - } - } -} - -\section{Changes in Rcpp release version 1.0.10 (2023-01-12)}{ - \itemize{ - \item Changes in Rcpp API: - \itemize{ - \item Unwind protection is enabled by default (Iñaki in \ghpr{1225}). - It can be disabled by defining \code{RCPP_NO_UNWIND_PROTECT} before - including \code{Rcpp.h}. \code{RCPP_USE_UNWIND_PROTECT} is not checked - anymore and has no effect. The associated plugin \code{unwindProtect} - is therefore deprecated and will be removed in a future release. - \item The 'finalize' method for Rcpp Modules is now eagerly materialized, - fixing an issue where errors can occur when Module finalizers are run - (Kevin in \ghpr{1231} closing \ghit{1230}). - \item Zero-row \code{data.frame} objects can receive \code{push_back} - or \code{push_front} (Dirk in \ghpr{1233} fixing \ghit{1232}). - \item One remaining \code{sprintf} has been replaced by - \code{snprintf} (Dirk and Kevin in \ghpr{1236} and \ghpr{1237}). - \item Several conversion warnings found by \code{clang++} have been - addressed (Dirk in \ghpr{1240} and \ghpr{1241}). - } - \item Changes in Rcpp Attributes: - \itemize{ - \item The C++20, C++2b (experimental) and C++23 standards now have - plugin support like the other C++ standards (Dirk in \ghpr{1228}). - \item The source path for attributes received one more protection - from spaces (Dirk in \ghpr{1235} addressing \ghit{1234}). - } - \item Changes in Rcpp Deployment: - \itemize{ - \item Several GitHub Actions have been updated. - } - } -} - -\section{Changes in Rcpp release version 1.0.9 (2022-07-02)}{ - \itemize{ - \item Changes in Rcpp API: - \itemize{ - \item Accomodate C++98 compilation by adjusting attributes.cpp (Dirk in - \ghpr{1193} fixing \ghit{1192}) - \item Accomodate newest compilers replacing deprecated - \code{std::unary_function} and \code{std::binary_function} with - \code{std::function} (Dirk in \ghpr{1202} fixing \ghit{1201} and - CRAN request) - \item Upon removal from precious list, the tag is set to null - (Iñaki in \ghpr{1205} fixing \ghit{1203}) - \item Move constructor and assignment for strings have been added - (Dean Scarff in \ghpr{1219}). - } - \item Changes in Rcpp Documentation: - \itemize{ - \item Adjust one overflowing column (Bill Denney in \ghpr{1196} fixing - \ghit{1195}) - \item Correct a typo in the FAQ (Marco Colombo in \ghpr{1217}) - } - \item Changes in Rcpp Deployment: - \itemize{ - \item Accomodate four digit version numbers in unit test (Dirk) - \item Do not run complete test suite to limit test time to CRAN - preference (Dirk in \ghpr{1206}) - \item Small updates to the CI test containers have been made - \item Some of changes also applied to an interim release - 1.0.8.3 made for CRAN on 2022-03-14. - } - } -} - -\section{Changes in Rcpp release version 1.0.8 (2022-01-11)}{ - \itemize{ - \item Changes in Rcpp API: - \itemize{ - \item \code{STRICT_R_HEADERS} is now enabled by default, see - extensive discussion in \ghit{1158} closing \ghit{898}. - \item A new \code{#define} allows default setting of finalizer - calls for external pointers (Iñaki in \ghpr{1180} closing \ghit{1108}). - \item \code{Rcpp:::CxxFlags()} now quotes the include path generated, - (Kevin in \ghpr{1189} closing \ghit{1188}). - \item New header files \code{Rcpp/Light}, \code{Rcpp/Lighter}, - \code{Rcpp/Lightest} and default \code{Rcpp/Rcpp} for fine-grained - access to features (and compilation time) (Dirk \ghpr{1191} - addressing \ghpr{1168}). - } - \item Changes in Rcpp Attributes: - \itemize{ - \item A new option \code{signature} allows customization of - function signatures (Travers Ching in \ghpr{1184} and \ghpr{1187} fixing - \ghit{1182}) - } - \item Changes in Rcpp Documentation: - \itemize{ - \item The Rcpp FAQ has a new entry on how \emph{not} to grow a vector - (Dirk in \ghpr{1167}). - \item Some long-spurious calls to \code{RNGSope} have been removed - from examples (Dirk in \ghpr{1173} closing \ghit{1172}). - \item DOI reference in the bibtex files have been updated per JSS - request (Dirk in \ghpr{1186}). - } - \item Changes in Rcpp Deployment: - \itemize{ - \item Some continuous integration components have been updated - (Dirk in \ghpr{1174}, \ghpr{1181}, and \ghpr{1190}). - } - } -} - -\section{Changes in Rcpp release version 1.0.7 (2021-07-06)}{ - \itemize{ - \item Changes in Rcpp API: - \itemize{ - \item Refactored \code{Rcpp_PreserveObject} and \code{Rcpp_ReleaseObject} - which are now O(1) (Dirk and Iñaki in \ghpr{1133} and \ghpr{1135} - fixing \ghit{382} and \ghit{1081}). - \item A spuriously assigned variable was removed (Dirk in - \ghpr{1138} fixing \ghit{1137}). - \item Global \code{Rcout} and \code{Rcerr} objects are supported - via a compiler directive (Iñaki in \ghpr{1139} fixing \ghit{928}) - \item Add support for \code{Rcpp::message} (Dirk in \ghpr{1146} - fixing \ghit{1145}). - \item The \code{uint32_t} type is used throughout instead of - \code{unsigned int} (Dirk in \ghpr{1153} fixing \ghit{1152}). - \item The \code{cfloat} header for floating point limits is now - included (Dirk in \ghpr{1162} fixing \ghit{1161}). - } - \item Changes in Rcpp Attributes: - \itemize{ - \item Packages with dots in their name can now have per-package - include files (Dirk in \ghpr{1132} fixing \ghit{1129}). - \item New argument \code{echo} to quieten optional evaluation in - \code{sourceCpp} (Dirk in \ghpr{1138} fixing \ghit{1126}). - } - \item Forthcoming Changes in Rcpp API: - \itemize{ - \item Starting with Rcpp 1.0.8 anticipated in January 2022, - \code{STRICT_R_HEADERS} will be enabled by default, see \ghit{1126}. - } - } -} - -\section{Changes in Rcpp release version 1.0.6 (2021-01-14)}{ - \itemize{ - \item Changes in Rcpp API: - \itemize{ - \item Replace remaining few uses of \code{EXTPTR_PTR} with - \code{R_ExternalPtrAddr} (Kevin in \ghpr{1098} fixing - \ghit{1097}). - \item Add \code{push_back} and \code{push_front} for - \code{DataFrame} (Walter Somerville in \ghpr{1099} fixing - \ghit{1094}). - \item Remove a misleading-to-wrong comment (Mattias Ellert in - \ghpr{1109} cleaning up after \ghpr{1049}). - \item Address a sanitizer report by initializing two private - \code{bool} variables (Benjamin Christoffersen in \ghpr{1113}). - \item External pointer finalizer toggle default values were - corrected to true (Dirk in \ghpr{1115}). - } - \item Changes in Rcpp Documentation: - \itemize{ - \item Several URLs were updated to https and/or new addresses (Dirk). - } - \item Changes in Rcpp Deployment: - \itemize{ - \item Added GitHub Actions CI using the same container-based setup - used previously, and also carried code coverage over (Dirk in - \ghpr{1128}). - } - \item Changes in Rcpp support functions: - \itemize{ - \item \code{Rcpp.package.skeleton()} avoids warning from R. (Dirk) - } - } -} - -\section{Changes in Rcpp release version 1.0.5 (2020-07-01)}{ - \itemize{ - \item Changes in Rcpp API: - \itemize{ - \item The exception handler code in \ghpr{1043} was updated to ensure - proper include behavior (Kevin in \ghpr{1047} fixing \ghit{1046}). - \item A missing \code{Rcpp_list6} definition was added to support - R 3.3.* builds (Davis Vaughan in \ghpr{1049} fixing \ghit{1048}). - \item Missing \code{Rcpp_list{2,3,4,5}} definition were added to - the Rcpp namespace (Dirk in \ghpr{1054} fixing \ghit{1053}). - \item A further updated corrected the header include and provided - a missing else branch (Mattias Ellert in \ghpr{1055}). - \item Two more assignments are protected with \code{Rcpp::Shield} - (Dirk in \ghpr{1059}). - \item One call to \code{abs} is now properly namespaced with - \code{std::} (Uwe Korn in \ghpr{1069}). - \item String object memory preservation was corrected/simplified - (Kevin in \ghpr{1082}). - } - \item Changes in Rcpp Attributes: - \itemize{ - \item Empty strings are not passed to \code{R CMD SHLIB} which was - seen with R 4.0.0 on Windows (Kevin in \ghpr{1062} fixing - \ghpr{1061}). - \item The \code{short_file_name()} helper function is safer with - respect to temporaries (Kevin in \ghpr{1067} fixing \ghit{1066}, - and \ghpr{1071} fixing \ghpr{1070}). - } - \item Changes in Rcpp Sugar: - \itemize{ - \item Two \code{sample()} objects are now standard vectors and not - \code{R_alloc} created (Dirk in \ghpr{1075} fixing \ghpr{1074}). - } - \item Changes in Rcpp support functions: - \itemize{ - \item \code{Rcpp.package.skeleton()} adjusts for a (documented) - change in R 4.0.0 (Dirk in \ghpr{1088} fixing \ghpr{1087}). - } - \item Changes in Rcpp Documentation: - \itemize{ - \item The pdf file of the earlier introduction is again typeset - with bibliographic information (Dirk). - \item A new vignette describing how to package C++ libraries has - been added (Dirk in \ghpr{1078} fixing \ghit{1077}). - } - \item Changes in Rcpp Deployment: - \itemize{ - \item Travis CI unit tests now run a matrix over the versions of R - also tested at CRAN (rel/dev/oldrel/oldoldrel), and coverage runs - in parallel for a net speed-up (Dirk in \ghpr{1056} and - \ghpr{1057}). - \item The exceptions test is now partially skipped on Solaris as - it already is on Windows (Dirk in \ghpr{1065}). - \item The default CI runner was upgraded to R 4.0.0 (Dirk). - \item The CI matrix spans R 3.5, 3.6, r-release and r-devel (Dirk). - } - } -} - -\section{Changes in Rcpp version 1.0.4 (2020-03-13)}{ - \itemize{ - \item Changes in Rcpp API: - \itemize{ - \item Safer \code{Rcpp_list*}, \code{Rcpp_lang*} and - \code{Function.operator()} (Romain in \ghpr{1014}, \ghit{1015}). - \item A number of \code{#nocov} markers were added (Dirk in - \ghpr{1036}, \ghpr{1042} and \ghpr{1044}). - \item Finalizer calls clear external pointer first (Kirill Müller and - Dirk in \ghpr{1038}). - \item Scalar operations with a rhs matrix no longer change the - matrix value (Qiang in \ghpr{1040} fixing (again) \ghit{365}). - \item \code{Rcpp::exception} and \code{Rcpp::stop} are now more - thread-safe (Joshua Pritikin in \ghpr{1043}). - } - \item Changes in Rcpp Attributes: - \itemize{ - \item The \code{cppFunction} helper now deals correctly with mulitple - \code{depends} arguments (TJ McKinley in \ghpr{1016} fixing - \ghit{1017}). - \item Invisible return objects are now supported via new option (Kun Ren - in \ghpr{1025} fixing \ghit{1024}). - \item Unavailable packages referred to in \code{LinkingTo} are now - reported (Dirk in \ghpr{1027} fixing \ghit{1026}). - \item The \code{sourceCpp} function can now create a debug DLL on - Windows (Dirk in \ghpr{1037} fixing \ghit{1035}). - } - \item Changes in Rcpp Documentation: - \itemize{ - \item The \code{.github/} directory now has more explicit guidance on - contributing, issues, and pull requests (Dirk). - \item The Rcpp Attributes vignette describe the new invisible return - object option (Kun Ren in \ghpr{1025}). - \item Vignettes are now included as pre-made pdf files (Dirk in \ghpr{1029}) - \item The Rcpp FAQ has a new entry on the recommended - \code{importFrom} directive (Dirk in \ghpr{1031} fixing \ghit{1030}). - \item The bib file for the vignette was once again updated to - current package versions (Dirk). - } - \item Changes in Rcpp Deployment: - \itemize{ - \item Added unit test to check if C++ version remains remains aligned - with the package number (Dirk in \ghpr{1022} fixing \ghit{1021}). - \item The unit test system was switched to tinytest (Dirk in - \ghpr{1028}, \ghpr{1032}, \ghpr{1033}). - } - } -} - -\section{Changes in Rcpp version 1.0.3 (2019-11-08)}{ - \itemize{ - \item Changes in Rcpp API: - \itemize{ - \item Compilation can be sped up by skipping Modules headers via a - toggle \code{RCPP_NO_MODULES} (Kevin in \ghpr{995} for \ghit{993}). - \item Compilation can be sped up by toggling \code{RCPP_NO_RTTI} which - implies \code{RCPP_NO_MODULES} (Dirk in \ghpr{998} fixing \ghit{997}). - \item \code{XPtr} tags are now preserved in \code{as<>} (Stephen Wade - in \ghpr{1003} fixing \ghit{986}, plus Dirk in \ghpr{1012}). - \item A few more temporary allocations are now protected from garbage - collection (Romain Francois in \ghpr{1010}, and Dirk in \ghpr{1011}). - } - \item Changes in Rcpp Modules: - \itemize{ - \item Improved initialization via explicit \code{Rcpp::} prefix - (Riccardo Porreca in \ghpr{980}). - } - \item Changes in Rcpp Deployment: - \itemize{ - \item A unit test for Rcpp Class exposure was updated to not fail under - r-devel (Dirk in \ghpr{1008} fixing \ghit{1006}). - } - \item Changes in Rcpp Documentation: - \itemize{ - \item The \code{Rcpp-modules} vignette received a major review and - edit (Riccardo Porreca in \ghpr{982}). - \item Minor whitespace alignments and edits were made in three - vignettes following the new \pkg{pinp} release (Dirk). - \item New badges for DOI and CRAN and BioConductor reverse dependencies - have been added to README.md (Dirk). - \item Vignettes are now included pre-made (Dirk in \ghpr{1005} - addressing \ghit{1004})). - \item The Rcpp FAQ has two new entries on 'no modules / no rtti' and - exceptions across shared libraries (Dirk in \ghpr{1009}). - } - } -} - -\section{Changes in Rcpp version 1.0.2 (2019-07-20)}{ - \itemize{ - \item Changes in Rcpp API: - \itemize{ - \item Files in \code{src/} are now consistentely lowercase (Dirk - in \ghpr{956}). - \item The Rcpp 'API Version' is now accessible via - \code{getRcppVersion()} (Dirk in \ghpr{963}). - } - \item Changes in Rcpp Attributes: - \itemize{ - \item The second END wrapper macro also gets \code{UNPROTECT} and - a variable reference suppressing compiler warnings (Dirk in - \ghpr{953} fixing \ghit{951}). - \item Default function arguments are parsed correctly (Pierrick - Roger in \ghpr{977} fixing \ghit{975}) - } - \item Changes in Rcpp Sugar: - \itemize{ - \item Added decreasing parameter to \code{sort_unique()} - (James Balamuta in \ghpr{958} addressing \ghit{950}). - } - \item Changes in Rcpp Deployment: - \itemize{ - \item Travis CI unit tests are now always running irrespective of - the package version (Dirk in \ghpr{954}). - } - \item Changes in Rcpp Documentation: - \itemize{ - \item The \code{Rcpp-modules} vignette now covers the - \code{RCPP_EXPOSED_*} macros, and the \code{Rcpp-extending} vignette - references it (Ralf Stubner in \ghpr{959} fixing \ghit{952}). - } - } -} - -\section{Changes in Rcpp version 1.0.1 (2019-03-17)}{ - \itemize{ - \item Changes in Rcpp API: - \itemize{ - \item Subsetting is no longer limited by an integer range (William - Nolan in \ghpr{920} fixing \ghit{919}). - \item Error messages from subsetting are now more informative - (Qiang and Dirk). - \item \code{Shelter} increases count only on non-null objects - (Dirk in \ghpr{940} as suggested by Stepan Sindelar in \ghit{935}). - \item \code{AttributeProxy::set()} and a few related setters get - \code{Shield<>} to ensure \code{rchk} is happy (Romain in \ghpr{947} - fixing \ghit{946}). - } - \item Changes in Rcpp Attributes: - \itemize{ - \item A new plugin was added for C++20 (Dirk in \ghpr{927}) - \item Fixed an issue where 'stale' symbols could become registered in - RcppExports.cpp, leading to linker errors and other related issues - (Kevin in \ghpr{939} fixing \ghit{733} and \ghit{934}). - \item The wrapper macro gets an \code{UNPROTECT} to ensure \code{rchk} - is happy (Romain in \ghpr{949}) fixing \ghit{948}). - } - \item Changes in Rcpp Documentation: - \itemize{ - \item Three small corrections were added in the 'Rcpp Quickref' - vignette (Zhuoer Dong in \ghpr{933} fixing \ghit{932}). - \item The \code{Rcpp-modules} vignette now has documentation for - \code{.factory} (Ralf Stubner in \ghpr{938} fixing \ghit{937}). - } - \item Changes in Rcpp Deployment: - \itemize{ - \item Travis CI again reports to CodeCov.io (Dirk and Ralf Stubner in - \ghpr{942} fixing \ghit{941}). - } - } -} - -\section{Changes in Rcpp version 1.0.0 (2018-11-05)}{ - \itemize{ - \item Happy tenth birthday to Rcpp, and hello release 1.0 ! - \item Changes in Rcpp API: - \itemize{ - \item The empty destructor for the \code{Date} class was removed - to please g++-9 (prerelease) and \code{-Wdeprecated-copy} (Dirk). - \item The constructor for \code{NumericMatrix(not_init(n,k))} was - corrected (Romain in \ghpr{904}, Dirk in \ghpr{905}, and also - Romain in \ghpr{908} fixing \ghpr{907}). - \item \code{Rcpp::String} no longer silently drops embedded - \code{NUL} bytes in strings but throws new Rcpp exception - \code{embedded_nul_in_string}. (Kevin in \ghpr{917} fixing \ghit{916}). - } - \item Changes in Rcpp Deployment: - \itemize{ - \item The Dockerfile for Continuous Integration sets the required - test flag (for release versions) inside the container (Dirk). - \item Correct the \code{R CMD check} call to skip vignettes (Dirk). - } - \item Changes in Rcpp Attributes: - \itemize{ - \item A new \code{[[Rcpp::init]]} attribute allows function - registration for running on package initialization (JJ in - \ghpr{903}). - \item Sort the files scanned for attributes in the C locale for - stable output across systems (JJ in \ghpr{912}). - } - \item Changes in Rcpp Documentation: - \itemize{ - \item The 'Rcpp Extending' vignette was corrected and refers to - \code{EXPOSED} rather than \code{EXPORTED} (Ralf Stubner in - \ghpr{910}). - \item The 'Unit test' vignette is no longer included (Dirk in - \ghpr{914}). - } - } -} - -\section{Changes in Rcpp version 0.12.19 (2018-09-20)}{ - \itemize{ - \item Changes in Rcpp API: - \itemize{ - \item The \code{no_init()} accessor for vectors and matrices is - now wrapped in \code{Shield<>()} to not trigger \code{rchk} - warnings (Kirill Müller in \ghpr{893} addressing \ghit{892}). - \item \code{STRICT_R_HEADERS} will be defined twelve months from - now; until then we protect it via \code{RCPP_NO_STRICT_HEADERS} - which can then be used to avoid the definition; downstream - maintainers are encouraged to update their packages as needed - (Dirk in \ghpr{900} beginning to address \ghit{898}). - } - \item Changes in Rcpp Attributes: - \itemize{ - \item Added \code{[[Rcpp::init]]} attribute for registering C++ - functions to run during package initialization (JJ in \ghpr{903} - addressing \ghit{902}). - } - \item Changes in Rcpp Modules: - \itemize{ - \item Improved \code{exposeClass} functionality along with added - test (Martin Lysy in \ghpr{886} fixing \ghit{879}). - } - \item Changes in Rcpp Documentation: - \itemize{ - \item Two typos were fixed in the Rcpp Sugar vignette (Patrick - Miller in \ghpr{895}). - \item Several vignettes now use the \code{collapse} argument to - show output in the corresponding code block. - } - \item Changes in Rcpp Deployment: - \itemize{ - \item The old \code{LdFlags()} build helper was marked as - deprecated [but removed for release] (Dirk in \ghpr{887}). - \item Dockerfiles for continuous integration, standard deployment - and 'plus sized' deployment are provided along with builds - (Dirk in \ghpr{894}). - \item Travis CI now use the \code{rcpp/ci} container for tests - (Dirk in \ghpr{896}). - } - } -} - -\section{Changes in Rcpp version 0.12.18 (2018-07-21)}{ - \itemize{ - \item Changes in Rcpp API: - \itemize{ - \item The \code{StringProxy::operator==} is now \code{const} - correct (Romain in \ghpr{855} fixing \ghit{854}). - \item The \code{Environment::new_child()} is now \code{const} - (Romain in \ghpr{858} fixing \ghit{854}). - \item Next \code{eval} codes now properly unwind (Lionel in the large - and careful \ghpr{859} fixing \ghit{807}). - \item In debugging mode, more type information is shown on - \code{abort()} (Jack Wasey in \ghpr{860} and \ghpr{882} fixing - \ghit{857}). - \item A new class was added which allow suspension of the RNG - synchronisation to address an issue seen in \CRANpkg{RcppDE} - (Kevin in \ghpr{862}). - \item Evaluation calls now happen in the \code{base} environment - (which may fix an issue seen between \CRANpkg{conflicted} and some - BioConductor packages) (Kevin in \ghpr{863} fixing \ghit{861}). - \item Call stack display on error can now be controlled more - finely (Romain in \ghpr{868}). - \item The new \code{Rcpp_fast_eval} is used instead of - \code{Rcpp_eval} though this still requires setting - \code{RCPP_USE_UNWIND_PROTECT} before including \code{Rcpp.h} (Qiang - Kou in \ghpr{867} closing \ghit{866}). - \item The \code{Rcpp::unwindProtect()} function extracts the - unwinding from the \code{Rcpp_fast_eval()} function and makes it - more generally available. (Lionel in \ghpr{873} and \ghpr{877}). - \item The \code{tm_gmtoff} part is skipped on AIX too - (\ghpr{876}). - } - \item Changes in Rcpp Attributes: - \itemize{ - \item The \code{sourceCpp()} function now evaluates R code in the - correct local environment in which a function was compiled (Filip - Schouwenaars in \ghpr{852} and \ghpr{869} fixing \ghit{851}). - \item Filenames are now sorted in a case-insenstive way so that - the \code{RcppExports} files are more stable across locales (Jack - Wasey in \ghpr{878}). - } - \item Changes in Rcpp Sugar: - \itemize{ - \item The sugar functions \code{min} and \code{max} now recognise - empty vectors (Dirk in \ghpr{884} fixing \ghit{883}). - } - } -} - - -\section{Changes in Rcpp version 0.12.17 (2018-05-09)}{ - \itemize{ - \item Changes in Rcpp API: - \itemize{ - \item The random number \code{Generator} class no longer inherits from - \code{RNGScope} (Kevin in \ghpr{837} fixing \ghit{836}). - \item A new class, \code{SuspendRNGSynchronizationScope}, can be created - and used to ensure that calls to Rcpp functions do not attempt to call - \code{::GetRNGstate()} or \code{::PutRNGstate()} for the duration of - some code block. - \item A spurious parenthesis was removed to please gcc8 (Dirk - fixing \ghit{841}) - \item The optional \code{Timer} class header now undefines - \code{FALSE} which was seen to have side-effects on some platforms - (Romain in \ghpr{847} fixing \ghpr{846}). - \item Optional \code{StoragePolicy} attributes now also work for - string vectors (Romain in \ghpr{850} fixing \ghit{849}). - } - \item Changes in Rcpp Documentation: - \itemize{ - \item A few old typesetting conventions from the prior Rnw format - have been corrected (Peter Hickey in \ghpr{831}; Joris Meys; Dirk) - \item Two internal links to the introduction published in JSS have been - updated to the changed filename given the newer TAS introduction. - \item Some remaining backticks were replaced with straight quotes - (Ralf Stubner in \ghpr{845}). - \item A citation to the Rcpp introducion in the The American - Statistician has been added to the introductory and FAQ vignettes. - } - } -} - -\section{Changes in Rcpp version 0.12.16 (2018-03-08)}{ - \itemize{ - \item Changes in Rcpp API: - \itemize{ - \item Rcpp now sets and puts the RNG state upon each entry to an Rcpp - function, ensuring that nested invocations of Rcpp functions manage the - RNG state as expected (Kevin in \ghpr{825} addressing \ghit{823}). - \item The \code{R::pythag} wrapper has been commented out; the underlying - function has been gone from R since 2.14.0, and \code{::hypot()} (part of - C99) is now used unconditionally for complex numbers (Dirk in \ghpr{826}). - \item The \code{long long} type can now be used on 64-bit Windows (Kevin - in \ghpr{811} and again in \ghpr{829} addressing \ghit{804}). - } - \item Changes in Rcpp Attributes: - \itemize{ - \item Code generated with \code{cppFunction()} now uses \code{.Call()} - directly (Kirill Müller in \ghpr{813} addressing \ghit{795}). - } - \item Changes in Rcpp Documentation: - \itemize{ - \item The Rcpp FAQ vignette is now indexed as `Rcpp-FAQ`; a stale Gmane - reference was removed and entry for getting compilers under Conda was added. - \item The top-level README.md now has a \emph{Support} section. - \item The Rcpp.bib reference file was refreshed to current versions. - } - } -} - -\section{Changes in Rcpp version 0.12.15 (2018-01-16)}{ - \itemize{ - \item Changes in Rcpp API: - \itemize{ - \item Calls from exception handling to \code{Rf_warning()} now correctly - set an initial format string (Dirk in \ghpr{777} fixing \ghit{776}). - \item The 'new' Date and Datetime vectors now have \code{is_na} methods - too. (Dirk in \ghpr{783} fixing \ghit{781}). - \item Protect more temporary \code{SEXP} objects produced by \code{wrap} - (Kevin in \ghpr{784}). - \item Use public R APIs for \code{new_env} (Kevin in \ghpr{785}). - \item Evaluation of R code is now safer when compiled against R - 3.5 (you also need to explicitly define \code{RCPP_USE_UNWIND_PROTECT} - before including \code{Rcpp.h}). Longjumps of all kinds (condition - catching, returns, restarts, debugger exit) are appropriately - detected and handled, e.g. the C++ stack unwinds correctly - (Lionel in \ghpr{789}). [ Committed but subsequently disabled in release - 0.12.15 ] - \item The new function \code{Rcpp_fast_eval()} can be used for - performance-sensitive evaluation of R code. Unlike - \code{Rcpp_eval()}, it does not try to catch errors with - \code{tryEval} in order to avoid the catching overhead. While this - is safe thanks to the stack unwinding protection, this also means - that R errors are not transformed to an \code{Rcpp::exception}. If - you are relying on error rethrowing, you have to use the slower - \code{Rcpp_eval()}. On old R versions \code{Rcpp_fast_eval()} - falls back to \code{Rcpp_eval()} so it is safe to use against any - versions of R (Lionel in \ghpr{789}). [ Committed but subsequently - disabled in release 0.12.15 ] - \item Overly-clever checks for \code{NA} have been removed (Kevin in - \ghpr{790}). - \item The included tinyformat has been updated to the current version, - Rcpp-specific changes are now more isolated (Kirill in \ghpr{791}). - \item Overly picky \emph{fall-through} warnings by gcc-7 regarding - \code{switch} statements are now pre-empted (Kirill in \ghpr{792}). - \item Permit compilation on ANDROID (Kenny Bell in \ghpr{796}). - \item Improve support for NVCC, the CUDA compiler (Iñaki Ucar in - \ghpr{798} addressing \ghit{797}). - \item Speed up tests for NA and NaN (Kirill and Dirk in \ghpr{799} and - \ghpr{800}). - \item Rearrange stack unwind test code, keep test disabled for now (Lionel - in \ghpr{801}). - \item Further condition away protect unwind behind #define (Dirk in - \ghpr{802}). - } - \item Changes in Rcpp Attributes: - \itemize{ - \item Addressed a missing Rcpp namespace prefix when generating a C++ - interface (James Balamuta in \ghpr{779}). - } - \item Changes in Rcpp Documentation: - \itemize{ - \item The Rcpp FAQ now shows \code{Rcpp::Rcpp.plugin.maker()} and not the - outdated \code{:::} use applicable non-exported functions. - } - } -} - -\section{Changes in Rcpp version 0.12.14 (2017-11-17)}{ - \itemize{ - \item Changes in Rcpp API: - \itemize{ - \item New const iterators functions \code{cbegin()} and \code{cend()} - added to \code{MatrixRow} as well (Dan Dillon in \ghpr{750}). - \item The \code{Rostream} object now contains a \code{Buffer} rather than - allocating one (Kirill Müller in \ghpr{763}). - \item New \code{DateVector} and \code{DatetimeVector} classes are now the - default fully deprecating the old classes as announced one year ago. - } - \item Changes in Rcpp Package: - \itemize{ - \item DESCRIPTION file now list doi information per CRAN suggestion. - } - \item Changes in Rcpp Documentation: - \itemize{ - \item Update CITATION file with doi information and PeerJ preprint. - } - } -} - -\section{Changes in Rcpp version 0.12.13 (2017-09-24)}{ - \itemize{ - \item Changes in Rcpp API: - \itemize{ - \item New const iterators functions \code{cbegin()} and \code{cend()} have - been added to several vector and matrix classes (Dan Dillon and James - Balamuta in \ghpr{748}) starting to address \ghit{741}). - } - \item Changes in Rcpp Modules: - \itemize{ - \item Misplacement of one parenthesis in macro \code{LOAD_RCPP_MODULE} - was corrected (Lei Yu in \ghpr{737}) - } - \item Changes in Rcpp Documentation: - \itemize{ - \item Rewrote the macOS sections to depend on official documentation due - to large changes in the macOS toolchain. (James Balamuta in \ghpr{742} - addressing issue \ghit{682}). - \item Added a new vignette \sQuote{Rcpp-introduction} based on new PeerJ - preprint, renamed existing introduction to \sQuote{Rcpp-jss-2011}. - \item Transitioned all vignettes to the 'pinp' RMarkdown template - (James Balamuta and Dirk Eddelbuettel in \ghpr{755} addressing - issue \ghit{604}). - \item Added an entry on running `compileAttributes()` twice to the - Rcpp-FAQ (\ghit{#745}). - } - } -} - -\section{Changes in Rcpp version 0.12.12 (2017-07-13)}{ - \itemize{ - \item Changes in Rcpp API: - \itemize{ - \item The \code{tinyformat.h} header now ends in a newline (\ghit{701}). - \item Fixed rare protection error that occurred when fetching stack traces - during the construction of an Rcpp exception (Kirill Müller in \ghpr{706}). - \item Compilation is now also possibly on Haiku-OS (Yo Gong in \ghpr{708} - addressing \ghit{707}). - \item Dimension attributes are explicitly cast to \code{int} (Kirill - Müller in \ghpr{715}). - \item Unused arguments are no longer declared (Kirill Müller in - \ghpr{716}). - \item Visibility of exported functions is now supported via the R macro - \code{atttribute_visible} (Jeroen Ooms in \ghpr{720}). - \item The \code{no_init()} constructor accepts \code{R_xlen_t} (Kirill - Müller in \ghpr{730}). - \item Loop unrolling used \code{R_xlen_t} (Kirill Müller in \ghpr{731}). - \item Two unused-variables warnings are now avoided (Jeff Pollock in - \ghpr{732}). - } - \item Changes in Rcpp Attributes: - \itemize{ - \item Execute tools::package_native_routine_registration_skeleton - within package rather than current working directory (JJ in \ghpr{697}). - \item The R portion no longer uses \code{dir.exists} to no require R 3.2.0 - or newer (Elias Pipping in \ghpr{698}). - \item Fix native registration for exports with name attribute (JJ in \ghpr{703} - addressing \ghit{702}). - \item Automatically register init functions for Rcpp Modules (JJ in \ghpr{705} - addressing \ghit{704}). - \item Add Shield around parameters in Rcpp::interfaces (JJ in \ghpr{713} - addressing \ghit{712}). - \item Replace dot (".") with underscore ("_") in package names when generating - native routine registrations (JJ in \ghpr{722} addressing \ghit{721}). - \item Generate C++ native routines with underscore ("_") prefix to avoid - exporting when standard exportPattern is used in NAMESPACE (JJ in - \ghpr{725} addressing \ghit{723}). - } - } -} - -\section{Changes in Rcpp version 0.12.11 (2017-05-20)}{ - \itemize{ - \item Changes in Rcpp API: - \itemize{ - \item Rcpp::exceptions can now be constructed without a call stack (Jim - Hester in \ghpr{663} addressing \ghit{664}). - \item Somewhat spurious compiler messages under very verbose settings are - now suppressed (Kirill Müller in \ghpr{670}, \ghpr{671}, \ghpr{672}, - \ghpr{687}, \ghpr{688}, \ghpr{691}). - \item Refreshed the included \code{tinyformat} template library - (James Balamuta in \ghpr{674} addressing \ghit{673}). - \item Added \code{printf}-like syntax support for exception classes and - variadic templating for \code{Rcpp::stop} and \code{Rcpp::warning} - (James Balamuta in \ghpr{676}). - \item Exception messages have been rewritten to provide additional - information. (James Balamuta in \ghpr{676} and \ghpr{677} addressing - \ghit{184}). - \item One more instance of \code{Rf_mkString} is protected from garbage - collection (Dirk in \ghpr{686} addressing \ghit{685}). - \item Two exception specification that are no longer tolerated by - \code{g++-7.1} or later were removed (Dirk in \ghpr{690} addressing - \ghit{689}) - } - \item Changes in Rcpp Documentation: - \itemize{ - \item Added a Known Issues section to the Rcpp FAQ vignette - (James Balamuta in \ghpr{661} addressing \ghit{628}, \ghit{563}, - \ghit{552}, \ghit{460}, \ghit{419}, and \ghit{251}). - } - \item Changes in Rcpp Sugar: - \itemize{ - \item Added sugar function \code{trimws} (Nathan Russell in \ghpr{680} - addressing \ghit{679}). - } - \item Changes in Rcpp Attributes: - \itemize{ - \item Automatically generate native routine registrations (JJ in \ghpr{694}) - \item The plugins for C++11, C++14, C++17 now set the values R 3.4.0 or - later expects; a plugin for C++98 was added (Dirk in \ghpr{684} addressing - \ghit{683}). - } - \item Changes in Rcpp support functions: - \itemize{ - \item The \code{Rcpp.package.skeleton()} function now creates a package - registration file provided R 3.4.0 or later is used (Dirk in \ghpr{692}) - } - } -} - -\section{Changes in Rcpp version 0.12.10 (2017-03-17)}{ - \itemize{ - \item Changes in Rcpp API: - \itemize{ - \item Added new size attribute aliases for number of rows and columns in - DataFrame (James Balamuta in \ghpr{638} addressing \ghit{630}). - \item Fixed single-character handling in \code{Rstreambuf} (Iñaki Ucar in - \ghpr{649} addressing \ghit{647}). - \item XPtr gains a parameter \code{finalizeOnExit} to enable running the - finalizer when R quits (Jeroen Ooms in \ghpr{656} addressing \ghit{655}). - } - \item Changes in Rcpp Sugar: - \itemize{ - \item Fixed sugar functions \code{upper_tri()} and \code{lower_tri()} - (Nathan Russell in \ghpr{642} addressing \ghit{641}). - \item The \code{algorithm.h} file now accomodates the Intel compiler - (Dirk in \ghpr{643} and Dan in \ghpr{645} addressing issue \ghit{640}). - } - \item Changes in Rcpp Attributes: - \itemize{ - \item The C++17 standard is supported with a new plugin (used eg for - \code{g++-6.2}). - } - \item Changes in Rcpp Documentation: - \itemize{ - \item An overdue explanation of how C++11, C++14, and C++17 can be used - was added to the Rcpp FAQ. - } - } -} - -\section{Changes in Rcpp version 0.12.9 (2017-01-14)}{ - \itemize{ - \item Changes in Rcpp API: - \itemize{ - \item The exception stack message is now correctly demangled on all - compiler versions (Jim Hester in \ghpr{598}) - \item Date and Datetime object and vector now have format methods and - \code{operator<<} support (\ghpr{599}). - \item The \code{size} operator in \code{Matrix} is explicitly referenced - avoiding a g++-6 issues (\ghpr{607} fixing \ghit{605}). - \item The underlying date calculation code was updated (\ghpr{621}, - \ghpr{623}). - \item Addressed improper diagonal fill for non-symmetric matrices - (James Balamuta in \ghpr{622} addressing \ghit{619}) - } - \item Changes in Rcpp Sugar: - \itemize{ - \item Added new Sugar function \code{sample()} (Nathan Russell in - \ghpr{610} and \ghpr{616}). - \item Added new Sugar function \code{Arg()} (James Balamuta in - \ghpr{626} addressing \ghit{625}). - } - \item Changes in Rcpp unit tests - \itemize{ - \item Added Environment::find unit tests and an Environment::get(Symbol) - test (James Balamuta in \ghpr{595} addressing issue \ghit{594}). - \item Added diagonal matrix fill tests - (James Balamuta in \ghpr{622} addressing \ghit{619}) - } - \item Changes in Rcpp Documentation: - \itemize{ - \item Exposed pointers macros were included in the Rcpp Extending vignette - (MathurinD; James Balamuta in \ghpr{592} addressing \ghit{418}). - \item The file \code{Rcpp.bib} move to directory \code{bib} which is - guaranteed to be present (\ghpr{631}). - } - \item Changes in Rcpp build system - \itemize{ - \item Travis CI now also calls \CRANpkg{covr} for coverage analysis (Jim - Hester in PR \ghpr{591}) - } - } -} - -\section{Changes in Rcpp version 0.12.8 (2016-11-16)}{ - \itemize{ - \item Changes in Rcpp API: - \itemize{ - \item String and vector elements now use extended \code{R_xlen_t} indices - (Qiang in PR \ghpr{560}) - \item Hashing functions now return unsigned int (Qiang in PR \ghpr{561}) - \item Added static methods \code{eye()}, \code{ones()}, and \code{zeros()} - for select matrix types (Nathan Russell in PR \ghpr{569}) - \item The exception call stack is again correctly reported; print methods - and tests added too (Jim Hester in PR \ghpr{582} fixing \ghit{579}) - \item Variatic macros no longer use a GNU extensions (Nathan in PR - \ghpr{575}) - \item Hash index functions were standardized on returning unsigned - integers (Also PR \ghpr{575}) - } - \item Changes in Rcpp Sugar: - \itemize{ - \item Added new Sugar functions \code{rowSums()}, \code{colSums()}, - \code{rowMeans()}, \code{colMeans()} (PR \ghpr{551} by Nathan Russell - fixing \ghit{549}) - \item \code{Range} Sugar now used \code{R_xlen_t} type for start/end - (PR \ghpr{568} by Qiang Kou) - \item Defining \code{RCPP_NO_SUGAR} no longer breaks the build. - (PR \ghpr{585} by Daniel C. Dillon) - } - \item Changes in Rcpp unit tests - \itemize{ - \item A test for expression vectors was corrected. - \item The constructor test for datetime vectors reflects the new classes - which treats Inf correctly (and still as a non-finite value) - } - \item Changes in Rcpp Attributes - \itemize{ - \item An 'empty' return was corrected (PR \ghpr{589} fixing issue - \ghit{588}, and with thanks to Duncan Murdoch for the heads-up) - } - \item Updated Date and Datetime vector classes: - \itemize{ - \item The \code{DateVector} and \code{DatetimeVector} classes were renamed - with a prefix \code{old}; they are currently \code{typedef}'ed to the - existing name (\ghpr{557}) - \item New variants \code{newDateVector} and \code{newDatetimeVector} were - added based on \code{NumericVector} (also \ghpr{557}, \ghpr{577}, - \ghpr{581}, \ghpr{587}) - \item By defining \code{RCPP_NEW_DATE_DATETIME_VECTORS} the new classes - can activated. We intend to make the new classes the default no sooner - than twelve months from this release. - \item The \code{capabilities()} function can also be used for presence of - this feature - } - } -} - -\section{Changes in Rcpp version 0.12.7 (2016-09-04)}{ - \itemize{ - \item Changes in Rcpp API: - \itemize{ - \item The \code{NORET} macro is now defined if it was not already defined - by R itself (Kevin fixing issue \ghit{512}). - \item Environment functions get() & find() now accept a Symbol - (James Balamuta in \ghpr{513} addressing issue \ghit{326}). - \item Several uses of \code{Rf_eval} were replaced by the preferred - \code{Rcpp::Rcpp_eval} (Qiang in PR \ghpr{523} closing \ghit{498}). - \item Improved Autogeneration Warning for RcppExports - (James Balamuta in \ghpr{528} addressing issue \ghit{526}). - \item Fixed invalid C++ prefix identifiers in auto-generated code - (James Balamuta in \ghpr{528} and \ghpr{531} addressing issue - \ghit{387}; Simon Dirmeier in \ghpr{548}). - \item String constructors now set default UTF-8 encoding (Qiang Kou in - \ghpr{529} fixing \ghit{263}). - \item Add variadic variants of the \code{RCPP_RETURN_VECTOR} and - \code{RCPP_RETURN_MATRIX} macro when C++11 compiler used (Artem Klevtsov - in \ghpr{537} fixing \ghit{38}). - } - \item Changes in Rcpp build system - \itemize{ - \item Travis CI is now driven via \code{run.sh} from our fork, and deploys - all packages as .deb binaries using our PPA where needed (Dirk in - \ghpr{540} addressing issue \ghit{517}). - } - \item Changes in Rcpp unit tests - \itemize{ - \item New unit tests for random number generators the R namespace which - call the standalone Rmath library. (James Balamuta in \ghpr{514} - addressing issue \ghit{28}). - } - \item Changes in Rcpp Examples: - \itemize{ - \item Examples that used cxxfunction() from the inline package have been - rewritten to use either sourceCpp() or cppFunction() - (James Balamuta in \ghpr{541}, \ghpr{535}, \ghpr{534}, and \ghpr{532} - addressing issue \ghit{56}). - } - } -} - -\section{Changes in Rcpp version 0.12.6 (2016-07-18)}{ - \itemize{ - \item Changes in Rcpp API: - \itemize{ - \item The \code{long long} data type is used only if it is available, - to avoid compiler warnings (Kirill Müller in \ghpr{488}). - \item The compiler is made aware that \code{stop()} never returns, to - improve code path analysis (Kirill Müller in \ghpr{487} addressing issue - \ghit{486}). - \item String replacement was corrected (Qiang in \ghpr{479} following - mailing list bug report by Masaki Tsuda) - \item Allow for UTF-8 encoding in error messages via - \code{RCPP_USING_UTF8_ERROR_STRING} macro (Qin Wenfeng in \ghpr{493}) - \item The R function \code{Rf_warningcall} is now provided as well (as - usual without leading \code{Rf_}) (\ghpr{497} fixing \ghit{495}) - } - \item Changes in Rcpp Sugar: - \itemize{ - \item Const-ness of \code{min} and \code{max} functions has been corrected. - (Dan Dillon in PR \ghpr{478} fixing issue \ghit{477}). - \item Ambiguities for matrix/vector and scalar operations have been fixed - (Dan Dillon in PR \ghpr{476} fixing issue \ghit{475}). - \item New \code{algorithm} header using iterator-based approach for - vectorized functions (Dan in PR \ghpr{481} revisiting PR \ghpr{428} and - addressing issue \ghit{426}, with futher work by Kirill in PR \ghpr{488} - and Nathan in \ghpr{503} fixing issue \ghit{502}). - \item The \code{na_omit()} function is now faster for vectors without - \code{NA} values (Artem Klevtsov in PR \ghpr{492}) - } - \item Changes in Rcpp Attributes: - \itemize{ - \item Add \code{cacheDir} argument to \code{sourceCpp()} to enable caching of - shared libraries across R sessions (JJ in \ghpr{504}). - \item Code generation now deals correctly which packages containing a dot - in their name (Qiang in \ghpr{501} fixing \ghit{500}). - } - \item Changes in Rcpp Documentation: - \itemize{ - \item A section on default parameters was added to the Rcpp FAQ vignette - (James Balamuta in \ghpr{505} fixing \ghit{418}). - \item The Rcpp-attributes vignette is now mentioned more prominently in - question one of the Rcpp FAQ vignette. - \item The Rcpp Quick Reference vignette received a facelift with new - sections on Rcpp attributes and plugins begin added. (James Balamuta in - \ghpr{509} fixing \ghit{484}). - \item The bib file was updated with respect to the recent JSS publication - for RProtoBuf. - } - } -} - -\section{Changes in Rcpp version 0.12.5 (2016-05-14)}{ - \itemize{ - \item Changes in Rcpp API: - \itemize{ - \item The checks for different C library implementations now also check for Musl - used by Alpine Linux (Sergio Marques in PR \ghpr{449}). - \item \code{Rcpp::Nullable} works better with Rcpp::String (Dan Dillon in - PR \ghpr{453}). - } - \item Changes in Rcpp Attributes: - \itemize{ - \item R 3.3.0 Windows with Rtools 3.3 is now supported (Qin Wenfeng in PR - \ghpr{451}). - \item Correct handling of dependent file paths on Windows (use winslash = "/"). - } - \item Changes in Rcpp Modules: - \itemize{ - \item An apparent race condition in Module loading seen with R 3.3.0 was - fixed (Ben Goodrich in \ghpr{461} fixing \ghit{458}). - \item The (older) \code{loadRcppModules()} is now deprecated in favour of - \code{loadModule()} introduced around R 2.15.1 and Rcpp 0.9.11 (PR \ghpr{470}). - } - \item Changes in Rcpp support functions: - \itemize{ - \item The \code{Rcpp.package.skeleton()} function was again updated in - order to create a \code{DESCRIPTION} file which passes \code{R CMD check} - without notes. warnings, or error under R-release and R-devel (PR \ghpr{471}). - \item A new function \code{compilerCheck} can test for minimal \code{g++} - versions (PR \ghpr{474}). - } - } -} - -\section{Changes in Rcpp version 0.12.4 (2016-03-22)}{ - \itemize{ - \item Changes in Rcpp API: - \itemize{ - \item New accessors \code{as()} and \code{clone()} were added to the - \code{Nullable} class (Dan in PR \ghpr{423} closing \ghit{421}) - \item The \code{Nullable<>::operator SEXP()} and - \code{Nullable<>::get()} now also work for \code{const} objects - (Kirill Müller in PR \ghpr{417}). - \item A subsetting error was fixed (Qiang via \ghpr{432} closing - \ghit{431}). - } - \item Changes in Rcpp Sugar: - \itemize{ - \item Added new Sugar function \code{median()} (Nathan in PR \ghpr{425} - closing \ghit{424}) - \item Added new Sugar function \code{cbind()} (Nathan in PR \ghpr{447} - closing \ghit{407}) - } - \item Changes in Rcpp Attributes: - \itemize{ - \item A plugin for C++14 was added (Dan in PR \ghpr{427}) - } - \item Changes in Rcpp Documentation: - \itemize{ - \item An entry was added to the Rcpp-FAQ vignette describing the required - packages for vignette building (\ghit{422}). - \item Use on OS X was further detailed (James Balamuta in \ghpr{433} with - further review by Bob Rudis). - \item An entry was added concerning the hard-code limit of arguments to - some constructor and function (cf \ghit{435}). - \item The Rcpp-FAQ vignette now contains a table of content. - \item Typos and indentation were corrected in the Rcpp Sugar vignette - (\ghpr{445} by Colin Gillespie). - } - } -} - -\section{Changes in Rcpp version 0.12.3 (2016-01-10)}{ - \itemize{ - \item Changes in Rcpp API: - \itemize{ - \item Const iterators now \code{CharacterVector} now behave like regular - iterators (PR \ghpr{404} by Dan fixing \ghit{362}). - \item Math operators between matrix and scalars type have been added (PR - \ghpr{406} by Qiang fixing \ghit{365}). - \item A missing \code{std::hash} function interface for - \code{Rcpp::String} has been addded (PR \ghpr{408} by Qiang fixing - \ghit{84}). - } - \item Changes in Rcpp Attributes: - \itemize{ - \item Avoid invalid function names when generating C++ interfaces (PR - \ghpr{403} by JJ fixing \ghit{402}). - \item Insert additional space around \code{&} in function interface (PR - \ghpr{400} by Kazuki Fukui fixing \ghit{278}). - } - \item Changes in Rcpp Modules: - \itemize{ - \item The copy constructor now initialized the base class (PR \ghpr{411} - by Joshua Pritikin fixing \ghit{410}) - } - \item Changes in Rcpp Repository: - \itemize{ - \item Added a file \code{Contributing.md} providing some points to - potential contributors (PR \ghpr{414} closing issue \ghit{413}) - } - } -} - -\section{Changes in Rcpp version 0.12.2 (2015-11-14)}{ - \itemize{ - \item Changes in Rcpp API: - \itemize{ - \item Correct return type in product of matrix dimensions (PR \ghpr{374} - by Florian) - \item Before creating a single String object from a \code{SEXP}, ensure - that it is from a vector of length one (PR \ghpr{376} by Dirk, fixing - \ghit{375}). - \item No longer use \code{STRING_ELT} as a left-hand side, thanks to a - heads-up by Luke Tierney (PR \ghpr{378} by Dirk, fixing \ghit{377}). - \item Rcpp Module objects are now checked more carefully (PR \ghpr{381} - by Tianqi, fixing \ghit{380}) - \item An overflow in Matrix column indexing was corrected (PR \ghpr{390} - by Qiang, fixing a bug reported by Allessandro on the list) - \item \code{Nullable} types can now be assigned \code{R_NilValue} in - function signatures. (PR \ghpr{395} by Dan, fixing issue \ghit{394}) - \item \code{operator<<()} now always shows decimal points (PR \ghpr{396} - by Dan) - \item Matrix classes now have a \code{transpose()} function (PR \ghpr{397} - by Dirk fixing \ghit{383}) - \item \code{operator<<()} for complex types was added (PRs \ghpr{398} by - Qiang and \ghpr{399} by Dirk, fixing \ghit{187}) - } - \item Changes in Rcpp Attributes: - \itemize{ - \item Enable export of C++ interface for functions that return void. - } - \item Changes in Rcpp Sugar: - \itemize{ - \item Added new Sugar function \code{cummin()}, \code{cummax()}, - \code{cumprod()} (PR \ghpr{389} by Nathan Russell fixing \ghit{388}) - \item Enabled sugar math operations for subsets; e.g. x[y] + x[z]. - (PR \ghpr{393} by Kevin and Qiang, implementing \ghit{392}) - } - \item Changes in Rcpp Documentation: - \itemize{ - \item The \code{NEWS} file now links to GitHub issue tickets and pull - requests. - \item The \code{Rcpp.bib} file with bibliographic references was updated. - } - } -} - -\section{Changes in Rcpp version 0.12.1 (2015-09-10)}{ - \itemize{ - \item Changes in Rcpp API: - \itemize{ - \item Correct use of WIN32 instead of _WIN32 to please Windows 10 - \item Add an assignment operator to \code{DimNameProxy} (PR \ghpr{339} by Florian) - \item Add vector and matrix accessors \code{.at()} with bounds checking - (PR \ghpr{342} by Florian) - \item Correct character vector conversion from single char (PR \ghpr{344} by - Florian fixing issue \ghit{343}) - \item Correct on use of \code{R_xlen_t} back to \code{size_t} (PR \ghpr{348} by - Romain) - \item Correct subsetting code to allow for single assignment (PR \ghpr{349} by - Florian) - \item Enable subset assignment on left and righ-hand side (PR \ghpr{353} by - Qiang, fixing issue \ghit{345}) - \item Refreshed to included \code{tinyformat} template library (PR \ghpr{357} by - Dirk, issue \ghit{356}) - \item Add \code{operator<<()} for vectors and matrices (PR \ghpr{361} by Dan - fixing issue \ghit{239}) - \item Make \code{String} and \code{String_Proxy} objects comparable (PR - \ghpr{366} and PR \ghpr{372} by Dan, fixing issue \ghit{191}) - \item Add a new class \code{Nullable} for objects which may be \code{NULL} - (PR \ghpr{368} by Dirk and Dan, fixing issue \ghit{363}) - \item Correct creation and access of large matrices (PR \ghpr{370} by Florian, - fixing issue \ghit{369}) - } - \item Changes in Rcpp Attributes: - \itemize{ - \item Correctly reset directory in case of no-rebuilding but Windows code - (PR \ghpr{335} by Dirk) - } - \item Changes in Rcpp Modules: - \itemize{ - \item We no longer define multiple Modules objects named \code{World} in - the unit tests with was seen to have a bad effect with R 3.2.2 or later - (PR \ghpr{351} by Dirk fixing issue \ghit{350}). - \item Applied patch by Kurt Hornik which improves how Rcpp loads Modules - (PR \ghpr{353} by Dirk) - } - \item Changes in Rcpp Documentation: - \itemize{ - \item The \code{Rcpp.bib} file with bibliographic references was updated. - } - } -} - -\section{Changes in Rcpp version 0.12.0 (2015-07-24)}{ - \itemize{ - \item Changes in Rcpp API: - \itemize{ - \item \code{Rcpp_eval()} no longer uses \code{R_ToplevelExec} when evaluating - R expressions; this should resolve errors where calling handlers (e.g. - through \code{suppressMessages()}) were not properly respected. - \item All internal length variables have been changed from \code{R_len_t} - to \code{R_xlen_t} to support vectors longer than 2^31-1 elements (via - PR \ghpr{303} by Qiang Kou). - \item The sugar function \code{sapply} now supports lambda functions - (addressing \ghit{213} thanks to Matt Dziubinski) - \item The \code{var} sugar function now uses a more robust two-pass - method, supports complex numbers, with new unit tests added (via PR - \ghpr{320} by Matt Dziubinski) - \item \code{String} constructors now allow encodings (via PR \ghpr{310} - by Qiang Kou) - \item \code{String} objects are preserving the underlying \code{SEXP} - objects better, and are more careful about initializations (via PRs - \ghpr{322} and \ghpr{329} by Qiang Kou) - \item DataFrame constructors are now a little more careful (via PR - \ghpr{301} by Romain Francois) - \item For R 3.2.0 or newer, \code{Rf_installChar()} is used instead of - \code{Rf_install(CHAR())} (via PR \ghpr{332}). - } - \item Changes in Rcpp Attributes: - \itemize{ - \item Use more robust method of ensuring unique paths for generated shared - libraries. - \item The \code{evalCpp} function now also supports the \code{plugins} - argument. - \item Correctly handle signature termination characters ('\{' or ';') contained - in quotes. - } - \item Changes in Rcpp Documentation: - \itemize{ - \item The \code{Rcpp-FAQ} vignette was once again updated with respect to - OS X issues and Fortran libraries needed for e.g. \CRANpkg{RcppArmadillo}. - \item The included \code{Rcpp.bib} bibtex file (which is also used by - other Rcpp* packages) was updated with respect to its CRAN references. - } - } -} - -\section{Changes in Rcpp version 0.11.6 (2015-05-01)}{ - \itemize{ - \item Changes in Rcpp API: - \itemize{ - \item The unwinding of exceptions was refined to protect against inadvertent - memory leaks. - \item Header files now try even harder not to let macro definitions leak. - \item Matrices have a new default constructor for zero-by-zero dimension - matrices (via a pull request by Dmitrii Meleshko). - \item A new \code{empty()} string constructor was added (via another pull - request). - \item Better support for Vectors with a storage policy different from the - default, i.e. \code{NoProtectStorage}, was added. - } - \item Changes in Rcpp Attributes: - \itemize{ - \item Rtools 3.3 is now supported. - } - } -} +\title{News for Package 'Rcpp'} +\newcommand{\cpkg}{\href{http://CRAN.R-project.org/package=#1}{\pkg{#1}}} \section{Changes in Rcpp version 0.11.5 (2015-03-04)}{ \itemize{ @@ -1554,16 +17,16 @@ \item The \code{Rcpp::Environment} constructor can now use a supplied parent environment. \item The \code{Rcpp::Function} constructor can now use a supplied - environment or namespace. + environment or namespace. \item The \code{attributes_hidden} macro from R is used to shield internal functions; the \code{R_ext/Visibility.h} header is now included as well. - \item A \code{Rcpp::print} function was added as a wrapper around \code{Rf_PrintValue}. + \item A \code{Rcpp::print} function was added as a wrapper around \code{Rf_PrintValue}. } \item Changes in Rcpp Attributes: \itemize{ \item The \code{pkg_types.h} file is now included in \code{RcppExports.cpp} - if it is present in either the \code{inst/include} or \code{src}. - \item \code{sourceCpp} was modified to allow includes of local files + if it is present in either the \code{inst/include} or \code{src}. + \item \code{sourceCpp} was modified to allow includes of local files (e.g. \code{#include "foo.hpp"}). Implementation files (*.cc; *.cpp) corresponding to local includes are also automatically built if they exist. \item The generated attributes code was simplified with respect to @@ -1691,15 +154,15 @@ \item Changes in Rcpp support functions: \itemize{ \item The \code{Rcpp.package.skeleton()} function will now use - \CRANpkg{pkgKitten} package, if available, to create a package which passes + \cpkg{pkgKitten} package, if available, to create a package which passes \code{R CMD check} without warnings. A new \code{Suggests:} has been added - for \CRANpkg{pkgKitten}. + for \cpkg{pkgKitten}. \item The \code{modules=TRUE} case for \code{Rcpp.package.skeleton()} has been improved and now runs without complaints from \code{R CMD check} as well. } \item Changes in Rcpp unit test functions: \itemize{ - \item Functions from the \CRANpkg{RUnit} package are now prefixed with \code{RUnit::} + \item Functions from the \cpkg{RUnit} package are now prefixed with \code{RUnit::} \item The \code{testRcppModule} and \code{testRcppClass} sample packages now pass \code{R CMD check --as-cran} cleanly with NOTES or WARNINGS } @@ -1742,7 +205,7 @@ \itemize{ \item Changes in Rcpp API: \itemize{ - \item Preserve backwards compatibility with \CRANpkg{Rcpp} 0.10.* by + \item Preserve backwards compatibility with \cpkg{Rcpp} 0.10.* by allowing \code{RObject} extraction from vectors (or lists) of Rcpp objects \item Add missing default constructor to Reference class that was @@ -1793,7 +256,7 @@ \itemize{ \item Changes in Rcpp API: \itemize{ - \item Functions provided/used by \CRANpkg{Rcpp} are now registered + \item Functions provided/used by \cpkg{Rcpp} are now registered with R and instantiated by client package alleviating the new for explicit linking against \code{libRcpp} which is therefore no longer created. @@ -1832,7 +295,7 @@ \item Changes in Rcpp unit tests: \itemize{ \item The file \code{tests/doRUnit.R} was rewritten following the - pattern deployed in \CRANpkg{RProtoBuf} which is due to Murray Stokely + pattern deployed in \cpkg{RProtoBuf} which is due to Murray Stokely \item The function \code{test()} was rewritten; it provides an easy entry point to running unit tests of the installed package } @@ -1993,7 +456,8 @@ } \item Changes in Rcpp sugar: \itemize{ - \item New function \code{na_omit} based on a StackOverflow thread + \item New function \code{na_omit} based on the StackOverflow thread + \url{http://stackoverflow.com/questions/15953768/} \item New function \code{is_finite} and \code{is_infinite} that reproduces the behavior of R's \code{is.finite} and \code{is.infinite} functions diff --git a/local/README b/inst/README similarity index 100% rename from local/README rename to inst/README diff --git a/local/THANKS b/inst/THANKS similarity index 100% rename from local/THANKS rename to inst/THANKS diff --git a/inst/bib/Rcpp.bib b/inst/bib/Rcpp.bib deleted file mode 100644 index 7a5f5115b..000000000 --- a/inst/bib/Rcpp.bib +++ /dev/null @@ -1,1027 +0,0 @@ -@String{CRAN = "https://CRAN.R-Project.org/" } -@String{manuals = CRAN # "doc/manuals/" } -@String{RCoreTeam = "{R Core Team}" } -@String{RFoundation = "R Foundation for Statistical Computing" } -@String{R-Forge = "https://R-Forge.R-Project.org/" } -@String{DOI = "10.32614/CRAN.package." } - -@manual{Abrahams+Grosse-Kunstleve:2003:Boost.Python, - author = { David Abrahams and Ralf W. Grosse-Kunstleve }, - organization = "Boost Consulting", - title = "Building Hybrid Systems with Boost.Python", - year = 2003, - url = "https://www.boostpro.com/writing/bpl.pdf" -} - -@Book{Abrahams+Gurtovoy:2004:TemplateMetaprogramming, - author = {David Abrahams and Aleksey Gurtovoy}, - title = {{C++} {T}emplate {M}etaprogramming: Concepts, Tools - and Techniques from {B}oost and Beyond}, - publisher = {Addison-Wesley}, - year = 2004, - address = {Boston} -} - -@book{Anderson:1990:UGLAPACK, - author = {Anderson, E. and Bai, Z. and Bischof, C. and - Blackford, S. and Demmel, J. and Dongarra, J. and Du - Croz, J. and Greenbaum, A. and Hammarling, S. and - McKenney, A. and Sorensen, D.}, - title = {{LAPACK} Users' Guide}, - edition = {Third}, - publisher = {Society for Industrial and Applied Mathematics}, - year = 1999, - address = {Philadelphia, PA}, - isbn = {0-89871-447-8 (paperback)} -} - -@Manual{Armstrong:2009:RAbstraction, - title = {{RAbstraction}: {C++} abstraction for {R} objects}, - author = {Whit Armstrong}, - year = 2009, - note = {Code repository last updated 2009-07-22.}, - url = {https://github.com/armstrtw/rabstraction} -} - -@Manual{Armstrong:2009:RObjects, - title = {{RObjects}: {C++} wrapper for R objects (a better - implementation of {RAbstraction}}, - author = {Whit Armstrong}, - year = 2009, - note = {Code repository last updated 2009-11-28.}, - url = {https://github.com/armstrtw/RObjects} -} - -@InProceedings{Bates+DebRoy:2001:C++Classes, - author = {Douglas M. Bates and Saikat DebRoy}, - title = {{C++} Classes for {R} Objects}, - booktitle = {Proceedings of the 2nd International Workshop on Distributed - Statistical Computing, March 15--17, 2001, Technische - Universit\"at Wien, Vienna, Austria}, - editor = {Kurt Hornik and Friedrich Leisch}, - year = {2001}, - url = {https://www.ci.tuwien.ac.at/Conferences/DSC-2001/Proceedings/}, - note = {ISSN 1609-395X} -} - - -@Misc{Brokken:2011:Cpp, - author = {Frank B. Brokken}, - title = {C++ Annotations}, - howpublished = {Electronic book, University of Groningen}, - year = 2011, - url = {https://www.icce.rug.nl/documents/cplusplus/} -} - -@Manual{CRAN:anytime, - title = {anytime: Anything to 'POSIXct' or 'Date' Converter}, - author = {Dirk Eddelbuettel}, - year = {2025}, - note = {R package version 0.3.12}, - oldurl = CRAN # "package=anytime", - doi = DOI # "anytime" -} - -@Manual{CRAN:AsioHeaders, - title = {'Asio' C++ Header Files}, - author = {Dirk Eddelbuettel}, - year = {2025}, - note = {R package version 1.30.2-1}, - oldurl = CRAN # "package=AsioHeaders", - doi = DOI # "AsioHeaders" -} - -@Manual{CRAN:BH, - title = {BH: Boost C++ Header Files}, - author = {Dirk Eddelbuettel and John W. Emerson and Michael - J. Kane}, - year = {2025}, - note = {R package version 1.90.0-1}, - oldurl = CRAN # "package=BH", - doi = DOI # "BH" -} - -@Manual{CRAN:Matrix, - title = {\pkg{Matrix}: Sparse and Dense Matrix Classes and Methods}, - author = {Douglas Bates and Martin Maechler}, - year = 2025, - note = {R package version 1.7-4}, - oldurl = CRAN # "package=Matrix", - doi = DOI # "Matrix" -} - -@Manual{CRAN:RInside, - title = {RInside: C++ classes to embed R in C++ applications}, - author = {Dirk Eddelbuettel and Romain Fran\c{c}ois}, - year = 2025, - note = {R package version 0.2.19}, - oldurl = CRAN # "package=RInside", - doi = DOI # "RInside" -} - -@Manual{CRAN:RProtoBuf, - title = {RProtoBuf: R Interface to the Protocol Buffers API}, - author = {Romain Fran\c{c}ois and Dirk Eddelbuettel and Murray Stokely and Jeroen Ooms}, - year = 2025, - note = {R package version 0.4.24}, - oldurl = CRAN # "package=RProtoBuf", - doi = DOI # "RProtoBuf" -} - -@Manual{CRAN:RQuantLib, - title = {RQuantLib: {R} Interface to the {QuantLib} Library}, - author = {Dirk Eddelbuettel and Khanh Nguyen and Terry Leitch}, - year = 2025, - note = {R package version 0.4.26}, - oldurl = CRAN # "package=RQuantLib", - doi = DOI # "RQuantLib" -} - -@Manual{CRAN:RUnit, - title = {RUnit: R Unit Test Framework}, - author = {Matthias Burger and Klaus Juenemann and Thomas - Koenig}, - year = 2024, - note = {R package version 0.4.33.1}, - oldurl = CRAN # "package=RUnit", - doi = DOI # "RUnit" -} - -@Manual{CRAN:Rcpp, - title = {{Rcpp}: Seamless {R} and {C++} Integration}, - author = {Dirk Eddelbuettel and Romain Fran\c{c}ois and JJ - Allaire and Kevin Ushey and Qiang Kou and - Nathan Russel and John Chambers and Douglas Bates}, - year = 2026, - note = {R package version 1.1.1}, - oldurl = CRAN # "package=Rcpp", - doi = DOI # "Rcpp" -} - -@Manual{CRAN:Rcpp:Attributes, - crossref = {CRAN:Rcpp}, - author = {J. J. Allaire and Dirk Eddelbuettel and Romain - Fran\c{c}ois}, - title = {{Rcpp} Attributes}, - year = 2026, - note = {Vignette included in R package Rcpp}, - oldurl = CRAN # "package=Rcpp", - doi = DOI # "Rcpp" -} - -@Manual{CRAN:Rcpp:FAQ, - crossref = {CRAN:Rcpp}, - author = {Dirk Eddelbuettel and Romain Fran\c{c}ois}, - title = {Frequently Asked Questions About {Rcpp}}, - year = 2026, - note = {Vignette included in R package {Rcpp}}, - oldurl = CRAN # "package=Rcpp", - doi = DOI # "Rcpp" -} - -@Manual{CRAN:Rcpp:Libraries, - crossref = {CRAN:Rcpp}, - author = {Dirk Eddelbuettel}, - title = {Thirteen Simple Steps for Creating An R Package with an External C++ Library }, - year = 2026, - note = {Vignette included in R package Rcpp}, - oldurl = CRAN # "package=Rcpp", - doi = DOI # "Rcpp" -} - -@Manual{CRAN:Rcpp:Modules, - crossref = {CRAN:Rcpp}, - author = {Dirk Eddelbuettel and Romain Fran\c{c}ois}, - title = {Exposing {C++} functions and classes with {Rcpp} modules}, - year = 2026, - note = {Vignette included in R package Rcpp}, - oldurl = CRAN # "package=Rcpp", - doi = DOI # "Rcpp" -} - -@Manual{CRAN:Rcpp:Package, - crossref = {CRAN:Rcpp}, - author = {Dirk Eddelbuettel and Romain Fran\c{c}ois}, - title = {Writing a package that uses {Rcpp}}, - year = 2026, - note = {Vignette included in R package {Rcpp}}, - oldurl = CRAN # "package=Rcpp", - doi = DOI # "Rcpp" -} - -@Manual{CRAN:Rcpp:Sugar, - crossref = {CRAN:Rcpp}, - author = {Dirk Eddelbuettel and Romain Fran\c{c}ois}, - title = {Rcpp syntactic sugar}, - year = 2026, - note = {Vignette included in R package {Rcpp}}, - oldurl = CRAN # "package=Rcpp", - doi = DOI # "Rcpp" -} - -@Manual{CRAN:RcppArmadillo, - title = {RcppArmadillo: Rcpp Integration for the Armadillo - Templated Linear Algebra Library}, - author = {Dirk Eddelbuettel and Romain Fran\c{c}ois and - Douglas Bates and Binxiang Ni and Conrad Sanderson}, - year = 2025, - note = {R package version 15.2.3-1}, - oldurl = CRAN # "package=RcppArmadillo", - doi = DOI # "RcppArmadillo" -} - -@Manual{CRAN:RcppCCTZ, - title = {RcppCCTZ: Rcpp Bindings for the CCTZ Library}, - author = {Dirk Eddelbuettel}, - year = 2024, - note = {R package version 0.2.13}, - oldurl = CRAN # "package=RcppCCTZ", - doi = DOI # "RcppCCTZ" -} - -@Manual{CRAN:RcppClassic, - title = {RcppClassic: Deprecated 'classic' Rcpp API}, - author = {Dirk Eddelbuettel and Romain Fran\c{c}ois}, - year = 2022, - note = {R package version 0.9.13}, - oldurl = CRAN # "package=RcppClassic", - doi = DOI # "RcppClassic" -} - -@Manual{CRAN:RcppDate, - title = {RcppDate: 'date' C++ Header Libary for Date and Time Functionality}, - author = {Dirk Eddelbuettel}, - year = 2025, - note = {R package version 0.0.6}, - oldurl = CRAN # "package=RcppDate", - doi = DOI # "RcppDate" -} - -@Manual{CRAN:RcppDE, - title = {RcppDE: Global Optimization by Differential Evolution in C++}, - author = {Dirk Eddelbuettel}, - year = 2025, - note = {R package version 0.1.8}, - oldurl = CRAN # "package=RcppDE", - doi = DOI # "RcppDE" -} - -@Manual{CRAN:RcppEigen, - title = {RcppEigen: Rcpp Integration for the Eigen Templated Linear - Algebra Library}, - author = {Douglas Bates and Dirk Eddelbuettel and Romain Fran\c{c}ois and Yixuan Qiu}, - year = 2024, - note = {{R} package version 0.3.4.0.2}, - oldurl = CRAN # "package=RcppEigen", - doi = DOI # "RcppEigen" -} - -@Manual{CRAN:RcppExamples, - title = {RcppExamples: Examples using {Rcpp} to interface {R} - and {C++}}, - author = {Dirk Eddelbuettel and Romain Fran\c{c}ois}, - year = 2025, - note = {R package version 0.1.10}, - oldurl = CRAN # "package=RcppExamples", - doi = DOI # "RcppExamples" -} - -@Manual{CRAN:RcppGSL, - title = {RcppGSL: Rcpp Integration for GNU GSL Vectors and Matrices}, - author = {Dirk Eddelbuettel and Romain Fran\c{c}ois}, - year = 2023, - note = {R package version 0.3.13}, - oldurl = CRAN # "package=RcppGSL", - doi = DOI # "RcppGSL" -} - -@Manual{CRAN:RcppInt64, - title = {RppInt64: Rcpp-Based Helper Functions to Pass Int64 and nanotime Values Between R and C++}, - author = {Dirk Eddelbuettel}, - year = 2024, - note = {R package version 0.0.5}, - oldurl = CRAN # "package=RcppInt64", - doi = DOI # "RcppInt64" -} - -@Manual{CRAN:RcppZiggurat, - title = {RcppZiggurat: Rcpp Integration of Different Ziggurat Normal RNG Implementations}, - author = {Dirk Eddelbuettel}, - year = 2025, - note = {R package version 0.1.8}, - oldurl = CRAN # "package=RcppZiggurat", - doi = DOI # "RcppZiggurat" -} - -@Manual{CRAN:Rserve, - title = {Rserve: Versatile R Server}, - author = {Simon Urbanek}, - year = 2025, - note = {R package version 1.8-16}, - oldurl = CRAN # "package=Rserve", - doi = DOI # "Rserve" -} - -@Manual{CRAN:cxxPack, - title = {cxxpack: {R/C++} Tools for Literate Statistical - Practice}, - author = {Dominick Samperi}, - year = 2010, - note = {R package version 7.0.6}, - oldurl = CRAN # "package=cxxPack", - doi = DOI # "cxxPack" -} - -@Manual{CRAN:devtools, - title = {devtools: Tools to Make Developing R Packages - Easier}, - author = {Hadley Wickham and Jim Hester and Winston Chang}, - year = 2025, - note = {R package version 2.4.6}, - oldurl = CRAN # "package=devtools", - doi = DOI # "devtools" -} - -@Manual{CRAN:highlight, - title = {highlight: Syntax Highlighter}, - author = {Hadley Wickham and Romain Fran\c{c}ois and Andre Simon}, - year = 2025, - note = {R package with version 0.5.2}, - oldurl = CRAN # "package=highlight", - doi = DOI # "highlight" -} - -@Manual{CRAN:inline, - title = {inline: Functions to Inline C, C++, Fortran Function Calls from - R}, - author = {Oleg Sklyar and Duncan Murdoch and Mike Smith and - Dirk Eddelbuettel and Romain Fran\c{c}ois and - Karline Soetaert and Johannes Ranke}, - year = 2025, - note = {R package version 0.3.21}, - oldurl = CRAN # "package=inline", - doi = DOI # "inline" -} - -@Manual{CRAN:littler, - title = {littler: {R} at the {Command-Line} via r}, - author = {Dirk Eddelbuettel and Jeffrey Horner}, - year = 2025, - note = {R package version 0.3.21}, - oldurl = CRAN # "package=littler", - doi = DOI # "littler" -} - -@Manual{CRAN:microbenchmark, - title = {microbenchmark: Accurate Timing Functions}, - author = {Olaf Mersmann}, - year = 2023, - note = {R package version 1.5-0}, - oldurl = CRAN # "package=microbenchmark", - doi = DOI # "microbenchmark" -} - -@Manual{CRAN:minqa, - title = {minqa: Derivative-Free Optimization Algorithms by - Quadratic Approximation}, - author = {Douglas Bates and Katharine M. Mullen and John - C. Nash and Ravi Varadhan}, - year = 2024, - note = {R package version 1.2.8}, - oldurl = CRAN # "package=minqa", - doi = DOI # "minqa" -} - -@Manual{CRAN:pkgKitten, - title = {pkgKitten: Create Simple Packages Which Do not Upset - R Package Checks}, - author = {Dirk Eddelbuettel}, - year = {2024}, - note = {R package version 0.2.4}, - oldurl = CRAN # "package=pkgKitten", - doi = DOI # "pkgKitten" -} - -@Manual{CRAN:profvis, - title = {profvis: Interactive Visualizations for Profiling R Code}, - author = {Winston Chang and Javier Luraschi and and Timothy Mastny}, - year = 2024, - note = {R package version 0.4.0}, - oldurl = CRAN # "package=profvis", - doi = DOI # "profvis" -} - -@Manual{CRAN:rbenchmark, - title = {\pkg{rbenchmark}: Benchmarking routine for R}, - author = {Wacek Kusnierczyk}, - year = 2012, - note = {R package version 1.0.0}, - oldurl = CRAN # "package=rbenchmark", - doi = DOI # "rbenchmark" -} - -@Manual{CRAN:roxygen2, - title = {roxygen2: In-Line documentation for R}, - author = {Hadley Wickham and Peter Danenberg and G\a'bor Cs\a'rdi and Manuel Eugster}, - year = 2025, - note = {R package version 7.3.3}, - oldurl = CRAN # "package=roxygen2", - doi = DOI # "roxygen2" -} - -@Article{CRAN:testthat, - author = {Hadley Wickham}, - title = {testthat: Get Started with Testing}, - journal = {The R Journal}, - year = 2011, - volume = 3, - pages = {5--10}, -} - -@Book{Chambers:1998:PwD, - author = {John M. Chambers}, - title = {Programming with Data: {A} Guide to the {S} Language}, - publisher = {Springer-Verlag}, - year = 1998, - address = {Heidelberg}, - note = {{ISBN} 978-0387985039} -} - -@Book{Chambers:2008:SoDA, - author = {John M. Chambers}, - title = {Software for Data Analysis: Programming with {R}}, - publisher = {Springer-Verlag}, - year = 2008, - series = {Statistics and Computing}, - address = {Heidelberg}, - note = {{ISBN} 978-0-387-75935-7} -} - -@Book{Chambers:2016:ExtR, - author = {John M. Chambers}, - title = {Extending R}, - publisher = {Chapman and Hall/CRC}, - year = 2016, - series = {{The R Series}}, - address = {London}, - note = {{ISBN} 9781498775717} -} - -@Article{Chambers:2020:S+R+DS, - author = {Chambers, John M.}, - title = {S, R, and Data Science}, - year = 2020, - issue_date = {June 2020}, - publisher = {Association for Computing Machinery}, - address = {New York, NY, USA}, - volume = 4, - number = {HOPL}, - url = {https://doi.org/10.1145/3386334}, - doi = {10.1145/3386334}, - journal = {Proceeding of the ACM on Programming Languages}, - month = jun, - articleno = 84, - numpages = 17, - keywords = {data science, statistical computing, scientific - computing} -} - -@Misc{Cpp11, - author = "ISO/IEC", - organization = "{International Organization for Standardization}", - title = "\proglang{C++} 2011 Standard Document 14882:2011", - howpublished = {ISO/IEC Standard Group for Information Technology / Programming Languages / C++}, - year = 2011, - url = "https://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=50372", - urlansi = "https://webstore.ansi.org/RecordDetail.aspx?sku=ISO/IEC%2014882:2011" -} - -@book{Dongarra:1979:UGLINPACK, - title = {LINPACK users' guide}, - author = {Dongarra, Jack J and Moler, Cleve B and Bunch, James - R and Stewart, Gilbert W}, - year = 1979, - publisher = {SIAM} -} - -@Article{Eddelbuettel+Sanderson:2013:RcppArmadillo, - title = {{RcppArmadillo}: Accelerating {R} with High-Performance {C++} Linear Algebra}, - author = {Dirk Eddelbuettel and Conrad Sanderson}, - journal = {Computational Statistics and Data Analysis}, - year = 2014, - volume = 71, - month = {March}, - pages = {1054--1063}, - doi = {10.1016/j.csda.2013.02.005}, - url = {https://dx.doi.org/10.1016/j.csda.2013.02.005} -} - -@Article{Eddelbuettel+Sanderson:2014:RcppArmadillo, - title = {{RcppArmadillo}: Accelerating {R} with High-Performance {C++} Linear Algebra}, - author = {Dirk Eddelbuettel and Conrad Sanderson}, - journal = {Computational Statistics and Data Analysis}, - year = 2014, - volume = 71, - month = {March}, - pages = {1054--1063}, - doi = {10.1016/j.csda.2013.02.005}, - url = {https://dx.doi.org/10.1016/j.csda.2013.02.005} -} - -@Book{Eddelbuettel:2013:Rcpp, - author = {Dirk Eddelbuettel}, - title = {Seamless R and C++ Integration with Rcpp}, - publisher = {Springer}, - series = {Use R!}, - year = 2013, - address = {New York}, - isbn = {978-1-4614-6867-7} -} - -@article{Efron:1979:Bootstrap, - URL = {https://www.jstor.org/stable/2958830}, - author = {Efron, B.}, - journal = {The Annals of Statistics}, - number = {1}, - pages = {1-26}, - publisher = {Institute of Mathematical Statistics}, - title = {Bootstrap Methods: Another Look at the Jackknife}, - volume = {7}, - year = {1979} -} - -@MISC{Eigen:Web, - author = {Ga\"{e}l Guennebaud and Beno\^{i}t Jacob and others}, - title = {Eigen v3}, - year = 2012, - url = {https://eigen.tuxfamily.org} -} - -@Manual{GSL, - title = {{GNU} {S}cientific {L}ibrary {R}eference {M}anual}, - author = {Mark Galassi and Jim Davies and James Theiler and Brian Gough and Gerard Jungman and Patrick Alken and Michael Booth and Fabrice Rossi}, - year = {2010}, - edition = {3rd}, - note = {Version 1.14. {ISBN} 0954612078}, - url = {https://www.gnu.org/software/gsl} -} - -@Book{Gentleman:2009:RProgramming, - author = {Robert Gentleman}, - title = {R Programming for Bioinformatics}, - publisher = {Chapman \& Hall/CRC}, - year = 2009, - series = {Computer Science and Data Analysis}, - address = {Boca Raton, FL} -} - -@Manual{GitHub:Rperform, - title = {Rperform: Rperform - Performance testing for R packages}, - author = {Akash Tandon and Toby Dylan Hocking}, - year = {2015}, - note = {R package version 0.0.0.9000}, -} - -@Article{Gropp+Lusk+Doss+Skjellum:1996:MPI, - author = {William Gropp and Ewing Lusk and Nathan Doss and Anthony Skjellum}, - title = {A high-performance, portable implementation of the {MPI} message passing interface standard}, - journal = {Parallel Computing}, - year = 1996, - url = {https://dx.doi.org/10.1016/0167-8191(96)00024-5}, - doi = {10.1016/0167-8191(96)00024-5}, - volume = 22, - number = 6, - pages = {789--828} -} - -@Book{Gropp+Lusk+Skjellum:1999:MPI, - author = {William Gropp and Ewing Lusk and Anthony Skjellum}, - title = {Using {MPI}: Portable Parallel Programming with the Message Passing Interface}, - publisher = {MIT Press}, - year = 1999, - series = {Scientific and Engineering Computation Series}, - edition = {2nd}, - month = {November}, - note = {{ISBN} 978-0-262-57132-6} -} - -@article{Ihaka:1996, - Author = {Ihaka, Ross and Gentleman, Robert}, - Journal = {Journal of Computational and Graphical Statistics}, - Number = 3, - Pages = {299--314}, - Title = {R: A Language for Data Analysis and Graphics}, - Volume = 5, - Year = 1996 -} - -@article{JOSS:RcppCNPy, - doi = {10.21105/joss.00055}, - url = {https://doi.org/10.21105/joss.00055}, - year = {2016}, - month = {sep}, - publisher = {The Open Journal}, - volume = {1}, - number = {5}, - author = {Dirk Eddelbuettel and Wush Wu}, - title = {{RcppCNPy}: Read-Write Support for {NumPy} Files in R}, - journal = {The Journal of Open Source Software} -} - -@Article{JSS:RProtoBuf, - title = {{RProtoBuf}: Efficient Cross-Language Data Serialization in - {R}}, - author = {Dirk Eddelbuettel and Murray Stokely and Jeroen Ooms}, - journal = {Journal of Statistical Software}, - year = {2016}, - volume = {71}, - number = {2}, - pages = {1--24}, - url = {https://doi.org/10.18637/jss.v071.i02}, - doi = {10.18637/jss.v071.i02} -} - -@Article{JSS:Rcpp, - title = {{Rcpp}: Seamless {R} and {C++} Integration}, - author = {Dirk Eddelbuettel and Romain Fran\c{c}ois}, - journal = {Journal of Statistical Software}, - year = 2011, - volume = 40, - number = 8, - pages = {1--18}, - url = {https://doi.org/10.18637/jss.v040.i08}, - doi = {10.18637/jss.v040.i08} -} - -@Article{JSS:RcppEigen, - title = {Fast and Elegant Numerical Linear Algebra Using the - {RcppEigen} Package}, - author = {Douglas Bates and Dirk Eddelbuettel}, - journal = {Journal of Statistical Software}, - year = {2013}, - volume = {52}, - number = {5}, - pages = {1--24}, - url = {https://doi.org/10.18637/jss.v052.i05}, - doi = {10.18637/jss.v052.i05} -} - -@Unpublished{Java+Gaile+Manly:2007:RCpp, - author = {James J. Java and Daniel P. Gaile and Kenneth - E. Manly}, - title = {{R/Cpp}: Interface Classes to Simplify Using {R} - Objects in {C++} Extensions}, - note = {Unpublished manuscript, University at Buffalo}, - url = - {https://sphhp.buffalo.edu/biostat/research/techreports/UB_Biostatistics_TR0702.pdf}, - month = {July}, - year = 2007 -} - -@misc{KDE-TechBase:2012, - author = {KDE-TechBase}, - title = {Binary Compatibility Issues With {C++}}, - url = "https://techbase.kde.org/Policies/Binary_Compatibility_Issues_With_C++", - year = 2012, - note = "[Online; accessed 24-November-2012]" -} - -@InProceedings{Leisch:2008:Tutorial, - author = {Friedrich Leisch}, - title = {Tutorial on {C}reating \proglang{R} {P}ackages}, - booktitle = {COMPSTAT 2008 -- Proceedings in Computational - Statistics}, - year = 2008, - editor = {Paula Brito}, - address = {Heidelberg}, - publisher = {Physica Verlag}, - url = CRAN # "doc/contrib/Leisch-CreatingPackages.pdf" -} - -@Manual{Liang:2008:rcppbind, - title = {rcppbind: {A} template library for R/C++ developers}, - author = {Gang Liang}, - year = 2008, - note = {R package version 1.0}, - url = R-Forge # "projects/rcppbind" -} - -@Book{Lippman+Lajoie+Moo:2005:Cpp_Primer, - author = {Stanley B. Lippman and Jos\'{e}e Lajoie and Barbara E. Moo}, - title = {The C++ Primer}, - publisher = {Addison-Wesley}, - address = {Boston}, - year = 2005, - edition = {4th} -} - -@Book{Matloff:2011:ArtOfR, - author = {Norman Matloff}, - title = {The Art of R Programming: A Tour of Statistical Software Design}, - publisher = {No Starch Press}, - address = {San Francisco, CA}, - year = 2011 -} - -@InProceedings{Maurer+Wong:2008:AttributesInC++, - author = {Jens Maurer and Michael Wong}, - title = {Towards support for attributes in {C++} (Revision - 6)}, - booktitle = {JTC1/SC22/WG21 - The C++ Standards Committee}, - year = {2008}, - url = - {https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2761.pdf}, - note = {{N2761=08-0271}} -} - -@book{Meyers:1995:MoreEffectiveC++, - author = {Scott Meyers}, - title = {More Effective C++: 35 New Ways to Improve Your - Programs and Designs}, - year = 1995, - note = {{ISBN} 020163371X}, - publisher = {Addison-Wesley}, - address = {Boston} -} - -@book{Meyers:2001:EffectiveSTL, - author = {Scott Meyers}, - title = {Effective STL: 50 specific ways to improve your use - of the standard template library}, - year = 2001, - note = {{ISBN} 0-201-74962-9}, - publisher = {Addison-Wesley}, - address = {Essex} -} - -@book{Meyers:2005:EffectiveC++, - author = {Scott Meyers}, - title = {Effective C++: 55 Specific Ways to Improve Your - Programs and Designs}, - year = 2005, - note = {{ISBN} 978-0321334879}, - publisher = {Addison-Wesley}, - address = {Boston}, - edition = {3rd}, -} - -@Article{PeerJ:Rcpp, - author = {Dirk Eddelbuettel and James Joseph Balamuta}, - title = {Extending R with C++: A Brief Introduction to Rcpp}, - journal = {PeerJ Preprints}, - volume = 5, - issue = {e3188v1}, - year = 2017, - month = {August}, - url = {https://doi.org/10.7287/peerj.preprints.3188v1/}, - doi = {10.7287/peerj.preprints.3188v1/} -} - -@Book{Plauger+Et+Al:2000:STL, - author = {P.J. Plauger and Alexander Stepanov and Meng Lee and - David R. Musser}, - title = {The {C++} Standard Template Library}, - publisher = {Prentice Hall PTR}, - year = 2000, - note = {{ISBN} 978-0134376332} -} - -@manual{QuantLib, - author = {{QuantLib Core Team}}, - year = 2021, - title = {QuantLib: a free/open-source library for quantitative finance}, - url = {https://quantlib.org} -} - -@manual{R:Administration, - author = RCoreTeam, - organization = RFoundation, - address = {Vienna, Austria}, - year = 2025, - title = "R Installation and Administration", - annote = {{ISBN} 3-900051-09-7}, - doi = "10.32614/R.manuals", - url = manuals # "R-admin.html" -} - -@manual{R:Extensions, - author = RCoreTeam, - organization = RFoundation, - address = {Vienna, Austria}, - year = 2025, - title = "Writing R extensions", - annote = {{ISBN} 3-900051-11-9}, - doi = "10.32614/R.manuals", - url = manuals # "R-exts.html" -} - -@manual{R:Internals, - author = RCoreTeam, - organization = RFoundation, - address = {Vienna, Austria}, - year = 2025, - title = "R internals", - annote = {{ISBN} 3-900051-14-3}, - doi = "10.32614/R.manuals", - url = manuals # "R-ints.html" -} - -@manual{R:Language, - author = RCoreTeam, - organization = RFoundation, - address = {Vienna, Austria}, - year = 2025, - title = "R language", - annote = {{ISBN} 3-900051-13-5}, - doi = "10.32614/R.manuals", - url = manuals # "R-lang.html" -} - -@Manual{R:Main, - title = {R: A Language and Environment for Statistical - Computing}, - author = RCoreTeam, - organization = RFoundation, - address = {Vienna, Austria}, - year = 2025, - doi = "10.32614/R.manuals", - url = {https://www.R-project.org/} -} - -@InProceedings{Runnalls:2009:CXXR, - author = {Andrew Runnalls}, - title = {Aspects of {CXXR} internals}, - booktitle = {Directions in Statistical Computing}, - address = {University of Copenhagen, Denmark}, - year = 2009 -} - -@Manual{Samperi:2009:RcppTemplate, - title = {RcppTemplate: Rcpp {R/C++} Object Mapping Library - and Package Template}, - author = {Dominick Samperi}, - year = 2009, - note = {(Archived) R package version 6.1}, - url = CRAN # "/src/contrib/Archive/RcppTemplate" -} - -@article{Sanderson+Curtin:2016, - doi = {10.21105/joss.00026}, - url = {https://dx.doi.org/10.21105/joss.00026}, - year = 2016, - month = {{June}}, - publisher = {The Open Journal}, - volume = 1, - number = 2, - author = {Conrad Sanderson and Ryan Curtin}, - title = {Armadillo: {A Template-Based C++ Library for Linear - Algebra}}, - journal = {{JOSS}} -} - -@TechReport{Sanderson:2010:Armadillo, - author = {Conrad Sanderson}, - title = {{Armadillo}: {An} open source {C++} Algebra Library - for Fast Prototyping and Computationally Intensive - Experiments }, - institution = {{NICTA}}, - year = 2010, - url = "https://arma.sf.net" -} - -@Book{Stroustrup:1997:Cpp, - author = {Bjarne Stroustrup}, - title = {The C++ Programming Language}, - publisher = {Addison-Wesley}, - address = {Boston}, - year = 1997, - edition = {3rd} -} - -@Book{Stroustrup:2013:Cpp, - author = {Bjarne Stroustrup}, - title = {The C++ Programming Language}, - publisher = {Addison-Wesley}, - address = {Boston}, - year = 2013, - pages = 1368, - edition = {4th} -} - -@Article{TAS:Rcpp, - author = {Dirk Eddelbuettel and James Joseph Balamuta}, - title = {Extending R with C++: A Brief Introduction to Rcpp}, - journal = {The American Statistician}, - volume = 72, - number = 1, - year = 2018, - month = {August}, - url = {https://doi.org/10.1080/00031305.2017.1375990}, - doi = {10.1080/00031305.2017.1375990} -} - -@Article{TempleLang:2009:ModestProposal, - author = {Duncan {Temple Lang}}, - title = {A modest proposal: an approach to making the - internal {R} system extensible}, - journal = {Computational Statistics}, - year = 2009, - volume = 24, - number = 2, - pages = {271-281}, - month = {May} -} - -@Article{TempleLang:2009:RGCCTranslationUnit, - author = {Duncan {Temple Lang}}, - title = {Working with meta-data from {C/C++} code in {R}: the - {RGCCTranslationUnit} package}, - journal = {Computational Statistics}, - year = 2009, - volume = 24, - number = 2, - pages = {283-293}, - month = {May} -} - -@InProceedings{Urbanek:2003:Rserve, - author = {Simon Urbanek}, - title = {{Rserve}: A Fast Way to Provide {R} Functionality to - Applications}, - booktitle = {Proceedings of the 3rd International Workshop on Distributed - Statistical Computing, Vienna, Austria}, - editor = {Kurt Hornik and Friedrich Leisch and Achim Zeileis}, - year = {2003}, - url = {https://www.ci.tuwien.ac.at/Conferences/DSC-2003/Proceedings/}, - note = {{ISSN 1609-395X}} -} - -@Book{Vandevoorde+Josuttis:2003:Templates, - author = {David Vandevoorde and Nicolai M. Josuttis}, - title = {{C++} {T}emplates: The Complete Guide}, - publisher = {Addison-Wesley}, - year = 2003, - address = {Boston} -} - -@inproceedings{Veldhuizen:1998:Blitz, - author = {Todd L. Veldhuizen}, - title = {Arrays in {Blitz++}}, - booktitle = {ISCOPE '98: Proceedings of the Second International - Symposium on Computing in Object-Oriented Parallel - Environments}, - note = {{ISBN} 3-540-65387-2}, - year = 1998, - pages = {223--230}, - publisher = {Springer-Verlag}, - address = {London}, -} - - -@Book{Venables+Ripley:2000:SProgramming, - author = {Willian N. Venables and Brian D. Ripley}, - title = {S Programming}, - publisher = {Springer-Verlag}, - year = 2000, - series = {Statistics and Computing}, - address = {New York} -} - - -@Book{Venables+Ripley:2002:MASS, - title = {Modern Applied Statistics with S}, - author = {W. N. Venables and B. D. Ripley}, - publisher = {Springer}, - edition = {Fourth}, - address = {New York}, - year = 2002, - note = {ISBN 0-387-95457-0}, - url = {https://www.stats.ox.ac.uk/pub/MASS4}, -} - -@misc{arxiv:corels, - title = {Learning Certifiably Optimal Rule Lists for - Categorical Data}, - author = {Elaine Angelino and Nicholas Larus-Stone and Daniel - Alabi and Margo Seltzer and Cynthia Rudin}, - year = 2017, - howpublished = {\href{https://www.arxiv.org/1704.01701}{arXiv:1704.01701}}, - archivePrefix ={arXiv}, - primaryClass = {stat.ML} -} - -@Misc{github:corels, - author = {Nicholas Laurus-Stone}, - title = {corels: {Learning Certifiably Optimal Rule Lists}}, - howpublished = {\url{https://github.com/nlarusstone/corels}. Also online at \url{https://corels.eecs.harvard.edu/corels/}}, - month = 06, - year = 2019 -} - -@Misc{github:rcppcorels, - author = {Dirk Eddelbuettel}, - title = {RcppCorels: R binding for the 'Certifiably Optimal RulE ListS (Corels)' Learner}, - howpublished = {\url{https://github.com/eddelbuettel/rcppcorels}}, - month = 11, - year = 2019 -} diff --git a/inst/examples/ConvolveBenchmarks/exampleRCode.r b/inst/examples/ConvolveBenchmarks/exampleRCode.r index 47605ef06..9c822961d 100755 --- a/inst/examples/ConvolveBenchmarks/exampleRCode.r +++ b/inst/examples/ConvolveBenchmarks/exampleRCode.r @@ -1,4 +1,4 @@ -#!/usr/bin/env r +#!/usr/bin/r suppressMessages(require(Rcpp)) set.seed(42) diff --git a/inst/examples/ConvolveBenchmarks/overhead.r b/inst/examples/ConvolveBenchmarks/overhead.r index 30df92698..2d46b589a 100644 --- a/inst/examples/ConvolveBenchmarks/overhead.r +++ b/inst/examples/ConvolveBenchmarks/overhead.r @@ -1,4 +1,4 @@ -#!/usr/bin/env r +#!/usr/bin/r set.seed(42) a <- rnorm(100) @@ -17,8 +17,12 @@ overhead_cpp <- function(a,b) .Call( overhead_cpp_symbol, a, b ) ## load benchmarkin helper function suppressMessages(library(rbenchmark)) -res <- benchmark(overhead_cpp(a,b), overhead_c(a,b), - columns=c("test", "replications", "elapsed", "relative", "user.self", "sys.self"), - order="relative", - replications=10000) -print(res) +benchmark( + + overhead_cpp(a,b), + overhead_c(a,b), + + columns=c("test", "replications", "elapsed", "relative", "user.self", "sys.self"), + order="relative", + replications=10000) + diff --git a/inst/examples/FastLM/benchmark.r b/inst/examples/FastLM/benchmark.r index f994b3597..dfb48cc8b 100755 --- a/inst/examples/FastLM/benchmark.r +++ b/inst/examples/FastLM/benchmark.r @@ -1,4 +1,4 @@ -#!/usr/bin/env r +#!/usr/bin/r -t # # Comparison benchmark # @@ -22,9 +22,6 @@ # You should have received a copy of the GNU General Public License # along with Rcpp. If not, see . -suppressMessages(library(RcppGSL)) -suppressMessages(library(RcppArmadillo)) - source("lmArmadillo.R") source("lmGSL.R") diff --git a/inst/examples/FastLM/benchmarkLongley.r b/inst/examples/FastLM/benchmarkLongley.r index 9d5044778..6c27594e2 100755 --- a/inst/examples/FastLM/benchmarkLongley.r +++ b/inst/examples/FastLM/benchmarkLongley.r @@ -1,4 +1,4 @@ -#!/usr/bin/env r +#!/usr/bin/r -t # # Comparison benchmark -- using old and small Longley data set # diff --git a/inst/examples/FastLM/fastLMviaArmadillo.r b/inst/examples/FastLM/fastLMviaArmadillo.r index 628ebe4f7..e96d5bb98 100755 --- a/inst/examples/FastLM/fastLMviaArmadillo.r +++ b/inst/examples/FastLM/fastLMviaArmadillo.r @@ -1,4 +1,4 @@ -#!/usr/bin/env r +#!/usr/bin/r -t # # A faster lm() replacement based on Armadillo # @@ -27,8 +27,8 @@ checkLmArmadillo <- function(y, X) { fun <- lmArmadillo() res <- fun(y, X) fit <- lm(y ~ X - 1) - rc <- all.equal( as.numeric(res[[1]]), as.numeric(coef(fit))) & - all.equal( as.numeric(res[[2]]), as.numeric(coef(summary(fit))[,2])) + rc <- all.equal( res[[1]], as.numeric(coef(fit))) & + all.equal( res[[2]], as.numeric(coef(summary(fit))[,2])) invisible(rc) } diff --git a/inst/examples/FastLM/fastLMviaGSL.r b/inst/examples/FastLM/fastLMviaGSL.r index 24262f93f..5d3da6695 100755 --- a/inst/examples/FastLM/fastLMviaGSL.r +++ b/inst/examples/FastLM/fastLMviaGSL.r @@ -1,4 +1,4 @@ -#!/usr/bin/env r +#!/usr/bin/r -t # # A faster lm() replacement based on GNU GSL # diff --git a/inst/examples/FastLM/lmArmadillo.R b/inst/examples/FastLM/lmArmadillo.R index 35db589d6..28ce5021d 100644 --- a/inst/examples/FastLM/lmArmadillo.R +++ b/inst/examples/FastLM/lmArmadillo.R @@ -19,14 +19,9 @@ # along with Rcpp. If not, see . suppressMessages(require(Rcpp)) - -## NOTE: This is the old way to compile Rcpp code inline. -## The code here has left as a historical artifact and tribute to the old way. -## Please use the code under the "new" inline compilation section. - suppressMessages(require(inline)) -lmArmadillo_old <- function() { +lmArmadillo <- function() { src <- ' Rcpp::NumericVector yr(Ysexp); @@ -54,36 +49,11 @@ lmArmadillo_old <- function() { ' ## turn into a function that R can call - fun_old <- cxxfunction(signature(Ysexp="numeric", Xsexp="numeric"), - src, - includes="#include ", - plugin="RcppArmadillo") + fun <- cfunction(signature(Ysexp="numeric", Xsexp="numeric"), + src, + includes="#include ", + Rcpp=TRUE, + cppargs="-I/usr/include", + libargs="-larmadillo -llapack") } - -## NOTE: Within this section, the new way to compile Rcpp code inline has been -## written. Please use the code next as a template for your own project. - -lmArmadillo <- function() { - - sourceCpp(code=' - #include - // [[Rcpp::depends(RcppArmadillo)]] - - // [[Rcpp::export]] - Rcpp::List fun(const arma::vec & y, const arma::mat & X){ - - int n = X.n_rows, k = X.n_cols; - - arma::vec coef = solve(X, y); // fit model y ~ X - - arma::vec resid = y - X*coef; // to compute std. error of the coefficients - double sig2 = arma::as_scalar(trans(resid)*resid)/(n-k); // requires Armadillo 0.8.2 or later - arma::mat covmat = sig2 * arma::inv(arma::trans(X)*X); - - return Rcpp::List::create( Rcpp::Named( "coefficients") = coef, - Rcpp::Named( "stderr") = sqrt(arma::diagvec(covmat))); - }') - - fun -} diff --git a/inst/examples/FastLM/lmGSL.R b/inst/examples/FastLM/lmGSL.R index da23e48d7..960d6c99b 100644 --- a/inst/examples/FastLM/lmGSL.R +++ b/inst/examples/FastLM/lmGSL.R @@ -19,14 +19,9 @@ # along with Rcpp. If not, see . suppressMessages(require(Rcpp)) - -## NOTE: This is the old way to compile Rcpp code inline. -## The code here has left as a historical artifact and tribute to the old way. -## Please use the code under the "new" inline compilation section. - suppressMessages(require(inline)) -lmGSL_old <- function() { +lmGSL <- function() { src <- ' @@ -67,52 +62,10 @@ lmGSL_old <- function() { ## turn into a function that R can call ## compileargs redundant on Debian/Ubuntu as gsl headers are found anyway - fun_old <- cxxfunction(signature(Ysexp="numeric", Xsexp="numeric"), - src, - includes="#include ", - plugin="RcppGSL") -} - -## NOTE: Within this section, the new way to compile Rcpp code inline has been -## written. Please use the code next as a template for your own project. - -lmGSL <- function() { - -sourceCpp(code=' -#include -#include -// [[Rcpp::depends(RcppGSL)]] - -// [[Rcpp::export]] -Rcpp::List fun(Rcpp::NumericVector Yr, Rcpp::NumericMatrix Xr){ - - int i, j, n = Xr.nrow(), k = Xr.ncol(); - double chisq; - - RcppGSL::Matrix X(n, k); // allocate a gsl_matrix of dim n, k - RcppGSL::Vector y(n); // allocate a gsl_vector of length n - RcppGSL::Vector c(k); // allocate a gsl_vector of length k - RcppGSL::Matrix cov(k, k); // allocate a gsl_matrix of dim k, k - - for (i = 0; i < n; i++) { - for (j = 0; j < k; j++) - X(i, j) = Xr(i, j); - y[i] = Yr(i); // Note vector requires [] not () - } - - gsl_multifit_linear_workspace *work = gsl_multifit_linear_alloc (n, k); - gsl_multifit_linear (X, y, c, cov, &chisq, work); - gsl_multifit_linear_free (work); - - Rcpp::NumericVector coefr(k), stderrestr(k); - for (i = 0; i < k; i++) { - coefr(i) = c[i]; - stderrestr(i) = sqrt(cov(i,i)); - } - - - return Rcpp::List::create( Rcpp::Named("coef") = coefr, - Rcpp::Named("stderr") = stderrestr); -}') -fun + fun <- cfunction(signature(Ysexp="numeric", Xsexp="numeric"), + src, + includes="#include ", + Rcpp=TRUE, + cppargs="-I/usr/include", + libargs="-lgsl -lgslcblas") } diff --git a/inst/examples/Misc/fibonacci.r b/inst/examples/Misc/fibonacci.r index 6ae402fca..b93c235a1 100755 --- a/inst/examples/Misc/fibonacci.r +++ b/inst/examples/Misc/fibonacci.r @@ -1,4 +1,4 @@ -#!/usr/bin/env r +#!/usr/bin/r ## this short example was provided in response to this StackOverflow questions: ## http://stackoverflow.com/questions/6807068/why-is-my-recursive-function-so-slow-in-r @@ -6,8 +6,6 @@ ## all expensive in C++ (my machine sees a 700-fold speed increase) and c) the byte ## compiler in R does not help here. -suppressMessages(library(Rcpp)) - ## byte compiler require(compiler) diff --git a/inst/examples/Misc/ifelseLooped.r b/inst/examples/Misc/ifelseLooped.r index c63bad836..b9923fd1e 100644 --- a/inst/examples/Misc/ifelseLooped.r +++ b/inst/examples/Misc/ifelseLooped.r @@ -1,4 +1,4 @@ -#!/usr/bin/env r +#!/usr/bin/r ## ## This example goes back to the following StackOverflow questions: ## http://stackoverflow.com/questions/7153586/can-i-vectorize-a-calculation-which-depends-on-previous-elements diff --git a/inst/examples/Misc/newFib.r b/inst/examples/Misc/newFib.r index b7655c9f1..cca76b8e4 100644 --- a/inst/examples/Misc/newFib.r +++ b/inst/examples/Misc/newFib.r @@ -1,4 +1,4 @@ -#!/usr/bin/env r +#!/usr/bin/r ## New and shorter version of Fibonacci example using Rcpp 0.9.16 or later features ## The the sibbling file 'fibonacci.r' for context diff --git a/inst/examples/Misc/piBySimulation.r b/inst/examples/Misc/piBySimulation.r index 2484ee83a..d404f54bd 100755 --- a/inst/examples/Misc/piBySimulation.r +++ b/inst/examples/Misc/piBySimulation.r @@ -1,4 +1,4 @@ -#!/usr/bin/env r +#!/usr/bin/r library(Rcpp) library(rbenchmark) diff --git a/inst/examples/Misc/piSugar.cpp b/inst/examples/Misc/piSugar.cpp index 69fa040e1..77a26d280 100644 --- a/inst/examples/Misc/piSugar.cpp +++ b/inst/examples/Misc/piSugar.cpp @@ -5,8 +5,9 @@ using namespace Rcpp; // [[Rcpp::export]] double piSugar(const int N) { - NumericVector x = runif(N); - NumericVector y = runif(N); - NumericVector d = sqrt(x*x + y*y); - return 4.0 * sum(d < 1.0) / N; + RNGScope scope; // ensure RNG gets set/reset + NumericVector x = runif(N); + NumericVector y = runif(N); + NumericVector d = sqrt(x*x + y*y); + return 4.0 * sum(d < 1.0) / N; } diff --git a/inst/examples/OpenMP/OpenMPandInline.r b/inst/examples/OpenMP/OpenMPandInline.r index 31f6e83e4..e564e51df 100644 --- a/inst/examples/OpenMP/OpenMPandInline.r +++ b/inst/examples/OpenMP/OpenMPandInline.r @@ -1,4 +1,4 @@ -#!/usr/bin/env r +#!/usr/bin/r library(inline) library(rbenchmark) diff --git a/inst/examples/RcppGibbs/RcppGibbs.R b/inst/examples/RcppGibbs/RcppGibbs.R index 6ab088da6..47641e1c9 100644 --- a/inst/examples/RcppGibbs/RcppGibbs.R +++ b/inst/examples/RcppGibbs/RcppGibbs.R @@ -83,12 +83,8 @@ RCgibbs <- cmpfun(Rgibbs) ## mat <- Rgibbs(10000,10); dim(mat) ## would give: [1] 10000 2 -## Now for the Rcpp version -- Notice how easy it is to code up! - -## NOTE: This is the old way to compile Rcpp code inline. -## The code here has left as a historical artifact and tribute to the old way. -## Please use the code under the "new" inline compilation section. +## Now for the Rcpp version -- Notice how easy it is to code up! gibbscode <- ' using namespace Rcpp; // inline does that for us already @@ -100,7 +96,7 @@ gibbscode <- ' int i,j; NumericMatrix mat(N, 2); - RNGScope scope; // Initialize Random number generator. Not needed when Attributes used. + RNGScope scope; // Initialize Random number generator // The rest of the code follows the R version double x=0, y=0; @@ -118,7 +114,7 @@ gibbscode <- ' ' # Compile and Load -RcppGibbs_old <- cxxfunction(signature(n="int", thin = "int"), +RcppGibbs <- cxxfunction(signature(n="int", thin = "int"), gibbscode, plugin="Rcpp") @@ -150,7 +146,7 @@ gslgibbscode <- ' ' ## Compile and Load -GSLGibbs_old <- cxxfunction(signature(ns="int", thns = "int"), +GSLGibbs <- cxxfunction(signature(ns="int", thns = "int"), body=gslgibbscode, includes=gslgibbsincl, plugin="RcppGSL") @@ -162,69 +158,6 @@ GSLGibbs_old <- cxxfunction(signature(ns="int", thns = "int"), # libargs="-lgsl -lgslcblas") -## NOTE: Within this section, the new way to compile Rcpp code inline has been -## written. Please use the code next as a template for your own project. - -## Use of the cppFunction() gives the ability to immediately compile embed C++ -## without having to worry about header specification or Rcpp attributes. - -cppFunction(' -NumericMatrix RcppGibbs(int N, int thn){ - // Note: n and thin are SEXPs which the Rcpp automatically converts to ints - - // Setup storage matrix - NumericMatrix mat(N, 2); - - // The rest of the code follows the R version - double x = 0, y = 0; - - for (int i = 0; i < N; i++) { - for (int j = 0; j < thn; j++) { - x = R::rgamma(3.0,1.0/(y*y+4)); - y = R::rnorm(1.0/(x+1),1.0/sqrt(2*x+2)); - } - mat(i,0) = x; - mat(i,1) = y; - } - - return mat; // Return to R -}') - - -## Use of the sourceCpp() is preferred for users who wish to source external -## files or specify their headers and Rcpp attributes within their code. -## Code here is able to easily be extracted and placed into its own C++ file. - -## Compile and Load -sourceCpp(code=" -#include -#include -#include - -using namespace Rcpp; // just to be explicit - -// [[Rcpp::depends(RcppGSL)]] - -// [[Rcpp::export]] -NumericMatrix GSLGibbs(int N, int thin){ - gsl_rng *r = gsl_rng_alloc(gsl_rng_mt19937); - double x = 0, y = 0; - NumericMatrix mat(N, 2); - for (int i = 0; i < N; i++) { - for (int j = 0; j < thin; j++) { - x = gsl_ran_gamma(r,3.0,1.0/(y*y+4)); - y = 1.0/(x+1)+gsl_ran_gaussian(r,1.0/sqrt(2*x+2)); - } - mat(i,0) = x; - mat(i,1) = y; - } - gsl_rng_free(r); - - return mat; // Return to R -}") - - - ## Now for some tests ## You can try other values if you like ## Note that the total number of interations are N*thin! @@ -289,3 +222,5 @@ print(res) ## And we are done + + diff --git a/inst/examples/RcppGibbs/RcppGibbs_Updated.R b/inst/examples/RcppGibbs/RcppGibbs_Updated.R deleted file mode 100644 index 938b2d1b1..000000000 --- a/inst/examples/RcppGibbs/RcppGibbs_Updated.R +++ /dev/null @@ -1,189 +0,0 @@ -## Simple Gibbs Sampler Example -## Adapted from Darren Wilkinson's post at -## http://darrenjw.wordpress.com/2010/04/28/mcmc-programming-in-r-python-java-and-c/ -## -## Sanjog Misra and Dirk Eddelbuettel, June-July 2011 -## Updated by Dirk Eddelbuettel, Mar 2020 - -suppressMessages({ - library(Rcpp) - library(rbenchmark) -}) - - -## Actual joint density -- the code which follow implements -## a Gibbs sampler to draw from the following joint density f(x,y) -fun <- function(x,y) { - x*x * exp(-x*y*y - y*y + 2*y - 4*x) -} - -## Note that the full conditionals are propotional to -## f(x|y) = (x^2)*exp(-x*(4+y*y)) : a Gamma density kernel -## f(y|x) = exp(-0.5*2*(x+1)*(y^2 - 2*y/(x+1)) : Normal Kernel - -## There is a small typo in Darrens code. -## The full conditional for the normal has the wrong variance -## It should be 1/sqrt(2*(x+1)) not 1/sqrt(1+x) -## This we can verify ... -## The actual conditional (say for x=3) can be computed as follows -## First - Construct the Unnormalized Conditional -fy.unnorm <- function(y) fun(3,y) - -## Then - Find the appropriate Normalizing Constant -K <- integrate(fy.unnorm,-Inf,Inf) - -## Finally - Construct Actual Conditional -fy <- function(y) fy.unnorm(y)/K$val - -## Now - The corresponding Normal should be -fy.dnorm <- function(y) { - x <- 3 - dnorm(y,1/(1+x),sqrt(1/(2*(1+x)))) -} - -## and not ... -fy.dnorm.wrong <- function(y) { - x <- 3 - dnorm(y,1/(1+x),sqrt(1/((1+x)))) -} - -if (interactive()) { - ## Graphical check - ## Actual (gray thick line) - curve(fy,-2,2,col='grey',lwd=5) - - ## Correct Normal conditional (blue dotted line) - curve(fy.dnorm,-2,2,col='blue',add=T,lty=3) - - ## Wrong Normal (Red line) - curve(fy.dnorm.wrong,-2,2,col='red',add=T) -} - -## Here is the actual Gibbs Sampler -## This is Darren Wilkinsons R code (with the corrected variance) -## But we are returning only his columns 2 and 3 as the 1:N sequence -## is never used below -Rgibbs <- function(N,thin) { - mat <- matrix(0,ncol=2,nrow=N) - x <- 0 - y <- 0 - for (i in 1:N) { - for (j in 1:thin) { - x <- rgamma(1,3,y*y+4) - y <- rnorm(1,1/(x+1),1/sqrt(2*(x+1))) - } - mat[i,] <- c(x,y) - } - mat -} - -## Now for the Rcpp version -- Notice how easy it is to code up! - -cppFunction("NumericMatrix RcppGibbs(int N, int thn){ - NumericMatrix mat(N, 2); // Setup storage - double x = 0, y = 0; // The rest follows the R version - for (int i = 0; i < N; i++) { - for (int j = 0; j < thn; j++) { - x = R::rgamma(3.0,1.0/(y*y+4)); - y = R::rnorm(1.0/(x+1),1.0/sqrt(2*x+2)); - } - mat(i,0) = x; - mat(i,1) = y; - } - return mat; // Return to R -}") - - -## Use of the sourceCpp() is preferred for users who wish to source external -## files or specify their headers and Rcpp attributes within their code. -## Code here is able to easily be extracted and placed into its own C++ file. - -## Compile and Load -sourceCpp(code=" -#include -#include -#include - -using namespace Rcpp; // just to be explicit - -// [[Rcpp::depends(RcppGSL)]] - -// [[Rcpp::export]] -NumericMatrix GSLGibbs(int N, int thin){ - gsl_rng *r = gsl_rng_alloc(gsl_rng_mt19937); - double x = 0, y = 0; - NumericMatrix mat(N, 2); - for (int i = 0; i < N; i++) { - for (int j = 0; j < thin; j++) { - x = gsl_ran_gamma(r,3.0,1.0/(y*y+4)); - y = 1.0/(x+1)+gsl_ran_gaussian(r,1.0/sqrt(2*x+2)); - } - mat(i,0) = x; - mat(i,1) = y; - } - gsl_rng_free(r); - - return mat; // Return to R -}") - - - -## Now for some tests -## You can try other values if you like -## Note that the total number of interations are N*thin! -Ns <- c(1000,5000,10000,20000) -thins <- c(10,50,100,200) -tim_R <- rep(0,4) -tim_Rgsl <- rep(0,4) -tim_Rcpp <- rep(0,4) - -for (i in seq_along(Ns)) { - tim_R[i] <- system.time(mat <- Rgibbs(Ns[i],thins[i]))[3] - tim_Rgsl[i] <- system.time(gslmat <- GSLGibbs(Ns[i],thins[i]))[3] - tim_Rcpp[i] <- system.time(rcppmat <- RcppGibbs(Ns[i],thins[i]))[3] - cat("Replication #", i, "complete \n") -} - -## Comparison -speedup <- round(tim_R/tim_Rcpp,2); -speedup2 <- round(tim_R/tim_Rgsl,2); -summtab <- round(rbind(tim_R, tim_Rcpp,tim_Rgsl,speedup,speedup2),3) -colnames(summtab) <- c("N=1000","N=5000","N=10000","N=20000") -rownames(summtab) <- c("Elasped Time (R)","Elapsed Time (Rcpp)", "Elapsed Time (Rgsl)", - "SpeedUp Rcpp", "SpeedUp GSL") -print(summtab) - -## Contour Plots -- based on Darren's example -if (interactive() && require(KernSmooth)) { - op <- par(mfrow=c(4,1),mar=c(3,3,3,1)) - x <- seq(0,4,0.01) - y <- seq(-2,4,0.01) - z <- outer(x,y,fun) - contour(x,y,z,main="Contours of actual distribution",xlim=c(0,2), ylim=c(-2,4)) - fit <- bkde2D(as.matrix(mat),c(0.1,0.1)) - contour(drawlabels=T, fit$x1, fit$x2, fit$fhat, xlim=c(0,2), ylim=c(-2,4), - main=paste("Contours of empirical distribution:",round(tim_R[4],2)," seconds")) - fitc <- bkde2D(as.matrix(rcppmat),c(0.1,0.1)) - contour(fitc$x1,fitc$x2,fitc$fhat,xlim=c(0,2), ylim=c(-2,4), - main=paste("Contours of Rcpp based empirical distribution:",round(tim_Rcpp[4],2)," seconds")) - fitg <- bkde2D(as.matrix(gslmat),c(0.1,0.1)) - contour(fitg$x1,fitg$x2,fitg$fhat,xlim=c(0,2), ylim=c(-2,4), - main=paste("Contours of GSL based empirical distribution:",round(tim_Rgsl[4],2)," seconds")) - par(op) -} - - -## also use rbenchmark package -N <- 20000 -thn <- 200 -res <- benchmark(Rgibbs(N, thn), - RcppGibbs(N, thn), - GSLGibbs(N, thn), - columns=c("test", "replications", "elapsed", - "relative", "user.self", "sys.self"), - order="relative", - replications=10) -print(res) - - -## And we are done diff --git a/inst/examples/RcppGibbs/timeRNGs.R b/inst/examples/RcppGibbs/timeRNGs.R index 036c2341e..f95be4c5a 100644 --- a/inst/examples/RcppGibbs/timeRNGs.R +++ b/inst/examples/RcppGibbs/timeRNGs.R @@ -3,114 +3,12 @@ suppressMessages(library(Rcpp)) suppressMessages(library(inline)) suppressMessages(library(rbenchmark)) -## NOTE: Within this section, the new way to compile Rcpp code inline has been -## written. Please use the code next as a template for your own project, and -## do NOT use the old code below - -cppFunction(' -NumericVector rcppGamma(NumericVector x){ - int n = x.size(); - - const double y = 1.234; - for (int i=0; i. suppressMessages(library(Rcpp)) -suppressMessages(library(RcppGSL)) - -## NOTE: This is the old way to compile Rcpp code inline. -## The code here has left as a historical artifact and tribute to the old way. -## Please use the code under the "new" inline compilation section. - suppressMessages(library(inline)) -firstExample_old <- function() { +firstExample <- function() { ## a really simple C program calling three functions from the GSL gslrng <- ' gsl_rng *r; @@ -35,10 +29,10 @@ firstExample_old <- function() { r = gsl_rng_alloc (gsl_rng_default); - printf(" generator type: %s\\n", gsl_rng_name (r)); - printf(" seed = %lu\\n", gsl_rng_default_seed); + printf("generator type: %s\\n", gsl_rng_name (r)); + printf("seed = %lu\\n", gsl_rng_default_seed); v = gsl_rng_get (r); - printf(" first value = %.0f\\n", v); + printf("first value = %.0f\\n", v); gsl_rng_free(r); return R_NilValue; @@ -46,16 +40,18 @@ firstExample_old <- function() { ## turn into a function that R can call ## compileargs redundant on Debian/Ubuntu as gsl headers are found anyway - funx_old <- cxxfunction(signature(), gslrng, - includes="#include ", - plugin="RcppGSL") + funx <- cfunction(signature(), gslrng, + includes="#include ", + Rcpp=FALSE, + cppargs="-I/usr/include", + libargs="-lgsl -lgslcblas") cat("Calling first example\n") - funx_old() + funx() invisible(NULL) } -secondExample_old <- function() { +secondExample <- function() { ## now use Rcpp to pass down a parameter for the seed gslrng <- ' @@ -71,9 +67,9 @@ secondExample_old <- function() { v = gsl_rng_get (r); #ifndef BeSilent - printf(" generator type: %s\\n", gsl_rng_name (r)); - printf(" seed = %d\\n", seed); - printf(" first value = %.0f\\n", v); + printf("generator type: %s\\n", gsl_rng_name (r)); + printf("seed = %d\\n", seed); + printf("first value = %.0f\\n", v); #endif gsl_rng_free(r); @@ -83,27 +79,26 @@ secondExample_old <- function() { ## turn into a function that R can call ## compileargs redundant on Debian/Ubuntu as gsl headers are found anyway ## use additional define for compile to suppress output - funx_old <- cxxfunction(signature(par="numeric"), gslrng, - includes="#include ", - plugin="RcppGSL") + funx <- cfunction(signature(par="numeric"), gslrng, + includes="#include ", + Rcpp=TRUE, + cppargs="-I/usr/include", + libargs="-lgsl -lgslcblas") cat("\n\nCalling second example without -DBeSilent set\n") - print(funx_old(0)) - + print(funx(0)) - ## now override settings to add -D flag - settings <- getPlugin("RcppGSL") - settings$env$PKG_CPPFLAGS <- paste(settings$PKG_CPPFLAGS, "-DBeSilent") - - funx_old <- cxxfunction(signature(par="numeric"), gslrng, - includes="#include ", - settings=settings) + funx <- cfunction(signature(par="numeric"), gslrng, + includes="#include ", + Rcpp=TRUE, + cppargs="-I/usr/include -DBeSilent", + libargs="-lgsl -lgslcblas") cat("\n\nCalling second example with -DBeSilent set\n") - print(funx_old(0)) + print(funx(0)) invisible(NULL) } -thirdExample_old <- function() { +thirdExample <- function() { ## now use Rcpp to pass down a parameter for the seed, and a vector size gslrng <- ' @@ -128,17 +123,19 @@ thirdExample_old <- function() { ## turn into a function that R can call ## compileargs redundant on Debian/Ubuntu as gsl headers are found anyway ## use additional define for compile to suppress output - funx_old <- cxxfunction(signature(s="numeric", n="numeric"), - gslrng, - includes="#include ", - plugin="RcppGSL") + funx <- cfunction(signature(s="numeric", n="numeric"), + gslrng, + includes="#include ", + Rcpp=TRUE, + cppargs="-I/usr/include", + libargs="-lgsl -lgslcblas") cat("\n\nCalling third example with seed and length\n") - print(funx_old(0, 5)) + print(funx(0, 5)) invisible(NULL) } -fourthExample_old <- function() { +fourthExample <- function() { ## now use Rcpp to pass down a parameter for the seed, and a vector size gslrng <- ' @@ -163,185 +160,17 @@ fourthExample_old <- function() { ## turn into a function that R can call ## compileargs redundant on Debian/Ubuntu as gsl headers are found anyway ## use additional define for compile to suppress output - funx_old <- cxxfunction(signature(s="numeric", n="numeric"), - gslrng, - includes=c("#include ", - "using namespace Rcpp;", - "using namespace std;"), - plugin="RcppGSL") + funx <- cfunction(signature(s="numeric", n="numeric"), + gslrng, + includes=c("#include ", + "using namespace Rcpp;", + "using namespace std;"), + Rcpp=TRUE, + cppargs="-I/usr/include", + libargs="-lgsl -lgslcblas") cat("\n\nCalling fourth example with seed, length and namespaces\n") - print(funx_old(0, 5)) - - invisible(NULL) -} - -## NOTE: Within this section, the new way to compile Rcpp code inline has been -## written. Please use the code next as a template for your own project. - -firstExample <- function() { - ## a really simple C program calling three functions from the GSL - - sourceCpp(code=' -#include -#include - -// [[Rcpp::depends(RcppGSL)]] - -// [[Rcpp::export]] -SEXP funx(){ - gsl_rng *r; - gsl_rng_env_setup(); - double v; - - r = gsl_rng_alloc (gsl_rng_default); - - printf(" generator type: %s\\n", gsl_rng_name (r)); - printf(" seed = %lu\\n", gsl_rng_default_seed); - v = gsl_rng_get (r); - printf(" first value = %.0f\\n", v); - - gsl_rng_free(r); - return R_NilValue; -}') - - cat("Calling first example\n") - funx() - invisible(NULL) -} - -secondExample <- function() { - - ## now use Rcpp to pass down a parameter for the seed - - ## turn into a function that R can call - ## compileargs redundant on Debian/Ubuntu as gsl headers are found anyway - ## use additional define for compile to suppress output - - gslrng <- ' - #include - #include - - // [[Rcpp::depends(RcppGSL)]] - - // [[Rcpp::export]] - double funx(int seed){ - - gsl_rng *r; - gsl_rng_env_setup(); - double v; - - r = gsl_rng_alloc (gsl_rng_default); - - gsl_rng_set (r, (unsigned long) seed); - v = gsl_rng_get (r); - - #ifndef BeSilent - printf(" generator type: %s\\n", gsl_rng_name (r)); - printf(" seed = %d\\n", seed); - printf(" first value = %.0f\\n", v); - #endif - - gsl_rng_free(r); - return v; - }' - - sourceCpp(code=gslrng, rebuild = TRUE) - - cat("\n\nCalling second example without -DBeSilent set\n") - print(funx(0)) - - - ## now override settings to add -D flag - o = Sys.getenv("PKG_CPPFLAGS") - Sys.setenv("PKG_CPPFLAGS" = paste(o, "-DBeSilent")) - - sourceCpp(code=gslrng, rebuild = TRUE) - - # Restore environment flags - Sys.setenv("PKG_CPPFLAGS" = o ) - - cat("\n\nCalling second example with -DBeSilent set\n") - print(funx(0)) - - invisible(NULL) -} - -thirdExample <- function() { - - ## now use Rcpp to pass down a parameter for the seed, and a vector size - - ## turn into a function that R can call - ## compileargs redundant on Debian/Ubuntu as gsl headers are found anyway - ## use additional define for compile to suppress output - - sourceCpp(code=' - #include - #include - - // [[Rcpp::depends(RcppGSL)]] - - // [[Rcpp::export]] - std::vector funx(int seed, int len){ - - gsl_rng *r; - gsl_rng_env_setup(); - std::vector v(len); - - r = gsl_rng_alloc (gsl_rng_default); - - gsl_rng_set (r, (unsigned long) seed); - for (int i=0; i. require(Rcpp) - - -## NOTE: This is the old way to compile Rcpp code inline. -## The code here has left as a historical artifact and tribute to the old way. -## Please use the code under the "new" inline compilation section. - require(inline) -funx_old <- cxxfunction( +funx <- cxxfunction( signature(), 'throw std::range_error("boom"); return R_NilValue ; ', plugin = "Rcpp" ) - -## NOTE: Within this section, the new way to compile Rcpp code inline has been -## written. Please use the code next as a template for your own project. - -cppFunction(' -SEXP funx(){ - throw std::range_error("boom"); return R_NilValue ; -}') - tryCatch( funx(), "C++Error" = function(e){ cat( sprintf( "C++ exception of class '%s' : %s\n", class(e)[1L], e$message ) ) } ) diff --git a/inst/examples/RcppInline/external_pointer.r b/inst/examples/RcppInline/external_pointer.r index 2874ba74d..8fa8dcf84 100755 --- a/inst/examples/RcppInline/external_pointer.r +++ b/inst/examples/RcppInline/external_pointer.r @@ -1,4 +1,4 @@ -#!/usr/bin/env r +#!/usr/bin/r -t # # Copyright (C) 2009 - 2010 Romain Francois # @@ -20,12 +20,7 @@ require(Rcpp) require(inline) - -## NOTE: This is the old way to compile Rcpp code inline. -## The code here has left as a historical artifact and tribute to the old way. -## Please use the code under the "new" inline compilation section. - -funx_old <- cxxfunction(signature(), ' +funx <- cxxfunction(signature(), ' /* creating a pointer to a vector */ std::vector* v = new std::vector ; v->push_back( 1 ) ; @@ -41,11 +36,11 @@ funx_old <- cxxfunction(signature(), ' protected by being on the R side */ return( p ) ; ', plugin = "Rcpp" ) -xp <- funx_old() +xp <- funx() stopifnot( identical( typeof( xp ), "externalptr" ) ) # passing the pointer back to C++ -funx_old <- cxxfunction(signature(x = "externalptr" ), ' +funx <- cxxfunction(signature(x = "externalptr" ), ' /* wrapping x as smart external pointer */ /* The SEXP based constructor does not protect the SEXP from garbage collection automatically, it is already protected @@ -58,56 +53,6 @@ funx_old <- cxxfunction(signature(x = "externalptr" ), ' /* just return the front of the vector as a SEXP */ return( Rcpp::wrap( p->front() ) ) ; ', plugin = "Rcpp" ) -front <- funx_old(xp) -stopifnot( identical( front, 1L ) ) - - -## NOTE: Within this section, the new way to compile Rcpp code inline has been -## written. Please use the code next as a template for your own project. - -## Use of the cppFunction() gives the ability to immediately compile embedded -## C++ directly within R without having to worry about header specification or -## Rcpp attributes. - -cppFunction(' -Rcpp::XPtr< std::vector > funx(){ - /* creating a pointer to a vector */ - std::vector* v = new std::vector ; - v->push_back( 1 ) ; - v->push_back( 2 ) ; - - /* wrap the pointer as an external pointer */ - /* this automatically protected the external pointer from R garbage - * collection until p goes out of scope. - */ - Rcpp::XPtr< std::vector > p(v) ; - - /* return it back to R, since p goes out of scope after the return - * the external pointer is no more protected by p, but it gets - * protected by being on the R side - */ - return( p ) ; -}') - -xp <- funx() -stopifnot( identical( typeof( xp ), "externalptr" ) ) - -# passing the pointer back to C++ -cppFunction(' -SEXP funx_pt(Rcpp::XPtr< std::vector > p){ - /* Wrapping x as smart external pointer */ - - /* The SEXP based constructor does not protect the SEXP from - * garbage collection automatically, it is already protected - * because it comes from the R side, however if you want to keep - * the Rcpp::XPtr object on the C(++) side - * and return something else to R, you need to protect the external - * pointer, by using the protect member function - */ - - /* Just return the front of the vector as a SEXP */ - return Rcpp::wrap(p->front()); -}') -front <- funx_pt(xp) +front <- funx(xp) stopifnot( identical( front, 1L ) ) diff --git a/inst/examples/SugarPerformance/sugarBenchmarks.R b/inst/examples/SugarPerformance/sugarBenchmarks.R index 27de7d1a5..1a40c0a78 100755 --- a/inst/examples/SugarPerformance/sugarBenchmarks.R +++ b/inst/examples/SugarPerformance/sugarBenchmarks.R @@ -1,4 +1,4 @@ -#!/usr/bin/env r +#!/usr/bin/r -t suppressMessages(library(inline)) suppressMessages(library(Rcpp)) @@ -53,7 +53,7 @@ src <- sprintf( ' timer.Reset(); timer.Start(); for (unsigned int i=0; i(N); @@ -29,22 +24,8 @@ cpp <- ' ' # create a C++ function -funx <- cxxfunction(signature(N = "integer" , xvec = "numeric", fun = "function" ), - body=cpp, include = "using namespace Rcpp; ", plugin = "Rcpp") - - -## NOTE: Within this section, the new way to compile Rcpp code inline has been -## written. Please use the code next as a template for your own project. - -# C++ source code to operate on function and vector -cppFunction(' -NumericVector funx(int n, NumericVector numvec, Function f){ - for( int i = 0; i < n; i++ ){ - numvec = f( numvec ) ; - } - return numvec ; -}') - +funx <- cfunction(signature(N = "integer" , xvec = "numeric", fun = "function" ), + cpp, , Rcpp = TRUE, include = "using namespace Rcpp; ") # create the vector xvec <- sqrt(c(1:12, 11:1)) @@ -55,3 +36,4 @@ par(mar=c(3,3,1,1),cex=0.8, pch=19) # run example funx( 10L, xvec, vecfunc ) + diff --git a/inst/include/Rcpp.h b/inst/include/Rcpp.h index bec4f9f41..345786562 100644 --- a/inst/include/Rcpp.h +++ b/inst/include/Rcpp.h @@ -2,8 +2,8 @@ // // Rcpp.h: R/C++ interface class library // -// Copyright (C) 2008 - 2009 Dirk Eddelbuettel -// Copyright (C) 2009 - 2015 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2008 - 2009 Dirk Eddelbuettel +// Copyright (C) 2009 - 2014 Dirk Eddelbuettel and Romain Francois // // This file is part of Rcpp. // @@ -32,10 +32,7 @@ #include #include #include -#include #include - -#include #include #include @@ -45,6 +42,7 @@ #include #include +#include #include #include #include @@ -56,24 +54,15 @@ #include #include #include - -#include - -#if !defined(RCPP_FORCE_OLD_DATE_DATETIME_VECTORS) - #define RCPP_NEW_DATE_DATETIME_VECTORS 1 -#endif -#include +#include +#include +#include +#include #include -#ifndef RCPP_NO_MODULES #include #include -#endif - -#include - -#include #ifndef RCPP_NO_SUGAR #include @@ -89,6 +78,4 @@ #include #include - -#include #endif diff --git a/inst/include/Rcpp/Benchmark/Timer.h b/inst/include/Rcpp/Benchmark/Timer.h index 5dab598ac..240597f9d 100644 --- a/inst/include/Rcpp/Benchmark/Timer.h +++ b/inst/include/Rcpp/Benchmark/Timer.h @@ -1,6 +1,8 @@ +// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*- +// // Timer.h: Rcpp R/C++ interface class library -- Rcpp benchmark utility // -// Copyright (C) 2012 - 2025 JJ Allaire, Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2012 - 2014 JJ Allaire, Dirk Eddelbuettel and Romain Francois // // This file is part of Rcpp. // @@ -24,9 +26,7 @@ #include #include -#ifndef R_NO_REMAP - #define R_NO_REMAP -#endif +#define R_NO_REMAP #include #if defined(_WIN32) @@ -120,17 +120,17 @@ namespace Rcpp{ out.attr("names") = names; return out; } - + static std::vector get_timers(int n){ return std::vector( n, Timer() ) ; } - + inline nanotime_t now() const { return get_nanotime() ; } - + inline nanotime_t origin() const { - return start_time ; + return start_time ; } private: @@ -143,8 +143,5 @@ namespace Rcpp{ } -#ifdef FALSE - #undef FALSE #endif -#endif diff --git a/inst/include/Rcpp/DataFrame.h b/inst/include/Rcpp/DataFrame.h index 6e2062715..f07d828ee 100644 --- a/inst/include/Rcpp/DataFrame.h +++ b/inst/include/Rcpp/DataFrame.h @@ -2,7 +2,7 @@ // // DataFrame.h: Rcpp R/C++ interface class library -- data frames // -// Copyright (C) 2010 - 2025 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2010 - 2014 Dirk Eddelbuettel and Romain Francois // // This file is part of Rcpp. // @@ -40,10 +40,10 @@ namespace Rcpp{ typedef Vector Parent ; DataFrame_Impl() : Parent( internal::empty_data_frame() ){} - DataFrame_Impl(SEXP x) : Parent(x) { + DataFrame_Impl(SEXP x) { set__(x); } - DataFrame_Impl( const DataFrame_Impl& other) : Parent() { + DataFrame_Impl( const DataFrame_Impl& other){ set__(other) ; } @@ -61,95 +61,49 @@ namespace Rcpp{ } // By definition, the number of rows in a data.frame is contained - // in its row.names attribute. Since R 3.5.0 this is returned as a - // compact sequence from which we can just take the (x)length - // But as this makes an allocation an even simpler check on length as - // discussed in #1430 is also possible and preferable. We also switch - // to returning R_xlen_t which as upcast from int is safe - inline R_xlen_t nrow() const { - Shield rn{Rf_getAttrib(Parent::get__(), R_RowNamesSymbol)}; - return Rf_xlength(rn); - } - - template - void push_back( const T& object){ - Parent::push_back(object); - set_type_after_push(); - } - - template - void push_back( const T& object, const std::string& name ){ - Parent::push_back(object, name); - set_type_after_push(); - } - - template - void push_front( const T& object){ - Parent::push_front(object); - set_type_after_push(); - } - - template - void push_front( const T& object, const std::string& name){ - Parent::push_front(object, name); - set_type_after_push(); + // in its row.names attribute. If it has row names of the form 1:n, + // they will be stored as {NA_INTEGER, -}. Unfortunately, + // getAttrib(df, R_RowNamesSymbol) will force an expansion of that + // compact form thereby allocating a huge vector when we just want + // the row.names. Hence this workaround. + inline int nrows() const { + SEXP rn = R_NilValue ; + SEXP att = ATTRIB( Parent::get__() ) ; + while( att != R_NilValue ){ + if( TAG(att) == R_RowNamesSymbol ) { + rn = CAR(att) ; + break ; + } + att = CDR(att) ; + } + if (Rf_isNull(rn)) + return 0; + if (TYPEOF(rn) == INTSXP && LENGTH(rn) == 2 && INTEGER(rn)[0] == NA_INTEGER) + return abs(INTEGER(rn)[1]); + return LENGTH(rn); } - // Offer multiple variants to accomodate both old interface here and signatures in other classes - inline R_xlen_t nrows() const { return DataFrame_Impl::nrow(); } - inline R_xlen_t rows() const { return DataFrame_Impl::nrow(); } - - inline R_xlen_t ncol() const { return DataFrame_Impl::length(); } - inline R_xlen_t cols() const { return DataFrame_Impl::length(); } - static DataFrame_Impl create(){ return DataFrame_Impl() ; } - template - static DataFrame_Impl create(const T&... args) { - return DataFrame_Impl::from_list(Parent::create(args...)); - } + + #include private: void set__(SEXP x){ if( ::Rf_inherits( x, "data.frame" )){ Parent::set__( x ) ; } else{ - Shield y(internal::convert_using_rfunction( x, "as.data.frame" )) ; + SEXP y = internal::convert_using_rfunction( x, "as.data.frame" ) ; Parent::set__( y ) ; } } - void set_type_after_push(){ - R_xlen_t max_rows = 0; - bool invalid_column_size = false; - List::iterator it; - // Get the maximum number of rows - for (it = Parent::begin(); it != Parent::end(); ++it) { - if (Rf_xlength(*it) > max_rows) { - max_rows = Rf_xlength(*it); - } - } - if (max_rows > 0) { - for (it = Parent::begin(); it != Parent::end(); ++it) { - if (Rf_xlength(*it) == 0 || ( Rf_xlength(*it) > 1 && max_rows % Rf_xlength(*it) != 0 )) { - // We have a column that is not an integer fraction of the largest - invalid_column_size = true; - } - } - } - if (invalid_column_size) { - warning("Column sizes are not equal in DataFrame::push_back, object degrading to List\n"); - } else { - set__(Parent::get__()); - } - } - static DataFrame_Impl from_list( Parent obj ){ bool use_default_strings_as_factors = true ; bool strings_as_factors = true ; int strings_as_factors_index = -1 ; - R_xlen_t n = obj.size() ; + int n = obj.size() ; CharacterVector names = obj.attr( "names" ) ; if( !names.isNULL() ){ for( int i=0; i call( Rf_lang3(as_df_symb, obj, Rf_ScalarLogical(strings_as_factors) ) ) ; + Shield call( Rf_lang3(as_df_symb, obj, wrap( strings_as_factors ) ) ) ; SET_TAG( CDDR(call), strings_as_factors_symb ) ; - Shield res(Rcpp_fast_eval(call, R_GlobalEnv)); + Shield res( Rcpp_eval( call ) ) ; DataFrame_Impl out( res ) ; return out ; diff --git a/inst/include/Rcpp/date_datetime/Date.h b/inst/include/Rcpp/Date.h similarity index 50% rename from inst/include/Rcpp/date_datetime/Date.h rename to inst/include/Rcpp/Date.h index 3d5f080f8..51e6a82aa 100644 --- a/inst/include/Rcpp/date_datetime/Date.h +++ b/inst/include/Rcpp/Date.h @@ -1,8 +1,8 @@ -// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*- +// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 4 -*- // // Date.h: Rcpp R/C++ interface class library -- dates // -// Copyright (C) 2010 - 2015 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2010 - 2013 Dirk Eddelbuettel and Romain Francois // // This file is part of Rcpp. // @@ -22,28 +22,24 @@ #ifndef Rcpp__Date_h #define Rcpp__Date_h -#if defined(WIN32) || defined(__WIN32) || defined(__WIN32__) -#include -#endif - namespace Rcpp { class Date { public: - Date() { + Date(){ m_d = 0; update_tm(); } Date(SEXP s); // from integer (with negative dates before Jan 1, 1970) - Date(const int &dt) { + Date(const int &dt){ m_d = dt; update_tm(); } // from fractional integer since epoch, just like R - Date(const double &dt) { + Date(const double &dt){ m_d = dt; update_tm(); } @@ -59,26 +55,28 @@ namespace Rcpp { m_tm.tm_mday = year; } else { m_tm.tm_mday = day; - m_tm.tm_mon = mon - 1; // range 0 to 11 + m_tm.tm_mon = mon - 1; // range 0 to 11 m_tm.tm_year = year - baseYear(); } - double tmp = mktime00(m_tm); // use mktime() replacement borrowed from R - m_tm.tm_year += baseYear(); // we'd rather keep it as a normal year + double tmp = mktime00(m_tm); // use mktime() replacement borrowed from R + m_tm.tm_year += baseYear() ; // we'd rather keep it as a normal year m_d = tmp/(24*60*60); } - double getDate(void) const { - return m_d; - } + ~Date() {}; + + double getDate(void) const { + return m_d; + } // intra-day useless for date class //int getSeconds() const { return m_tm.tm_sec; } //int getMinutes() const { return m_tm.tm_min; } //int getHours() const { return m_tm.tm_hour; } int getDay() const { return m_tm.tm_mday; } - int getMonth() const { return m_tm.tm_mon + 1; } // makes it 1 .. 12 - int getYear() const { return m_tm.tm_year; } // does include 1900 (see Date.cpp) - int getWeekday() const { return m_tm.tm_wday + 1; } // makes it 1 .. 7 + int getMonth() const { return m_tm.tm_mon + 1; } // makes it 1 .. 12 + int getYear() const { return m_tm.tm_year; } // does include 1900 (see Date.cpp) + int getWeekday() const { return m_tm.tm_wday + 1; } // makes it 1 .. 7 int getYearday() const { return m_tm.tm_yday + 1; } // makes it 1 .. 366 // 1900 as per POSIX mktime() et al @@ -87,45 +85,27 @@ namespace Rcpp { } // Minimal set of date operations. - friend Date operator+( const Date &date, int offset); - friend double operator-( const Date &date1, const Date& date2); - friend bool operator<( const Date &date1, const Date& date2); - friend bool operator>( const Date &date1, const Date& date2); + friend Date operator+(const Date &date, int offset); + friend double operator-(const Date& date1, const Date& date2); + friend bool operator<(const Date &date1, const Date& date2); + friend bool operator>(const Date &date1, const Date& date2); friend bool operator==(const Date &date1, const Date& date2); friend bool operator>=(const Date &date1, const Date& date2); friend bool operator<=(const Date &date1, const Date& date2); friend bool operator!=(const Date &date1, const Date& date2); inline int is_na() const { - return traits::is_na(m_d); - } - - operator double() const { - return m_d; - } - - inline std::string format(const char *fmt = "%Y-%m-%d") const { - char txt[32]; - struct tm temp = m_tm; - temp.tm_year -= baseYear(); // adjust for fact that system has year rel. to 1900 - size_t res = ::strftime(txt, 31, fmt, &temp); - if (res == 0) { - return std::string(""); - } else { - return std::string(txt); - } + return traits::is_na( m_d ) ; } - friend inline std::ostream &operator<<(std::ostream & os, const Date d); - private: - double m_d; // (fractional) day number, relative to epoch of Jan 1, 1970 - struct tm m_tm; // standard time representation + double m_d; // (fractional) day number, relative to epoch of Jan 1, 1970 + struct tm m_tm; // standard time representation // update m_tm based on m_d - void update_tm() { + void update_tm(){ if (R_FINITE(m_d)) { - time_t t = static_cast(24*60*60 * m_d); // (fractional) days since epoch to seconds since epoch + time_t t = 24*60*60 * m_d; // (fractional) days since epoch to seconds since epoch m_tm = *gmtime_(&t); } else { m_tm.tm_sec = m_tm.tm_min = m_tm.tm_hour = m_tm.tm_isdst = NA_INTEGER; @@ -140,57 +120,52 @@ namespace Rcpp { // needed to wrap containers of Date such as vector or map namespace internal { - template<> inline double caster(Rcpp::Date from) { - return static_cast(from.getDate()); - } - template<> inline Rcpp::Date caster(double from) { - return Rcpp::Date(static_cast(from)); - } + template<> inline double caster( Rcpp::Date from){ + return static_cast( from.getDate() ) ; + } + template<> inline Rcpp::Date caster( double from){ + return Rcpp::Date( static_cast( from ) ) ; + } } - template<> inline SEXP wrap_extra_steps(SEXP x) { - Rf_setAttrib(x, R_ClassSymbol, Rf_mkString("Date")); - return x; + template<> inline SEXP wrap_extra_steps( SEXP x ){ + Rf_setAttrib( x, R_ClassSymbol, Rf_mkString( "Date" ) ) ; + return x ; } inline Date operator+(const Date &date, int offset) { Date newdate(date.m_d); newdate.m_d += offset; - time_t t = static_cast(24*60*60 * newdate.m_d); // days since epoch to seconds since epo + time_t t = 24*60*60 * newdate.m_d; // days since epoch to seconds since epo newdate.m_tm = *gmtime_(&t); return newdate; } - inline double operator-( const Date& d1, const Date& d2) { return d1.m_d - d2.m_d; } - inline bool operator<( const Date &d1, const Date& d2) { return d1.m_d < d2.m_d; } - inline bool operator>( const Date &d1, const Date& d2) { return d1.m_d > d2.m_d; } - inline bool operator==(const Date &d1, const Date& d2) { return d1.m_d == d2.m_d; } - inline bool operator>=(const Date &d1, const Date& d2) { return d1.m_d >= d2.m_d; } - inline bool operator<=(const Date &d1, const Date& d2) { return d1.m_d <= d2.m_d; } - inline bool operator!=(const Date &d1, const Date& d2) { return d1.m_d != d2.m_d; } - - inline std::ostream &operator<<(std::ostream & os, const Date d) { - os << d.format(); - return os; - } + inline double operator-(const Date& d1, const Date& d2) { return d1.m_d - d2.m_d; } + inline bool operator<(const Date &d1, const Date& d2) { return d1.m_d < d2.m_d; } + inline bool operator>(const Date &d1, const Date& d2) { return d1.m_d > d2.m_d; } + inline bool operator==(const Date &d1, const Date& d2) { return d1.m_d == d2.m_d; } + inline bool operator>=(const Date &d1, const Date& d2) { return d1.m_d >= d2.m_d; } + inline bool operator<=(const Date &d1, const Date& d2) { return d1.m_d <= d2.m_d; } + inline bool operator!=(const Date &d1, const Date& d2) { return d1.m_d != d2.m_d; } - namespace internal { + namespace internal{ - inline SEXP getPosixClasses() { + inline SEXP getPosixClasses(){ Shield datetimeclass(Rf_allocVector(STRSXP,2)); SET_STRING_ELT(datetimeclass, 0, Rf_mkChar("POSIXct")); SET_STRING_ELT(datetimeclass, 1, Rf_mkChar("POSIXt")); - return datetimeclass; + return datetimeclass ; } - inline SEXP new_posixt_object( double d) { - Shield x(Rf_ScalarReal(d)); - Rf_setAttrib(x, R_ClassSymbol, getPosixClasses()); - return x; + inline SEXP new_posixt_object( double d){ + Shield x( Rf_ScalarReal( d ) ) ; + Rf_setAttrib(x, R_ClassSymbol, getPosixClasses() ); + return x ; } - inline SEXP new_date_object(double d) { - Shield x(Rf_ScalarReal(d)); + inline SEXP new_date_object( double d){ + Shield x(Rf_ScalarReal( d ) ) ; Rf_setAttrib(x, R_ClassSymbol, Rf_mkString("Date")); return x; } diff --git a/inst/include/Rcpp/date_datetime/oldDateVector.h b/inst/include/Rcpp/DateVector.h similarity index 75% rename from inst/include/Rcpp/date_datetime/oldDateVector.h rename to inst/include/Rcpp/DateVector.h index 6ecea7ed6..f490f5f5a 100644 --- a/inst/include/Rcpp/date_datetime/oldDateVector.h +++ b/inst/include/Rcpp/DateVector.h @@ -2,7 +2,7 @@ // // DateVector.h: Rcpp R/C++ interface class library -- Date vector support // -// Copyright (C) 2010 - 2015 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2010 - 2013 Dirk Eddelbuettel and Romain Francois // // This file is part of Rcpp. // @@ -27,12 +27,12 @@ namespace Rcpp { - class oldDateVector : public GreedyVector { + class DateVector : public GreedyVector { public: - oldDateVector(SEXP vec) : GreedyVector(vec) {} - oldDateVector(int n) : GreedyVector(n) {} + DateVector(SEXP vec) : GreedyVector(vec){} + DateVector(int n) : GreedyVector(n){} - inline std::vector getDates() const { + inline std::vector getDates() const{ return v ; } diff --git a/inst/include/Rcpp/Datetime.h b/inst/include/Rcpp/Datetime.h new file mode 100644 index 000000000..cee973eed --- /dev/null +++ b/inst/include/Rcpp/Datetime.h @@ -0,0 +1,125 @@ +// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 4 -*- +// +// Datetime.h: Rcpp R/C++ interface class library -- Datetime (POSIXct) +// +// Copyright (C) 2010 - 2013 Dirk Eddelbuettel and Romain Francois +// +// This file is part of Rcpp. +// +// Rcpp is free software: you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// Rcpp is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Rcpp. If not, see . + +#ifndef Rcpp__Datetime_h +#define Rcpp__Datetime_h + +#include + +namespace Rcpp { + + class Datetime { + public: + Datetime() { + m_dt = 0; + update_tm(); + } + Datetime(SEXP s); + + // from double, just like POSIXct + Datetime(const double &dt){ + m_dt = dt; + update_tm(); + } + Datetime(const std::string &s, const std::string &fmt="%Y-%m-%d %H:%M:%OS"); + + double getFractionalTimestamp(void) const { return m_dt; } + + int getMicroSeconds() const { return m_us; } + int getSeconds() const { return m_tm.tm_sec; } + int getMinutes() const { return m_tm.tm_min; } + int getHours() const { return m_tm.tm_hour; } + int getDay() const { return m_tm.tm_mday; } + int getMonth() const { return m_tm.tm_mon + 1; } // makes it 1 .. 12 + int getYear() const { return m_tm.tm_year ; } + int getWeekday() const { return m_tm.tm_wday + 1; } // makes it 1 .. 7 + int getYearday() const { return m_tm.tm_yday + 1; } // makes it 1 .. 366 + + // Minimal set of date operations. + friend Datetime operator+(const Datetime &dt, double offset); + friend double operator-(const Datetime& dt1, const Datetime& dt2); + friend bool operator<(const Datetime &dt1, const Datetime& dt2); + friend bool operator>(const Datetime &dt1, const Datetime& dt2); + friend bool operator==(const Datetime &dt1, const Datetime& dt2); + friend bool operator>=(const Datetime &dt1, const Datetime& dt2); + friend bool operator<=(const Datetime &dt1, const Datetime& dt2); + friend bool operator!=(const Datetime &dt1, const Datetime& dt2); + + inline int is_na() const { return traits::is_na( m_dt ) ; } + + private: + double m_dt; // fractional seconds since epoch + struct tm m_tm; // standard time representation + unsigned int m_us; // microsecond (to complement m_tm) + + // update m_tm based on m_dt + void update_tm() { + if (R_FINITE(m_dt)) { + time_t t = static_cast(std::floor(m_dt)); + m_tm = *gmtime_(&t); + // m_us is fractional (micro)secs as diff. between (fractional) m_dt and m_tm + m_us = static_cast(::Rf_fround( (m_dt - t) * 1.0e6, 0.0)); + } else { + m_dt = NA_REAL; // NaN and Inf need it set + m_tm.tm_sec = m_tm.tm_min = m_tm.tm_hour = m_tm.tm_isdst = NA_INTEGER; + m_tm.tm_min = m_tm.tm_hour = m_tm.tm_mday = m_tm.tm_mon = m_tm.tm_year = NA_INTEGER; + m_us = NA_INTEGER; + } + } + + }; + + + // template specialisation for wrap() on datetime + template <> SEXP wrap(const Rcpp::Datetime &dt); + + // needed to wrap containers of Date such as vector or map + namespace internal { + template<> inline double caster( Rcpp::Datetime from){ + return from.getFractionalTimestamp() ; + } + template<> inline Rcpp::Datetime caster( double from){ + return Rcpp::Datetime( from ) ; + } + } + + template<> SEXP wrap_extra_steps( SEXP x ) ; + + inline Datetime operator+(const Datetime &datetime, double offset) { + Datetime newdt(datetime.m_dt); + newdt.m_dt += offset; + time_t t = static_cast(std::floor(newdt.m_dt)); + newdt.m_tm = *gmtime_(&t); + newdt.m_us = static_cast(::Rf_fround( (newdt.m_dt - t) * 1.0e6, 0.0)); + return newdt; + } + + inline double operator-(const Datetime& d1, const Datetime& d2) { return d1.m_dt - d2.m_dt; } + inline bool operator<(const Datetime &d1, const Datetime& d2) { return d1.m_dt < d2.m_dt; } + inline bool operator>(const Datetime &d1, const Datetime& d2) { return d1.m_dt > d2.m_dt; } + inline bool operator==(const Datetime &d1, const Datetime& d2) { return d1.m_dt == d2.m_dt; } + inline bool operator>=(const Datetime &d1, const Datetime& d2) { return d1.m_dt >= d2.m_dt; } + inline bool operator<=(const Datetime &d1, const Datetime& d2) { return d1.m_dt <= d2.m_dt; } + inline bool operator!=(const Datetime &d1, const Datetime& d2) { return d1.m_dt != d2.m_dt; } + +} + +#endif diff --git a/inst/include/Rcpp/date_datetime/oldDatetimeVector.h b/inst/include/Rcpp/DatetimeVector.h similarity index 71% rename from inst/include/Rcpp/date_datetime/oldDatetimeVector.h rename to inst/include/Rcpp/DatetimeVector.h index b448d7d2f..3ec29a395 100644 --- a/inst/include/Rcpp/date_datetime/oldDatetimeVector.h +++ b/inst/include/Rcpp/DatetimeVector.h @@ -2,7 +2,7 @@ // // DatetimeVector.h: Rcpp R/C++ interface class library -- Datetime vector // -// Copyright (C) 2010 - 2015 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2010 - 2013 Dirk Eddelbuettel and Romain Francois // // This file is part of Rcpp. // @@ -28,13 +28,13 @@ namespace Rcpp { - class oldDatetimeVector : public GreedyVector { + class DatetimeVector : public GreedyVector { public: - oldDatetimeVector(SEXP vec) : GreedyVector(vec) {} - oldDatetimeVector(int n) : GreedyVector(n) {} + DatetimeVector(SEXP vec) : GreedyVector(vec){} + DatetimeVector(int n) : GreedyVector(n){} - std::vector getDatetimes() const { - return v; + std::vector getDatetimes() const{ + return v ; } }; diff --git a/inst/include/Rcpp/Dimension.h b/inst/include/Rcpp/Dimension.h index 6f625f72b..a9b0e12b2 100644 --- a/inst/include/Rcpp/Dimension.h +++ b/inst/include/Rcpp/Dimension.h @@ -40,24 +40,24 @@ namespace Rcpp{ return *this ; } Dimension(const size_t& n1) : dims(1){ - dims[0] = static_cast(n1) ; + dims[0] = n1 ; } Dimension(const size_t& n1, const size_t& n2) : dims(2){ - dims[0] = static_cast(n1) ; - dims[1] = static_cast(n2) ; + dims[0] = n1 ; + dims[1] = n2 ; } Dimension(const size_t& n1, const size_t& n2, const size_t& n3) : dims(3){ - dims[0] = static_cast(n1) ; - dims[1] = static_cast(n2) ; - dims[2] = static_cast(n3) ; + dims[0] = n1 ; + dims[1] = n2 ; + dims[2] = n3 ; } operator SEXP() const ; inline int size() const { return (int) dims.size() ; } - inline R_xlen_t prod() const { - return std::accumulate( dims.begin(), dims.end(), static_cast(1), std::multiplies() ); + inline int prod() const { + return std::accumulate( dims.begin(), dims.end(), 1, std::multiplies() ) ; } inline reference operator[](int i){ diff --git a/inst/include/Rcpp/DottedPair.h b/inst/include/Rcpp/DottedPair.h index ba08c10b0..e056e2d85 100644 --- a/inst/include/Rcpp/DottedPair.h +++ b/inst/include/Rcpp/DottedPair.h @@ -2,7 +2,7 @@ // // DottedPair.h: Rcpp R/C++ interface class library -- dotted pair list template // -// Copyright (C) 2010 - 2025 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2010 - 2013 Dirk Eddelbuettel and Romain Francois // // This file is part of Rcpp. // @@ -35,10 +35,8 @@ RCPP_API_CLASS(DottedPair_Impl), DottedPair_Impl(SEXP x) { Storage::set__(x) ; } - template - DottedPair_Impl(const T&... args) { - Storage::set__(pairlist(args...)); - } + + #include void update(SEXP){} diff --git a/inst/include/Rcpp/DottedPairImpl.h b/inst/include/Rcpp/DottedPairImpl.h index a011d4f4c..bf3aa5de9 100644 --- a/inst/include/Rcpp/DottedPairImpl.h +++ b/inst/include/Rcpp/DottedPairImpl.h @@ -63,12 +63,12 @@ namespace Rcpp{ template void replace( const int& index, const T& object ) ; - inline R_xlen_t length() const { - return ::Rf_xlength(static_cast(*this).get__()) ; + inline R_len_t length() const { + return ::Rf_length(static_cast(*this).get__()) ; } - inline R_xlen_t size() const { - return ::Rf_xlength(static_cast(*this).get__()) ; + inline R_len_t size() const { + return ::Rf_length(static_cast(*this).get__()) ; } /** diff --git a/inst/include/Rcpp/Environment.h b/inst/include/Rcpp/Environment.h index bc89a702f..16215852a 100644 --- a/inst/include/Rcpp/Environment.h +++ b/inst/include/Rcpp/Environment.h @@ -1,8 +1,9 @@ - +// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*- +// // Environment.h: Rcpp R/C++ interface class library -- access R environments // -// Copyright (C) 2009 - 2013 Dirk Eddelbuettel and Romain Francois -// Copyright (C) 2014 - 2025 Dirk Eddelbuettel, Romain Francois and Kevin Ushey +// Copyright (C) 2009 - 2013 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2014 Dirk Eddelbuettel, Romain Francois and Kevin Ushey // // This file is part of Rcpp. // @@ -22,6 +23,10 @@ #ifndef Rcpp_Environment_h #define Rcpp_Environment_h +// From 'R/Defn.h' +// NOTE: can't include header directly as it checks for some C99 features +extern "C" SEXP R_NewHashedEnv(SEXP, SEXP); + namespace Rcpp{ RCPP_API_CLASS(Environment_Impl), @@ -32,12 +37,10 @@ namespace Rcpp{ if( Rf_isEnvironment(x) ) return x ; SEXP asEnvironmentSym = Rf_install("as.environment"); try { - Shield call(Rf_lang2(asEnvironmentSym, x)); - return Rcpp_fast_eval(call, R_GlobalEnv); - } catch( const eval_error& ex) { - const char* fmt = "Cannot convert object to an environment: " - "[type=%s; target=ENVSXP]."; - throw not_compatible(fmt, Rf_type2char(TYPEOF(x))); + Shield res( Rcpp_eval( Rf_lang2( asEnvironmentSym, x ) ) ); + return res ; + } catch( const eval_error& ex){ + throw not_compatible( "cannot convert to environment" ) ; } } @@ -83,7 +86,12 @@ namespace Rcpp{ */ SEXP ls(bool all) const { SEXP env = Storage::get__() ; - return R_lsInternal3(env, all ? TRUE : FALSE, TRUE); + if( is_user_database() ){ + R_ObjectTable *tb = (R_ObjectTable*) R_ExternalPtrAddr(HASHTAB(env)); + return tb->objects(tb) ; + } else { + return R_lsInternal( env, all ? TRUE : FALSE ) ; + } return R_NilValue ; } @@ -97,45 +105,17 @@ namespace Rcpp{ SEXP get(const std::string& name) const { SEXP env = Storage::get__() ; SEXP nameSym = Rf_install(name.c_str()); -#if R_VERSION < R_Version(4,5,0) SEXP res = Rf_findVarInFrame( env, nameSym ) ; -#else - SEXP res = R_getVarEx(nameSym, env, FALSE, R_UnboundValue); -#endif - if( res == R_UnboundValue ) return R_NilValue ; - - /* We need to evaluate if it is a promise */ - if( TYPEOF(res) == PROMSXP){ - res = internal::Rcpp_eval_impl( res, env ) ; // #nocov - } - return res ; - } - - /** - * Get an object from the environment - * - * @param name symbol name to call - * - * @return a SEXP (possibly R_NilValue) - */ - SEXP get(Symbol name) const { - SEXP env = Storage::get__() ; -#if R_VERSION < R_Version(4,5,0) - SEXP res = Rf_findVarInFrame( env, name ) ; -#else - SEXP res = R_getVarEx(name, env, FALSE, R_UnboundValue); -#endif if( res == R_UnboundValue ) return R_NilValue ; /* We need to evaluate if it is a promise */ if( TYPEOF(res) == PROMSXP){ - res = internal::Rcpp_eval_impl( res, env ) ; + res = Rf_eval( res, env ) ; } return res ; } - /** * Get an object from the environment or one of its * parents @@ -146,43 +126,13 @@ namespace Rcpp{ SEXP find( const std::string& name) const{ SEXP env = Storage::get__() ; SEXP nameSym = Rf_install(name.c_str()); -#if R_VERSION < R_Version(4,5,0) SEXP res = Rf_findVar( nameSym, env ) ; -#else - SEXP res = R_getVarEx(nameSym, env, TRUE, R_UnboundValue); -#endif if( res == R_UnboundValue ) throw binding_not_found(name) ; /* We need to evaluate if it is a promise */ if( TYPEOF(res) == PROMSXP){ - res = internal::Rcpp_eval_impl( res, env ) ; - } - return res ; - } - - /** - * Get an object from the environment or one of its - * parents - * - * @param name symbol name to call - */ - SEXP find(Symbol name) const{ - SEXP env = Storage::get__() ; -#if R_VERSION < R_Version(4,5,0) - SEXP res = Rf_findVar( name, env ) ; -#else - SEXP res = R_getVarEx(name, env, TRUE, R_UnboundValue); -#endif - if( res == R_UnboundValue ) { - // Pass on the const char* to the RCPP_EXCEPTION_CLASS's - // const std::string& requirement - throw binding_not_found(name.c_str()) ; - } - - /* We need to evaluate if it is a promise */ - if( TYPEOF(res) == PROMSXP){ - res = internal::Rcpp_eval_impl( res, env ) ; + res = Rf_eval( res, env ) ; } return res ; } @@ -197,11 +147,7 @@ namespace Rcpp{ */ bool exists( const std::string& name ) const { SEXP nameSym = Rf_install(name.c_str()); -#if R_VERSION < R_Version(4,5,0) SEXP res = Rf_findVarInFrame( Storage::get__() , nameSym ) ; -#else - SEXP res = R_getVarEx(nameSym, Storage::get__(), FALSE, R_UnboundValue); -#endif return res != R_UnboundValue ; } @@ -223,10 +169,6 @@ namespace Rcpp{ return true ; } - bool assign(const std::string& name, const Shield& x) const { - return assign(name, (SEXP) x); - } - /** * wrap and assign. If there is a wrap method taking an object * of WRAPPABLE type, then it is wrapped and the corresponding SEXP @@ -258,9 +200,10 @@ namespace Rcpp{ we have to go back to R to do this operation */ SEXP internalSym = Rf_install( ".Internal" ); SEXP removeSym = Rf_install( "remove" ); - Shield str(Rf_mkString(name.c_str())); - Shield call(Rf_lang2(internalSym, Rf_lang4(removeSym, str, Storage::get__(), Rf_ScalarLogical(FALSE)))); - Rcpp_fast_eval( call, R_GlobalEnv ) ; + Shield call( Rf_lang2(internalSym, + Rf_lang4(removeSym, Rf_mkString(name.c_str()), Storage::get__(), Rf_ScalarLogical( FALSE )) + ) ); + Rf_eval( call, R_GlobalEnv ) ; } } else{ throw no_such_binding(name) ; @@ -330,6 +273,14 @@ namespace Rcpp{ return R_BindingIsActive(nameSym, Storage::get__()) ; } + /** + * Indicates if this is a user defined database. + */ + bool is_user_database() const { + SEXP env = Storage::get__() ; + return OBJECT(env) && Rf_inherits(env, "UserDefinedDatabase") ; + } + /** * @return the global environment. See ?globalenv */ @@ -377,8 +328,7 @@ namespace Rcpp{ try{ SEXP getNamespaceSym = Rf_install("getNamespace"); Shield package_str( Rf_mkString(package.c_str()) ); - Shield call( Rf_lang2(getNamespaceSym, package_str) ); - env = Rcpp_fast_eval(call, R_GlobalEnv); + env = Rcpp_eval( Rf_lang2(getNamespaceSym, package_str) ) ; } catch( ... ){ throw no_such_namespace( package ) ; } @@ -395,17 +345,32 @@ namespace Rcpp{ /** * creates a new environment whose this is the parent */ - Environment_Impl new_child(bool hashed) const { + Environment_Impl new_child(bool hashed) { SEXP newEnvSym = Rf_install("new.env"); - Shield call(Rf_lang3(newEnvSym, Rf_ScalarLogical(hashed), Storage::get__())); - return Environment_Impl(Rcpp_fast_eval(call, R_GlobalEnv)); + return Environment_Impl( Rcpp_eval(Rf_lang3( newEnvSym, Rf_ScalarLogical(hashed), Storage::get__() )) ); } + void update(SEXP){} }; typedef Environment_Impl Environment ; +inline Environment new_env(int size = 29) { + Shield sizeSEXP(Rf_ScalarInteger(size)); + return R_NewHashedEnv(R_EmptyEnv, sizeSEXP); +} + +inline Environment new_env(SEXP parent, int size = 29) { + Shield sizeSEXP(Rf_ScalarInteger(size)); + Shield parentSEXP(parent); + if (!Rf_isEnvironment(parentSEXP)) { + stop("parent is not an environment"); + } + return R_NewHashedEnv(parentSEXP, sizeSEXP); +} + + } // namespace Rcpp #endif diff --git a/inst/include/Rcpp/Fast.h b/inst/include/Rcpp/Fast.h index 1f1e5cf7e..8a78e0f46 100644 --- a/inst/include/Rcpp/Fast.h +++ b/inst/include/Rcpp/Fast.h @@ -2,7 +2,7 @@ // // Fast.h: Rcpp R/C++ interface class library -- faster vectors (less interface) // -// Copyright (C) 2010 - 2016 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2010 - 2012 Dirk Eddelbuettel and Romain Francois // // This file is part of Rcpp. // @@ -26,19 +26,19 @@ namespace Rcpp { template class Fast { public: - typedef typename VECTOR::stored_type value_type; + typedef typename VECTOR::stored_type value_type ; - Fast( /*const*/ VECTOR& v_) : v(v_), data(v_.begin()) {} + Fast( const VECTOR& v_) : v(v_), data( v_.begin() ){} - inline value_type& operator[](R_xlen_t i) { return data[i]; } - inline const value_type& operator[](R_xlen_t i) const { return data[i]; } - inline R_xlen_t size() const { return v.size(); } + inline value_type& operator[]( int i){ return data[i] ; } + inline const value_type& operator[]( int i) const { return data[i] ; } + inline int size() const { return v.size() ; } private: - /*const*/ VECTOR& v; - value_type* data; + const VECTOR& v ; + value_type* data ; -}; +} ; } #endif diff --git a/inst/include/Rcpp/Function.h b/inst/include/Rcpp/Function.h index 783318b39..1ee9a90b5 100644 --- a/inst/include/Rcpp/Function.h +++ b/inst/include/Rcpp/Function.h @@ -1,7 +1,8 @@ - +// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*- +// // Function.h: Rcpp R/C++ interface class library -- functions (also primitives and builtins) // -// Copyright (C) 2010 - 2026 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2010 - 2013 Dirk Eddelbuettel and Romain Francois // // This file is part of Rcpp. // @@ -42,12 +43,9 @@ namespace Rcpp{ case BUILTINSXP: Storage::set__(x); break; - default: // #nocov start - const char* fmt = "Cannot convert object to a function: " - "[type=%s; target=CLOSXP, SPECIALSXP, or " - "BUILTINSXP]."; - throw not_compatible(fmt, Rf_type2char(TYPEOF(x))); - } // #nocov end + default: + throw not_compatible("cannot convert to function") ; + } } /** @@ -69,11 +67,7 @@ namespace Rcpp{ } Function_Impl(const std::string& name, const std::string& ns) { -#if R_VERSION < R_Version(4,5,0) Shield env(Rf_findVarInFrame(R_NamespaceRegistry, Rf_install(ns.c_str()))); -#else - Shield env(R_getVarEx(Rf_install(ns.c_str()), R_NamespaceRegistry, FALSE, R_UnboundValue)); -#endif if (env == R_UnboundValue) { stop("there is no namespace called \"%s\"", ns); } @@ -81,14 +75,10 @@ namespace Rcpp{ } SEXP operator()() const { - Shield call(Rf_lang1(Storage::get__())); - return Rcpp_fast_eval(call, R_GlobalEnv); + return Rcpp_eval( Rf_lang1( Storage::get__() ) ) ; } - template - SEXP operator()(const T&... args) const { - return invoke(pairlist(args...), R_GlobalEnv); - } + #include /** * Returns the environment of this function @@ -96,13 +86,9 @@ namespace Rcpp{ SEXP environment() const { SEXP fun = Storage::get__() ; if( TYPEOF(fun) != CLOSXP ) { - throw not_a_closure(Rf_type2char(TYPEOF(fun))); + throw not_a_closure() ; } - #if (defined(R_VERSION) && R_VERSION >= R_Version(4,5,0)) - return R_ClosureEnv(fun); - #else - return CLOENV(fun); - #endif + return CLOENV(fun) ; } /** @@ -121,14 +107,6 @@ namespace Rcpp{ Shield x( Rf_findFun( nameSym, env ) ) ; Storage::set__(x) ; } - - SEXP invoke(SEXP args_, SEXP env) const { - Shield args(args_); - Shield call(Rcpp_lcons(Storage::get__(), args)); - SEXP out = Rcpp_fast_eval(call, env); - return out; - } - }; typedef Function_Impl Function ; diff --git a/inst/include/Rcpp/InternalFunction.h b/inst/include/Rcpp/InternalFunction.h index 9a4ad6625..d052ca5e9 100644 --- a/inst/include/Rcpp/InternalFunction.h +++ b/inst/include/Rcpp/InternalFunction.h @@ -1,4 +1,4 @@ -// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*- +// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*- // // InternalFunction.h: Rcpp R/C++ interface class library -- exposing C++ functions // @@ -26,7 +26,9 @@ #include +#ifdef RCPP_USING_CXX11 #include +#endif namespace Rcpp{ @@ -35,20 +37,19 @@ namespace Rcpp{ RCPP_GENERATE_CTOR_ASSIGN(InternalFunction_Impl) - template +#ifdef RCPP_USING_CXX11 + template InternalFunction_Impl(const std::function &fun) { - set( - XPtr >( - new Rcpp::InternalFunctionWithStdFunction::CppFunctionBaseFromStdFunction(fun), - false - ) - ); - } - template - InternalFunction_Impl(RESULT_TYPE (*fun)(T...)) { - set(XPtr >(new CppFunctionN(fun), true)); + set( + XPtr >( + new Rcpp::InternalFunctionWithStdFunction::CppFunctionBaseFromStdFunction(fun), + false + ) + ); } +#endif + #include void update(SEXP){} private: diff --git a/inst/include/Rcpp/InternalFunctionWithStdFunction.h b/inst/include/Rcpp/InternalFunctionWithStdFunction.h index 993bf282e..162ead791 100644 --- a/inst/include/Rcpp/InternalFunctionWithStdFunction.h +++ b/inst/include/Rcpp/InternalFunctionWithStdFunction.h @@ -1,51 +1,69 @@ -// -// InternalFunction_with_std_function.h: Rcpp R/C++ interface class library -- exposing C++ std::function's -// -// Copyright (C) 2014 - 2025 Christian Authmann -// Copyright (C) 2015 - 2025 Romain Francois and Dirk Eddelbuettel -// -// This file is part of Rcpp. -// -// Rcpp is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 2 of the License, or -// (at your option) any later version. -// -// Rcpp is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Rcpp. If not, see . - -#ifndef Rcpp_InternalFunctionWithStdFunction_h -#define Rcpp_InternalFunctionWithStdFunction_h - -#include -#include - -namespace Rcpp { - - namespace InternalFunctionWithStdFunction { - - template - class CppFunctionBaseFromStdFunction : public CppFunctionBase { - public: - CppFunctionBaseFromStdFunction(const std::function &fun) : fun(fun) {} - virtual ~CppFunctionBaseFromStdFunction() {} - - SEXP operator()(SEXP* args) { - BEGIN_RCPP - return call(fun, args); - END_RCPP - } - - private: - const std::function fun; - }; - - } // namespace InternalFunctionWithStdFunction -} // namespace Rcpp - -#endif +// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*- +// +// InternalFunction_with_std_function.h: Rcpp R/C++ interface class library -- exposing C++ std::function's +// +// Copyright (C) 2014 Christian Authmann +// +// This file is part of Rcpp. +// +// Rcpp is free software: you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// Rcpp is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Rcpp. If not, see . + +#ifndef Rcpp_InternalFunctionWithStdFunction_h +#define Rcpp_InternalFunctionWithStdFunction_h + +#include + +namespace Rcpp{ + + namespace InternalFunctionWithStdFunction { + + #include + + template + class CppFunctionBaseFromStdFunction : public CppFunctionBase { + public: + CppFunctionBaseFromStdFunction(const std::function &fun) : fun(fun) {} + virtual ~CppFunctionBaseFromStdFunction() {} + + SEXP operator()(SEXP* args) { + BEGIN_RCPP + auto result = call(fun, args); + return Rcpp::module_wrap(result); + END_RCPP + } + + private: + const std::function fun; + }; + + template + class CppFunctionBaseFromStdFunction : public CppFunctionBase { + public: + CppFunctionBaseFromStdFunction(const std::function &fun) : fun(fun) {} + virtual ~CppFunctionBaseFromStdFunction() {} + + SEXP operator()(SEXP* args) { + BEGIN_RCPP + call(fun, args); + END_RCPP + } + + private: + const std::function fun; + }; + + } // namespace InternalFunctionWithStdFunction +} // namespace Rcpp + +#endif diff --git a/inst/include/Rcpp/Interrupt.h b/inst/include/Rcpp/Interrupt.h index a75fea600..aec3afcd0 100644 --- a/inst/include/Rcpp/Interrupt.h +++ b/inst/include/Rcpp/Interrupt.h @@ -49,7 +49,7 @@ namespace Rcpp { // R_ToplevelExec so it doesn't longjmp namespace { - inline void checkInterruptFn(void* /*dummy*/) { + inline void checkInterruptFn(void *dummy) { R_CheckUserInterrupt(); } diff --git a/inst/include/Rcpp/Language.h b/inst/include/Rcpp/Language.h index d893df67a..452d468b4 100644 --- a/inst/include/Rcpp/Language.h +++ b/inst/include/Rcpp/Language.h @@ -1,7 +1,8 @@ - +// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*- +// // Language.h: Rcpp R/C++ interface class library -- language objects (calls) // -// Copyright (C) 2010 - 2025 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2010 - 2013 Dirk Eddelbuettel and Romain Francois // // This file is part of Rcpp. // @@ -34,8 +35,8 @@ namespace Rcpp{ { public: - typedef typename DottedPairProxyPolicy::DottedPairProxy Proxy; - typedef typename DottedPairProxyPolicy::const_DottedPairProxy const_Proxy; + typedef typename DottedPairProxyPolicy::DottedPairProxy Proxy ; + typedef typename DottedPairProxyPolicy::const_DottedPairProxy const_Proxy ; RCPP_GENERATE_CTOR_ASSIGN(Language_Impl) @@ -48,7 +49,7 @@ namespace Rcpp{ * to a call using as.call */ Language_Impl(SEXP x){ - Storage::set__( r_cast(x) ); + Storage::set__( r_cast(x) ) ; } /** @@ -61,7 +62,7 @@ namespace Rcpp{ * > call( "rnorm" ) */ explicit Language_Impl( const std::string& symbol ){ - Storage::set__( Rf_lang1( Rf_install(symbol.c_str()) ) ); + Storage::set__( Rf_lang1( Rf_install(symbol.c_str()) ) ) ; } /** @@ -73,7 +74,7 @@ namespace Rcpp{ * > call( "rnorm" ) */ explicit Language_Impl( const Symbol& symbol ){ - Storage::set__( Rf_lang1( symbol ) ); + Storage::set__( Rf_lang1( symbol ) ) ; } /** @@ -82,7 +83,7 @@ namespace Rcpp{ * @param function function to call */ explicit Language_Impl( const Function& function) { - Storage::set__( Rf_lang1( function ) ); + Storage::set__( Rf_lang1( function ) ) ; } /** @@ -102,29 +103,21 @@ namespace Rcpp{ * 0.0 is wrapped as a numeric vector using wrap( const& double ) * ... */ - template - Language_Impl(const std::string& symbol, const T&... t) { - Storage::set__(langlist(Rf_install(symbol.c_str()), t...) ); - } - - template - Language_Impl(const Function& function, const T&... t) { - Storage::set__(langlist(function, t...)); - } + #include /** * sets the symbol of the call */ void setSymbol( const std::string& symbol){ - setSymbol( Symbol( symbol ) ); + setSymbol( Symbol( symbol ) ) ; } /** * sets the symbol of the call */ void setSymbol( const Symbol& symbol ){ - SEXP x = Storage::get__(); - SETCAR( x, symbol ); + SEXP x = Storage::get__() ; + SETCAR( x, symbol ) ; SET_TAG(x, R_NilValue); } @@ -132,7 +125,7 @@ namespace Rcpp{ * sets the function */ void setFunction( const Function& function){ - SEXP x = Storage::get__(); + SEXP x = Storage::get__() ; SETCAR( x, function ); SET_TAG(x, R_NilValue); /* probably not necessary */ } @@ -141,85 +134,83 @@ namespace Rcpp{ * eval this call in the global environment */ SEXP eval() const { - return Rcpp_fast_eval( Storage::get__(), R_GlobalEnv ); + return Rcpp_eval( Storage::get__(), R_GlobalEnv ) ; } /** * eval this call in the requested environment */ SEXP eval(SEXP env) const { - return Rcpp_fast_eval( Storage::get__(), env ); + return Rcpp_eval( Storage::get__(), env ) ; } SEXP fast_eval() const { - return internal::Rcpp_eval_impl( Storage::get__(), R_GlobalEnv); + return Rf_eval( Storage::get__(), R_GlobalEnv) ; } SEXP fast_eval(SEXP env ) const { - return internal::Rcpp_eval_impl( Storage::get__(), env); + return Rf_eval( Storage::get__(), env) ; } - void update(SEXP x) { - if (TYPEOF(x) != LANGSXP) { - Storage::set__(r_cast(x)); - } - SET_TAG( x, R_NilValue ); + void update( SEXP x){ + SET_TYPEOF( x, LANGSXP ) ; + SET_TAG( x, R_NilValue ) ; } }; - typedef Language_Impl Language; + typedef Language_Impl Language ; template class fixed_call { public: - typedef RESULT_TYPE result_type; + typedef RESULT_TYPE result_type ; fixed_call( Language call_ ) : call(call_){} fixed_call( Function fun ) : call(fun){} RESULT_TYPE operator()(){ - return as( call.eval() ); + return as( call.eval() ) ; } private: - Language call; - }; + Language call ; + } ; template - class unary_call : public std::function { + class unary_call : public std::unary_function { public: unary_call( Language call_ ) : call(call_), proxy(call_,1) {} - unary_call( Language call_, R_xlen_t index ) : call(call_), proxy(call_,index){} + unary_call( Language call_, int index ) : call(call_), proxy(call_,index){} unary_call( Function fun ) : call( fun, R_NilValue), proxy(call,1) {} RESULT_TYPE operator()( const T& object ){ - proxy = object; - return as( call.eval() ); + proxy = object ; + return as( call.eval() ) ; } private: - Language call; - Language::Proxy proxy; - }; + Language call ; + Language::Proxy proxy ; + } ; template - class binary_call : public std::function { + class binary_call : public std::binary_function { public: binary_call( Language call_ ) : call(call_), proxy1(call_,1), proxy2(call_,2) {} - binary_call( Language call_, R_xlen_t index1, R_xlen_t index2 ) : call(call_), proxy1(call_,index1), proxy2(call_,index2){} + binary_call( Language call_, int index1, int index2 ) : call(call_), proxy1(call_,index1), proxy2(call_,index2){} binary_call( Function fun) : call(fun, R_NilValue, R_NilValue), proxy1(call,1), proxy2(call,2){} RESULT_TYPE operator()( const T1& o1, const T2& o2 ){ - proxy1 = o1; - proxy2 = o2; - return as( call.eval() ); + proxy1 = o1 ; + proxy2 = o2 ; + return as( call.eval() ) ; } private: - Language call; - Language::Proxy proxy1; - Language::Proxy proxy2; - }; + Language call ; + Language::Proxy proxy1 ; + Language::Proxy proxy2 ; + } ; } // namespace Rcpp diff --git a/inst/include/Rcpp/Light b/inst/include/Rcpp/Light deleted file mode 100644 index dffc88d97..000000000 --- a/inst/include/Rcpp/Light +++ /dev/null @@ -1,25 +0,0 @@ -// Rcpp/Light: R/C++ interface class library -- without Rcpp Modules -// -// Copyright (C) 2008 - 2021 Dirk Eddelbuettel -// Copyright (C) 2009 - 2021 Dirk Eddelbuettel and Romain Francois -// -// This file is part of Rcpp. -// -// Rcpp is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 2 of the License, or -// (at your option) any later version. -// -// Rcpp is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Rcpp. If not, see . - -// no Modules -#define RCPP_NO_MODULES - -// include Rcpp as usual -#include diff --git a/inst/include/Rcpp/Lighter b/inst/include/Rcpp/Lighter deleted file mode 100644 index 78b56e5b5..000000000 --- a/inst/include/Rcpp/Lighter +++ /dev/null @@ -1,25 +0,0 @@ -// Rcpp/Lighter: R/C++ interface class library -- without Rcpp Modules + RTTI -// -// Copyright (C) 2008 - 2021 Dirk Eddelbuettel -// Copyright (C) 2009 - 2021 Dirk Eddelbuettel and Romain Francois -// -// This file is part of Rcpp. -// -// Rcpp is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 2 of the License, or -// (at your option) any later version. -// -// Rcpp is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Rcpp. If not, see . - -// no RTTI (actually implies no Modules) -- solid gain -#define RCPP_NO_RTTI - -// include Rcpp/Light which includes Rcpp -#include diff --git a/inst/include/Rcpp/Lightest b/inst/include/Rcpp/Lightest deleted file mode 100644 index cd501c796..000000000 --- a/inst/include/Rcpp/Lightest +++ /dev/null @@ -1,26 +0,0 @@ -// Rcpp/Lightest: R/C++ interface class library -- without Rcpp Modules, RTTI, Sugar -// -// Copyright (C) 2008 - 2021 Dirk Eddelbuettel -// Copyright (C) 2009 - 2021 Dirk Eddelbuettel and Romain Francois -// -// This file is part of Rcpp. -// -// Rcpp is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 2 of the License, or -// (at your option) any later version. -// -// Rcpp is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Rcpp. If not, see . -// New (draft) header with optional components off - -// no Sugar (but unclear how much it helps) -#define RCPP_NO_SUGAR - -// include Rcpp/Lighter -#include diff --git a/inst/include/Rcpp/Module.h b/inst/include/Rcpp/Module.h index 7556e9f3c..2de10cae3 100644 --- a/inst/include/Rcpp/Module.h +++ b/inst/include/Rcpp/Module.h @@ -1,7 +1,8 @@ - +// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*- +// // Module.h: Rcpp R/C++ interface class library -- Rcpp modules // -// Copyright (C) 2010 - 2026 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2010 - 2012 Dirk Eddelbuettel and Romain Francois // // This file is part of Rcpp. // @@ -22,7 +23,6 @@ #define Rcpp_Module_h #include -#include namespace Rcpp{ @@ -85,53 +85,10 @@ namespace Rcpp{ #include #include +#include -namespace Rcpp { - template - inline void signature(std::string& s, const char* name) { - s.clear(); - s += get_return_type() + " " + name + "("; - int n = sizeof...(T); - int i = 0; - // Using initializer list as c++11 implementation of a fold expression - (void)std::initializer_list{ - (s += get_return_type(), s += (++i == n ? "" : ", "), 0)... }; - s += ")"; - } - - template - class CppFunctionN : public CppFunction { - public: - CppFunctionN(RESULT_TYPE (*fun)(T...), const char* docstring = 0) : CppFunction(docstring), ptr_fun(fun) {} - - SEXP operator()(SEXP* args) { - BEGIN_RCPP - return call(ptr_fun, args); - END_RCPP - } - - inline int nargs() { return sizeof...(T); } - inline bool is_void() { return std::is_void::value; } - inline void signature(std::string& s, const char* name) { Rcpp::signature(s, name); } - inline DL_FUNC get_function_ptr() { return (DL_FUNC)ptr_fun; } - - private: - RESULT_TYPE (*ptr_fun)(T...); - }; - - template - class CppFunction_WithFormalsN : public CppFunctionN { - public: - CppFunction_WithFormalsN(RESULT_TYPE (*fun)(T...), Rcpp::List formals_, const char* docstring = 0) : - CppFunctionN(fun, docstring), formals(formals_) {} - - SEXP get_formals() { return formals; } - - private: - Rcpp::List formals; - }; -} - + // templates CppFunction0, ..., CppFunction65 +#include #include #include @@ -143,7 +100,7 @@ namespace Rcpp{ typedef Rcpp::XPtr XP ; CppMethod() {} - virtual SEXP operator()(Class* /*object*/, SEXP* /*args*/) { return R_NilValue ; } + virtual SEXP operator()(Class* object, SEXP* args) { return R_NilValue ; } virtual ~CppMethod(){} virtual int nargs(){ return 0 ; } virtual bool is_void(){ return false ; } @@ -173,78 +130,11 @@ namespace Rcpp{ ParentMethod* parent_method_pointer ; } ; - template - inline void ctor_signature(std::string& s, const std::string& classname) { - s.assign(classname); - s += "("; - int n = sizeof...(T); - int i = 0; - // Using initializer list as c++11 implementation of a fold expression - (void)std::initializer_list{ - (s += get_return_type(), s += (++i == n ? "" : ", "), 0)... }; - s += ")"; - } - template - class Constructor_Base { - public: - virtual Class* get_new( SEXP* args, int nargs ) = 0 ; - virtual int nargs() = 0 ; - virtual void signature(std::string& s, const std::string& class_name) = 0 ; - } ; +#include +#include +#include - template - class Constructor: public Constructor_Base { - public: - virtual Class* get_new( SEXP* args, int nargs ){ - return get_new_impl(args, nargs, traits::make_index_sequence()); - } - virtual int nargs(){ return sizeof...(T) ; } - virtual void signature(std::string& s, const std::string& class_name ){ - ctor_signature(s, class_name) ; - } - - private: - template - Class* get_new_impl(SEXP* args, int nargs, traits::index_sequence) { - return new Class( as(args[Is])... ) ; - } - }; - - template - class Factory_Base { - public: - virtual Class* get_new( SEXP* args, int nargs ) = 0 ; - virtual int nargs() = 0 ; - virtual void signature(std::string& s, const std::string& class_name) = 0 ; - } ; - - template - class Factory : public Factory_Base { - public: - Factory( Class* (*fun)(T...) ) : ptr_fun(fun){} - virtual Class* get_new( SEXP* args, int nargs ){ - return get_new( args, traits::make_index_sequence() ) ; - } - virtual int nargs(){ return sizeof...(T) ; } - virtual void signature(std::string& s, const std::string& class_name ){ - ctor_signature(s, class_name) ; - } - private: - template - Class* get_new( SEXP* args, traits::index_sequence ){ - return ptr_fun( bare_as(args[I])... ) ; - } - Class* (*ptr_fun)(T...) ; - } ; - - inline bool yes( SEXP* /*args*/, int /* nargs */ ){ - return true ; - } - - template - bool yes_arity( SEXP* /* args */ , int nargs){ - return nargs == n ; - } +#include typedef bool (*ValidConstructor)(SEXP*,int) ; typedef bool (*ValidMethod)(SEXP*,int) ; @@ -311,7 +201,6 @@ namespace Rcpp{ template class S4_CppConstructor : public Reference { - typedef Reference Base; public: typedef XPtr XP_Class ; typedef Reference::Storage Storage ; @@ -326,20 +215,19 @@ namespace Rcpp{ field( "docstring" ) = m->docstring ; } - RCPP_CTOR_ASSIGN_WITH_BASE(S4_CppConstructor) + RCPP_CTOR_ASSIGN(S4_CppConstructor) } ; template class S4_CppOverloadedMethods : public Rcpp::Reference { - typedef Rcpp::Reference Base; public: typedef Rcpp::XPtr XP_Class ; typedef SignedMethod signed_method_class ; typedef std::vector vec_signed_method ; S4_CppOverloadedMethods( vec_signed_method* m, const XP_Class& class_xp, const char* name, std::string& buffer ) : Reference( "C++OverloadedMethods" ){ - int n = static_cast(m->size()) ; + int n = m->size() ; Rcpp::LogicalVector voidness(n), constness(n) ; Rcpp::CharacterVector docstrings(n), signatures(n) ; Rcpp::IntegerVector nargs(n) ; @@ -365,72 +253,12 @@ namespace Rcpp{ } - RCPP_CTOR_ASSIGN_WITH_BASE(S4_CppOverloadedMethods) + RCPP_CTOR_ASSIGN(S4_CppOverloadedMethods) } ; - - template - class CppMethodImplN : public CppMethod { - public: - typedef typename std::conditional::type Method; - typedef CppMethod method_class; - typedef typename Rcpp::traits::remove_const_and_reference::type CLEANED_RESULT_TYPE; - - CppMethodImplN(Method m) : method_class(), met(m) {} - SEXP operator()(Class* object, SEXP* args) { - // Can't pass pointer to member function directly to `call()`, so wrap it in a lambda - auto f = [&object, this](T... cpp_args) -> CLEANED_RESULT_TYPE { - return (object->*met)(cpp_args...); - }; - return call(f, args); - } - inline int nargs() { return sizeof...(T); } - inline bool is_void() { return std::is_void::value; } - inline bool is_const() { return IsConst; } - inline void signature(std::string& s, const char* name) { Rcpp::signature(s, name); } - private: - Method met; - }; - - template - using CppMethodN = CppMethodImplN; - - template - using const_CppMethodN = CppMethodImplN; - - template - class Pointer_CppMethodImplN : public CppMethod { - public: - typedef typename std::conditional::type Method; - typedef CppMethod method_class; - typedef typename Rcpp::traits::remove_const_and_reference::type CLEANED_RESULT_TYPE; - - Pointer_CppMethodImplN(Method m) : method_class(), met(m) {} - SEXP operator()(Class* object, SEXP* args) { - // Need to have `object` as the first argument to the function, so wrap it in a lambda - auto f = [&object, this](T... cpp_args) -> CLEANED_RESULT_TYPE { - return met(object, cpp_args...); - }; - return call(f, args); - } - inline int nargs() { return sizeof...(T); } - inline bool is_void() { return std::is_void::value; } - inline bool is_const() { return IsConst; } - inline void signature(std::string& s, const char* name) { Rcpp::signature(s, name); } - private: - Method met; - }; - - template - using Pointer_CppMethodN = Pointer_CppMethodImplN; - - template - using Const_Pointer_CppMethodN = Pointer_CppMethodImplN; - - +#include +#include template class CppProperty { @@ -489,7 +317,6 @@ namespace Rcpp{ template class S4_field : public Rcpp::Reference { - typedef Rcpp::Reference Base; public: typedef XPtr XP_Class ; S4_field( CppProperty* p, const XP_Class& class_xp ) : Reference( "C++Field" ){ @@ -501,7 +328,7 @@ namespace Rcpp{ field( "docstring" ) = p->docstring ; } - RCPP_CTOR_ASSIGN_WITH_BASE(S4_field) + RCPP_CTOR_ASSIGN(S4_field) } ; @@ -538,25 +365,8 @@ namespace Rcpp{ } ; } - -namespace Rcpp { - template - void function(const char* name_, RESULT_TYPE (*fun)(T... t), const char* docstring = 0) { - Rcpp::Module* scope = ::getCurrentScope(); - if (scope) { - scope->Add(name_, new CppFunctionN(fun, docstring)); - } - } - - template - void function(const char* name_, RESULT_TYPE (*fun)(T... t), Rcpp::List formals, const char* docstring = 0) { - Rcpp::Module* scope = ::getCurrentScope(); - if (scope) { - scope->Add(name_, new CppFunction_WithFormalsN(fun, formals, docstring)); - } - } -} - +// function factories +#include namespace Rcpp { @@ -567,11 +377,10 @@ namespace Rcpp { } class CppClass : public S4{ - typedef S4 Base; public: typedef XPtr XP_Class ; typedef Rcpp::XPtr XP ; - CppClass( SEXP x) : S4(x){}; // #nocov + CppClass( SEXP x) : S4(x){}; CppClass( Module* p, class_Base* cl, std::string& buffer ) : S4("C++Class") { XP_Class clxp( cl, false, R_NilValue, R_NilValue ) ; @@ -592,12 +401,11 @@ namespace Rcpp { slot( "parents" ) = cl->parents ; } - RCPP_CTOR_ASSIGN_WITH_BASE(CppClass) + RCPP_CTOR_ASSIGN(CppClass) } ; class CppObject : public S4{ - typedef S4 Base; public: typedef Rcpp::XPtr XP ; CppObject( Module* p, class_Base* clazz, SEXP xp ) : S4("C++Object") { @@ -605,7 +413,7 @@ namespace Rcpp { slot( "cppclass" ) = Rcpp::XPtr( clazz, false ) ; slot( "pointer" ) = xp ; } - RCPP_CTOR_ASSIGN_WITH_BASE(CppObject) + RCPP_CTOR_ASSIGN(CppObject) } ; } @@ -640,7 +448,8 @@ static VARIABLE_IS_NOT_USED SEXP moduleSym = NULL; // this macro is called by code wanting to load a module -- see RInside's rinside_module_sample0.cpp #define LOAD_RCPP_MODULE(NAME) \ - Shield __load_module_call__( Rf_lang2( GET_MODULE_SYM, _rcpp_module_boot_##NAME() ) ); \ - Rcpp_fast_eval( __load_module_call__, R_GlobalEnv ); + Shield __load_module_call__( Rf_lang2( GET_MODULE_SYM, _rcpp_module_boot_##NAME() ); \ + Rf_eval(__load_module_call__), R_GlobalEnv ); #endif + diff --git a/inst/include/Rcpp/Nullable.h b/inst/include/Rcpp/Nullable.h deleted file mode 100644 index 53704ffb8..000000000 --- a/inst/include/Rcpp/Nullable.h +++ /dev/null @@ -1,148 +0,0 @@ -// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*- -// -// Nullable.h: Rcpp R/C++ interface class library -- SEXP container which can be NULL -// -// Copyright (C) 2015 Dirk Eddelbuettel and Daniel C. Dillon -// -// This file is part of Rcpp. -// -// Rcpp is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 2 of the License, or -// (at your option) any later version. -// -// Rcpp is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Rcpp. If not, see . - -#ifndef Rcpp_Nullable_h -#define Rcpp_Nullable_h - -// We looked into the safe_bool_idiom [1] but found that more trouble than is -// warranted here. We first and foremost want an operator SEXP() which got in -// the way of redefining operator bool. -// [1] http://www.artima.com/cppsource/safebool.html) - -namespace Rcpp { - - template - class Nullable { - public: - - /** - * Empty no-argument constructor of a Nullable object - * - * Assigns (R's) NULL value, and sets validator to FALSE - */ - inline Nullable() : m_sexp(R_NilValue), m_set(false) {} - - /** - * Template constructor of a Nullable object - * - * Assigns object, and set validator to TRUE - */ - - inline Nullable(const T &t) : m_sexp(t), m_set(true) {} - - /** - * Standard constructor of a Nullable object - * - * @param SEXP is stored - */ - inline Nullable(SEXP t) { - m_sexp = t; - m_set = true; - } - - public: - - /** - * Copy constructor for Nullable object - * - * @param SEXP is used to update internal copy - */ - inline Nullable &operator=(SEXP sexp) { - m_sexp = sexp; - m_set = true; - return *this; - } - - /** - * operator SEXP() to return nullable object - * - * @throw 'not initialized' if object has not been set - */ - inline operator SEXP() const { - checkIfSet(); - return m_sexp; - } - - /** - * get() accessor for object - * - * @throw 'not initialized' if object has not been set - */ - inline SEXP get() const { - checkIfSet(); - return m_sexp; - } - - /** - * Boolean test for usability as a T - */ - inline bool isUsable() const { - return m_set && !Rf_isNull(m_sexp); - } - - /** - * Boolean test for NULL - * - * @throw 'not initialized' if object has not been set - */ - inline bool isNull() const { - checkIfSet(); - return Rf_isNull(m_sexp); - } - - /** - * Boolean test for not NULL - * - * @throw 'not initialized' if object has not been set - */ - inline bool isNotNull() const { - return ! isNull(); - } - - /** - * Test function to check if object has been initialized - * - */ - inline bool isSet(void) const { return m_set; } - - /** - * Returns m_sexp as a T - */ - inline T as() { return get(); } - - /** - * Return a clone of m_sexp as a T - */ - inline T clone() const { return Rcpp::clone(get()); } - - private: - SEXP m_sexp; - bool m_set; - - inline void checkIfSet(void) const { - if (!m_set) { - throw ::Rcpp::exception("Not initialized"); - } - } - }; -} - -#endif diff --git a/inst/include/Rcpp/Pairlist.h b/inst/include/Rcpp/Pairlist.h index 375d74271..043615efb 100644 --- a/inst/include/Rcpp/Pairlist.h +++ b/inst/include/Rcpp/Pairlist.h @@ -2,7 +2,7 @@ // // Pairlist.h: Rcpp R/C++ interface class library -- pair lists objects (LISTSXP) // -// Copyright (C) 2010 - 2025 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2010 - 2013 Dirk Eddelbuettel and Romain Francois // // This file is part of Rcpp. // @@ -42,15 +42,11 @@ namespace Rcpp{ Pairlist_Impl(SEXP x){ Storage::set__(r_cast(x)) ; } - template - Pairlist_Impl(const T&... args ){ - Storage::set__(pairlist(args... )) ; - } - void update(SEXP x) { - if (TYPEOF(x) != LISTSXP) { - Storage::set__(r_cast(x)); - } + #include + + void update(SEXP x){ + SET_TYPEOF( x, LISTSXP ) ; } } ; diff --git a/inst/include/Rcpp/Promise.h b/inst/include/Rcpp/Promise.h index 8b4096a01..681fa2b25 100644 --- a/inst/include/Rcpp/Promise.h +++ b/inst/include/Rcpp/Promise.h @@ -29,11 +29,8 @@ namespace Rcpp{ RCPP_GENERATE_CTOR_ASSIGN(Promise_Impl) Promise_Impl( SEXP x){ - if( TYPEOF(x) != PROMSXP) { - const char* fmt = "Not a promise: [type = %s]."; - throw not_compatible(fmt, Rf_type2char(TYPEOF(x))); - } - + if( TYPEOF(x) != PROMSXP) + throw not_compatible("not a promise") ; Storage::set__(x) ; } diff --git a/inst/include/Rcpp/RNGScope.h b/inst/include/Rcpp/RNGScope.h deleted file mode 100644 index 840460a81..000000000 --- a/inst/include/Rcpp/RNGScope.h +++ /dev/null @@ -1,41 +0,0 @@ -// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*- -// -// RNGScope.h: Rcpp R/C++ interface class library -- -// -// Copyright (C) 2010 - 2016 Douglas Bates, Dirk Eddelbuettel and Romain Francois -// -// This file is part of Rcpp. -// -// Rcpp is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 2 of the License, or -// (at your option) any later version. -// -// Rcpp is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Rcpp. If not, see . - -#ifndef Rcpp__RNGScope_h -#define Rcpp__RNGScope_h - -namespace Rcpp { - -class RNGScope{ -public: - RNGScope(){ internal::enterRNGScope(); } - ~RNGScope(){ internal::exitRNGScope(); } -}; - -class SuspendRNGSynchronizationScope { -public: - SuspendRNGSynchronizationScope() { internal::beginSuspendRNGSynchronization(); } - ~SuspendRNGSynchronizationScope() { internal::endSuspendRNGSynchronization(); } -}; - -} // namespace Rcpp - -#endif diff --git a/inst/include/Rcpp/RObject.h b/inst/include/Rcpp/RObject.h index 881ec69ca..388c30ec9 100644 --- a/inst/include/Rcpp/RObject.h +++ b/inst/include/Rcpp/RObject.h @@ -48,7 +48,7 @@ namespace Rcpp{ */ template RObject_Impl& operator=(const T& other) { - Storage::set__(Shield(wrap(other))); + Storage::set__( wrap(other) ) ; return *this; } diff --git a/inst/include/Rcpp/Rcpp b/inst/include/Rcpp/Rcpp deleted file mode 100644 index eef8b8894..000000000 --- a/inst/include/Rcpp/Rcpp +++ /dev/null @@ -1,21 +0,0 @@ -// Rcpp/Rcpp: R/C++ interface class library -// -// Copyright (C) 2008 - 2021 Dirk Eddelbuettel -// Copyright (C) 2009 - 2021 Dirk Eddelbuettel and Romain Francois -// -// This file is part of Rcpp. -// -// Rcpp is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 2 of the License, or -// (at your option) any later version. -// -// Rcpp is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Rcpp. If not, see . - -#include diff --git a/inst/include/Rcpp/Reference.h b/inst/include/Rcpp/Reference.h index 4bd08276f..fda1df0d4 100644 --- a/inst/include/Rcpp/Reference.h +++ b/inst/include/Rcpp/Reference.h @@ -2,7 +2,7 @@ // // Reference.h: Rcpp R/C++ interface class library -- Reference class objects // -// Copyright (C) 2010 - 2019 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2010 - 2013 Dirk Eddelbuettel and Romain Francois // // This file is part of Rcpp. // @@ -58,17 +58,16 @@ namespace Rcpp{ */ Reference_Impl( const std::string& klass ) { SEXP newSym = Rf_install("new"); - Shield str(Rf_mkString(klass.c_str())); - Shield call(Rf_lang2(newSym, str)); - Storage::set__( Rcpp_fast_eval( call , Rcpp::internal::get_Rcpp_namespace()) ); + Shield call( Rf_lang2( newSym, Rf_mkString( klass.c_str() ) ) ); + Storage::set__( Rcpp_eval( call ) ) ; } void update( SEXP x){ - if( ! ::Rf_isS4(x) ) throw not_reference(); + if( ! ::Rf_isS4(x) ) throw not_reference() ; } } ; - typedef Reference_Impl Reference; + typedef Reference_Impl Reference ; } // namespace Rcpp diff --git a/inst/include/Rcpp/Rmath.h b/inst/include/Rcpp/Rmath.h index ad1958e52..e8b1bf1e9 100644 --- a/inst/include/Rcpp/Rmath.h +++ b/inst/include/Rcpp/Rmath.h @@ -1,7 +1,8 @@ - +// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*- +// // Rmath.h: Rcpp R/C++ interface class library -- Wrappers for R's Rmath API // -// Copyright (C) 2012-2025 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2012 Dirk Eddelbuettel and Romain Francois // // This file is part of Rcpp. // @@ -130,10 +131,12 @@ namespace R { inline double qnbinom(double p, double sz, double pb, int lt, int lg) { return ::Rf_qnbinom(p, sz, pb, lt, lg); } inline double rnbinom(double sz, double pb) { return ::Rf_rnbinom(sz, pb); } +#if R_VERSION >= R_Version(3, 1, 2) inline double dnbinom_mu(double x, double sz, double mu, int lg) { return ::Rf_dnbinom_mu(x, sz, mu, lg); } inline double pnbinom_mu(double x, double sz, double mu, int lt, int lg) { return ::Rf_pnbinom_mu(x, sz, mu, lt, lg); } inline double qnbinom_mu(double x, double sz, double mu, int lt, int lg) { return ::Rf_qnbinom_mu(x, sz, mu, lt, lg); } //inline double rnbinom_mu(double sz, double mu) { return ::Rf_rnbinom_mu(sz, mu); } +#endif /* Poisson Distribution */ inline double dpois(double x, double lb, int lg) { return ::Rf_dpois(x, lb, lg); } @@ -157,7 +160,7 @@ namespace R { inline double dnbeta(double x, double a, double b, double ncp, int lg) { return ::Rf_dnbeta(x, a, b, ncp, lg); } inline double pnbeta(double x, double a, double b, double ncp, int lt, int lg) { return ::Rf_pnbeta(x, a, b, ncp, lt, lg); } inline double qnbeta(double p, double a, double b, double ncp, int lt, int lg) { return ::Rf_qnbeta(p, a, b, ncp, lt, lg); } - //inline double rnbeta(double a, double b, double np) { return ::Rf_rnbeta(a, b, np); } + inline double rnbeta(double a, double b, double np) { return ::Rf_rnbeta(a, b, np); } /* Non-central F Distribution */ inline double dnf(double x, double df1, double df2, double ncp, int lg) { return ::Rf_dnf(x, df1, df2, ncp, lg); } @@ -216,8 +219,7 @@ namespace R { #ifndef HAVE_HYPOT inline double hypot(double a, double b) { return ::Rf_hypot(a, b); } #endif - /* Gone since R 2.14.0 according to Brian Ripley and is now comment out per his request */ - /* inline double pythag(double a, double b) { return ::Rf_pythag(a, b); } */ + inline double pythag(double a, double b) { return ::Rf_pythag(a, b); } #ifndef HAVE_EXPM1 inline double expm1(double x); /* = exp(x)-1 {care for small x} */ { return ::Rf_expm1(x); } #endif diff --git a/inst/include/Rcpp/S4.h b/inst/include/Rcpp/S4.h index 2ec8cdebf..4ac09c65a 100644 --- a/inst/include/Rcpp/S4.h +++ b/inst/include/Rcpp/S4.h @@ -1,7 +1,8 @@ - +// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*- +// // S4.h: Rcpp R/C++ interface class library -- S4 objects // -// Copyright (C) 2010 - 2026 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2010 - 2013 Dirk Eddelbuettel and Romain Francois // // This file is part of Rcpp. // @@ -37,10 +38,10 @@ namespace Rcpp{ * * @param x must be an S4 object */ - S4_Impl(SEXP x) { // #nocov start + S4_Impl(SEXP x) { if( ! ::Rf_isS4(x) ) throw not_s4() ; Storage::set__(x) ; - } // #nocov end + } S4_Impl& operator=( SEXP other ){ Storage::set__( other ) ; @@ -51,12 +52,12 @@ namespace Rcpp{ * Creates an S4 object of the requested class. * * @param klass name of the target S4 class - * @throw S4_creation_error if klass does not map to a known S4 class + * @throw not_s4 if klass does not map to a known S4 class */ S4_Impl( const std::string& klass ){ Shield x( R_do_new_object(R_do_MAKE_CLASS(klass.c_str())) ); if (!Rf_inherits(x, klass.c_str())) - throw S4_creation_error( klass ) ; // #nocov + throw S4_creation_error( klass ) ; Storage::set__(x) ; } @@ -65,9 +66,6 @@ namespace Rcpp{ */ bool is( const std::string& clazz) const ; - /** - * @throw not_s4 if x is not an S4 class - */ void update(SEXP x){ if( ! ::Rf_isS4(x) ) throw not_s4() ; } diff --git a/inst/include/Rcpp/String.h b/inst/include/Rcpp/String.h index 2103e5b28..631081a69 100644 --- a/inst/include/Rcpp/String.h +++ b/inst/include/Rcpp/String.h @@ -1,8 +1,8 @@ - +// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*- +// // String.h: Rcpp R/C++ interface class library -- single string // -// Copyright (C) 2012 - 2020 Dirk Eddelbuettel and Romain Francois -// Copyright (C) 2021 - 2025 Dirk Eddelbuettel, Romain Francois and Iñaki Ucar +// Copyright (C) 2012 - 2013 Dirk Eddelbuettel and Romain Francois // // This file is part of Rcpp. // @@ -29,17 +29,18 @@ #if RCPP_STRING_DEBUG_LEVEL > 0 #define RCPP_STRING_DEBUG_FORMAT "%40s:%4d " - #define RCPP_STRING_DEBUG(MSG) Rprintf(RCPP_STRING_DEBUG_FORMAT "%s\n" , ::Rcpp::internal::debug::short_file_name(__FILE__).c_str(), __LINE__, MSG); - #define RCPP_STRING_DEBUG_1(fmt, MSG) Rprintf(RCPP_STRING_DEBUG_FORMAT fmt "\n" , ::Rcpp::internal::debug::short_file_name(__FILE__).c_str(), __LINE__, MSG); - #define RCPP_STRING_DEBUG_2(fmt, M1, M2) Rprintf(RCPP_STRING_DEBUG_FORMAT fmt "\n" , ::Rcpp::internal::debug::short_file_name(__FILE__).c_str(), __LINE__, M1, M2); - #define RCPP_STRING_DEBUG_3(fmt, M1, M2, M3) Rprintf(RCPP_STRING_DEBUG_FORMAT fmt "\n" , ::Rcpp::internal::debug::short_file_name(__FILE__).c_str(), __LINE__, M1, M2, M3); + #define RCPP_STRING_DEBUG( MSG ) Rprintf( RCPP_STRING_DEBUG_FORMAT "%s\n" , short_file_name(__FILE__), __LINE__, MSG ) ; + #define RCPP_STRING_DEBUG_1( fmt, MSG ) Rprintf( RCPP_STRING_DEBUG_FORMAT fmt "\n" , short_file_name(__FILE__), __LINE__, MSG ) ; + #define RCPP_STRING_DEBUG_2( fmt, M1, M2 ) Rprintf( RCPP_STRING_DEBUG_FORMAT fmt "\n" , short_file_name(__FILE__), __LINE__, M1, M2 ) ; + #define RCPP_STRING_DEBUG_3( fmt, M1, M2, M3 ) Rprintf( RCPP_STRING_DEBUG_FORMAT fmt "\n" , short_file_name(__FILE__), __LINE__, M1, M2, M3) ; #else - #define RCPP_STRING_DEBUG(MSG) - #define RCPP_STRING_DEBUG_1(fmt, MSG) - #define RCPP_STRING_DEBUG_2(fmt, M1, M2) - #define RCPP_STRING_DEBUG_3(fmt, M1, M2, M3) + #define RCPP_STRING_DEBUG( MSG ) + #define RCPP_STRING_DEBUG_1( fmt, MSG ) + #define RCPP_STRING_DEBUG_2( fmt, M1, M2 ) + #define RCPP_STRING_DEBUG_3( fmt, M1, M2, M3 ) #endif + namespace Rcpp { /** @@ -52,694 +53,378 @@ namespace Rcpp { typedef internal::const_string_proxy const_StringProxy; /** default constructor */ - String(): data(Rf_mkCharCE("", CE_UTF8)), token(R_NilValue), buffer(), valid(true), buffer_ready(true), enc(CE_UTF8) { - token = Rcpp_PreciousPreserve(data); - RCPP_STRING_DEBUG("String()"); + String( ): data( Rf_mkChar("") ), buffer(), valid(true), buffer_ready(true) { + RCPP_STRING_DEBUG( "String()" ) ; } /** copy constructor */ - String(const String& s) : data(R_NilValue), token(R_NilValue), buffer(s.buffer), valid(s.valid), buffer_ready(s.buffer_ready), enc(s.enc) { - if (!buffer_ready) { - data = s.get_sexp(); - token = Rcpp_PreciousPreserve(data); - } - RCPP_STRING_DEBUG("String(const String&)"); + String( const String& other) : data( other.get_sexp()), valid(true), buffer_ready(false) { + RCPP_STRING_DEBUG( "String(const String&)" ) ; } /** construct a string from a single CHARSXP SEXP */ - String(SEXP charsxp) : data(R_NilValue), token(R_NilValue) { - if (TYPEOF(charsxp) == STRSXP) { - data = STRING_ELT(charsxp, 0); - } else if (TYPEOF(charsxp) == CHARSXP) { - data = charsxp; - } - - if (::Rf_isString(data) && ::Rf_length(data) != 1) { - const char* fmt = "Expecting a single string value: " - "[type=%s; extent=%i]."; - throw ::Rcpp::not_compatible(fmt, - Rf_type2char(TYPEOF(data)), - ::Rf_length(data)); - } - - valid = true; - buffer_ready = false; - enc = Rf_getCharCE(data); - token = Rcpp_PreciousPreserve(data); - RCPP_STRING_DEBUG("String(SEXP)"); + String(SEXP charsxp) : data(charsxp), valid(true), buffer_ready(false) { + RCPP_STRING_DEBUG( "String(SEXP)" ) ; } /** from string proxy */ - String(const StringProxy& proxy): data(proxy.get()), token(R_NilValue), valid(true), buffer_ready(false), enc(Rf_getCharCE(proxy.get())) { - token = Rcpp_PreciousPreserve(data); - RCPP_STRING_DEBUG("String(const StringProxy&)"); - } - - String(const StringProxy& proxy, cetype_t enc): data(proxy.get()), token(R_NilValue), valid(true), buffer_ready(false) { - token = Rcpp_PreciousPreserve(data); - set_encoding(enc); - RCPP_STRING_DEBUG("String(const StringProxy&, cetype_t)"); + String( const StringProxy& proxy ): data( proxy.get() ), valid(true), buffer_ready(false){ + RCPP_STRING_DEBUG( "String( const StringProxy&)" ) ; } - /** from string proxy */ - String(const const_StringProxy& proxy): data(proxy.get()), token(R_NilValue), valid(true), buffer_ready(false), enc(Rf_getCharCE(proxy.get())) { - token = Rcpp_PreciousPreserve(data); - RCPP_STRING_DEBUG("String(const const_StringProxy&)"); - } - - String(const const_StringProxy& proxy, cetype_t enc): data(proxy.get()), token(R_NilValue), valid(true), buffer_ready(false) { - token = Rcpp_PreciousPreserve(data); - set_encoding(enc); - RCPP_STRING_DEBUG("String(const const_StringProxy&, cetype_t)"); + String( const const_StringProxy& proxy ): data( proxy.get() ), valid(true), buffer_ready(false){ + RCPP_STRING_DEBUG( "String( const const_StringProxy&)" ) ; } /** from a std::string */ - String(const std::string& s, cetype_t enc = CE_UTF8) : data(R_NilValue), token(R_NilValue), buffer(s), valid(false), buffer_ready(true), enc(enc) { - RCPP_STRING_DEBUG("String(const std::string&, cetype_t)"); + String( const std::string& s) : buffer(s), valid(false), buffer_ready(true) { + RCPP_STRING_DEBUG( "String(const std::string& )" ) ; } - /** move constructor */ - String(String&& s) : data(s.data), token(s.token), buffer(std::move(s.buffer)), valid(s.valid), buffer_ready(s.buffer_ready), enc(s.enc) { - // Erase s. - s.data = R_NilValue; - s.token = R_NilValue; - s.buffer = std::string(); - s.valid = false; - s.buffer_ready = true; - s.enc = CE_UTF8; - RCPP_STRING_DEBUG("String(String&&)"); - } - - /** move a std::string */ - String(std::string&& s, cetype_t enc = CE_UTF8) : data(R_NilValue), token(R_NilValue), buffer(s), valid(false), buffer_ready(true), enc(enc) { - RCPP_STRING_DEBUG("String(std::string&&, cetype_t)"); - } - - String(const std::wstring& s, cetype_t enc = CE_UTF8) : data(internal::make_charsexp(s)), token(R_NilValue), valid(true), buffer_ready(false), enc(enc) { - token = Rcpp_PreciousPreserve(data); - RCPP_STRING_DEBUG("String(const std::wstring&, cetype_t)"); + String( const std::wstring& s) : data(internal::make_charsexp(s)), valid(true), buffer_ready(false) { + RCPP_STRING_DEBUG( "String(const std::wstring& )" ) ; } /** from a const char* */ - String(const char* s, cetype_t enc = CE_UTF8) : buffer(s), valid(false), buffer_ready(true), enc(enc) { - data = R_NilValue; - token = R_NilValue; - RCPP_STRING_DEBUG("String(const char*, cetype_t)"); + String( const char* s) : buffer(s), valid(false), buffer_ready(true){ + RCPP_STRING_DEBUG( "String(const char*)" ) ; } - String(const wchar_t* s, cetype_t enc = CE_UTF8) : data(internal::make_charsexp(s)), token(R_NilValue), valid(true), buffer_ready(false), enc(enc) { - token = Rcpp_PreciousPreserve(data); - RCPP_STRING_DEBUG("String(const wchar_t* s, cetype_t)"); + String( const wchar_t* s) : data(internal::make_charsexp(s)), valid(true), buffer_ready(false) { + RCPP_STRING_DEBUG( "String(const wchar_t* s)" ) ; } + /** constructors from R primitives */ - String(int x) : data(internal::r_coerce(x)), token(R_NilValue), valid(true), buffer_ready(false), enc(CE_UTF8) { - token = Rcpp_PreciousPreserve(data); - } - String(double x) : data(internal::r_coerce(x)), token(R_NilValue), valid(true), buffer_ready(false), enc(CE_UTF8) { - token = Rcpp_PreciousPreserve(data); - } - String(bool x) : data(internal::r_coerce(x)), token(R_NilValue), valid(true) , buffer_ready(false), enc(CE_UTF8) { - token = Rcpp_PreciousPreserve(data); - } - String(Rcomplex x) : data(internal::r_coerce(x)), token(R_NilValue), valid(true), buffer_ready(false), enc(CE_UTF8) { - token = Rcpp_PreciousPreserve(data); - } - String(Rbyte x) : data(internal::r_coerce(x)), token(R_NilValue), valid(true), buffer_ready(false), enc(CE_UTF8) { - token = Rcpp_PreciousPreserve(data); - } - - ~String() { - Rcpp_PreciousRelease(token); - data = R_NilValue; - token = R_NilValue; - } - - - inline String& operator=(int x) { - data = internal::r_coerce(x); - Rcpp_PreciousRelease(token); - token = Rcpp_PreciousPreserve(data); - valid = true; - buffer_ready = false; - return *this; - } - inline String& operator=(double x) { - data = internal::r_coerce(x); - Rcpp_PreciousRelease(token); - token = Rcpp_PreciousPreserve(data); - valid = true; - buffer_ready = false; - return *this; - } - inline String& operator=(Rbyte x) { - data = internal::r_coerce(x); - Rcpp_PreciousRelease(token); - token = Rcpp_PreciousPreserve(data); - valid = true; - buffer_ready = false; - return *this; - } - inline String& operator=(bool x) { - data = internal::r_coerce(x); - Rcpp_PreciousRelease(token); - token = Rcpp_PreciousPreserve(data); - valid = true; - buffer_ready = false; - return *this; - } - inline String& operator=(Rcomplex x) { - data = internal::r_coerce(x); - Rcpp_PreciousRelease(token); - token = Rcpp_PreciousPreserve(data); - valid = true; - buffer_ready = false; - return *this; - } - inline String& operator=(SEXP x) { - if (data != x) { - data = x; - Rcpp_PreciousRelease(token); - token = Rcpp_PreciousPreserve(data); - } - valid = true; - buffer_ready = false; - return *this; - } - inline String& operator=(const StringProxy& proxy) { - SEXP x = proxy.get(); - if (data != x) { - data = x; - Rcpp_PreciousRelease(token); - token = Rcpp_PreciousPreserve(x); - } - valid = true; - buffer_ready = false; - return *this; - } - inline String& operator=(const String& other) { - if (other.buffer_ready) { - // Copy the buffer without creating a SEXP. - if (valid) { - Rcpp_PreciousRelease(token); - valid = false; - } - data = R_NilValue; - token = R_NilValue; - buffer = other.buffer; - buffer_ready = true; - enc = other.enc; - } else { - SEXP x = other.get_sexp(); - if (data != x) { - data = x; - Rcpp_PreciousRelease(token); - token = Rcpp_PreciousPreserve(x); - } - valid = true; - buffer_ready = false; - } - return *this; - } - inline String& operator=(const std::string& s) { - buffer = s; - valid = false; - buffer_ready = true; - return *this; - } - inline String& operator=(String&& other) { - data = other.data; - token = other.token; - buffer = std::move(other.buffer); - valid = other.valid; - buffer_ready = other.buffer_ready; - enc = other.enc; - // Erase other. - other.data = R_NilValue; - other.token = R_NilValue; - other.buffer = std::string(); - other.valid = false; - other.buffer_ready = true; - other.enc = CE_UTF8; - return *this; - } - inline String& operator=(std::string&& s) { - buffer = s; - valid = false; - buffer_ready = true; - return *this; - } - inline String& operator=(const char* s) { - buffer = s; - valid = false; - buffer_ready = true; - return *this; - } + String( int x ) : data( internal::r_coerce(x) ), valid(true), buffer_ready(false) {} + String( double x ) : data( internal::r_coerce(x) ), valid(true), buffer_ready(false){} + String( bool x ) : data( internal::r_coerce(x) ), valid( true ) , buffer_ready(false){} + String( Rcomplex x ) : data( internal::r_coerce(x) ), valid( true ), buffer_ready(false){} + String( Rbyte x ) : data( internal::r_coerce(x) ), valid(true), buffer_ready(false){} + + + inline String& operator=( int x ){ data = internal::r_coerce( x ) ; valid = true ; buffer_ready = false ; return *this ; } + inline String& operator=( double x ){ data = internal::r_coerce( x ) ; valid = true ; buffer_ready = false ; return *this ; } + inline String& operator=( Rbyte x ){ data = internal::r_coerce( x ) ; valid = true ; buffer_ready = false ; return *this ; } + inline String& operator=( bool x ){ data = internal::r_coerce( x ) ; valid = true ; buffer_ready = false ; return *this ; } + inline String& operator=( Rcomplex x){ data = internal::r_coerce( x ) ; valid = true ; buffer_ready = false ; return *this ; } + inline String& operator=( SEXP x){ data = x ; valid = true ; buffer_ready = false ; return *this ; } + inline String& operator=( const StringProxy& proxy){ data = proxy.get() ; valid = true ; buffer_ready=false ; return *this ; } + inline String& operator=( const String& other ){ data = other.get_sexp() ; valid = true ; buffer_ready = false ; return *this ; } + inline String& operator=( const std::string& s){ buffer = s ; valid = false ; buffer_ready = true ; return *this ; } + inline String& operator=( const char* s){ buffer = s ; valid = false ; buffer_ready = true ; return *this ; } private: template - inline String& assign_wide_string(const T& s) { - data = internal::make_charsexp(s); - Rcpp_PreciousRelease(token); - token = Rcpp_PreciousPreserve(data); - valid = true; - buffer_ready = false; - return *this; + inline String& assign_wide_string( const T& s){ + data = internal::make_charsexp( s ) ; + valid = true ; + buffer_ready = false ; + return *this ; } public: - inline String& operator=(const std::wstring& s) { return assign_wide_string(s); } - inline String& operator=(const wchar_t* s) { return assign_wide_string(s); } + inline String& operator=( const std::wstring& s){ return assign_wide_string(s) ; } + inline String& operator=( const wchar_t* s){ return assign_wide_string(s) ; } - inline String& operator+=(const std::string& s) { - RCPP_STRING_DEBUG("String::operator+=(std::string)"); - if (is_na()) return *this; - setBuffer(); buffer += s; valid = false; - return *this; - } - inline String& operator+=(const char* s) { - RCPP_STRING_DEBUG("String::operator+=(const char*)"); - if (is_na()) return *this; - setBuffer(); buffer += s; valid = false; - return *this; + inline String& operator+=( const std::string& s){ + RCPP_STRING_DEBUG( "String::operator+=( std::string )" ) ; + if( is_na() ) return *this ; + setBuffer() ; buffer += s ; valid = false ; + return *this ; + } + inline String& operator+=( const char* s){ + RCPP_STRING_DEBUG( "String::operator+=( const char*)" ) ; + if( is_na() ) return *this ; + setBuffer() ; buffer += s ; valid = false ; + return *this ; } private: template - inline String& append_wide_string(const T& s) { - RCPP_STRING_DEBUG_1("String::operator+=(%s)", DEMANGLE(T)); - setData(); - if (is_na()) return *this; - const char* buf = CHAR(data); - std::wstring tmp(buf, buf + strlen(buf)); - tmp += s; - data = internal::make_charsexp(tmp); - Rcpp_PreciousRelease(token); - token = Rcpp_PreciousPreserve(data); - valid = true; - buffer_ready = false; - return *this; + inline String& append_wide_string( const T& s){ + RCPP_STRING_DEBUG_1( "String::operator+=( %s )", DEMANGLE(T) ) ; + setData() ; + if( is_na() ) return *this ; + const char* buf = CHAR( data ); + std::wstring tmp( buf, buf + strlen(buf ) ) ; + tmp += s ; + data = internal::make_charsexp( tmp ) ; + valid = true ; + buffer_ready = false ; + return *this ; } public: - inline String& operator+=(const std::wstring& s) { return append_wide_string(s); } - inline String& operator+=(const wchar_t* s) { return append_wide_string(s); } - - inline String& operator+=(const String& other) { - RCPP_STRING_DEBUG("String::operator+=(const char*)"); - if (is_na()) return *this; - if (other.is_na()) { - data = NA_STRING; - Rcpp_PreciousRelease(token); - token = Rcpp_PreciousPreserve(data); - valid = true; - buffer_ready = false; - return *this; - } - setBuffer(); buffer += other; valid = false; - return *this; - } - inline String& operator+=(const StringProxy& proxy) { - RCPP_STRING_DEBUG("String::operator+=(const StringProxy&)"); - if (is_na()) return *this; - SEXP proxy_sexp = proxy; - if (proxy_sexp == NA_STRING) { - data = NA_STRING; - Rcpp_PreciousRelease(token); - token = Rcpp_PreciousPreserve(data); - valid = true; - buffer_ready = false; - return *this; - } - setBuffer(); buffer += CHAR(proxy_sexp); valid = false; - return *this; - } - inline String& operator+=(const const_StringProxy& proxy) { - RCPP_STRING_DEBUG("String::operator+=(const StringProxy&)"); - if (is_na()) return *this; - SEXP proxy_sexp = proxy; - if (proxy_sexp == NA_STRING) { - data = NA_STRING; - Rcpp_PreciousRelease(token); - token = Rcpp_PreciousPreserve(data); - valid = true; - buffer_ready = false; - return *this; - } - setBuffer(); buffer += CHAR(proxy_sexp); valid = false; - return *this; - } - inline String& operator+=(SEXP x) { - RCPP_STRING_DEBUG("String::operator+=(SEXP)"); - if (is_na()) return *this; - if (x == NA_STRING) { - data = NA_STRING; - Rcpp_PreciousRelease(token); - token = Rcpp_PreciousPreserve(data); - valid = true; - buffer_ready = false; - return *this; - } - setBuffer(); buffer += CHAR(x); valid = false; - return *this; - } - // inline String& operator+=(int x ) { data += char_nocheck(internal::r_coerce(x)); return *this; } - // inline String& operator+=(double x ) { data += char_nocheck(internal::r_coerce(x)); return *this; } - // inline String& operator+=(Rbyte x ) { data += char_nocheck(internal::r_coerce(x)); return *this; } - // inline String& operator+=(bool x ) { data += char_nocheck(internal::r_coerce(x)); return *this; } - // inline String& operator+=(Rcomplex x) { data += char_nocheck(internal::r_coerce(x)); return *this; } - - - inline String& replace_first(const char* s, const char* news) { - RCPP_STRING_DEBUG_2("String::replace_first(const char* = '%s' , const char* = '%s')", s, news); - if (is_na()) return *this; - setBuffer(); - std::string s2 = std::string(s); - size_t index = std::distance(buffer.begin(), std::search(buffer.begin(), buffer.end(), s2.begin(), s2.end())); - if (index != std::string::npos) buffer.replace(index, strlen(s), news); - valid = false; - return *this; - } - inline String& replace_first(const Rcpp::String& s, const char* news) { + inline String& operator+=( const std::wstring& s){ return append_wide_string( s ); } + inline String& operator+=( const wchar_t* s){ return append_wide_string( s ); } + + inline String& operator+=( const String& other ){ + RCPP_STRING_DEBUG( "String::operator+=( const char*)" ) ; + if( is_na() ) return *this ; + if( other.is_na() ){ data = NA_STRING ; valid = true ; buffer_ready = false ; return *this ; } + setBuffer() ; buffer += other ; valid = false ; + return *this ; + } + inline String& operator+=( const StringProxy& proxy){ + RCPP_STRING_DEBUG( "String::operator+=( const StringProxy& )" ) ; + if( is_na() ) return *this ; + SEXP proxy_sexp = proxy ; + if( proxy_sexp == NA_STRING ) { data = NA_STRING ; valid = true; buffer_ready = false ; return *this ;} + setBuffer() ; buffer += CHAR(proxy_sexp) ; valid = false ; + return *this ; + } + inline String& operator+=( SEXP x){ + RCPP_STRING_DEBUG( "String::operator+=( SEXP )" ) ; + if( is_na() ) return *this ; + if( x == NA_STRING ) { data = NA_STRING ; valid = true; buffer_ready = false ; return *this ;} + setBuffer() ; buffer += CHAR(x) ; valid = false ; + return *this ; + } + // inline String& operator+=( int x ){ data += char_nocheck(internal::r_coerce( x ) ) ; return *this ; } + // inline String& operator+=( double x ){ data += char_nocheck(internal::r_coerce( x ) ) ; return *this ; } + // inline String& operator+=( Rbyte x ){ data += char_nocheck(internal::r_coerce( x ) ) ; return *this ; } + // inline String& operator+=( bool x ){ data += char_nocheck(internal::r_coerce( x ) ) ; return *this ; } + // inline String& operator+=( Rcomplex x){ data += char_nocheck(internal::r_coerce( x ) ) ; return *this ; } + + + inline String& replace_first( const char* s, const char* news ){ + RCPP_STRING_DEBUG_2( "String::replace_first( const char* = '%s' , const char* = '%s')", s, news ) ; + if( is_na() ) return *this ; + setBuffer() ; + size_t index = buffer.find_first_of( s ) ; + if( index != std::string::npos ) buffer.replace( index, strlen(s), news ) ; + valid = false ; + return *this ; + } + inline String& replace_first( const Rcpp::String& s, const char* news ){ // replace NA -> do nothing - if (s.is_na()) return *this; - return replace_first(s.get_cstring(), news); + if( s.is_na() ) return *this ; + return replace_first( s.get_cstring(), news ) ; } - inline String& replace_first(const char* s, const Rcpp::String& news) { + inline String& replace_first( const char* s, const Rcpp::String& news ){ // replace NA -> do nothing - if (news.is_na()) return *this; - return replace_first(s, news.get_cstring()); + if( news.is_na() ) return *this ; + return replace_first( s, news.get_cstring() ) ; } - inline String& replace_first(const Rcpp::String& s, const Rcpp::String& news) { + inline String& replace_first( const Rcpp::String& s, const Rcpp::String& news ){ // replace NA -> do nothing - if (s.is_na() || news.is_na()) return *this; - return replace_first(s.get_cstring(), news.get_cstring()); + if( s.is_na() || news.is_na() ) return *this ; + return replace_first( s.get_cstring(), news.get_cstring() ) ; } - inline String& replace_last(const char* s, const char* news) { - RCPP_STRING_DEBUG_2("String::replace_last(const char* = '%s' , const char* = '%s')", s, news); - if (is_na()) return *this; - setBuffer(); - std::string s2 = std::string(s); - size_t index = std::distance(buffer.begin(), std::find_end(buffer.begin(), buffer.end(), s2.begin(), s2.end())); - if (index != std::string::npos) buffer.replace(index, strlen(s), news); - valid = false; - return *this; + + + inline String& replace_last( const char* s, const char* news ){ + RCPP_STRING_DEBUG_2( "String::replace_last( const char* = '%s' , const char* = '%s')", s, news ) ; + if( is_na() ) return *this ; + setBuffer() ; + size_t index = buffer.find_last_of( s ) ; + if( index != std::string::npos ) buffer.replace( index, strlen(s), news ) ; + valid = false ; + return *this ; } - inline String& replace_last(const Rcpp::String& s, const char* news) { + inline String& replace_last( const Rcpp::String& s, const char* news ){ // replace NA -> do nothing - if (s.is_na()) return *this; - return replace_last(s.get_cstring(), news); + if( s.is_na() ) return *this ; + return replace_last( s.get_cstring(), news ) ; } - inline String& replace_last(const char* s, const Rcpp::String& news) { + inline String& replace_last( const char* s, const Rcpp::String& news ){ // replace NA -> do nothing - if (news.is_na()) return *this; - return replace_last(s, news.get_cstring()); + if( news.is_na() ) return *this ; + return replace_last( s, news.get_cstring() ) ; } - inline String& replace_last(const Rcpp::String& s, const Rcpp::String& news) { + inline String& replace_last( const Rcpp::String& s, const Rcpp::String& news ){ // replace NA -> do nothing - if (s.is_na() || news.is_na()) return *this; - return replace_last(s.get_cstring(), news.get_cstring()); - } - - - inline String& replace_all(const char* s, const char* news) { - RCPP_STRING_DEBUG_2("String::replace_all(const char* = '%s' , const char* = '%s')", s, news); - if (is_na()) return *this; - setBuffer(); - std::string s2 = std::string(s); - std::string::iterator iter = buffer.begin(); - while(true) { - iter = std::search(iter, buffer.end(), s2.begin(), s2.end()); - if (iter == buffer.end()) break; - size_t index = std::distance(buffer.begin(), iter); - if (index != std::string::npos) buffer.replace(index, strlen(s), news); + if( s.is_na() || news.is_na() ) return *this ; + return replace_last( s.get_cstring(), news.get_cstring() ) ; + } + + + inline String& replace_all( const char* s, const char* news ){ + RCPP_STRING_DEBUG_2( "String::replace_all( const char* = '%s' , const char* = '%s')", s, news ) ; + if( is_na() ) return *this ; + setBuffer() ; + size_t lens = strlen(s), len_news = strlen(news), index = buffer.find( s ) ; + while( index != std::string::npos ){ + buffer.replace( index, lens, news ) ; + index = buffer.find( s, index + len_news ) ; } - valid = false; - return *this; + valid = false ; + return *this ; } template - inline String& replace_all(const LHS& s, const RHS& news) { - return replace_all(String(s), String(news)); + inline String& replace_all( const LHS& s, const RHS& news ){ + return replace_all( String( s ), String(news) ) ; } - inline String& replace_all(const Rcpp::String& s, const char* news) { + inline String& replace_all( const Rcpp::String& s, const char* news ){ // replace NA -> do nothing - if (s.is_na()) return *this; - return replace_all(s.get_cstring(), news); + if( s.is_na() ) return *this ; + return replace_all( s.get_cstring(), news ) ; } - inline String& replace_all(const char* s, const Rcpp::String& news) { + inline String& replace_all( const char* s, const Rcpp::String& news ){ // replace NA -> do nothing - if (news.is_na()) return *this; - return replace_all(s, news.get_cstring()); + if( news.is_na() ) return *this ; + return replace_all( s, news.get_cstring() ) ; } - inline String& replace_all(const Rcpp::String& s, const Rcpp::String& news) { + inline String& replace_all( const Rcpp::String& s, const Rcpp::String& news ){ // replace NA -> do nothing - if (s.is_na() || news.is_na()) return *this; - return replace_all(s.get_cstring(), news.get_cstring()); + if( s.is_na() || news.is_na() ) return *this ; + return replace_all( s.get_cstring(), news.get_cstring() ) ; } - inline String& push_back(const char* s) { - if (is_na()) return *this; - setBuffer(); valid = false; buffer += s; - return *this; + inline String& push_back( const char* s){ + if( is_na() ) return *this ; + setBuffer() ; valid = false ; buffer += s ; + return *this ; } - inline String& push_back(const std::string& s) { - return push_back(s.c_str()); + inline String& push_back( const std::string& s){ + return push_back( s.c_str() ) ; } - inline String& push_back(const Rcpp::String& s) { - if (is_na()) return *this; - if (s.is_na()) { set_na(); return *this; } - return push_back(s.get_cstring()); + inline String& push_back( const Rcpp::String& s){ + if( is_na() ) return *this ; + if( s.is_na() ){ set_na(); return *this ; } + return push_back( s.get_cstring() ) ; } - inline String& push_front(const char* s) { - if (is_na()) return *this; - setBuffer(); valid = false; buffer = s + buffer; - return *this; + inline String& push_front( const char* s){ + if( is_na() ) return *this ; + setBuffer() ; valid = false ; buffer = s + buffer; + return *this ; } - inline String& push_front(const std::string& s) { - return push_front(s.c_str()); + inline String& push_front( const std::string& s){ + return push_front( s.c_str() ) ; } - inline String& push_front(const Rcpp::String& s) { - if (is_na()) return *this; - if (s.is_na()) { set_na(); return *this; } - return push_front(s.get_cstring()); + inline String& push_front( const Rcpp::String& s){ + if( is_na() ) return *this ; + if( s.is_na() ){ set_na(); return *this ; } + return push_front( s.get_cstring() ) ; } - inline void set_na() { - data = NA_STRING; - Rcpp_PreciousRelease(token); - token = Rcpp_PreciousPreserve(data); - valid = true; - buffer_ready = false; + inline void set_na(){ + data = NA_STRING ; valid = true; buffer_ready = false ; } - inline SEXP get_sexp_impl() const { - - // workaround for h5 package (currently deprecated so updates - // to CRAN may not be timely) -#ifdef __H5Cpp_H - return Rf_mkCharCE(buffer.c_str(), enc); -#else - if (buffer.find('\0') != std::string::npos) - throw embedded_nul_in_string(); - return Rf_mkCharLenCE(buffer.c_str(), static_cast(buffer.size()), enc); -#endif - } - inline SEXP get_sexp() const { - RCPP_STRING_DEBUG_1("String::get_sexp const (valid = %d) ", valid); - return valid ? data : get_sexp_impl(); + RCPP_STRING_DEBUG_1( "String::get_sexp const ( valid = %d) ", valid ) ; + return valid ? data : Rf_mkChar( buffer.c_str() ) ; } inline SEXP get_sexp() { - RCPP_STRING_DEBUG_1("String::get_sexp (valid = %d) ", valid); - setData(); return data; + RCPP_STRING_DEBUG_1( "String::get_sexp ( valid = %d) ", valid ) ; + setData() ; return data ; } inline operator std::string() const { - return get_cstring(); + return get_cstring() ; } inline operator std::wstring() const { - const char* s = get_cstring(); - return std::wstring(s, s + strlen(s)); - } - - inline const char* get_cstring() const { - return buffer_ready ? buffer.c_str() : CHAR(data); - } - - inline cetype_t get_encoding() const { - return enc; - } - - inline void set_encoding(cetype_t encoding) { - enc = encoding; - - if (valid) { - // TODO: may longjmp on failure to translate? - const char* translated = Rf_translateCharUTF8(data); - data = Rf_mkCharCE(translated, encoding); - Rcpp_PreciousRelease(token); - token = Rcpp_PreciousPreserve(data); - } else { - data = get_sexp_impl(); - token = Rcpp_PreciousPreserve(data); - valid = true; - } + const char* s = get_cstring() ; + return std::wstring( s, s + strlen(s) ); } - bool operator<(const Rcpp::String& other) const { - return strcmp(get_cstring(), other.get_cstring()) < 0; - } - bool operator==(const Rcpp::String& other) const { - return get_sexp() == other.get_sexp(); - } - bool operator!=(const Rcpp::String& other) const { - return get_sexp() != other.get_sexp(); - } - - bool operator==(const StringProxy& other) const { - return get_sexp() == other.get(); - } - - bool operator!=(const StringProxy& other) const { - return get_sexp() != other.get(); - } - - bool operator==(const const_StringProxy& other) const { - return get_sexp() == other.get(); + inline const char* get_cstring() const { + return buffer_ready ? buffer.c_str() : CHAR(data) ; } - bool operator!=(const const_StringProxy& other) const { - return get_sexp() != other.get(); + bool operator<( const Rcpp::String& other ) const { + return strcmp( get_cstring(), other.get_cstring() ) < 0; } - bool operator>(const Rcpp::String& other) const { - return strcmp(get_cstring(), other.get_cstring()) > 0; + bool operator==( const Rcpp::String& other) const { + return get_sexp() == other.get_sexp() ; } - - bool operator==(SEXP other) const { - return get_sexp() == other; + bool operator!=( const Rcpp::String& other) const { + return get_sexp() != other.get_sexp() ; } - bool operator!=(SEXP other) const { - return get_sexp() != other; + bool operator>( const Rcpp::String& other ) const { + return strcmp( get_cstring(), other.get_cstring() ) > 0; } private: /** the CHARSXP this String encapsulates */ - SEXP data; - SEXP token; + SEXP data ; /** a buffer used to do string operations withough going back to the SEXP */ - std::string buffer; + std::string buffer ; /** is data in sync with buffer */ - bool valid; + bool valid ; /** is the buffer initialized */ - bool buffer_ready; + bool buffer_ready ; - /** the encoding of encapsulated CHARSXP */ - cetype_t enc; - - inline bool is_na() const { return data == NA_STRING; } - inline void setBuffer() { - if (!buffer_ready) { - buffer = char_nocheck(data); - buffer_ready = true; + inline bool is_na() const { return data == NA_STRING ; } + inline void setBuffer(){ + if( !buffer_ready){ + buffer = char_nocheck(data) ; + buffer_ready = true ; } } - inline void setData() { - RCPP_STRING_DEBUG("setData"); - if (!valid) { - data = get_sexp_impl(); - token = Rcpp_PreciousPreserve(data); - valid = true; + inline void setData(){ + RCPP_STRING_DEBUG( "setData" ) ; + if(!valid) { + data = Rf_mkChar(buffer.c_str()) ; + valid = true ; } } - template void append(const T& s) { buffer += s;} - }; + template void append( const T& s){ buffer += s ;} + } ; namespace traits{ - template<> struct r_type_traits{ typedef r_type_RcppString_tag r_category; }; - template<> struct r_sexptype_traits{ enum{ rtype = STRSXP }; }; + template<> struct r_type_traits{ typedef r_type_RcppString_tag r_category ; } ; + template<> struct r_sexptype_traits{ enum{ rtype = STRSXP } ; } ; } namespace internal { - template class StoragePolicy> - string_proxy& string_proxy::operator=(const String& s) { - set(s.get_sexp()); - return *this; + template + string_proxy& string_proxy::operator=( const String& s){ + set( s.get_sexp() ); + return *this ; } template - SEXP string_element_converter::get(const Rcpp::String& input) { - RCPP_DEBUG("string_element_converter::get< Rcpp::String >()") - return input.get_sexp(); - } + SEXP string_element_converter::get( const Rcpp::String& input) { + RCPP_DEBUG( "string_element_converter::get< Rcpp::String >()" ) + return input.get_sexp() ; + } template <> - inline SEXP make_charsexp(const Rcpp::String& s) { - return s.get_sexp(); + inline SEXP make_charsexp( const Rcpp::String& s){ + return s.get_sexp() ; } - template class StoragePolicy> - template - string_proxy& string_proxy::operator+=(const T& rhs) { - String tmp = get(); - tmp += rhs; - set(tmp); - return *this; + template + template + string_proxy& string_proxy::operator+=(const T& rhs) { + String tmp = get() ; + tmp += rhs ; + set( tmp ) ; + return *this ; } - } + } - template <> - inline SEXP wrap(const Rcpp::String& object) { - RCPP_STRING_DEBUG("wrap()"); - Shield res(Rf_allocVector(STRSXP, 1)); + template <> + inline SEXP wrap( const Rcpp::String& object) { + RCPP_STRING_DEBUG( "wrap()" ) ; + Shield res( Rf_allocVector( STRSXP, 1 ) ) ; SEXP data = object.get_sexp(); - SET_STRING_ELT(res, 0, data); - return res; + SET_STRING_ELT( res, 0, data ) ; + return res ; } - inline bool operator==(const String::StringProxy& lhs, const String& rhs) { - return rhs == lhs; - } - - inline bool operator!=(const String::StringProxy& lhs, const String& rhs) { - return rhs != lhs; - } - - inline bool operator==(const String::const_StringProxy& lhs, const String& rhs) { - return rhs == lhs; - } - - inline bool operator!=(const String::const_StringProxy& lhs, const String& rhs) { - return rhs != lhs; - } } // Rcpp -/** hash via std */ -namespace std { - template <> - struct hash { - size_t operator()(const Rcpp::String & s) const{ - return hash()(s.get_cstring()); - } - }; -} - #endif diff --git a/inst/include/Rcpp/StringTransformer.h b/inst/include/Rcpp/StringTransformer.h index 8c009ff04..94ebe7fed 100644 --- a/inst/include/Rcpp/StringTransformer.h +++ b/inst/include/Rcpp/StringTransformer.h @@ -1,7 +1,8 @@ - +// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*- +// // clone.h: Rcpp R/C++ interface class library -- clone RObject's // -// Copyright (C) 2010 - 2025 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2010 - 2011 Dirk Eddelbuettel and Romain Francois // // This file is part of Rcpp. // @@ -26,25 +27,25 @@ namespace Rcpp{ template - class StringTransformer : public std::function { + class StringTransformer : public std::unary_function{ public: StringTransformer( const UnaryOperator& op_ ): op(op_), buffer(){} ~StringTransformer(){} const char* operator()(const char* input ) { - buffer = input; - std::transform( buffer.begin(), buffer.end(), buffer.begin(), op ); - return buffer.c_str(); + buffer = input ; + std::transform( buffer.begin(), buffer.end(), buffer.begin(), op ) ; + return buffer.c_str() ; } private: - const UnaryOperator& op; - std::string buffer; - }; + const UnaryOperator& op ; + std::string buffer ; + } ; template StringTransformer make_string_transformer( const UnaryOperator& fun){ - return StringTransformer( fun ); + return StringTransformer( fun ) ; } } diff --git a/inst/include/Rcpp/Symbol.h b/inst/include/Rcpp/Symbol.h index beabc546c..d5c7eaed1 100644 --- a/inst/include/Rcpp/Symbol.h +++ b/inst/include/Rcpp/Symbol.h @@ -2,7 +2,7 @@ // // Symbol.h: Rcpp R/C++ interface class library -- access R environments // -// Copyright (C) 2013 - 2015 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2013 Dirk Eddelbuettel and Romain Francois // // This file is part of Rcpp. // @@ -43,20 +43,18 @@ namespace Rcpp{ Storage::set__( x ) ; break; /* nothing to do */ case CHARSXP: { - SEXP charSym = Rf_installChar(x); // R 3.2.0 or later have Rf_installChar + SEXP charSym = Rf_install(CHAR(x)); // cannot be gc()'ed once in symbol table Storage::set__( charSym ) ; break ; } case STRSXP: { /* FIXME: check that there is at least one element */ - SEXP charSym = Rf_installChar(STRING_ELT(x, 0 )); // R 3.2.0 or later have Rf_installChar + SEXP charSym = Rf_install( CHAR(STRING_ELT(x, 0 )) ); // cannot be gc()'ed once in symbol table Storage::set__( charSym ); break ; } default: - const char* fmt = "Cannot convert object to a symbol: " - "[type=%s; target=SYMSXP]."; - throw not_compatible(fmt, Rf_type2char(TYPEOF(x))); + throw not_compatible("cannot convert to symbol (SYMSXP)") ; } } diff --git a/inst/include/Rcpp/Vector.h b/inst/include/Rcpp/Vector.h index 6c95ef8d9..6a7b8b1cb 100644 --- a/inst/include/Rcpp/Vector.h +++ b/inst/include/Rcpp/Vector.h @@ -1,4 +1,5 @@ - +// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*- +// // Vector.h: Rcpp R/C++ interface class library -- vectors // // Copyright (C) 2010 - 2013 Dirk Eddelbuettel and Romain Francois @@ -30,9 +31,7 @@ namespace Rcpp{ template struct Extractor ; } template class MatrixRow ; - template class ConstMatrixRow ; template class MatrixColumn ; - template class ConstMatrixColumn ; template class SubMatrix ; class Dimension ; diff --git a/inst/include/Rcpp/XPtr.h b/inst/include/Rcpp/XPtr.h index 17fb7cacd..2cc1c3d92 100644 --- a/inst/include/Rcpp/XPtr.h +++ b/inst/include/Rcpp/XPtr.h @@ -1,8 +1,8 @@ +// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*- // // XPtr.h: Rcpp R/C++ interface class library -- smart external pointers // -// Copyright (C) 2009 - 2020 Dirk Eddelbuettel and Romain Francois -// Copyright (C) 2021 Dirk Eddelbuettel, Romain Francois and Iñaki Ucar +// Copyright (C) 2009 - 2013 Dirk Eddelbuettel and Romain Francois // // This file is part of Rcpp. // @@ -24,71 +24,51 @@ #include -namespace Rcpp { +namespace Rcpp{ template -void standard_delete_finalizer(T* obj) { // #nocov start - delete obj; +void standard_delete_finalizer(T* obj){ + delete obj ; } template -void finalizer_wrapper(SEXP p) { - if (TYPEOF(p) != EXTPTRSXP) - return; - - T* ptr = (T*) R_ExternalPtrAddr(p); - RCPP_DEBUG_3("finalizer_wrapper<%s>(SEXP p = <%p>). ptr = %p", DEMANGLE(T), p, ptr) - - if (ptr == NULL) - return; - - // Clear before finalizing to avoid behavior like access of freed memory - R_ClearExternalPtr(p); - - Finalizer(ptr); -} // #nocov end +void finalizer_wrapper(SEXP p){ + if( TYPEOF(p) == EXTPTRSXP ){ + T* ptr = (T*) R_ExternalPtrAddr(p) ; + RCPP_DEBUG_3( "finalizer_wrapper<%s>(SEXP p = <%p>). ptr = %p", DEMANGLE(T), p, ptr ) + Finalizer(ptr) ; + } +} template < typename T, template class StoragePolicy = PreserveStorage, - void Finalizer(T*) = standard_delete_finalizer, - #ifdef RCPP_USE_FINALIZE_ON_EXIT - bool finalizeOnExit = true - #else - bool finalizeOnExit = false - #endif + void Finalizer(T*) = standard_delete_finalizer > class XPtr : - public StoragePolicy< XPtr >, - public SlotProxyPolicy< XPtr >, - public AttributeProxyPolicy< XPtr >, - public TagProxyPolicy< XPtr >, - public ProtectedProxyPolicy< XPtr >, - public RObjectMethods< XPtr > + public StoragePolicy< XPtr >, + public SlotProxyPolicy< XPtr >, + public AttributeProxyPolicy< XPtr >, + public TagProxyPolicy< XPtr >, + public ProtectedProxyPolicy< XPtr >, + public RObjectMethods< XPtr > { public: - typedef StoragePolicy Storage; - - /** - * constructs a XPtr wrapping the external pointer (EXTPTRSXP SEXP) - * - * @param xp external pointer to wrap - */ - explicit XPtr(SEXP x) { checked_set(x); }; + typedef StoragePolicy Storage ; /** * constructs a XPtr wrapping the external pointer (EXTPTRSXP SEXP) * * @param xp external pointer to wrap - * @param tag tag to assign to external pointer - * @param prot protected data to assign to external pointer */ - explicit XPtr(SEXP x, SEXP tag, SEXP prot) { - checked_set(x); - R_SetExternalPtrTag(x, tag); - R_SetExternalPtrProtected(x, prot); - }; + explicit XPtr(SEXP x, SEXP tag = R_NilValue, SEXP prot = R_NilValue) { + if( TYPEOF(x) != EXTPTRSXP ) + throw ::Rcpp::not_compatible( "expecting an external pointer" ) ; + Storage::set__(x) ; + R_SetExternalPtrTag( x, tag ) ; + R_SetExternalPtrProtected( x, prot ) ; + } ; /** * creates a new external pointer wrapping the dumb pointer p. @@ -101,22 +81,21 @@ class XPtr : * so you need to make sure the pointer can be "delete" d * this way (has to be a C++ object) */ - explicit XPtr(T* p, bool set_delete_finalizer = true, - SEXP tag = R_NilValue, SEXP prot = R_NilValue) { - RCPP_DEBUG_2("XPtr(T* p = <%p>, bool set_delete_finalizer = %s, SEXP tag = R_NilValue, SEXP prot = R_NilValue)", p, (set_delete_finalizer ? "true" : "false")) - Storage::set__(R_MakeExternalPtr((void*)p , tag, prot)); - if (set_delete_finalizer) { - setDeleteFinalizer(); // #nocov + explicit XPtr(T* p, bool set_delete_finalizer = true, SEXP tag = R_NilValue, SEXP prot = R_NilValue){ + RCPP_DEBUG_2( "XPtr(T* p = <%p>, bool set_delete_finalizer = %s, SEXP tag = R_NilValue, SEXP prot = R_NilValue)", p, ( set_delete_finalizer ? "true" : "false" ) ) + Storage::set__( R_MakeExternalPtr( (void*)p , tag, prot) ) ; + if( set_delete_finalizer ){ + setDeleteFinalizer() ; } } - XPtr(const XPtr& other) { - Storage::copy__(other); + XPtr( const XPtr& other ) { + Storage::copy__(other) ; } - XPtr& operator=(const XPtr& other) { - Storage::copy__(other); - return *this; + XPtr& operator=(const XPtr& other){ + Storage::copy__(other) ; + return *this ; } /** @@ -124,7 +103,7 @@ class XPtr : * if you want an exception thrown if the pointer is NULL) */ inline T* get() const { - return (T*)(R_ExternalPtrAddr(Storage::get__())); + return (T*)(R_ExternalPtrAddr( Storage::get__() )); } /** @@ -133,10 +112,12 @@ class XPtr : */ typedef void (*unspecified_bool_type)(); static void unspecified_bool_true() {} - operator unspecified_bool_type() const { + operator unspecified_bool_type() const + { return get() == NULL ? 0 : unspecified_bool_true; } - bool operator!() const { + bool operator!() const + { return get() == NULL; } @@ -146,7 +127,7 @@ class XPtr : inline T* checked_get() const { T* ptr = get(); if (ptr == NULL) - throw ::Rcpp::exception("external pointer is not valid"); // #nocov + throw ::Rcpp::exception("external pointer is not valid" ) ; return ptr; } @@ -155,7 +136,7 @@ class XPtr : * object to look and feel like a dumb pointer to T */ T& operator*() const { - return *(checked_get()); + return *(checked_get()) ; } /** @@ -163,13 +144,12 @@ class XPtr : * on this as if it was the dumb pointer */ T* operator->() const { - return checked_get(); + return checked_get() ; } - void setDeleteFinalizer() { // #nocov start - R_RegisterCFinalizerEx(Storage::get__(), finalizer_wrapper, - (Rboolean) finalizeOnExit); - } // #nocov end + void setDeleteFinalizer() { + R_RegisterCFinalizerEx( Storage::get__(), finalizer_wrapper , FALSE) ; + } /** * Release the external pointer (if any) immediately. This will cause @@ -182,31 +162,23 @@ class XPtr : */ void release() { - if (get() != NULL) { + if (get() != NULL) + { // Call the finalizer -- note that this implies that finalizers // need to be ready for a NULL external pointer value (our // default C++ finalizer is since delete NULL is a no-op). - // This clears the external pointer just before calling the finalizer, - // to avoid interesting behavior with co-dependent finalizers. - finalizer_wrapper(Storage::get__()); - } - } + finalizer_wrapper( Storage::get__() ); - inline operator T*() { - return checked_get(); + // Clear the external pointer + R_ClearExternalPtr( Storage::get__() ); + } } - void update(SEXP) {} - -private: - inline void checked_set(SEXP x) { - if (TYPEOF(x) != EXTPTRSXP) { - const char* fmt = "Expecting an external pointer: [type=%s]."; // #nocov - throw ::Rcpp::not_compatible(fmt, Rf_type2char(TYPEOF(x))); // #nocov - } - Storage::set__(x); + inline operator T*(){ + return checked_get() ; } + void update(SEXP){} }; } // namespace Rcpp diff --git a/inst/include/Rcpp/algorithm.h b/inst/include/Rcpp/algorithm.h deleted file mode 100644 index 2c84815cd..000000000 --- a/inst/include/Rcpp/algorithm.h +++ /dev/null @@ -1,462 +0,0 @@ -// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*- -// -// algorithm.h: Rcpp R/C++ interface class library -- data frames -// -// Copyright (C) 2016 - 2024 Daniel C. Dillon -// Copyright (C) 2025 Daniel C. Dillon and Iñaki Ucar -// -// This file is part of Rcpp. -// -// Rcpp is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 2 of the License, or -// (at your option) any later version. -// -// Rcpp is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Rcpp. If not, see . - -#ifndef Rcpp__Algorithm_h -#define Rcpp__Algorithm_h - -namespace Rcpp { -namespace algorithm { - -namespace helpers { - typedef struct {char a[1];} CTYPE_CHAR; - typedef struct {char a[2];} CTYPE_SHORT; - typedef struct {char a[3];} CTYPE_INT; - typedef struct {char a[4];} CTYPE_LONG; - typedef struct {char a[5];} CTYPE_LONG_LONG; - typedef struct {char a[6];} CTYPE_FLOAT; - typedef struct {char a[7];} CTYPE_DOUBLE; - typedef struct {char a[8];} CTYPE_LONG_DOUBLE; - typedef struct {char a[9];} CTYPE_STRING; - typedef struct {char a[10];} CTYPE_UNSIGNED_CHAR; - typedef struct {char a[11];} CTYPE_UNSIGNED_SHORT; - typedef struct {char a[12];} CTYPE_UNSIGNED_INT; - typedef struct {char a[13];} CTYPE_UNSIGNED_LONG; - typedef struct {char a[14];} CTYPE_UNSIGNED_LONG_LONG; - typedef struct {char a[128];} CTYPE_UNKNOWN; - - template< std::size_t I > - struct ctype_helper { static const bool value = false; }; - - template<> - struct ctype_helper< sizeof(CTYPE_CHAR) > { typedef char type; static const bool value = true; }; - - template<> - struct ctype_helper< sizeof(CTYPE_SHORT) > { typedef short type; static const bool value = true; }; - - template<> - struct ctype_helper< sizeof(CTYPE_INT) > { typedef int type; static const bool value = true; }; - - template<> - struct ctype_helper< sizeof(CTYPE_LONG) > { typedef long type; static const bool value = true; }; - - template<> - struct ctype_helper< sizeof(CTYPE_LONG_LONG) > { typedef rcpp_long_long_type type; static const bool value = true; }; - - template<> - struct ctype_helper< sizeof(CTYPE_FLOAT) > { typedef float type; static const bool value = true; }; - - template<> - struct ctype_helper< sizeof(CTYPE_DOUBLE) > { typedef double type; static const bool value = true; }; - - template<> - struct ctype_helper< sizeof(CTYPE_LONG_DOUBLE) > { typedef long double type; static const bool value = true; }; - - template<> - struct ctype_helper< sizeof(CTYPE_STRING) > { typedef std::string type; static const bool value = true; }; - - template<> - struct ctype_helper< sizeof(CTYPE_UNSIGNED_CHAR) > { typedef unsigned char type; static const bool value = true; }; - - template<> - struct ctype_helper< sizeof(CTYPE_UNSIGNED_SHORT) > { typedef unsigned short type; static const bool value = true; }; - - template<> - struct ctype_helper< sizeof(CTYPE_UNSIGNED_INT) > { typedef unsigned int type; static const bool value = true; }; - - template<> - struct ctype_helper< sizeof(CTYPE_UNSIGNED_LONG) > { typedef unsigned long type; static const bool value = true; }; - - template<> - struct ctype_helper< sizeof(CTYPE_UNSIGNED_LONG_LONG) > { typedef rcpp_ulong_long_type type; static const bool value = true; }; - - template< typename T > - struct ctype - { - static CTYPE_CHAR test(const char &); - static CTYPE_SHORT test(const short &); - static CTYPE_INT test(const int &); - static CTYPE_LONG test(const long &); - static CTYPE_LONG_LONG test(const rcpp_long_long_type &); - static CTYPE_FLOAT test(const float &); - static CTYPE_DOUBLE test(const double &); - static CTYPE_LONG_DOUBLE test(const long double &); - static CTYPE_STRING test(const std::string &); - static CTYPE_UNSIGNED_CHAR test(const unsigned char &); - static CTYPE_UNSIGNED_SHORT test(const unsigned short &); - static CTYPE_UNSIGNED_INT test(const unsigned int &); - static CTYPE_UNSIGNED_LONG test(const unsigned long &); - static CTYPE_UNSIGNED_LONG_LONG test(const rcpp_ulong_long_type &); - static CTYPE_UNKNOWN test(...); - - static T make(); - - typedef typename ctype_helper< sizeof(test(make())) >::type type; - }; - - template< typename T > - struct decays_to_ctype - { - static CTYPE_CHAR test(const char &); - static CTYPE_SHORT test(const short &); - static CTYPE_INT test(const int &); - static CTYPE_LONG test(const long &); - static CTYPE_LONG_LONG test(const rcpp_long_long_type &); - static CTYPE_FLOAT test(const float &); - static CTYPE_DOUBLE test(const double &); - static CTYPE_LONG_DOUBLE test(const long double &); - static CTYPE_STRING test(const std::string &); - static CTYPE_UNSIGNED_CHAR test(const unsigned char &); - static CTYPE_UNSIGNED_SHORT test(const unsigned short &); - static CTYPE_UNSIGNED_INT test(const unsigned int &); - static CTYPE_UNSIGNED_LONG test(const unsigned long &); - static CTYPE_UNSIGNED_LONG_LONG test(const rcpp_ulong_long_type &); - static CTYPE_UNKNOWN test(...); - - static T make(); - - static const bool value = ctype_helper< sizeof(test(make())) >::value; - }; - - template< typename T > - struct rtype_helper { - }; - - template<> - struct rtype_helper< double > { - typedef double type; - static constexpr int RTYPE = REALSXP; - static inline double NA() { return NA_REAL; } - static inline constexpr double ZERO() { return 0.0; } - static inline constexpr double ONE() { return 1.0; } - }; - - template<> - struct rtype_helper< int > { - typedef int type; - static constexpr int RTYPE = INTSXP; - static inline int NA() { return NA_INTEGER; } - static inline constexpr int ZERO() { return 0; } - static inline constexpr int ONE() { return 1; } - }; - - template< typename T > - struct rtype { - typedef typename rtype_helper< typename ctype< T >::type >::type type; - typedef rtype_helper< typename ctype< T >::type > helper_type; - static constexpr int RTYPE = helper_type::RTYPE; - static inline T NA() { return helper_type::NA(); } - static inline constexpr T ZERO() { return helper_type::ZERO(); } - static inline constexpr T ONE() { return helper_type::ONE(); } - }; - - struct log { - template< typename T > - inline double operator()(T val) { - if (!Vector< rtype< T >::RTYPE >::is_na(val)) { - return std::log(val); - } - - return rtype< double >::NA(); - } - }; - - struct exp { - template< typename T > - inline double operator()(T val) { - if (!Vector< rtype< T >::RTYPE >::is_na(val)) { - return std::exp(val); - } - - return rtype< double >::NA(); - } - }; - - struct sqrt { - template< typename T > - inline double operator()(T val) { - if (!Vector< rtype< T >::RTYPE >::is_na(val)) { - return std::sqrt(val); - } - - return rtype< double >::NA(); - } - }; -} // namespace helpers - -template< typename InputIterator > -typename traits::enable_if< helpers::decays_to_ctype< typename std::iterator_traits< InputIterator >::value_type >::value, - typename helpers::ctype< typename std::iterator_traits< InputIterator >::value_type >::type >::type - sum(InputIterator begin, InputIterator end) { - - typedef typename helpers::ctype< typename std::iterator_traits< InputIterator >::value_type >::type value_type; - typedef typename helpers::rtype< value_type > rtype; - - if (begin != end) { - value_type start = rtype::ZERO(); - - while (begin != end) { - if (!Vector< rtype::RTYPE >::is_na(*begin)) { - start += *begin++; - } else { - return rtype::NA(); - } - } - - return start; - } - - return rtype::ZERO(); -} - -template< typename InputIterator > -typename traits::enable_if< helpers::decays_to_ctype< typename std::iterator_traits< InputIterator >::value_type >::value, - typename helpers::ctype< typename std::iterator_traits< InputIterator >::value_type >::type >::type - sum_nona(InputIterator begin, InputIterator end) { - - typedef typename helpers::ctype< typename std::iterator_traits< InputIterator >::value_type >::type value_type; - typedef typename helpers::rtype< value_type > rtype; - - if (begin != end) { - value_type start = rtype::ZERO(); - - while (begin != end) { - start += *begin++; - } - - return start; - } - - return rtype::ZERO(); -} - -template< typename InputIterator > -typename traits::enable_if< helpers::decays_to_ctype< typename std::iterator_traits< InputIterator >::value_type >::value, - typename helpers::ctype< typename std::iterator_traits< InputIterator >::value_type >::type >::type - prod(InputIterator begin, InputIterator end) { - - typedef typename helpers::ctype< typename std::iterator_traits< InputIterator >::value_type >::type value_type; - typedef typename helpers::rtype< value_type > rtype; - - if (begin != end) { - value_type start = rtype::ONE(); - - while (begin != end) { - if (!Vector< rtype::RTYPE >::is_na(*begin)) { - start *= *begin++; - } else { - return rtype::NA(); - } - } - - return start; - } - - return rtype::ONE(); -} - -template< typename InputIterator > -typename traits::enable_if< helpers::decays_to_ctype< typename std::iterator_traits< InputIterator >::value_type >::value, - typename helpers::ctype< typename std::iterator_traits< InputIterator >::value_type >::type >::type - prod_nona(InputIterator begin, InputIterator end) { - - typedef typename helpers::ctype< typename std::iterator_traits< InputIterator >::value_type >::type value_type; - typedef typename helpers::rtype< value_type > rtype; - - if (begin != end) { - value_type start = rtype::ONE(); - - while (begin != end) { - start *= *begin++; - } - - return start; - } - - return rtype::ONE(); -} - -template< typename InputIterator > -typename traits::enable_if< helpers::decays_to_ctype< typename std::iterator_traits< InputIterator >::value_type >::value, - typename helpers::ctype< typename std::iterator_traits< InputIterator >::value_type >::type >::type - max(InputIterator begin, InputIterator end) { - - typedef typename helpers::ctype< typename std::iterator_traits< InputIterator >::value_type >::type value_type; - typedef typename helpers::rtype< value_type > rtype; - - if (begin != end) { - value_type max = *begin; - - while (begin != end) { - if (!Vector< rtype::RTYPE >::is_na(*begin)) { - max = std::max(max, *begin++); - } else { - return rtype::NA(); - } - } - - return max; - } - - return std::numeric_limits< typename rtype::type >::infinity() * -rtype::ONE(); -} - -template< typename InputIterator > -typename traits::enable_if< helpers::decays_to_ctype< typename std::iterator_traits< InputIterator >::value_type >::value, - typename helpers::ctype< typename std::iterator_traits< InputIterator >::value_type >::type >::type - max_nona(InputIterator begin, InputIterator end) { - - typedef typename helpers::ctype< typename std::iterator_traits< InputIterator >::value_type >::type value_type; - typedef typename helpers::rtype< value_type > rtype; - - if (begin != end) { - value_type max = *begin; - - while (begin != end) { - max = std::max(max, *begin++); - } - - return max; - } - - return std::numeric_limits< typename rtype::type >::infinity() * -rtype::ONE(); -} - -template< typename InputIterator > -typename traits::enable_if< helpers::decays_to_ctype< typename std::iterator_traits< InputIterator >::value_type >::value, - typename helpers::ctype< typename std::iterator_traits< InputIterator >::value_type >::type >::type - min(InputIterator begin, InputIterator end) { - - typedef typename helpers::ctype< typename std::iterator_traits< InputIterator >::value_type >::type value_type; - typedef typename helpers::rtype< value_type > rtype; - - if (begin != end) { - value_type min = *begin; - - while (begin != end) { - if (!Vector< rtype::RTYPE >::is_na(*begin)) { - min = std::min(min, *begin++); - } else { - return rtype::NA(); - } - } - - return min; - } - - return std::numeric_limits< typename rtype::type >::infinity(); -} - -template< typename InputIterator > -typename traits::enable_if< helpers::decays_to_ctype< typename std::iterator_traits< InputIterator >::value_type >::value, - typename helpers::ctype< typename std::iterator_traits< InputIterator >::value_type >::type >::type - min_nona(InputIterator begin, InputIterator end) { - - typedef typename helpers::ctype< typename std::iterator_traits< InputIterator >::value_type >::type value_type; - typedef typename helpers::rtype< value_type > rtype; - - if (begin != end) { - value_type min = *begin; - - while (begin != end) { - min = std::min(min, *begin++); - } - - return min; - } - - return std::numeric_limits< typename rtype::type >::infinity(); -} - -// for REALSXP -template< typename InputIterator > -typename traits::enable_if< helpers::decays_to_ctype< typename std::iterator_traits< InputIterator >::value_type >::value - && traits::same_type< typename helpers::ctype< typename std::iterator_traits< InputIterator >::value_type >::type, double >::value, double >::type - mean(InputIterator begin, InputIterator end) -{ - if (begin != end) - { - std::size_t n = end - begin; - long double s = std::accumulate(begin, end, 0.0L); - s /= n; - - if (R_FINITE((double) s)) { - long double t = 0.0L; - while (begin != end) { - t += *begin++ - s; - } - - s += t / n; - } - - return (double) s; - } - - return helpers::rtype< double >::NA(); -} - -// for LGLSXP and INTSXP -template< typename InputIterator > -typename traits::enable_if< helpers::decays_to_ctype< typename std::iterator_traits< InputIterator >::value_type >::value - && traits::same_type< typename helpers::ctype< typename std::iterator_traits< InputIterator >::value_type >::type, int >::value, double >::type - mean(InputIterator begin, InputIterator end) -{ - if (begin != end) - { - std::size_t n = end - begin; - long double s = std::accumulate(begin, end, 0.0L); - s /= n; - - if (R_FINITE((double) s)) { - long double t = 0.0L; - while (begin != end) { - if (*begin == helpers::rtype< int >::NA()) return helpers::rtype< double >::NA(); - t += *begin++ - s; - } - - s += t / n; - } - - return (double) s; - } - - return helpers::rtype< double >::NA(); -} - -template< typename InputIterator, typename OutputIterator > -void log(InputIterator begin, InputIterator end, OutputIterator out) { - std::transform(begin, end, out, helpers::log()); -} - -template< typename InputIterator, typename OutputIterator > -void exp(InputIterator begin, InputIterator end, OutputIterator out) { - std::transform(begin, end, out, helpers::exp()); -} - -template< typename InputIterator, typename OutputIterator > -void sqrt(InputIterator begin, InputIterator end, OutputIterator out) { - std::transform(begin, end, out, helpers::sqrt()); -} - -} // namespace algorithm -} // namespace Rcpp - -#endif diff --git a/inst/include/Rcpp/api/bones/wrap_extra_steps.h b/inst/include/Rcpp/api/bones/wrap_extra_steps.h index 48fab8b2d..170442105 100644 --- a/inst/include/Rcpp/api/bones/wrap_extra_steps.h +++ b/inst/include/Rcpp/api/bones/wrap_extra_steps.h @@ -1,9 +1,9 @@ -// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*- +// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*- /* :tabSize=4:indentSize=4:noTabs=false:folding=explicit:collapseFolds=1: */ // // wrap_extra_steps.h: Rcpp R/C++ interface class library -- wrap forward decl // -// Copyright (C) 2010 - 2017 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2010 - 2012 Dirk Eddelbuettel and Romain Francois // // This file is part of Rcpp. // @@ -23,11 +23,11 @@ #ifndef Rcpp__api__bones__wrap_extra_steps_h #define Rcpp__api__bones__wrap_extra_steps_h -namespace Rcpp { +namespace Rcpp{ -template SEXP wrap_extra_steps(SEXP x) { // #nocov start - return x; -} // #nocov end +template SEXP wrap_extra_steps( SEXP x ){ + return x ; +} } // Rcpp diff --git a/inst/include/Rcpp/api/meat/DataFrame.h b/inst/include/Rcpp/api/meat/DataFrame.h index b679e32ab..1068cefaf 100644 --- a/inst/include/Rcpp/api/meat/DataFrame.h +++ b/inst/include/Rcpp/api/meat/DataFrame.h @@ -23,7 +23,7 @@ namespace Rcpp{ template