Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Rcpp provides an API on top of R, permitting direct interchange of rich R objects between R and C++.
1
vote
1
answer
93
views
The average amount of time required to travel between two points in a torus-like space
Please, note that the second function is then used in R through Rcpp R package. … #include <Rcpp.h>
using namespace Rcpp;
using namespace std;
double sumAll(double i, double j, int a, int b, double coeff) {
double pi = 2 * acos(0.0);
double total = 0;
int half_a = a / 2; …
3
votes
1
answer
284
views
Implementation of Multidimensional numerical integration in C++ and R
Below there is my code:
// [[Rcpp::depends(RcppEigen)]]
// [[Rcpp::depends(RcppNumerical)]]
#define EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
#include <Eigen/Eigen>
#include <Rcpp.h>
#include <math.h> … ;
// [[Rcpp::depends(BH)]]
// [[Rcpp::export]]
double gaussian_free_diffusion(double x,double x0, double sigma, double t) {
double pi = 2 * acos(0.0);
double a1 = (1/sqrt(2.0 * pi * sigma * t)); …
3
votes
1
answer
117
views
Performing tasks on for-loop over thousands of items in Rcpp
I decided to go for c++ via Rcpp. … ::String res = collapse(tmp_path_data);
//Read file as DataFrame
Rcpp::DataFrame data_df = read_t(Named("file")=res);
//Extract column "name1" from DataFrame "data_df"
Rcpp::NumericVector …