Skip to content

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.

20 results for “from:Honglang Wang”

[Rcpp-devel] How to free memory in Rcpp
Honglang Wang · Dec 13, 2012 · rcpp-devel

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...

[Rcpp-devel] cbind
Honglang Wang · Dec 2, 2012 · rcpp-devel

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...

[Rcpp-devel] Why this is not working
Honglang Wang · Dec 3, 2012 · rcpp-devel

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...

[Rcpp-devel] How to increase the coding efficiency
Honglang Wang · Dec 4, 2012 · rcpp-devel

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...

[Rcpp-devel] How to increase the coding efficiency
Honglang Wang · Dec 12, 2012 · rcpp-devel

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...

[Rcpp-devel] How to free memory in Rcpp
Honglang Wang · Dec 14, 2012 · rcpp-devel

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...

[Rcpp-devel] How to increase the coding efficiency
Honglang Wang · Dec 6, 2012 · rcpp-devel

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...

[Rcpp-devel] Connection between arma and rcpp
Honglang Wang · Jan 29, 2013 · rcpp-devel

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...

[Rcpp-devel] How to increase the coding efficiency
Honglang Wang · Dec 11, 2012 · rcpp-devel

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...

[Rcpp-devel] Connection between arma and rcpp
Honglang Wang · Jan 29, 2013 · rcpp-devel

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...

[Rcpp-devel] Connection between arma and rcpp
Honglang Wang · Jan 29, 2013 · rcpp-devel

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...

[Rcpp-devel] How to increase the coding efficiency
Honglang Wang · Dec 5, 2012 · rcpp-devel

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...

[Rcpp-devel] How to increase the coding efficiency
Honglang Wang · Dec 4, 2012 · rcpp-devel

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...

[Rcpp-devel] How to increase the coding efficiency
Honglang Wang · Dec 4, 2012 · rcpp-devel

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...

[Rcpp-devel] How to free memory in Rcpp
Honglang Wang · Dec 13, 2012 · rcpp-devel

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...

[Rcpp-devel] How to free memory in Rcpp
Honglang Wang · Dec 13, 2012 · rcpp-devel

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...

[Rcpp-devel] How to free memory in Rcpp
Honglang Wang · Dec 14, 2012 · rcpp-devel

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...

[Rcpp-devel] How to increase the coding efficiency
Honglang Wang · Dec 5, 2012 · rcpp-devel

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...

[Rcpp-devel] How to free memory in Rcpp
Honglang Wang · Dec 13, 2012 · rcpp-devel

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...

[Rcpp-devel] How to increase the coding efficiency
Honglang Wang · Dec 11, 2012 · rcpp-devel

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 .