https://github.com/rcppcore/rcppeigen
Rcpp integration for the Eigen templated linear algebra library
https://github.com/rcppcore/rcppeigen
algorithm c-plus-plus cran eigen eigen-library r-package
Last synced: about 1 month ago
JSON representation
Rcpp integration for the Eigen templated linear algebra library
- Host: GitHub
- URL: https://github.com/rcppcore/rcppeigen
- Owner: RcppCore
- License: other
- Created: 2013-10-31T16:26:17.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2025-04-04T14:56:58.000Z (3 months ago)
- Last Synced: 2025-05-15T10:06:48.577Z (about 1 month ago)
- Topics: algorithm, c-plus-plus, cran, eigen, eigen-library, r-package
- Language: C++
- Size: 7.4 MB
- Stars: 115
- Watchers: 16
- Forks: 40
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog
- License: LICENSE
Awesome Lists containing this project
README
## RcppEigen: R and Eigen via Rcpp
[](https://github.com/RcppCore/RcppEigen/actions?query=workflow%3Aci)
[](https://www.gnu.org/licenses/gpl-2.0.html)
[](https://www.mozilla.org/MPL/2.0/)
[](https://cran.r-project.org/package=RcppEigen)
[](https://rcppcore.r-universe.dev/RcppEigen)
[](https://cran.r-project.org/package=RcppEigen)
[](https://app.codecov.io/github/RcppCore/RcppEigen?branch=master)
[](https://packages.debian.org/sid/r-cran-rcppeigen)
[](https://github.com/RcppCore/RcppEigen)
[](https://www.r-pkg.org:443/pkg/RcppEigen)
[](https://www.r-pkg.org:443/pkg/RcppEigen)
[](https://cran.r-project.org/package=RcppEigen)
[](https://cran.r-project.org/package=RcppEigen)
[](https://stackoverflow.com/questions/tagged/rcpp)
[](https://doi.org/10.18637/jss.v052.i05)### Synopsis
[Eigen](http://eigen.tuxfamily.org/index.php?title=Main_Page) is a C++ template library for linear algebra:
matrices, vectors, numerical solvers and related algorithms. It supports dense and sparse
matrices on integer, floating point and complex numbers, decompositions of such matrices,
and solutions of linear systems. Its performance on many algorithms is comparable with
some of the best implementations based on `Lapack` and level-3 `BLAS`.RcppEigen provides an interface from R to and from [Eigen](http://eigen.tuxfamily.org/index.php?title=Main_Page) by
using the facilities offered by the [Rcpp](http://dirk.eddelbuettel.com/code/rcpp.html)
package for seamless R and C++ integration.### Examples
A few examples are over at the [Rcpp Gallery](https://gallery.rcpp.org/tags/eigen/). A simple one is
```c++
#include// [[Rcpp::depends(RcppEigen)]]
using Eigen::Map; // 'maps' rather than copies
using Eigen::MatrixXd; // variable size matrix, double precision
using Eigen::VectorXd; // variable size vector, double precision
using Eigen::SelfAdjointEigenSolver; // one of the eigenvalue solvers// [[Rcpp::export]]
VectorXd getEigenValues(Map M) {
SelfAdjointEigenSolver es(M);
return es.eigenvalues();
}
```which can be turned into a function callable from R via a simple
```
sourceCpp("eigenExample.cpp")
```due to the two Rcpp directives to use headers from the RcppEigen package, and to export
the `getEigenValues()` function -- but read [the full
post](https://gallery.rcpp.org/articles/eigen-eigenvalues/) for details.### Status
The package is mature and under active development, following the
[Eigen](http://eigen.tuxfamily.org/index.php?title=Main_Page) release cycle.### Documentation
The package contains a pdf vignette which is a pre-print of the [paper by
Bates and Eddelbuettel](https://doi.org/10.18637/jss.v052.i05) in JSS (2013, v52i05).### Authors
Douglas Bates, Dirk Eddelbuettel, Romain Francois, and Yixuan Qiu
### License
GPL (>= 2)