2013-07-06から1日間の記事一覧

基礎的な算術計算など

#include <RcppArmadilloExtensions/sample.h> // [[Rcpp::depends(RcppArmadillo)]] using namespace Rcpp ; // [[Rcpp::export]] NumericVector factorial_num(int n) { NumericVector x(n); x[0] = 1; for(int i=1;i</rcpparmadilloextensions/sample.h>

math.h関連

math.h #include <RcppArmadilloExtensions/sample.h> // [[Rcpp::depends(RcppArmadillo)]] using namespace Rcpp ; // [[Rcpp::export]] NumericVector arith(double a, double b) { NumericVector x(28); x[0] = a+b; x[1] = a-b; x[2] = a*b; x[3] = a/b; x[4] = fmax(a,b); x[5] = round(a</rcpparmadilloextensions/sample.h>…

Rcpp.h,RcppArmadillo.hなど基礎

""はここにあるように、RcppArmadilloでRの乱択ができるように書かれたhファイルだが、その中で#include しているので、RcppArmadillo.hのいろいろも使えている(ここも参考) C:\Users\hogeUserName\Documents\R\win-library\3.0\RcppArmadillo\include\RcppA…