[Rcpp-devel] [RcppArmadillo] Result of Rcpp Wrap() for Sparse Matrix
Dirk Eddelbuettel
edd at debian.org
Wed Jun 14 16:01:30 CEST 2017
On 14 June 2017 at 11:00, Serguei Sokol wrote:
| Le 13/06/2017 à 18:24, Douglas Bates a écrit :
| > On Tue, Jun 13, 2017 at 10:56 AM Binxiang Ni <binxiangni at gmail.com <mailto:binxiangni at gmail.com>> wrote:
| >
| > Hi,
| >
| > I am working on fixing sparse matrix conversion for RcppArmadillo. Now a problem comes up to me: what kind of sparse matrix is expected to pass from
| > Armadillo to R? That is, what should the result of wrap() be? dgCMatrix(if logical, lgCMatrix or ngCMatrix) or their original type?
| >
| >
| > What do you mean by "their original type"?
| >
| > It seems that the correspondence is
| > Armadillo Matrix package
| > sp_mat <=> dgCMatrix
| > sp_cx_mat <=> zgCMatrix
| > sp_imat <=> igCMatrix
| I would also consider the format used in a package slam.
| It simply stores the indexes and non-zero values in a triplet (i,j,v).
There is more here: https://en.wikipedia.org/wiki/Sparse_matrix
But it would probably be good to hear from some actual users of sparse
matrices such as Doug (thanks for piping in already!), Soren or anybody else
with exposure to sparse matrices, ideally via CRAN packages we can wire up
for testing.
Dirk
--
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
More information about the Rcpp-devel
mailing list