<div dir="ltr"><div><div>Sure. What are you planning to do with ARPACK? It seems that the newest version of Armadillo already supports eigs_sym() and eigs_gen() to retrieve a limited number of eigenvalues.<br><br><br></div>
Best,<br></div>Yixuan<br><div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-02-03 Dirk Eddelbuettel <span dir="ltr"><<a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="im"><br>
On 3 February 2014 at 18:09, Yixuan Qiu wrote:<br>
| A pretty nice feature of Eigen is that it allows you to map an existing memory<br>
| address to an Eigen object, so the data stored in R can be directly reused by<br>
| Eigen. This may be the key point if we want to avoid copying data from R to<br>
| Eigen/Armadillo. Dirk, does Armadillo has such kind of constructor to receive a<br>
| pointer as input to initialize a vector or matrix?<br>
<br>
</div>Yes, and we've been using it for years. And documented it as such. For<br>
details, see Conrad's docs, eg <a href="http://arma.sourceforge.net/docs.html#Mat" target="_blank">http://arma.sourceforge.net/docs.html#Mat</a> and<br>
look at 'Advanced Constructors'.<br>
<div class="im"><br>
| Currently RcppEigen supports direct conversion from dgCMatrix, the<br>
| column-oriented sparse matrix class in the Matrix package. After you finish the<br>
| conversion, you can make use of all the fancy stuffs on sparse matrices<br>
| provided by Eigen, including basic arithmetic operations, linear algebra<br>
| solvers and matrix factorizations. It really helped me a lot when developing<br>
| rARPACK. Thank you Doug and Dirk. :-)<br>
<br>
</div>Thank you for rARPACK!<br>
<br>
I'll need to talk to you once Conrad exposes more code and we need eigs etc.<br>
We can possibly deploy that in RcppArmadillo. Maybe we'll need to factor out<br>
the basic ARPACK parts to be used by rARPACK and us. Or some other scheme.<br>
Suggestions welcome :)<br>
<br>
Cheers, Dirk<br>
<div class=""><div class="h5"><br>
<br>
| Best,<br>
| Yixuan<br>
|<br>
|<br>
|<br>
| 2014-02-03 Dirk Eddelbuettel <<a href="mailto:edd@debian.org">edd@debian.org</a>>:<br>
|<br>
|<br>
| On 3 February 2014 at 12:59, Douglas Bates wrote:<br>
| | On Mon, Feb 3, 2014 at 11:48 AM, Dirk Eddelbuettel <<a href="mailto:edd@debian.org">edd@debian.org</a>><br>
| wrote:<br>
| |<br>
| |<br>
| | On 3 February 2014 at 10:23, French, Joshua wrote:<br>
| | | Soren and Doug,<br>
| | |<br>
| | | Thanks for the info about the sparse matrices. I'll give it a<br>
| go and<br>
| | seen what<br>
| | | happens. If it works out, then perhaps I'll be able to provide<br>
| a nice<br>
| | | RcppGallery example.<br>
| |<br>
| | Yes -- there isn't much yet in RcppArmadillo but this is expected<br>
| to<br>
| | grow. And CRAN now has rARPACK so we get cheaply to the object code<br>
| too.<br>
| |<br>
| | One last comment I should have made earlier: "dense" data from R<br>
| comes over<br>
| | cheaply as a SEXP; "sparse" will always require a copy. Keep that<br>
| in<br>
| | mind,<br>
| | and on the margin don't believe anything any of us say but keep<br>
| profiling<br>
| | and<br>
| | measuring :)<br>
| |<br>
| |<br>
| | Not really. RcppEigen offers conversion of SEXPs to Eigen::SparseMatrix<br>
| and<br>
| | Eigen::MappedSparseMatrix types. The second uses the storage from R<br>
| without<br>
| | copying and hence should generally be declared with the const modifier.<br>
|<br>
| Oooops. My bad.<br>
|<br>
| I guess I generalized from my less performing converters contributed to<br>
| RcppArmadillo. Time permitting, maybe I should have another look at<br>
| RcppEigen<br>
| and see if I can do better for RcppArmadillo.<br>
|<br>
| | I think that wonderful vignetter by Bates and Eddelbuettel describes this<br>
| :-)<br>
|<br>
| :-)<br>
|<br>
| Dirk<br>
|<br>
| --<br>
| Dirk Eddelbuettel | <a href="mailto:edd@debian.org">edd@debian.org</a> | <a href="http://dirk.eddelbuettel.com" target="_blank">http://dirk.eddelbuettel.com</a><br>
| _______________________________________________<br>
| Rcpp-devel mailing list<br>
| <a href="mailto:Rcpp-devel@lists.r-forge.r-project.org">Rcpp-devel@lists.r-forge.r-project.org</a><br>
| <a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a><br>
|<br>
|<br>
|<br>
|<br>
| --<br>
| Yixuan Qiu <<a href="mailto:yixuan.qiu@cos.name">yixuan.qiu@cos.name</a>><br>
| Department of Statistics,<br>
| Purdue University<br>
<br>
--<br>
Dirk Eddelbuettel | <a href="mailto:edd@debian.org">edd@debian.org</a> | <a href="http://dirk.eddelbuettel.com" target="_blank">http://dirk.eddelbuettel.com</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Yixuan Qiu <<a href="mailto:yixuan.qiu@cos.name" target="_blank">yixuan.qiu@cos.name</a>><br>Department of Statistics,<br>Purdue University<br>
</div></div></div></div></div>