### Kalman Filter Example with RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Mentions the addition of a new example demonstrating a Kalman filter implementation using RcppArmadillo, including a C++ version and timing comparisons. This serves as a practical guide for implementing state-space models. ```cpp Kalman filter ``` -------------------------------- ### RcppArmadillo: New fastLm example Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog A new example file, fastLm.r, has been added to demonstrate the functionality of fastLm. This example also explores the impact of casting SEXP to Armadillo types. ```R * inst/examples/fastLm.r: New example fastLm ``` ```R * inst/examples/fastLm.r: Also examine the 'two versus one' casts impact when converting SEXP to Armadillo types ``` -------------------------------- ### RcppArmadillo Examples with make_list Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog Updates examples in src/RcppArmadillo.cpp to use make_list and demonstrates various ways to create named lists and access elements using Rcpp. ```cpp * src/RcppArmadillo.cpp: update examples to use make_list and showcase various ways to use them : Named(.)=., _[.] = , Named( ., . ) ``` -------------------------------- ### Add Rank-Deficient Example to fastLm Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog The manual page for fastLm (man/fastLm/Rd) is updated with an example demonstrating possible problems when using fastLmPure() and fastLm() with rank-deficient matrices. ```Rd * man/fastLm/Rd: Added rank-deficient example to illustrate possible problems with fastLmPure() and fastLm() ``` -------------------------------- ### RcppArmadillo: New introductory vignette Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog A new introductory vignette, RcppArmadillo-intro.Rnw, has been added. This vignette is based on a submitted paper and serves to guide users on how to use the RcppArmadillo package. ```R * inst/doc/RcppArmadillo-intro.Rnw: New introductory vignette based on just-submitted paper by Eddelbuettel and Sanderson ``` -------------------------------- ### Install RcppArmadillo from CRAN Source: https://cran.r-project.org/web/packages/RcppArmadillo/readme/README.html Use this command to install the package from the nearest CRAN mirror. ```R install.packages("RcppArmadillo") ``` -------------------------------- ### RcppArmadillo.package.skeleton Source: https://cran.r-project.org/web/packages/RcppArmadillo/refman/RcppArmadillo.html Automates the creation of a new R package that intends to use RcppArmadillo features. It extends the functionality of `package.skeleton` by adding necessary RcppArmadillo dependencies and example code. ```APIDOC ## RcppArmadillo.package.skeleton ### Description `RcppArmadillo.package.skeleton` automates the creation of a new source package that intends to use features of RcppArmadilo. It is based on the package.skeleton function which it executes first. ### Usage ```R RcppArmadillo.package.skeleton(name = "anRpackage", list = character(), environment = .GlobalEnv, path = ".", force = FALSE, code_files = character(), example_code = TRUE, author = "Your Name", maintainer = if (missing(author)) "Your Name" else author, email = "your@email.com", githubuser = NA_character_, license = "GPL (>= 2)") ``` ### Arguments `name` | See package.skeleton `list` | See package.skeleton `environment` | See package.skeleton `path` | See package.skeleton `force` | See package.skeleton `code_files` | See package.skeleton `example_code` | If TRUE, example c++ code using RcppArmadillo is added to the package `author` | Author of the package. `maintainer` | Maintainer of the package. `email` | Email of the package maintainer. `githubuser` | GitHub username for URL and BugReports, if present. `license` | License of the package. ### Details In addition to package.skeleton : The ‘⁠DESCRIPTION⁠’ file gains a Depends line requesting that the package depends on Rcpp and RcppArmadillo and a LinkingTo line so that the package finds Rcpp and RcppArmadillo header files. The ‘⁠NAMESPACE⁠’, if any, gains a `useDynLib` directive. The ‘⁠src⁠’ directory is created if it does not exists and a ‘⁠Makevars⁠’ file is added setting the environment variable ‘⁠PKG_LIBS⁠’ to accomodate the necessary flags to link with the Rcpp library. If the `example_code` argument is set to `TRUE`, example files ‘⁠rcpparma_hello_world.h⁠’ and ‘⁠rcpparma_hello_world.cpp⁠’ are also created in the ‘⁠src⁠’. An R file ‘⁠rcpparma_hello_world.R⁠’ is expanded in the ‘⁠R⁠’ directory, the `rcpparma_hello_world` function defined in this files makes use of the C++ function ‘⁠rcpparma_hello_world⁠’ defined in the C++ file. These files are given as an example and should eventually by removed from the generated package. ### Value Nothing, used for its side effects ### References Read the _Writing R Extensions_ manual for more details. Once you have created a _source_ package you need to install it: see the _R Installation and Administration_ manual, `INSTALL` and `install.packages`. ### See Also package.skeleton ### Examples ```R ## Not run: ## RcppArmadillo.package.skeleton( "foobar" ) ## End(Not run) ``` ``` -------------------------------- ### GET /armadillo_version Source: https://cran.r-project.org/web/packages/RcppArmadillo/refman/RcppArmadillo.html Retrieves the version information of the underlying Armadillo library. ```APIDOC ## GET /armadillo_version ### Description Report the version of the Armadillo library. ### Method GET ### Endpoint /armadillo_version ### Parameters #### Query Parameters - **single** (logical) - Required - A logical vector indicating whether a single return value is requested, or a named vector with three elements (major, minor, patch). ``` -------------------------------- ### Report Armadillo Version Source: https://cran.r-project.org/web/packages/RcppArmadillo/refman/RcppArmadillo.html Use `armadillo_version` to get the Armadillo library version. Specify `single = TRUE` for a single numeric value or `single = FALSE` for a named vector (major, minor, patch). `armadillo_version_typed` returns an S3 object for version comparison. ```R armadillo_version(single) armadillo_version_typed() ``` -------------------------------- ### Initialize Matrix with Fill Value in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Demonstrates how to initialize a matrix with a specific scalar value using `fill::value()`. This is useful for creating matrices pre-filled with a constant. ```cpp mat X(4,5,fill::value(123)); ``` -------------------------------- ### Batch Insertion Constructors for Sparse Matrices in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Introduces batch insertion constructors for sparse matrices, improving the efficiency of populating sparse matrices with data. ```cpp sparse matrices ``` -------------------------------- ### Saving and Loading Cubes in HDF5 Format with RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Introduces support for saving and loading cubes in HDF5 format, contributed by Szabolcs Horvat. This is useful for handling multi-dimensional data efficiently. ```cpp HDF5 format ``` -------------------------------- ### Create RcppArmadillo Package Skeleton Source: https://cran.r-project.org/web/packages/RcppArmadillo/refman/RcppArmadillo.html Automates the creation of a new source package configured to use RcppArmadillo. ```R RcppArmadillo.package.skeleton(name = "anRpackage", list = character(), environment = .GlobalEnv, path = ".", force = FALSE, code_files = character(), example_code = TRUE, author = "Your Name", maintainer = if (missing(author)) "Your Name" else author, email = "your@email.com", githubuser = NA_character_, license = "GPL (>= 2)") ``` ```R ## Not run: RcppArmadillo.package.skeleton( "foobar" ) ## End(Not run) ``` -------------------------------- ### Disable Default Initialization in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Shows how to construct a matrix without initializing its elements to zero by using `fill::none`. This can be beneficial for performance when the initial values are not critical. ```cpp mat X(4,5,fill::none); ``` -------------------------------- ### Include Armadillo Headers and Modify config.hpp Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog The Armadillo headers and the 'armadillo_bits' directory are added to 'inst/include/'. Only the 'armadillo_bits/config.hpp' file is modified from the original Armadillo sources. ```cpp * inst/include/armadillo: Added the armadillo headers and the armadillo_bits directory. This is from the armadillo sources with only the armadillo_bits/config.hpp file modified. ``` -------------------------------- ### Construct a matrix with zero fill in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Demonstrates how to specify a fill type during the construction of Armadillo matrix classes like Mat, Col, Row, and Cube, using `fill::zeros` for initialization. ```cpp mat X(4, 5, fill::zeros) ``` -------------------------------- ### Force Approximate Solver in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Explains how to use the `solve_opts::force_approx` option with the `solve()` function to ensure the approximate solver is used. This can improve performance for certain types of matrix problems. ```cpp solve_opts::force_approx ``` -------------------------------- ### Add fastLm Functionality Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog Introduces the bare-bones 'fastLm' C++ function in src/RcppArmadillo.cpp, along with an R wrapper in R/fastLm.R, a manual page in man/fastLm.Rd, a unit test, and makes 'fastLm' visible in the NAMESPACE. ```cpp * src/RcppArmadillo.cpp: Added bare-bones 'fastLm' function ``` ```R * R/fastLm.R: Added fastLm R wrapper for C++ fastLm ``` ```Rd * man/fastLm.Rd: Added manual page ``` ```R * inst/unitTests/runit.RcppArmadillo.R: Added unit test ``` ```R * NAMESPACE: Made fastLm visible ``` -------------------------------- ### Compute Hessenberg Decomposition at the R Prompt Source: https://cran.r-project.org/web/packages/RcppArmadillo/readme/README.html Demonstrates using cppFunction to expose the Armadillo hess() method directly from an R session. ```r > library(Rcpp) # for cppFunction() > cppFunction("arma::mat hd(const arma::mat& m) { return hess(m); }", depends="RcppArmadillo") > set.seed(20251122) > m <- matrix(rnorm(49), 7, 7) > hd(m) # compute Hessenberg decom using the function we just created [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.15745 1.64589 -0.809926 0.220417 -1.6050835 -0.947760 -0.972432 [2,] 2.80695 -2.65613 0.119320 0.484858 -0.0877464 0.913440 -0.488142 [3,] 0.00000 1.95335 -1.436409 1.879113 -0.1532293 -0.532077 -0.319914 [4,] 0.00000 0.00000 -1.253221 -1.694414 0.2497111 1.233231 1.055706 [5,] 0.00000 0.00000 0.000000 -3.333499 -1.4800146 -0.913523 -0.667435 [6,] 0.00000 0.00000 0.000000 0.000000 -1.2050704 -0.294369 1.254402 [7,] 0.00000 0.00000 0.000000 0.000000 0.0000000 0.324987 -1.504329 > ``` -------------------------------- ### Faster pinv() for Symmetric Positive Definite Matrices in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Reports performance improvements for the `pinv()` function when used with symmetric positive definite matrices. This optimization speeds up the computation of the pseudoinverse for this common matrix type. ```cpp pinv() ``` -------------------------------- ### Handle Sparse Matrices with trimatu() and trimatl() in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Details the expanded forms of `trimatu()` and `trimatl()` that now handle sparse matrices and allow for diagonal specification. These functions are used to trim matrices above or below the main diagonal. ```cpp trimatu() ``` ```cpp trimatl() ``` -------------------------------- ### Abridged Printing with .brief_print() in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Introduces the `.brief_print()` member function for matrices and cubes, which provides an abridged representation. This is useful for quickly inspecting large matrices without overwhelming the console. ```cpp .brief_print() ``` -------------------------------- ### New Sample Function in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Adds a new `sample()` function and associated tests, contributed by Christian Gunning. This provides enhanced capabilities for random sampling. ```cpp sample() ``` -------------------------------- ### Handle Diagonal Matrices in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Highlights performance improvements in handling diagonal matrices for functions like `inv_sympd()`, `pinv()`, and `rank()`. Also notes more robust detection of incorrect data formats by `.load()`. ```cpp inv_sympd() ``` ```cpp pinv() ``` ```cpp rank() ``` ```cpp .load() ``` -------------------------------- ### Bare-bones Linear Model Fitting (Pure Interface) Source: https://cran.r-project.org/web/packages/RcppArmadillo/refman/RcppArmadillo.html The `fastLmPure` function estimates linear models using Armadillo's `solve` function directly. It requires a model matrix `X` and a response vector `y`. Returns coefficients, standard errors, and residual degrees of freedom. ```R flm <- fastLmPure( cbind(1, log(trees$Girth)), log(trees$Volume) ) ``` ```R print(flm) ``` -------------------------------- ### Expanded .save() / .load() for Dense Matrices in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Details the expansion of `.save()` and `.load()` for dense matrices to support the `coord_ascii` format. This allows for saving and loading matrices in a specific sparse text representation. ```cpp .save() ``` ```cpp .load() ``` -------------------------------- ### Faster Submatrix Views and Element-wise Min/Max in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Highlights performance improvements for accessing submatrix views using `X.cols(first_col, last_col)` and for element-wise `min()` and `max()` operations within compound expressions. ```cpp X.cols(first_col,last_col) ``` ```cpp min() ``` ```cpp max() ``` -------------------------------- ### Checking for Elements Satisfying Conditions in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Shows the usage of `all()` and `any()` functions to check for the presence of elements that satisfy a relational condition within matrices or vectors. Useful for conditional logic and data validation. ```cpp all() any() ``` -------------------------------- ### POST /fastLmPure Source: https://cran.r-project.org/web/packages/RcppArmadillo/refman/RcppArmadillo.html Estimates a linear model using the Armadillo solve function for high-performance computation. ```APIDOC ## POST /fastLmPure ### Description Estimates the linear model using the solve function of the Armadillo linear algebra library. ### Method POST ### Endpoint /fastLmPure ### Parameters #### Request Body - **X** (matrix) - Required - A model matrix. - **y** (vector) - Required - A vector containing the explained variable. ### Response #### Success Response (200) - **coefficients** (vector) - A vector of coefficients. - **stderr** (vector) - A vector of the estimated standard errors of the coefficient estimates. - **df.residual** (scalar) - The degrees of freedom in the model. ``` -------------------------------- ### Workaround for Win64 Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog A specific workaround for the Win64 platform is implemented in inst/include/RcppArmadillo.h to address potential compilation or runtime issues. ```cpp * inst/include/RcppArmadillo.h: workaround for win64 ``` -------------------------------- ### Handling Rank Deficiency with fastLm Source: https://cran.r-project.org/web/packages/RcppArmadillo/refman/RcppArmadillo.html Demonstrates a case where `fastLm` may produce an approximate solution for rank-deficient matrices, unlike `lm` which detects and reports it. Use with caution and consider checking matrix condition numbers. ```R dd <- data.frame(f1 = gl(4, 6, labels = LETTERS[1:4]), f2 = gl(3, 2, labels = letters[1:3]))[-(7:8), ] ``` ```R xtabs(~ f2 + f1, dd) # one missing cell ``` ```R mm <- model.matrix(~ f1 * f2, dd) ``` ```R kappa(mm) # large, indicating rank deficiency ``` ```R set.seed(1) dd$y <- mm %*% seq_len(ncol(mm)) + rnorm(nrow(mm), sd = 0.1) ``` ```R summary(lm(y ~ f1 * f2, dd)) # detects rank deficiency ``` ```R summary(fastLm(y ~ f1 * f2, dd)) # fits all coefficients via approx solution ``` -------------------------------- ### Add C++ Flags for SunCC Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog A configuration header, inst/include/RcppArmadilloConfig.h, is added to provide C++ configuration flags that help with Sun Studio Compiler (suncc). ```cpp * inst/include/RcppArmadilloConfig.h: Addition cconfig helping suncc ``` -------------------------------- ### Swapping Matrix Contents in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Introduces the `.swap()` method for efficiently exchanging the contents of two matrices. This is useful for memory management and avoiding unnecessary copying. ```cpp `.swap()` ``` -------------------------------- ### Handling Non-Square Matrices with QR Decomposition in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Includes fixes for handling non-square matrices with `qr()` and `qr_econ()`. This ensures correct behavior for QR decomposition in various matrix shapes. ```cpp qr() qr_econ() ``` -------------------------------- ### Faster Median Calculation in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Notes the performance improvement for the `median()` function, contributed by Ruslan Shestopalyuk. This speeds up statistical calculations on large datasets. ```cpp median() ``` -------------------------------- ### Faster Find Function in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Reports performance improvements for the `find()` function, making it faster for locating elements within matrices. ```cpp find() ``` -------------------------------- ### Faster log_det() for Triangular Matrices in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Highlights performance improvements for the `log_det()` function when applied to triangular matrices. This optimization speeds up calculations involving determinants of such matrices. ```cpp log_det() ``` -------------------------------- ### Implement Linear Regression with RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/readme/README.html A lightweight implementation of linear regression using Armadillo's matrix operations. Use the Rcpp::sourceCpp() function to compile this code. ```cpp #include // [[Rcpp::depends(RcppArmadillo)]] // [[Rcpp::export]] Rcpp::List fastLm(const arma::mat& X, const arma::colvec& y) { int n = X.n_rows, k = X.n_cols; arma::colvec coef = arma::solve(X, y); // fit model y ~ X arma::colvec res = y - X*coef; // residuals double s2 = arma::dot(res, res) / (n - k); // std.errors of coefficients arma::colvec std_err = arma::sqrt(s2 * arma::diagvec(arma::pinv(arma::trans(X)*X))); return Rcpp::List::create(Rcpp::Named("coefficients") = coef, Rcpp::Named("stderr") = std_err, Rcpp::Named("df.residual") = n - k); } ``` -------------------------------- ### RcppArmadillo: Adapt to Armadillo 2.99.1 Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog This change adapts RcppArmadilloWrap.h to be compatible with Armadillo version 2.99.1. This ensures proper integration with the updated Armadillo library. ```C++ * inst/include/RcppArmadilloWrap.h: adapt to Armadillo 2.99.1 ``` -------------------------------- ### Sparse Matrix Conversion in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Details the added support for converting sparse matrices of type `dgCMatrix` from the Matrix package. This facilitates interoperability with sparse matrix representations. ```cpp class `dgCMatrix` ``` -------------------------------- ### SSE2 Vectorization of Elementary Expressions in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Highlights automatic SSE2 vectorization for elementary expressions like matrix addition when using GCC 4.7+ with -O3 optimization. This significantly speeds up computations on compatible hardware. ```cpp matrix addition ``` -------------------------------- ### Update to Armadillo 0.9.6 Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog The Armadillo library is updated to version 0.9.6. ```cpp * inst/include/* : updated to armadillo 0.9.6 ``` -------------------------------- ### Update to Armadillo 0.9.8 Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog The Armadillo library is updated to version 0.9.8. ```cpp * inst/include/*: updated to Armadillo 0.9.8 ``` -------------------------------- ### Matrix Multiplication with Transpose in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Demonstrates faster multiplication of a matrix with its transpose using Armadillo's optimized functions. This is useful for performance-critical linear algebra operations. ```cpp X*X.t() X.t()*X ``` -------------------------------- ### fastLm() Generic with Formula Interface Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog The fastLm() function in R/fastLm.R is made generic and gains a formula interface. It also includes methods for print, summary, and predict, allowing it to behave like a standard model fitting function. ```R * R/fastLm.R: fastLm() is now generic and has a formula interface as well as methods for print, summary, predict to behave like a standard model fitting function ``` -------------------------------- ### Handle Dense Matrix Subviews and Sparse Matrices in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Notes a fix for regressions that occurred when interacting between dense matrix subviews and sparse matrices. This ensures correct behavior in mixed matrix type operations. ```cpp dense matrix subviews ``` ```cpp sparse matrices ``` -------------------------------- ### RcppArmadillo: Update Armadillo to 3.2.3 Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog This entry details an update to Armadillo version 3.2.3. It also notes a reversion of specific header files related to matrix and column/row types due to compilation issues with g++ 4.7. ```R * DESCRIPTION: Release 0.3.2.3 * inst/include/*: Upgraded to new release 3.2.3 of Armadillo * inst/include/armadillo_bits/: Reverted files {Mat,Col,Row}_bones.hpp to the previous versions due to compilation issues under g++ 4.7 ``` -------------------------------- ### BibTeX Citation for RcppArmadillo Manual Source: https://cran.r-project.org/web/packages/RcppArmadillo/citation.html Use this BibTeX entry to cite the R package manual. ```bibtex @Manual{, title = {RcppArmadillo: 'Rcpp' Integration for the 'Armadillo' Templated Linear Algebra Library}, author = {Dirk Eddelbuettel and Romain Francois and Doug Bates and Binxiang Ni and Conrad Sanderson}, year = {2026}, note = {R package version 15.2.4-1}, url = {https://CRAN.R-project.org/package=RcppArmadillo}, doi = {10.32614/CRAN.package.RcppArmadillo}, } ``` -------------------------------- ### Small Fix for Armadillo 0.8.2 Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog A minor fix is applied to src/fastLm.cpp to ensure compatibility with Armadillo version 0.8.2. ```cpp * src/fastLm.cpp: Small fix for Armadillo 0.8.2 ``` -------------------------------- ### Update Armadillo to 0.9.52 Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog This commit updates the Armadillo library to version 0.9.52, codenamed 'Monkey Wrench'. It also includes a change in src/fastLm.cpp to use pinv() instead of inv() for handling singular matrices. ```cpp * src/fastLm.cpp: Switch from inv() (which now throws a warning on (near) singular matrices and returns an empty matrix) to the Moore-Penrose pseudo-inverse pinv() which allows us to continue the example from the manual page. Of course, for standard use inv() is doing the right thing by issueing the warning. ``` -------------------------------- ### RcppArmadillo: Force instantiation of arma version vars Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog This change in src/RcppArmadillo.cpp forces the instantiation of Armadillo version variables. This is a workaround to help with older OS X compilers. ```C++ * src/RcppArmadillo.cpp: Force instantiation of arma version vars which helps with older OS X compiler, as suggested by Gershon Bialer ``` -------------------------------- ### RcppArmadillo Package Skeleton Function Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog Introduces a new package skeleton function, RcppArmadillo:::RcppArmadillo.package.skeleton(), which is similar to Rcpp::Rcpp.package.skeleton() but specifically targets the use of RcppArmadillo. ```R * R/RcppArmadillo.package.skeleton.R: new package skeleton function similar to Rcpp::Rcpp.package.skeleton() but targetting use of RcppArmadillo ``` -------------------------------- ### RcppArmadillo: Adjust unit test output directory Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog The unit tests output directory 'fallback' has been changed to '..', and the test files are now located in the top-level of the $pkg.Rcheck/ directory. This change affects how test results are organized. ```R * inst/unitTests/runTests.R: unit tests output 'fallback' directory changed to '..' and files are now in top-level of $pkg.Rcheck/ ``` -------------------------------- ### Faster Handling of Subcubes in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Notes performance improvements in handling subcubes. This optimization benefits operations that involve extracting or manipulating portions of 3D arrays. ```cpp subcubes ``` -------------------------------- ### Remove OS_type Restriction and Add Maintainers Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog The OS_type restriction is removed from the DESCRIPTION file now that RcppArmadillo includes Armadillo headers directly. Douglas Bates is added to the Authors and Maintainers list. ```text * DESCRIPTION: Remove OS_type restriction now that RcppArmadillo includes Armadillo headers, add Doug to Authors and Maintainers ``` -------------------------------- ### Use Pivoted Decomposition with chol() in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Describes the expansion of the `chol()` function to optionally use pivoted decomposition. This can be beneficial for numerical stability with certain matrices. ```cpp chol() ``` -------------------------------- ### Fix Alias Handling in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Reports a fix for a regression in alias handling for functions like `fliplr()`, `flipud()`, and `reverse()`. These functions manipulate the order of matrix elements. ```cpp fliplr() ``` ```cpp flipud() ``` ```cpp reverse() ``` -------------------------------- ### Fast Fourier Transform (FFT) in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Adds support for the Fast Fourier Transform (`fft()`) function, enabling efficient frequency-domain analysis of signals and data. ```cpp fft() ``` -------------------------------- ### Update to Armadillo 0.9.10 Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog The Armadillo library is upgraded to version 0.9.10. This version introduces support for new 'mtOp' and 'mtGlue' operations. ```cpp * inst/include/* : upgrade to armadillo 0.9.10 ``` ```cpp * inst/include/* : support for new mtOp and mtGlue, introduced in armadillo 0.9.10 ``` -------------------------------- ### SCALAR Macro for API Change Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog Introduces the SCALAR macro in inst/include/RcppArmadilloDefines.in.h to handle the 0.9.0 API change in Armadillo, ensuring compatibility. ```cpp * inst/include/RcppArmadilloDefines.in.h added the SCALAR macro to take care of the 0.9.0 api change ``` -------------------------------- ### Update fastLm.cpp Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog This commit includes a small polish to the src/fastLm.cpp file and moves its content into its own dedicated file. ```cpp * src/fastLm.cpp: Moved into its own file, some more polish ``` -------------------------------- ### Faster Determinant for Diagonal/Triangular Matrices in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Notes the optimization for calculating the determinant of matrices marked as diagonal or triangular, leading to faster computations for these specific matrix types. ```cpp determinant ``` -------------------------------- ### Imbue and Transform Operations on Submatrices/Subcubes in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Enables `.imbue()` and `.transform()` operations on submatrices and subcubes. This allows for efficient in-place modification of specific parts of matrices and cubes. ```cpp `.imbue()` `.transform()` ``` -------------------------------- ### Expanded Standalone clamp() for Complex Values in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Notes that the standalone `clamp()` function has been extended to handle complex numbers. This allows for clamping the real and imaginary parts of complex values independently or jointly. ```cpp clamp() ``` -------------------------------- ### Standard Linear Model Fitting (Formula Interface) Source: https://cran.r-project.org/web/packages/RcppArmadillo/refman/RcppArmadillo.html The `fastLm` function provides a standard R interface for linear model fitting using formulas. It supports data frames and returns an object similar to `lm`, including residuals and fitted values. ```R flmmod <- fastLm( log(Volume) ~ log(Girth), data=trees) ``` ```R summary(flmmod) ``` -------------------------------- ### RcppArmadillo: Update Armadillo to beta 3.1.92 Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog This update incorporates a beta release of the Armadillo library, version 3.1.92. Beta versions may include new functionalities or fixes that are under testing. ```R * DESCRIPTION: Release 0.3.1.92 * inst/include/*: Upgraded to new (beta) release 3.1.92 of Armadillo ``` -------------------------------- ### Correct Dimensions for arma::field in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Addresses an issue with correct dimension setting during import/export of `arma::field` types. This fix is protected by a `#define` directive. ```cpp #define ``` -------------------------------- ### Configure Armadillo Random Number Generator Source: https://cran.r-project.org/web/packages/RcppArmadillo/refman/RcppArmadillo.html Sets the internal Armadillo random number generator seed. Requires undefining ARMA_RNG_ALT to function. ```R armadillo_set_seed_random() armadillo_set_seed(val) ``` -------------------------------- ### Add arma:: Prefix Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog In src/fastLm.cpp, the 'arma::' prefix is added to Armadillo types and functions to ensure proper namespacing and avoid potential conflicts. ```cpp * src/fastLm.cpp: added some arma:: prefix ``` -------------------------------- ### Control Warning Level in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Introduces the `ARMA_WARN_LEVEL` configuration option for controlling the verbosity of warning messages emitted by Armadillo. This allows users to suppress warnings for specific issues like failed decompositions. ```cpp ARMA_WARN_LEVEL ``` -------------------------------- ### Faster CSV Loading with OpenMP in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Reports faster loading of CSV files when OpenMP is enabled. This indicates parallel processing improvements for I/O operations. ```cpp OpenMP ``` -------------------------------- ### RcppArmadillo: Update Armadillo to 3.0.0 Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog This entry marks the release of RcppArmadillo version 0.3.0, which includes an upgrade to Armadillo library version 3.0.0. This is a significant update to the core linear algebra library. ```R * DESCRIPTION: Release 0.3.0 * inst/include/*: Upgraded to new release 3.0.0 of Armadillo ``` -------------------------------- ### Reshaping Matrices to Vectors in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Introduces the `vectorise()` function for reshaping matrices into vectors. This is helpful when data needs to be flattened for certain algorithms or operations. ```cpp vectorise() ``` -------------------------------- ### RcppArmadillo: Update Armadillo to beta 3.1.94 Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog This entry marks an update to a beta release of Armadillo, version 3.1.94. Beta releases often contain experimental features or early fixes. ```R * DESCRIPTION: Release 0.3.1.94 * inst/include/*: Upgraded to new (beta) release 3.1.94 of Armadillo ``` -------------------------------- ### Avoid Extra Memory Copy in wrap() Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog Optimizes the wrap() function in inst/include/RcppArmadillo.h to avoid an extra memory copy when possible, specifically for 'int' or 'double' element types in eGlue and eOp. ```cpp * inst/include/RcppArmadillo.h: avoid an extra memory copy when possible (i.e. in wrap( eGlue) and wrap( eOp ) when the elem_type is int or double). ``` -------------------------------- ### Added log_det_sympd() in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Introduces `log_det_sympd()`, a function specifically for calculating the log determinant of symmetric positive definite matrices. This function is optimized for this matrix type. ```cpp log_det_sympd() ``` -------------------------------- ### Added .clamp() Member Function in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Introduces the `.clamp()` member function, which restricts the values within a matrix or vector to a specified range. This is useful for data normalization or enforcing bounds. ```cpp .clamp() ``` -------------------------------- ### OpenMP Thread Management Source: https://cran.r-project.org/web/packages/RcppArmadillo/refman/RcppArmadillo.html Functions to report and set the maximum number of OpenMP threads used by Armadillo. ```APIDOC ## Report (or Set) Maximum Number of OpenMP Threads ### Description Report (or Set) Maximum Number of OpenMP Threads ### Usage ```R armadillo_get_number_of_omp_threads() armadillo_set_number_of_omp_threads(n) ``` ### Arguments `n` | Number of threads to be set ### Value For the getter, and on a system with OpenMP, the maximum number of threads that OpenMP may be using and on systems without it, one. The setter does not return a value. ``` -------------------------------- ### Mozilla Public License 2.0 Licensing Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Notes the change in licensing for Armadillo to the Mozilla Public License 2.0. This affects how the library can be used and distributed. ```text Mozilla Public License 2.0 ``` -------------------------------- ### Save/Load CSV with Semicolon Separator in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Illustrates the use of `csv_opts::semicolon` for saving and loading CSV files where the delimiter is a semicolon instead of a comma. This is useful for compatibility with regional settings or specific file formats. ```cpp csv_opts::semicolon ``` -------------------------------- ### Added tgamma() Function in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Introduces the `tgamma()` function, which computes the gamma function. The gamma function is a generalization of the factorial function to real and complex numbers. ```cpp tgamma() ``` -------------------------------- ### RcppArmadillo: Update Armadillo to test release 2.99.1 Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog This update integrates Armadillo test release 2.99.1 into RcppArmadillo. Test releases are often used for pre-release testing and feedback. ```R * inst/include/*: Upgraded to new test release 2.99.1 of Armadillo ``` -------------------------------- ### Patch for MinGW Compiler on Win32 Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog A small patch is added to inst/include/armadillo_bits/config.hpp to prevent the use of asinh, acosh, and atanh on win32 systems when using an older MinGW compiler that cannot handle them. This issue is resolved in newer R versions. ```cpp * inst/include/armadillo_bits: Added small patch to not use asinh, acosh and atanh on win32 as the (older) MinGW compiler cannot cope. This problem will go away once R 2.12 is released as it requires gcc / g++ 4.5. ``` -------------------------------- ### Use Shift-Invert Mode with eigs_sym() and eigs_gen() in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Explains the addition of an optional shift-invert mode to `eigs_sym()` and `eigs_gen()`. This mode is useful for finding eigenvalues close to a specific value. ```cpp eigs_sym() ``` ```cpp eigs_gen() ``` -------------------------------- ### RcppArmadillo: Update Armadillo to 3.2.0 Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog This log entry signifies an upgrade to Armadillo version 3.2.0. Such updates often bring performance enhancements and bug fixes from the core Armadillo library. ```R * DESCRIPTION: Release 0.3.2.0 * inst/include/*: Upgraded to new release 3.2.0 of Armadillo ``` -------------------------------- ### Apply Upstream Corrections for randn and randg in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Mentions the application of upstream corrections for `arma::randn` draws when using alternative generators (like R's) and for `arma::randg`. This ensures more accurate random number generation. ```cpp arma::randn ``` ```cpp arma::randg ``` -------------------------------- ### RcppArmadillo: Update Armadillo to 3.2.4 Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog This entry indicates an upgrade of the Armadillo C++ linear algebra library to version 3.2.4 within the RcppArmadillo package. This typically involves incorporating new features, bug fixes, or performance improvements from the underlying Armadillo library. ```R * DESCRIPTION: Release 0.3.2.4 * inst/include/*: Upgraded to new release 3.2.4 of Armadillo ``` -------------------------------- ### RcppArmadillo: Protect ARMA_DEFAULT_OSTREAM define Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog This modification to RcppArmadilloConfig.h adds a #ifndef test to protect the define of ARMA_DEFAULT_OSTREAM. This prevents potential redefinition issues. ```C++ * inst/include/RcppArmadilloConfig.h: Protect define of ARMA_DEFAULT_OSTREAM by a #ifndef test ``` -------------------------------- ### RcppArmadillo: Update Armadillo to 3.0.2 Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog This entry signifies an update to Armadillo version 3.0.2. Updates to the underlying library often include bug fixes and performance enhancements. ```R * DESCRIPTION: Release 0.3.0.2 * inst/include/*: Upgraded to new release 3.0.2 of Armadillo ``` -------------------------------- ### Manage OpenMP Threads Source: https://cran.r-project.org/web/packages/RcppArmadillo/refman/RcppArmadillo.html Functions to report or set the maximum number of OpenMP threads used by Armadillo. ```R armadillo_get_number_of_omp_threads() armadillo_set_number_of_omp_threads(n) ``` -------------------------------- ### Set Armadillo RNG from a given value in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Provides functions to set Armadillo's system RNG from a specified value or randomize it. Note: These functions may not work within RStudio due to RStudio's own use of the system RNG. ```cpp rcpparma_hello_world() ``` -------------------------------- ### RcppArmadillo: Update Armadillo to test release 2.99.3 Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog This entry signifies an update to Armadillo test release 2.99.3. Test releases are typically used for pre-release evaluation of the Armadillo library. ```R * DESCRIPTION: Release 0.2.39 * inst/include/*: Upgraded to new test release 2.99.3 of Armadillo ``` -------------------------------- ### Throttle or Reset Core Usage Source: https://cran.r-project.org/web/packages/RcppArmadillo/refman/RcppArmadillo.html Helper functions to limit or restore the number of cores used by RcppArmadillo-internal code on OpenMP-enabled systems. ```R armadillo_throttle_cores(n = 2) armadillo_reset_cores() ``` -------------------------------- ### RcppArmadillo: Use Rcpp::Rcout for output Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog This change replaces std::cout with Rcpp::Rcout in several Armadillo header files. This ensures that output from Armadillo functions is correctly handled within the R environment. ```C++ * inst/include/armadillo_bits/Cube_meat.hpp : changes related to std::cout -> Rcpp::Rcout * inst/include/armadillo_bits/Mat_meat.hpp : idem * inst/include/armadillo_bits/config.hpp : idem * inst/include/armadillo_bits/debug.hpp : idem * inst/include/armadillo_bits/field_meat.hpp : idem * inst/include/armadillo_bits/forward_bones.hpp : idem ``` -------------------------------- ### RcppArmadillo: Update Armadillo to 3.0.1 Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog This update incorporates Armadillo version 3.0.1. Such updates typically include bug fixes and performance improvements from the core Armadillo library. ```R * DESCRIPTION: Release 0.3.0.1 * inst/include/*: Upgraded to new release 3.0.1 of Armadillo ``` -------------------------------- ### Core Throttling for RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/refman/RcppArmadillo.html Helper functions to throttle or reset the number of cores used by RcppArmadillo-internal code, particularly for systems with OpenMP. ```APIDOC ## Throttle (or Reset) (Rcpp)Armadillo to Two Cores ### Description Helper functions to throttle use of cores by RcppArmadillo-internal code on systems with OpenMP. On package load, the initial value is saved and used to reset the value. ### Usage ```R armadillo_throttle_cores(n = 2) armadillo_reset_cores() ``` ``` -------------------------------- ### RcppArmadillo: Add missing semicolon for C++0x Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog A missing semicolon was added to a code block within RcppArmadillo/Mat_meat.h that is ifdef'ed for C++0x mode. This corrects a syntax error. ```C++ * inst/include/RcppArmadillo/Mat_meat.h: Add missing semicolon in code ifdef'ed for C++0x mode, with thanks to Teo Guo Ci ``` -------------------------------- ### RcppArmadillo: Update Armadillo to 2.4.3 Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog This entry signifies an update to Armadillo version 2.4.3. Updates to the underlying library often include bug fixes and performance enhancements. ```R * DESCRIPTION: Release 0.2.35 (depending on Rcpp 0.9.10) * inst/include/*: Upgraded to new release 2.4.3 of Armadillo ``` -------------------------------- ### Fix constexpr for Fixed-Size Matrices in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Corrects the incorrect use of `constexpr` for handling fixed-size matrices and vectors. This ensures proper compile-time evaluation where applicable. ```cpp constexpr ``` -------------------------------- ### Handle Out-of-Bounds Access with std::out_of_range Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Notes that element accessors in RcppArmadillo now throw `std::out_of_range` exceptions for out-of-bounds access, providing more specific error information than the previous `std::logic_error`. ```cpp std::out_of_range ``` -------------------------------- ### RcppArmadillo: Update Armadillo to 3.0.3 Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog This update brings the Armadillo library to version 3.0.3. Such updates typically include bug fixes and performance improvements. ```R * DESCRIPTION: Release 0.3.0.3 * inst/include/*: Upgraded to new release 3.0.3 of Armadillo ``` -------------------------------- ### RcppArmadillo: Update Armadillo to test release 2.99.2 Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog This update incorporates Armadillo test release 2.99.2. Test releases are often used to gather feedback on new features or fixes before a stable release. ```R * DESCRIPTION: Release 0.2.38 * inst/include/*: Upgraded to new test release 2.99.2 of Armadillo ``` -------------------------------- ### Rounding Matrix Elements in RcppArmadillo Source: https://cran.r-project.org/web/packages/RcppArmadillo/news.html Adds the `round()` function for rounding matrix elements to the nearest integer. This is useful for data discretization or preparing data for specific analyses. ```cpp round() ``` -------------------------------- ### BibTeX Citation for RcppArmadillo Article Source: https://cran.r-project.org/web/packages/RcppArmadillo/citation.html Use this BibTeX entry to cite the 2014 Computational Statistics and Data Analysis article. ```bibtex @Article{, 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}, } ``` -------------------------------- ### Fix Runtime Error with SCALAR Macro Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog Corrects a runtime error in src/RcppArmadillo.cpp that occurred when using the SCALAR macro, ensuring proper functionality. ```cpp * src/RcppArmadillo.cpp : fix a runtime error uisng the SCALAR macro ``` -------------------------------- ### RcppArmadillo: Update Armadillo to test release 2.99.4 Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog This update incorporates a test release of Armadillo, version 2.99.4. Test releases are often used for pre-release testing of new features or fixes. ```R * DESCRIPTION: Release 0.2.40 * inst/include/*: Upgraded to new test release 2.99.4 of Armadillo ``` -------------------------------- ### Compute sig2 via std::inner_product Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog In src/fastLm.cpp, the calculation of sig2 is changed to use std::inner_product for potentially improved precision or performance. ```cpp * src/fastLm.cpp: Compute sig2 via std::inner_product ``` -------------------------------- ### Add CxxFlags() Function Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog A new function, RcppArmadillo:::CxxFlags(), is added to R/flags.R, likely to provide or manage C++ compiler flags for RcppArmadillo. ```R * R/flags.R: added RcppArmadillo:::CxxFlags() ``` -------------------------------- ### RcppArmadillo: Update Armadillo to 2.4.4 Source: https://cran.r-project.org/web/packages/RcppArmadillo/ChangeLog This update incorporates Armadillo version 2.4.4. Such updates typically include bug fixes and performance improvements from the core Armadillo library. ```R * DESCRIPTION: Release 0.2.36 * inst/include/*: Upgraded to new release 2.4.4 of Armadillo ```