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 wrote
On 6 December 2012 at 12:33, Douglas Bates wrote:
| // [[Rcpp::depends(RcppEigen)]]
| #include
|
| typedef Eigen::MatrixXd Mat;
| typedef Eigen::MapMMat;
| typedef Eigen::HouseholderQRQR;
| typedef Eigen::VectorXd Vec;
| typedef Eigen::Map
I don't know as much about Armadillo as I do about Eigen so I will cheat
and write using RcppEigen instead of RcppArmadillo. Page 6 of the Eigen
tutorial at http://eigen.tuxfamily.org/dox/ discusses decompositions and
solving linear systems of equations. One of the simplest ways of solving a
weig
Le 06/12/12 05:57, Robert A'gata a écrit :
Hi,
I am not sure what I am missing. Any help would be greatly appreciated.
I have the following code:
// myList will have column called "a"
Rcpp::List myList = someInputList;
Rcpp::NumericVector test = Rcpp::as(myList["a"]);
/* up to the above line,
> /* up to the above line, everything compiles.
> Now I want to get a double out from first element of test.*/
>
> double test0 = Rcpp::as(test[0]);
Does this work?
double test0 = test[0];
In general, including a self-contained minimal example helps.
sourceRcpp() makes this trivial.
-Christian
-
On 5 December 2012 at 23:57, Robert A'gata wrote:
| Hi,
|
| I am not sure what I am missing. Any help would be greatly appreciated. I have
| the following code:
|
| // myList will have column called "a"
| Rcpp::List myList = someInputList;
| Rcpp::NumericVector test = Rcpp::as(myList["a"]);
|
|