rcpparmadillo

Error install RcppArmadillo on macOS Catalina [duplicate]

岁酱吖の 提交于 2021-02-08 11:10:38
问题 This question already has answers here : Cannot compile R packages with c++ code after updating to macOS Catalina (2 answers) Closed 1 year ago . I followed the steps in R Compiler Tools for Rcpp on macOS (for R 3.6.x), but an error occurs when I try to install RcppArmadillo . I don't have Xcode.app install, and prefer to use the command line tools instead. The answers posted here didn't help :( * installing *source* package ‘RcppArmadillo’ ... ** package ‘RcppArmadillo’ successfully unpacked

Error install RcppArmadillo on macOS Catalina [duplicate]

。_饼干妹妹 提交于 2021-02-08 11:06:08
问题 This question already has answers here : Cannot compile R packages with c++ code after updating to macOS Catalina (2 answers) Closed 1 year ago . I followed the steps in R Compiler Tools for Rcpp on macOS (for R 3.6.x), but an error occurs when I try to install RcppArmadillo . I don't have Xcode.app install, and prefer to use the command line tools instead. The answers posted here didn't help :( * installing *source* package ‘RcppArmadillo’ ... ** package ‘RcppArmadillo’ successfully unpacked

Using SuperLU sparse solver with RcppArmadillo

混江龙づ霸主 提交于 2021-02-05 04:49:56
问题 I am trying to use the SparseLU solver from armadillo (http://arma.sourceforge.net/docs.html#spsolve) through RcppArmadillo: #define ARMA_USE_SUPERLU // [Rcpp::depends(RcppArmadillo)] #include <RcppArmadillo.h> // [[Rcpp::export]] arma::vec sp_solver(arma::sp_mat K, arma::vec x) { arma::superlu_opts opts; opts.symmetric = true; arma::vec res; arma::spsolve(res, K, x, "superlu", opts); return res; } /*** R library(Matrix) K <- sparseMatrix(i = c(1, 2, 1), j = c(1, 2, 2), x = c(1, 1, 0.5),

Using SuperLU sparse solver with RcppArmadillo

戏子无情 提交于 2021-02-05 04:49:45
问题 I am trying to use the SparseLU solver from armadillo (http://arma.sourceforge.net/docs.html#spsolve) through RcppArmadillo: #define ARMA_USE_SUPERLU // [Rcpp::depends(RcppArmadillo)] #include <RcppArmadillo.h> // [[Rcpp::export]] arma::vec sp_solver(arma::sp_mat K, arma::vec x) { arma::superlu_opts opts; opts.symmetric = true; arma::vec res; arma::spsolve(res, K, x, "superlu", opts); return res; } /*** R library(Matrix) K <- sparseMatrix(i = c(1, 2, 1), j = c(1, 2, 2), x = c(1, 1, 0.5),

fatal error: 'RcppArmadillo.h' file not found

荒凉一梦 提交于 2021-01-29 16:43:01
问题 Rcpp::sourceCpp('~/Desktop/my.cpp') Was working on some stand alone Rcpparmadillo files and came across this error: fatal error: 'RcppArmadillo.h' file not found #include <RcppArmadillo.h> ^~~~~~~~~~~~~~~~~ The example "my.cpp": // [[Rcpp::depends(RcppArmadillo)] #include <RcppArmadillo.h> // [[Rcpp::export]] arma::vec add_two(arma::vec x){ return x + 2; } /*** R add_two( c(42, 22)) */ I recently upgraded to RcppArmadillo version 0.9.900.1.0 and I am on macOS Catalina 10.15.5 and R version 3

Rstudio no autocomplete with Rcpp Armadillo?

我的梦境 提交于 2021-01-28 19:12:52
问题 I have long used Rcpp with Rstudio, but recently I lost autocomplete and diagnostic functionality. I was able to trace the cause to RcppArmadillow. Here is the basic default c++ new file code with modifications. #include <Rcpp.h> using namespace Rcpp; // [[Rcpp::depends(RcppArmadillo)]] // [[Rcpp::export]] NumericVector timesTwo(NumericVector x) { return x * 2; } // [[Rcpp::export]] double GetValueAt(const NumericMatrix& x, int row = 1, int col = 1) { return x(row-1,col-1); } /*** R timesTwo

Cannot compile RcppArmadillo

帅比萌擦擦* 提交于 2020-12-31 14:56:40
问题 RcppArmadillo is a dependency of a few packages I'm trying to install. I get this error on compilation of RcppArmadillo version 0.10.1.0.0 (which is what R automatically pulls from CRAN when it finds that RcppArmadillo is a dep): RcppArmadillo.cpp:26:40: error: redeclaration 'arma::arma_version::major' differs in 'constexpr' const unsigned int arma::arma_version::major; ^ In file included from ../inst/include/armadillo:91:0, from ../inst/include/RcppArmadilloForward.h:49, from ../inst/include

Cannot compile RcppArmadillo

时光毁灭记忆、已成空白 提交于 2020-12-31 14:55:31
问题 RcppArmadillo is a dependency of a few packages I'm trying to install. I get this error on compilation of RcppArmadillo version 0.10.1.0.0 (which is what R automatically pulls from CRAN when it finds that RcppArmadillo is a dep): RcppArmadillo.cpp:26:40: error: redeclaration 'arma::arma_version::major' differs in 'constexpr' const unsigned int arma::arma_version::major; ^ In file included from ../inst/include/armadillo:91:0, from ../inst/include/RcppArmadilloForward.h:49, from ../inst/include

Parallel Worker in namespace

浪尽此生 提交于 2019-12-11 18:49:33
问题 This example is a follow up example from this earlier post. I am trying to move the Parallel Worker to its own cpp file and and declare it in the header file. Calling 'mypackage' function within public worker The two errors are as follows: 1) variable type 'ExampleInternal::PARALLEL_WORKER' is an abstract class and in my non-reproducible example: 2) error: expected unqualified-id on the 'ExampleInternal::PARALLEL_WORKER{' line in the Parallel_worker.cpp file. Right now the code looks like

How to deal with an Rcpp::XPtr that may have one of several types

久未见 提交于 2019-12-11 07:46:03
问题 I'm in the situation where I have an Rcpp::XPtr to an Armadillo object (e.g. arma::Mat , which may be a matrix of one of the supported data types). Now I'd like to write a function that queries the number of elements. The best I could come up with so far is the following (inspired by bigstatsr): #define DISPATCH_DATA_TYPE(CALL) \ { \ switch (data_type) \ { \ case 1: CALL(unsigned short) \ case 2: CALL(unsigned int) \ case 3: CALL(unsigned long) \ case 4: CALL(short) \ case 5: CALL(int) \ case