rcpp

    0熱度

    1回答

    在Windows機器上使用RCPP和RStudio/RTools,我創建了批處理地理編碼NYC地址的軟件包。該軟件包使用免費的NYC DCP Geosupport地理編碼軟件的DLL和C頭文件。我很樂意分享我的軟件包,但遇到Makevars/Makevars.win文件中的路徑時遇到了障礙。因爲我是我自己的機器上運行此,我已經定位出地理編碼軟件安裝在我的機器上,並使用這些信息爲我Makevars/

    0熱度

    1回答

    當我想下面的代碼CPP #include <Rcpp.h> using namespace Rcpp; // [[Rcpp::export]] void print_mat(double *Mat, int nbLig, int nbCol) { int i, j; for (i = 0; i < nbLig; i++) { for (j = 0; j < nbCo

    1熱度

    1回答

    設置(我使用分佈式R中的水蟒): g++ (Ubuntu 5.4.0-6ubuntu1~16.04.2) 5.4.0 20160609 R version 3.3.1 (2016-06-21) -- "Bug in Your Hair" Rcpp -- 0.12.5 小例子: library(Rcpp) evalCpp("1+1") 錯誤: Error in dyn.load("/t

    3熱度

    2回答

    使用含有具有C一個.cpp文件中RCPP包的Rcpp.package.skeleton函數I已經創建了一個包++函數返回0: #include <Rcpp.h> using namespace Rcpp; // [[Rcpp::export]] RcppExport SEXP just_zero() { BEGIN_RCPP Rcpp::RNGScope __rngScope

    0熱度

    1回答

    我有以下CPP功能,並希望把它寫R中 我用RCPP包來編譯和使用,但發生 事實上,一些錯誤我有使用問題R中的指針 void creationPI(double *distC, int mC, int tailleC, double *PIC,int aC) //distC: distribution de X ; mC= smax-smin+1 ie u+v+1; tailleC=a+

    -1熱度

    2回答

    我試圖安裝RcppGSL作爲在逃避這個庫中的鏈接上面介紹到C後 Linking GSL library to RcppGSL on Windows machine 介紹:在64升/ local323 和移動的所有文件一個目錄放入鏈接中顯示的LIB_GSL/lib中。我使用了下面的代碼。 library(Rcpp) Sys.setenv("LIB_GSL" = "C:/local323") # t

    -1熱度

    1回答

    在下面的代碼中,我試圖從正態分佈中生成一個值爲NumericVector的值,其中每次調用rnorm()時每次都有不同的均值和方差。 下面是代碼: // [[Rcpp::export]] NumericVector generate_ai(NumericVector log_var) { int log_var_length = log_var.size(); Numer

    1熱度

    2回答

    我想創建一個整數索引序列的矩陣。該R掛件是: indexRow <- max(0,1):min(2,12) matrix1[indexRow, ] 這是我在Rcpp試圖創建整數序列: #include <Rcpp.h> #include <algorithm> #include <vector> #include <numeric> using namespace Rcpp; us

    -2熱度

    1回答

    我正在閱讀Dirk's notes,因爲我試圖找到將稀疏矩陣傳遞給Rcpp函數的解決方案。我的稀疏矩陣只包含一和零,所以我試圖以該sp_mat對象轉換爲sp_imat對象如下: arma::sp_imat toSpMat(Rcpp::S4 mat){ Rcpp::IntegerVector dims = mat.slot("Dim"); arma::urowvec i = R

    0熱度

    1回答

    我正在嘗試在OSX El Capitain中從C++源文件創建一個dylib文件,以通過Rcpp讀入R。下面是我所創建的一個非常簡化的例子: //test.cpp #include <Rcpp.h> RcppExport SEXP dosum(SEXP _a, SEXP _b){ double a = Rcpp::as<double>(_a); double b = Rc