- Notifications
You must be signed in to change notification settings - Fork42
Rcpp integration for the Eigen templated linear algebra library
License
RcppCore/RcppEigen
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Eigen is a C++ template library for linear algebra:matrices, vectors, numerical solvers and related algorithms. It supports dense and sparsematrices on integer, floating point and complex numbers, decompositions of such matrices,and solutions of linear systems. Its performance on many algorithms is comparable withsome of the best implementations based onLapack and level-3BLAS.
RcppEigen provides an interface from R to and fromEigen byusing the facilities offered by theRcpppackage for seamless R and C++ integration.
A few examples are over at theRcpp Gallery. A simple one is
#include<RcppEigen.h>// [[Rcpp::depends(RcppEigen)]]using Eigen::Map;// 'maps' rather than copiesusing Eigen::MatrixXd;// variable size matrix, double precisionusing Eigen::VectorXd;// variable size vector, double precisionusing Eigen::SelfAdjointEigenSolver;// one of the eigenvalue solvers// [[Rcpp::export]]VectorXdgetEigenValues(Map<MatrixXd> M) { SelfAdjointEigenSolver<MatrixXd>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 exportthegetEigenValues() function -- but readthe fullpost for details.
The package is mature and under active development, following theEigen release cycle.
The package contains a pdf vignette which is a pre-print of thepaper byBates and Eddelbuettel in JSS (2013, v52i05).
Douglas Bates, Dirk Eddelbuettel, Romain Francois, and Yixuan Qiu
GPL (>= 2)
About
Rcpp integration for the Eigen templated linear algebra library
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors14
Uh oh!
There was an error while loading.Please reload this page.