Search Archives
Search tips
from:Name
Search by author name, e.g. from:Duncan Murdoch
"exact phrase"
Match an exact phrase
word1 word2
Match messages containing both words
Date range
Use the date pickers to filter results to a time period
Use the list dropdown to narrow results to a specific mailing list. Combine from: with other terms to filter by author and content.
Dear All, How to free memory in Rcpp? What's the command? Thanks. Best wishes! Honglang Wang Office C402 Wells Hall Department of Statistics and Probability Michigan State University 1579 I Spartan Village, East Lansing, MI 48823 wangho16 at msu...
Dear All, I am new to Rcpp. If I want to do the similar thing as "cbind" in R, what should I do in RcppArmadillo? Thanks. Best wishes! Honglang Wang Office C402 Wells Hall Department of Statistics and Probability Michigan...
Dear All, Why the following code is not working: // [[Rcpp::depends(RcppArmadillo)]] #include <Rcpp.h> #include <RcppArmadillo.h> using namespace Rcpp; // [[Rcpp::depends(RcppArmadillo)]] #include <RcppArmadillo.h> // [[Rcpp::export]] List test(NumericVector yr, NumericMatrix Xr) { int n = Xr.nrow(), k...
Dear All, I have tried out the first example by using RcppArmadillo, but I am not sure whether the code is efficient or not. And I did the comparison of the computation time. 1) R code using for loop in...
And actually, i got three different types of errors: 1)Error in betahat(ker, inv[l], cbind(inv[1:ll], inv[(ll + 1):(2 * ll)]), : unused argument(s) (n = 1) Calls: system.time ... apply -> FUN -> betahat -> .External -> cpp_exception Execution...
Thanks, Romain. Best wishes! Honglang Wang Office C402 Wells Hall Department of Statistics and Probability Michigan State University 1579 I Spartan Village, East Lansing, MI 48823 wangho16 at msu.edu On Fri, Dec 14, 2012 at 11:04 AM, Romain...
Thanks Douglas, I will study your code and Eigen carefully. Best wishes! Honglang Wang Office C402 Wells Hall Department of Statistics and Probability Michigan State University 1579 I Spartan Village, East Lansing, MI 48823 wangho16 at msu.edu On Thu...
Dear All, I have a problem, maybe that's trivial to you, but it's really bothering me. How to transfer rama objects and rcpp objects easily? A simple test code is the following: // [[Rcpp::depends(RcppArmadillo)]] #include <RcppArmadillo.h...
I tried out that if the dim of the matrix less than or equal to 4, inv() and solve() have the same speed. Best wishes! Honglang Wang Office C402 Wells Hall Department of Statistics and Probability Michigan State University 1579...
Thanks, Kevin. Your last comment saves me a day, lol. Since I do not know how to learn Rcpp effectively, there is no big pic of Rcpp in my mind. This is the first time I know that we could...
Thanks, I am sorry I did not make my point clear. Let me describe it clearly: 1) The first question is about using "apply": // [[Rcpp::depends(RcppArmadillo)]] #include <RcppArmadillo.h> using namespace Rcpp; // [[Rcpp::export]] List foo(NumericVector x, double...
I am sorry. I think you are right. I know little about computation. And it will be great that you write what you would like to wrote to explain to me. I am really learning a lot from this discussion...
Since the "ker" function defined in R is very simple and vectorized, I thought it was fine to call this function in C++. And I tried to code this function inside C++, and I found it became ever slower: from...
Yes, the main issue for my coding is the allocation of memory. And I have fixed one of the biggest memory allocation issue: 4000 by 4000 diagonal matrix. And since I am not familiar with Rcpp and RcppArmadillo, I have...
I am sorry that I was abusing this list. My point is 1) First, this code works for me for some simulation cases. I repeated the simulation 1000 times, which then called this Rcpp function 1000 times at least. And...
Hi Yan, Thanks a lot. Your advice is really the point for me. Have a good night. Best wishes! Honglang Wang Office C402 Wells Hall Department of Statistics and Probability Michigan State University 1579 I Spartan Village, East Lansing, MI...
Hi Romain, Thanks very much. I tried your method. And now the old error has gone, which is really good for me. But a new error is : Error in betahat(ker, x, X, y, t, h, m) : (list) object cannot...
The following is a full example although I don't know whether it's minimal or not: library(Rcpp) library(RcppArmadillo) sourceCpp("betahat_mod.cpp") #The following is data generation. n=200 m=20 p=2 t=runif(m*n...
Hi, Here is the sample code: // [[Rcpp::export]] List betahat(Function ker, double t0, NumericMatrix Xr, NumericMatrix yr, NumericVector tr, double h, int m) { int n = Xr.nrow(), p = Xr.ncol(); arma::mat X(Xr.begin(), n, p, false); arma...
Dear All, I have modified the code as following. Since I found the old code had the memory allocation issue, I calculated each term of the matrix with dim 4. The speed is pretty much good now. But since I...
Can't find what you're looking for? Try searching with Google .