RcppArmadillo: 'Rcpp' Integration for the 'Armadillo' Templated Linear Algebra Library

'Armadillo' is a templated C++ linear algebra library aiming towards a good balance between speed and ease of use. It provides high-level syntax and functionality deliberately similar to Matlab. It is useful for algorithm development directly in C++, or quick conversion of research code into production environments. It provides efficient classes for vectors, matrices and cubes where dense and sparse matrices are supported. Integer, floating point and complex numbers are supported. A sophisticated expression evaluator (based on template meta-programming) automatically combines several operations to increase speed and efficiency. Dynamic evaluation automatically chooses optimal code paths based on detected matrix structures. Matrix decompositions are provided through integration with LAPACK, or one of its high performance drop-in replacements (such as 'MKL' or 'OpenBLAS'). It can automatically use 'OpenMP' multi-threading (parallelisation) to speed up computationally expensive operations. The 'RcppArmadillo' package includes the header files from the 'Armadillo' library; users do not need to install 'Armadillo' itself in order to use 'RcppArmadillo'. Starting from release 15.0.0, the minimum compilation standard is C++14 so 'Armadillo' version 14.6.3 is included as a fallback when an R package forces the C++11 standard. Package authors should set a '#define' to select the 'current' version, or select the 'legacy' version (also chosen as default) if they must. See 'GitHub issue #475' for details. Since release 7.800.0, 'Armadillo' is licensed under Apache License 2; previous releases were under licensed as MPL 2.0 from version 3.800.0 onwards and LGPL-3 prior to that; 'RcppArmadillo' (the 'Rcpp' bindings/bridge to Armadillo) is licensed under the GNU GPL version 2 or later, as is the rest of 'Rcpp'.

Version: 15.0.1-1
Depends: R (≥ 3.3.0)
Imports: Rcpp (≥ 1.0.12), stats, utils, methods
LinkingTo: Rcpp
Suggests: tinytest, Matrix (≥ 1.3.0), pkgKitten, reticulate, slam
Published: 2025-09-01
DOI: 10.32614/CRAN.package.RcppArmadillo
Author: Dirk Eddelbuettel ORCID iD [aut, cre], Romain Francois ORCID iD [aut], Doug Bates ORCID iD [aut], Binxiang Ni [aut], Conrad Sanderson ORCID iD [aut]
RcppArmadillo author details
Maintainer: Dirk Eddelbuettel <edd at debian.org>
BugReports: https://github.com/RcppCore/RcppArmadillo/issues
License: GPL-2 | GPL-3 [expanded from: GPL (≥ 2)]
Copyright: see file COPYRIGHTS
URL: https://github.com/RcppCore/RcppArmadillo, https://dirk.eddelbuettel.com/code/rcpp.armadillo.html
NeedsCompilation: yes
Citation: RcppArmadillo citation info
Materials: README, NEWS, ChangeLog
In views: NumericalMathematics
CRAN checks: RcppArmadillo results

Documentation:

Reference manual: RcppArmadillo.html , RcppArmadillo.pdf
Vignettes: RcppArmadillo-introduction (source)
RcppArmadillo-sparseMatrix (source)

Downloads:

Package source: RcppArmadillo_15.0.1-1.tar.gz
Windows binaries: r-devel: RcppArmadillo_14.6.3-1.zip, r-release: RcppArmadillo_15.0.1-1.zip, r-oldrel: RcppArmadillo_14.6.3-1.zip
macOS binaries: r-release (arm64): RcppArmadillo_14.6.3-1.tgz, r-oldrel (arm64): RcppArmadillo_14.6.3-1.tgz, r-release (x86_64): RcppArmadillo_15.0.1-1.tgz, r-oldrel (x86_64): RcppArmadillo_15.0.1-1.tgz
Old sources: RcppArmadillo archive

Reverse dependencies:

