'Rcpp' Integration for the 'Eigen' Templated Linear Algebra Library

R and 'Eigen' integration using 'Rcpp'. 'Eigen' 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'. The 'RcppEigen' package includes the header files from the 'Eigen' C++ template library. Thus users do not need to install 'Eigen' itself in order to use 'RcppEigen'. Since version 3.1.1, 'Eigen' is licensed under the Mozilla Public License (version 2); earlier version were licensed under the GNU LGPL version 3 or later. 'RcppEigen' (the 'Rcpp' bindings/bridge to 'Eigen') is licensed under the GNU GPL version 2 or later, as is the rest of 'Rcpp'.


RcppEigen: R and Eigen via Rcpp

CI License License CRAN r-universe Dependencies Coverage Status Debian package Last Commit Downloads (monthly) Downloads (total) CRAN use BioConductor use StackOverflow JSS

Synopsis

Eigen 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 by using the facilities offered by the Rcpp package for seamless R and C++ integration.

Examples

A few examples are over at the Rcpp Gallery. A simple one is

#include <RcppEigen.h>

// [[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<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 export the getEigenValues() function -- but read the full post for details.

Status

The package is mature and under active development, following the Eigen release cycle.

Documentation

The package contains a pdf vignette which is a pre-print of the paper by Bates and Eddelbuettel in JSS (2013, v52i05).

Authors

Douglas Bates, Dirk Eddelbuettel, Romain Francois, and Yixuan Qiu

License

GPL (>= 2)

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("RcppEigen")

0.3.4.0.2 by Dirk Eddelbuettel, 2 years ago


https://github.com/RcppCore/RcppEigen, https://dirk.eddelbuettel.com/code/rcpp.eigen.html


Report a bug at https://github.com/RcppCore/RcppEigen/issues


Browse source code at https://github.com/cran/RcppEigen


Authors: Doug Bates [aut] , Dirk Eddelbuettel [aut, cre] , Romain Francois [aut] , Yixuan Qiu [aut] , Authors of Eigen [cph] (Authorship and copyright in included Eigen library as detailed in inst/COPYRIGHTS)


Documentation:   PDF Manual  


GPL (>= 2) | file LICENSE license


Imports Rcpp, stats, utils

Suggests Matrix, inline, tinytest, pkgKitten, microbenchmark

Linking to Rcpp


Imported by GTEs, HDMAADMM, QuadratiK, Rcppautodiff, SoyNAM, ameras, bbknnR, bigstep, bnns, fastQR, fmriqa, gsaot, knn.covertree, learner, marcox, midr, scorematchingad, sparseLTSEigen, staggered, tensorMiss, varclust.

Suggested by AgePopDenom, BIOMASS, PosteriorBootstrap, RcppNumerical, alien, bayestestR, bridgesampling, brms.mmrm, collapse, fahb, flocker, gaston, insight, kde1d, lsoda, modelbased, nestedcv, ngme2, parameters, performance, pfr, psqn, report, see, tidyILD, trending.

Enhanced by interp.

