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 State University
1579 I Spartan Village, East Lansing, MI 4
") =Z);
}
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
wangh...@msu.edu
___
Rcpp-devel mailing list
Rcpp-devel@lis
}
Anyone could help me with how to increase the efficiency of the coding?
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
wangh.
Inv = arma::trans(D)*W*D;
arma::vec betahat = arma::inv(Inv)*arma::trans(D)*W*y;
arma::colvec betahat0(betahat.begin(),betahat.size()/2,false);
return List::create(Named("betahat") = betahat0);
}
Best wishes!
Honglang Wang
Office C402 Wells Hall
Department of Statistics and Probab
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 no
idea how to reuse the memory. I hope I can have some materials to learn
this.
*W*y;
arma::colvec betahat0(betahat.begin(),betahat.size()/2,false);
return List::create(Named("betahat") = betahat0);
}
Best wishes!
Honglang Wang
Office C402 Wells Hall
Department of Statistics and Probability
Michigan State University
1579 I Spartan Village, East Lansing, MI 48
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. Before I even have not
heard of profiling of a program. Thanks.
Best wishes!
Honglang Wang
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
wangh...@msu.edu
On Thu, Dec 6, 2012 at 1:33 PM, Douglas Bates
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 I Spartan Village, East Lansing, MI 48823
wangh...@msu.edu
On
betahat.size()/2,false);
return List::create(Named("betahat") = betahat0);
}
Best wishes!
Honglang Wang
Office C402 Wells Hall
Department of Statistics and Probability
Michigan State University
1579 I Spartan Village, East Lansing, MI 48823
wangh...@msu.edu
On Thu, Dec 6, 2012 at 2:10 A
7;memory not mapped'
Error in betahat(ker, inv[l], cbind(inv[1:ll], inv[(ll + 1):(2 * ll)]), :
badly formed function expression
Calls: system.time ... apply -> FUN -> betahat -> .External -> cpp_exception
Execution halted
And I really have no idea what is the problem.
Best
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
wangh...@ms
error. I am just wondering whether I need to
free some memory in this code. 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
wangh...@msu.edu
On Thu, Dec 13, 2012 at
separately (since I
set the seed, it used the same data), but it worked well in this case. Then
I really have no idea what is going on there.
Best wishes!
Honglang Wang
Office C402 Wells Hall
Department of Statistics and Probability
Michigan State University
1579 I Spartan Village, East Lansing, MI 48823
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 48823
wangh...@msu.edu
On Thu, Dec 13, 2012 at 10:54
hat -> .External -> cpp_exception
Execution halted
What should I do? Do I have to do like:
arma::colvec betahat0(betahat.begin(),betahat.size()/2,false);
NumericVector betahat00(p);
betahat00 = betahat0;
return List::create(Named("betahat") = betahat00);
Best wishes!
Honglang Wang
Offi
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
wangh...@msu.edu
On Fri, Dec 14, 2012 at 11:04 AM, Romain Francois
wrote:
> I dont know. This looks lik
= Ar.ncol();
arma::mat A(Ar.begin(),n,m,false);
A.reshape(m,n);
arma::mat U(m,1)=f2(A,1, function(x) foo(f=f1,x)$r);
double r = arma::accu(U);
return r;
}
A <- matrix(rnorm(8),nrow=4)
fpp(mean, apply, A)
Anyone can help me out? Thanks a lot?
Best wishes!
Honglang Wang
Office
a=0; a(A.row(a)));
}
double r = arma::accu(U);
return r;
}
### how to deal with the arma object A.row(a) for the input of foo, which
need rcpp object?
A <- matrix(rnorm(8),nrow=4)
fpp(mean,A)
Thanks.
Best wishes!
Honglang Wang
Office C402 Wells Hall
Department of Statistics and Probabil
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 change the type of the input into
arma. Thanks a lot. That's what I want.
Best wishes!
Honglang
20 matches
Mail list logo