Reverse depends: bsvarSIGNs, GRENITS, VEwaningVariant
Reverse imports: ADAPT, ast2ast, baygel, bigergm, bliss, BSTFA, CARDspa, CelliD, changepointGA, Crossover, dexter, diffuStats, DOVE, drclust, echos, EFAfactors, evinf, fChange, FLightR, GBOP2, gkwreg, Glarmadillo, globpso, GPCERF, GWASinlps, HiGarrote, iDOVE, ieTest, imagine, inferCSN, IRTM, joineRML, lessSEM, lgspline, lifepack, Linnorm, MADMMplasso, malan, minimaxALT, mlrv, MUGS, navigation, noisysbmGGM, PCPS, PFIM, regmed, roboBayes, scde, scGPS, sgdGMF, simPop, slalom, slasso, sstvars, SYNCSA, thisutils, updog, vcpen
Reverse linking to: abclass, abcrf, abn, acc, AcceptReject, acebayes, ACEt, ACSSpack, activegp, adaHuber, ADAPT, adapt3, adaptIVPT, ade4, adjclust, adjSURVCI, ADMM, aftgee, aftsem, afttest, agcounts, ahMLE, aifeducation, aihuman, AllelicSeries, alpaca, AlphaSimR, alqrfe, Amelia, AMISforInfectiousDiseases, anMC, ANN2, AntMAN, aorsf, apollo, APRScenario, ARCensReg, ARCokrig, arrApply, aRtsy, asmbPLS, ASV, ATAforecasting, ATNr, autoRasch, avar, babelmixr2, BalancedSampling, bama, BAMBI, bambu, bamm, banditpam, BANDITS, bandle, BAREB, bartXViz, BASiCS, baskexact, batchmix, Bayenet, BayesChange, bayescopulareg, bayesCureRateModel, BayesDLMfMRI, bayesDP, bayesEO, BayesESS, BayesianLasso, bayesianVARs, bayesImageS, bayeslm, bayesm, BayesMallows, BayesMFSurv, bayesmove, BayesPPD, BayesPPDSurv, BayesRegDTR, Bayesrel, BayesReversePLLH, BayesRGMM, BayesSpace, BayesSUR, BayesSurvive, bayesWatch, baygel, bayMDS, bayNorm, BCClong, BCEE, bcf, BClustLonG, bcROCsurface, beam, BEKKs, belg, bespatial, betaBayes, beyondWhittle, BGGM, BGVAR, bhetGP, BHMSMAfMRI, BHSBVAR, biClassify, BIDistances, bife, BIFIEsurvey, bigergm, biglasso, bigMap, bigReg, bigsnpr, bigstatsr, bigtime, bigutilsr, BigVAR, binaryGP, binGroup2, binspp, biosensors.usc, bisque, blatent, Blend, bliss, blockmodels, BLPestimatoR, bmabasket, BMisc, BNPmix, BoltzMM, bonsaiforest, BoostMLR, bootCT, bootUR, BosonSampling, BOSSreg, bpgmm, bpnreg, bpr, BPRMeth, BranchGLM, brmsmargins, BSL, BSPBSS, bspline, bssm, BSSprep, BSTFA, bsvars, bsvarSIGNs, btb, BTLLasso, BTtest, Buddle, BUSpaRse, BuyseTest, bvarsv, bvartools, BVSNLP, carat, CARDspa, CARMS, CaseBasedReasoning, catlearn, catSurv, CausalQueries, CB2, ccaPP, cccp, cctools, CDatanet, CDM, CelliD, cellWise, CERFIT, CeTF, CFC, CGGP, cglm, changepointGA, changepoints, ChannelAttribution, chouca, chromVAR, circlus, CircSpaceTime, CircularDDM, circumplex, cIRT, cladoRcpp, Cleanet, clhs, cliqueMS, clubpro, ClusPred, ClusROC, clusterHD, clusterMI, ClusterR, clustord, CLVTools, cmenet, CMGFM, coala, COAP, coda.base, colorednoise, comat, combinIT, CoMiRe, COMIX, communication, coneproj, conleyreg, conos, conquer, CoOL, copCAR, cophescan, copre, cord, corrcoverage, cosimmr, Countr, countSTAR, covdepGE, covglasso, covTestR, CovTools, CoxPlus, coxrobust, coxrt, CPAT, cPCG, CPGLIB, cpr, cpss, cqrReg, crandep, crawl, Crossover, CSeQTL, ctmcd, cTMed, curveDepth, CWT, cytometree, CytoSimplex, dann, DatabionicSwarm, DatAssim, dateutils, dccmidas, dccpp, DCLEAR, dcm2, dcortools, dcov, DCSmooth, dcurver, decorrelate, deepgp, deforestable, deform, DegNorm, densEstBayes, densityratio, DepthProc, DEScan2, deseats, DESeq2, desla, dexter, dfms, dfmta, dga, DGM, DGP4LCF, diagis, didimputation, DifferentialRegulation, diffuStats, DIFM, dina, Dire, DiscreteFDR, DiscreteFWER, distinct, dlmtree, dmbc, DMQ, dMrs, dnn, DOVE, DR.SC, drclust, drgee, DriftBurstHypothesis, DrImpute, dscore, dsp, DSSP, DstarM, DSWE, DtD, dtwclust, DyadiCarma, dynmix, DySS, eBsc, ebTobit, echoice2, echos, edina, eDMA, EFAfactors, EFAtools, elmNNRcpp, EloChoice, EloRating, em, emBayes, EMbC, EMC2, emcAdr, EMgaussian, emIRT, EMMIXgene, empichar, endogeneity, energymethod, epigraHMM, EpiLPS, epistasisGA, epizootic, equateMultiple, EquiTrends, ergmito, errum, esaddle, esemifar, esreg, EstMix, etm, eulerr, evgam, evinf, evolqg, exdex, ExhaustiveSearch, expertsurv, expSBM, extBatchMarking, exuber, fabMix, factorstochvol, FamilyRank, FarmTest, fastadi, FastBandChol, fastcpd, fasterElasticNet, fasterize, fastGLCM, fastglmpca, fastLink, fastliu, fastM, fastmit, fastPLS, fastpos, fastshap, fastTopics, FaultTree, FBCRM, FBFsearch, fChange, fclust, fctbases, fdacluster, fdaMixed, fdaSP, fdasrvf, fdesigns, fDMA, FDX, fect, fEGarch, FGLMtrunc, fHMM, fiberLD, fICA, filling, finity, fipp, FKSUM, flamingos, flan, FlexVarJM, flintyR, FLORAL, FMCCSD, fmerPack, fmf, forecast, FORTLS, fourierin, fourPNO, fpROC, FRASER, free, FRESA.CAD, FRESHD, FSelectorRcpp, FSSF, FuncDiv, funcharts, funMoDisco, GA, GADAG, gamreg, gamselBayes, GAS, gaselect, gasper, GauPro, GBOP2, gbp, gcKrig, GCPBayes, GCSM, GDINA, gdpc, GEEaSPU, gena, GeneralizedUmatrix, GenomeAdmixR, geocmeans, geocomplexity, GeoDiff, geodiv, geoFKF, geoFourierFDA, geogrid, geojsonR, GFDmcv, gfiExtremes, GFM, ggbrain, ggdmc, ggdmcLikelihood, ggdmcModel, ggdmcPrior, GGPA, ggsc, gicf, gigg, GiniDistance, GiRaF, gjam, gkwreg, glamlasso, Glarmadillo, glcm, GLCMTextures, GLMaSPU, glmGamPoi, glmmPen, glmmsel, globpso, GMCM, Gmedian, GMKMcharlie, GMMAT, gmtFD, gmvjoint, gmwmx, gmwmx2, gMWT, gofar, goffda, GofKmt, goldfish, GPCERF, GPCMlasso, gpcp, GPFDA, GpGp, gplite, GPM, GPvam, GPvecchia, GRAB, gRain, graper, graphicalEvidence, graphicalVAR, graphlayouts, gRbase, gRc, greed, GreedyEPL, GRENITS, gridOT, gRim, grove, growfunctions, grpsel, GSE, gsynth, GWASinlps, GWEX, GWmodel, GxEScanR, HACSim, hahmmr, handwriter, harmony, hawkes, hawkesbow, hdbcp, hdbinseg, hdbm, hdflex, HDJM, hdme, HDNRA, hdpGLM, HDSpatialScan, HDTD, heatwaveR, hesim, heterogen, hgwrr, hibayes, HiGarrote, highfrequency, higlasso, HistDAWass, hkevp, HLMdiag, HMB, hmcdm, HMMEsolver, hpa, HSAR, hsphase, HTLR, hypervolume, iAR, IBclust, ICcalib, iccbeta, iclogcondist, iClusterVB, ICSClust, ICtest, idefix, iDOVE, ieTest, ILSE, imagine, imbalance, immer, inca, IncDTW, inferCSN, infinitefactor, interep, interflex, intkrige, intRinsic, intrinsicFRP, intsurv, invgamstochvol, iPath, ipsecr, IrishDirectorates, IRTM, IsoBayes, ivdoctr, ivsacim, ivx, jackalope, JANE, JFM, JMbayes, JMbayes2, jmcm, JMI, jmotif, joineRML, jrSiCKLSNMF, jSDM, jti, JUMP, kalmanfilter, kdecopula, KDEmcmc, KernelKnn, kimfilter, kmBlock, KODAMA, KoulMde, l0ara, L0Learn, l1spectral, LA, lacunr, LAM, LaMa, lamle, landscapemetrics, Langevin, LassoGEE, latentgraph, lavacreg, lavaSearch2, lbfgsb3c, lddmm, ldmppr, ldsep, ldsr, leafletZH, lefko3, legion, leidenAlg, LeMaRns, lemur, lessSEM, lgspline, lidR, lifepack, lightAUC, LikertMakeR, linconGaussR, linelistBayes, Linnorm, lit, Lmoments, lnmixsurv, lodr, longevity, LorenzRegression, lowmemtkmeans, lpcde, lpirfs, lsirm12pl, ltsspca, ludic, Luminescence, lvmcomp, MABOUST, MADMMplasso, MAGEE, magi, MAINT.Data, malan, manifold, ManifoldOptim, maotai, MAPITR, marble, MarginalMaxTest, markophylo, markovchain, MarZIC, mashr, mastif, MAT, matchingMarkets, matchingR, matrixCorr, MatrixCorrelation, matrixdist, MAVE, mbkmeans, mccca, mcemGLM, mclustAddons, mclustcomp, MCMCprecision, mcmcse, mDAG, MDCcure, MDEI, mdgc, mdmb, meltt, MendelianRandomization, meshed, MESS, metafolio, MetaHD, metapack, metaRange, meteorits, mets, mev, MGMM, mhazard, miceadds, miceFast, microsimulation, mig, miloR, milr, mina, minerva, minimaxALT, miniPCH, mirt, mirtCAT, mirtjml, MiSPU, MissCP, missoNet, missSBM, mixedBayes, mixedCCA, mixedMem, mixgb, MixMatrix, mixsqp, mixture, MLModelSelection, mlpack, mlrv, mlsbm, mmcif, MMGFM, mmsample, MMVBVS, MNARclust, mnlfa, mnorm, modeLLtest, modsem, mombf, momentuHMM, MomTrunc, Morpho, motif, motifmatchr, moveHMM, mp, MR.RGM, mrf2d, mrfDepth, mrgsolve, MSCA, MSEtool, MSGARCH, MSIMST, MSstats, MSTest, MTLR, MuFiMeshGP, multbxxc, multgee, MultiCOAP, MultiFit, multilevLCA, multilink, multinomialLogitMix, multinomineq, MultiscaleDTM, multiScaleR, multivar, MultOrdRS, MultSurvTests, mutualinf, mvgam, mvMAPIT, mvnfast, mvnimpute, mvrsquared, n1qn1, NAIR, navigation, ncpen, netClust, netcmc, netcontrol, netdiffuseR, NetMix, netrankr, NetRep, nett, netUtils, NetworkDistance, networkR, neuroim2, nevada, ngspatial, nlmeVPC, nlmixr2est, nlmixr2extra, nlmm, NLPwavelet, nmslibR, nn2poly, noisysbmGGM, nonlinearTseries, nonprobsvy, NPCirc, NPflow, nprobust, numbat, o2plsda, obliqueRSF, ODRF, oeli, oem, ohoegdm, onlineforecast, onlinePCA, opa, OpenImageR, oppr, OPSR, optiSel, orthoDr, OSFD, OutcomeWeights, OUTRIDER, pacotest, PAGFL, pagoda2, PanelCount, PanelMatch, PANPRSnext, parallelDist, parglm, pARI, PartialNetwork, partition, pbv, pcalg, PCMBaseCpp, PCMRS, pda, pdSpecEst, pecora, pECV, pedbp, penAFT, penalized, PenCoxFrail, penPHcure, pense, pEPA, PEPBVS, pg, pgee.mixed, pgKDEsphere, pGPx, pgsc, Phase123, Phase12Compare, phenofit, PHSMM, PhylogeneticEM, phylosignal, phylter, phyr, PieceExpIntensity, PINSPlus, PJFM, pleiotest, PLFD, pliman, plmmr, PLNmodels, plotHMM, PLSiMCpp, pmartR, PoissonMultinomial, polykde, polyqtlR, POMaSPU, porridge, PoweR, PPforest, ppgmmga, PPMR, pprof, PPSFS, PPtreeViz, PQLseq, pqrBayes, pqrfe, PRDA, PRECAST, prioriactions, prioritizr, probe, ProFAST, profoc, projpred, pRoloc, PROsetta, prospectr, prototest, proxyC, psbcSpeedUp, psd, pseudoCure, PSGD, psgp, psp, psychonetrics, pumBayes, puniform, qbld, qch, qgg, qris, qtlpoly, Qtools, quadrupen, quanteda.textmodels, quanteda.textstats, QuantilePeer, QuantRegGLasso, QUBIC, queuecomputer, quollr, qwraps2, r2sundials, raceland, Racmacs, Radviz, rags2ridges, ramcmc, rare, ratematrix, rayimage, rayshader, rbridge, rcccd, RCDT, RcppCensSpatial, RcppDE, RcppDist, RcppDPR, RcppDynProg, RcppEnsmallen, RcppHMM, RcppPlanc, RcppSMC, Rdimtools, rdist, ReAD, RealVAMS, reda, redist, redistmetrics, registr, regmed, regmhmm, regnet, regsem, relliptical, relsurv, remaCor, remify, remstats, remstimate, remulate, repolr, reReg, resemble, reservr, resourcecode, revdbayes, revealedPrefs, Rfast, Rfast2, Rforestry, Rfssa, RGMM, rhoR, ridgetorus, Riemann, RiemBase, riskRegression, rjaf, rlibkriging, rliger, Rlinsolve, RLumCarlo, RLumModel, rmarchingcubes, RMCLab, RMFM, rmgarch, Rmodule, RMSS, rMVP, Rnanoflann, RNOmni, roben, RobGARCHBoot, roboBayes, robregcc, RobRegression, robslopes, robustBLME, robustcov, robustHD, robustmatrix, robustreg, rocTree, rofanova, ROKET, roll, roptim, ROptSpace, rotasym, rotations, RPatternJoin, RPhosFate, Rphylopars, rpm, rpms, rpql, RprobitB, rqPen, RRI, rrMixture, rrpack, rrum, Rsolnp, rsparse, rSpectral, RSSL, RStoolbox, rstpm2, rsvddpd, rtrend, rTwig, rugarch, rust, Rvcg, RWNN, rxode2, s2net, saeMSPE, saeRobust, SAGMM, SAIGEgds, SAMGEP, samplr, samurais, sanba, SANple, SANvi, SAR, sarima, sasfunclust, satdad, sbfc, sbm, SBmedian, sbmSDP, SC3, scalablebayesm, scanstatistics, ScatterDensity, sccore, scde, scGPS, scINSIGHT, scistreer, scITD, scmap, scMitoMut, scoringRules, SCORNET, sctransform, sdetorus, sdpdth, sdsfun, secrdesign, seededlda, segclust2d, segMGarch, segtest, semidist, sensitivity, sensobol, sentometrics, sentopics, seqHMM, sfcr, SFDesign, SFS, sgd, sgdGMF, SGDinference, sgs, shapr, ShrinkCovMat, shrinkDSM, shrinkTVP, shrinkTVPVAR, SHT, Sieve, sievePH, SiFINeT, signeR, signnet, SimBIID, simcdm, simer, SimJoint, simmr, SIMplyBee, simPop, simStateSpace, SimSurvNMarker, SimTOST, simts, singR, sirt, SIT, sits, skm, slalom, slasso, slcm, sleev, slfm, SLmetrics, smarter, smartsnp, SMASH, smile, SMMA, SMME, smmR, smoof, smooth, smoothemplik, smoots, smurf, SNPknock, snpsettest, SoftBart, sommer, sorcering, SpaCCI, SpaceTimeBSS, SpaCOAP, sparseDFM, SparseICA, SparseLPM, sparsereg, sparsevb, sparta, sparvaride, SpatialBSS, SpatialEpi, SpatialTools, spatialwarnings, SpatMCA, SpaTopic, SpatPCA, spBayesSurv, spBFA, spBPS, Spbsampling, spCP, spduration, specs, SpecsVerification, spEDM, spfa, spFW, sphunif, spinBayes, splines2, SPlit, SplitGLM, SplitReg, splmm, spNetwork, spnn, springer, sprintr, squat, srm, Sshaped, SSOSVM, sstvars, STAREG, starma, STARTS, statespacer, statgenGWAS, statgenIBD, statgenQTLxT, StatRec, stcos, StempCens, stepSplitReg, StepwiseTest, stm, StochBlock, stochcorr, stochvol, stpm, stpphawkes, strat, stratEst, StratifiedSampling, strucchangeRcpp, sts, StuteTest, subsampling, SubTite, superml, SuperpixelImageSegmentation, support, surbayes, sureLDA, SurrogateRegression, surtvep, survey, surveybootstrap, SurvivalClusteringTree, svars, SVP, switchSelection, symmetry, symphony, synMicrodata, T4cluster, T4transport, tabularMLC, TAG, TAM, TapeS, targeted, TauStar, tci, tclust, TDAkit, TDAvec, tEDM, telefit, tensorBSS, TestCor, TestDesign, tetrascatt, textmineR, textTinyR, tfarima, thisutils, tidylda, tidynorm, tidypopgen, tlars, tma, tmvtnsim, trackdem, trajeR, tree.interpreter, TreeBUGS, treeclim, treenomial, TruncatedNormal, tsBSS, TSLA, tsmarch, TTR.PGM, tvR, ubms, UComp, unmarked, unsystation, UPCM, updog, UtilityFrailtyPH12, VAJointSurv, varband, VARSELECTEXPOSURE, VarSelLCM, VARtests, VBJM, vcpen, VeccTMVN, VEwaningVariant, VIC5, VICatMix, VMDecomp, vMF, VUROCS, waddR, walker, waspr, watson, WaveSampling, wCorr, wdnet, WeibullR, weibulltools, womblR, WRI, wru, wv, xdcclarge, XDNUTS, ycevo, yuima, zic, ZVCV
Reverse suggests: bayesEO, bayesmove, CaseBasedReasoning, collapse, crmPack, DepthProc, FSelectorRcpp, geocomplexity, GPM, hdbinseg, HSAR, IBMPopSim, lbfgsb3c, lsoda, ManifoldOptim, MfUSampler, parallelDist, psqn, r2sundials, RcppProgress, sdsfun, sits, smoots, spEDM, splines2, tEDM, unsystation

Linking:

Please use the canonical form https://CRAN.R-project.org/package=RcppArmadillo to link to this page.