Linked to by ADSIHT, ALDEx3, APML0, ARCokrig, AovBay, AsyPeer, BINtools, BLSM, BPrinStratTTE, BRRAT, BayesESS, BayesFactor, BayesGP, BayesGmed, BayesGrowth, BayesLN, BayesPET, BayesPPD, BayesProject, BayesSenMC, BayesfMRI, BayesianLasso, BayesianPlatformDesignTimeTrend, BeSS, BeeGUTS, Bernadette, BigDataStatMeth, BigVAR, BinaryReplicates, BoundIRT, CARME, CCMMR, CDatanet, CKLRT, CNVRG, COMIX, CVXR, CausalQueries, ClustAssess, ClustVarLV, CoSMoS, Colossus, CrownScorchTLS, Cyclops, DAISIE, DAST, DCPO, DDD, DDRTree, DPTM, DTRKernSmooth, DetMCD, EDI, Eagle, EcoEnsemble, EloSteepness, EpiNow2, EpiPvr, FIRM, FORTLS, FRK, FactorHet, FastGP, FastGaSP, FastJM, FastPCS, FastRCS, FlexReg, ForceChoice, GAGAs, GGClassification, GLMcat, GPBayes, GUD, GWmodel, GWnorm, GeneralizedWendland, GeoAdjust, HDTSA, HHBayes, HausdorffGoF, IBclust, ICAOD, ICSKAT, JMH, JSM, KernelICA, LMMELSM, LMN, LRQVB, LassoHiDFastGibbs, LocalCop, MADPop, MCMCprecision, MCPModPack, MDDC, MIRES, MJMbamlss, MLBC, MLZ, MM4LMM, MPTinR, MTS, MediaK, MedianaDesigner, MetaStan, MetricGraph, MixLFA, MonotonicityTest, N2R, NCutYX, ODRF, OncoBayes2, OpenMx, OwenQ, PBD, PCObw, PCpluS, PRIMAL, PReMiuM, PTE, PUlasso, PanelMatch, PartialNetwork, PoolTestR, ProbBreed, ProbitSpatial, QFASA, QuantilePeer, R2D2ordinal, RAINBOWR, RBesT, REndo, RMixtCompIO, RNewsflow, RNiftyReg, RPEGLMEN, RSpectra, RTMB, RZigZag, Rankcluster, Ravages, RcppFastAD, RcppML, Rlgt, Rmixmod, RoBTT, RobKF, RobustCalibration, RobustGaSP, Rvcg, SAM, SAMtool, SIS, SKFCPD, SLGP, SLOPE, SMUT, SPACO, ScaleSpikeSlab, Seurat, SeuratObject, SmartSVA, SparseChol, SpatialGEV, StanHeaders, StanMoMo, SteadyStateBVAR, StealLikeBayes, SuperGauss, SurrogateBMA, TDA, TFRE, TMB, TSDFGS, TriDimRegression, TwoStepSDFM, VBel, WSPsignal, WhiteLabRt, WpProj, YPBP, YPPE, abess, adelie, admixr2, aihuman, apollo, approxOT, asteRisk, autoFRK, bWGR, babelmixr2, baclava, bage, baggr, bakR, baldur, balnet, basad, bayes4psy, bayesPO, bayesQRsurvey, bayesWatch, bayesZIB, bayesdfa, bayesforecast, bayeslist, bbmix, bclogit, beastt, beezdemand, bellreg, bennu, betaregscale, bigsparser, bigtime, bigutilsr, binspp, birdie, bistablehistory, blackbox, blavaan, blockForest, bmgarch, bmggum, bmlm, bmstdr, boodist, bqmm, breathteststan, bscm, bsynth, bvhar, bws, causalOT, cbq, celliverse, cenROC, cloneRate, clustTMB, clusterGGM, cmpp, coglasso, compas, conStruct, conos, covafillr, crctStepdown, ctsem, ctsmTMB, dbMatrix, dcortools, ddsPLS, densEstBayes, depthR, dgraphs, dicepro, diffcp, disaggregation, disbayes, dlmtree, drf, drmTMB, dsem, dsp, dspline, dtametaTMB, eDNAjoint, earthtide, ef, eggCounts, eimpute, elgbd, enrichit, epigrowthfit, estimatr, exdqlm, expectreg, expertsurv, factorana, fad, fastLink, fastLogisticRegressionWrap, fastglm, fb4package, fcirt, fdaPDE, fdaconcur, fdapace, fdarep, fddm, fido, finalsize, folda, forestBalance, freqTLS, fuser, gKRLS, gRain, gRbase, gRim, galamm, gastempt, gbeta, gedi2, geeVerse, genpca, geokmeans, geostan, gif, gkwreg, gllvm, glmmLasso, glmmPen, glmmTMB, glmmfields, glmmrBase, glmmrOptim, glmnet, glow, greencrab.toolkit, grf, groupedSurv, grpCox, hal9001, hbal, hbamr, hdtg, heterogen, historicalborrowlong, hmde, hmmTMB, hopit, hrt, hsstan, hts, hwep, icenReg, imt, imuGAP, imuf, intervalpsych, iprior, iq, irls, isotracer, jfa, keyATM, leidenAlg, lfmm, lgpr, libcmaesr, lime, lit, lme4, locStra, localboot, lslx, mGSFPCA, markerpen, mas, mase, maxentcpp, mcmcsae, measr, melt, metaBMA, mgwrsar, midnight, milorGWAS, miniLNM, minic, mlts, mlumr, mmpca, mmrm, mniw, modelSelection, morseTKTD, mrMLM, mrMLM.GUI, mrbayes, mrfDepth, mrtsSphere, msPCA, multiblock, multinma, multipleDL, multiview, nabor, natcpp, nebula, netOP, netgsa, netify, networkscaleup, nlmixr2est, nnmf, nnsolve, ocf, oem, pagoda2, parTimeROC, pcFactorStan, pcaone, pda, pdglasso, pema, penppml, personalized2part, phacking, phylopairs, phylosem, phylter, pimeta, piqp, plac, plantmix, pompp, portvine, ppforest2, prome, prophet, psBayesborrow, psrwe, psychonetrics, publipha, pvEBayes, pwlmm, qbrms, qfratio, qshap, qtl2, qtl2pleio, rIsing, rMVP, rPBK, randnet, ranger, raptr, rater, ravetools, rbioacc, rcbayes, reems, remotePARTS, repsim, rethnicity, rid, riemtan, riskParityPortfolio, rkriging, rmBayes, rmdcev, rmsb, robCompositions, robsel, rootWishartHD, rpf, rsides, rstan, rstanarm, rstanbdp, rstanemax, rtestim, rts2, rvinecopulib, rxode2, rxode2lincmt, rxode2ll, saeHB.TF.beta, saeczi, samc, sanic, sccore, scregclust, sdmTMB, secrfunc, selection.index, serofoi, serosv, serrsBayes, shrinkr, skpr, sleev, smer, smile, sommer, spDBL, spGARCH, spaMM, spanner, spatialGE, spboost, spca, spsurv, squat, ssMousetrack, ssdtools, stan4bart, stelfi, stochvolTMB, survPen, surveil, survextrap, surveyvoi, survstan, svines, thurstonianIRT, tinyVAST, tipsae, tlrmvnmvt, tmbstan, tramME, transmdl, transport, trialr, truncnormbayes, trustOptim, tsdistributions, tsgarch, tsissm, tsnet, tulpa, twingp, ubms, ungroup, unityForest, unmarked, vglmer, vimixr, vinereg, volesti, vostokR, walker, wbsd, winputall, xnicher, xrnet, zoid, ztpln.


See at CRAN