Project Synopsis
- Project: Sparse matrix automatic conversion in RcppArmadillo
- Student: Binxiang Ni
- Mentors: Qiang Kou, Dirk Eddelbuettel and other Rcpp team members
- Organization: R project for Statistical Computing
Project Goals
- Evaluate which types of sparse matrices can be converted.
- Write conversion functions and unit tests for convertible sparse matrices.
- Add warning messages for unconvertible sparse matrices.
- Provide documentation for sparse matrix support in RcppArmadillo.
Fully Merged Pull Requests
The source code of RcppArmadillo is stored in Github. Below are all the merged pull requests committed by me during Google Summer of Code:
- Add support for dtCMatrix and dsCMatrix.
- Add conversion and unit tests for dgT, dtT and dsTMatrix.
- Add conversion and unit tests for dgR, dtR and dsRMatrix.
- Add conversion and unit tests for pMatrix and ddiMatrix.
- Rewrite conversion for dgT, dtT and dsTMatrix, and add file-based tests.
- Add conversion and unit tests for indMatrix.
- Rewrite conversion for ddiMatrix.
- Add a warning message for matrices that cannot be converted.
- Add new vignette for sparse matrix support.
- Add support for sparse matrix conversion from Python SciPy.
Notes and Comments
- When a new function is added, one corresponding unit test should also be accompanied to verify the assertion.
- How to write a unit test for RcppArmadillo.
- About
static_cast
. - The meaning of
.
and the difference between::
and:::
. - Keeping a decent ChangeLog is important.
- Travis CI setup.
- A PR at a time to avoid conflicts.
Merge and squash
.Rebase
andMerge
.- DESCRIPTION file contains all essential information of a package..
- Rcpp uses ‘proxy models’, which may lead to a considerable copying cost when working with
Rcpp::IntegerVector
rather thanstd::vector<int>
. Reason. - Full consideration on types and property of a sparse matrix.
- Mechanism of RUnit.
- Runit requires every unit test covered in a function.
- Close connection after using
textConnection()
- Details in Column Pointer.
- Highlighting.
- Consistent code style.
- Procedures for adding a new R function to RcppArmadillo.
- Ways to check a package
- Difference between
Imports
andSuggests
. is()
for S4 object.- Why Rstudio invokes
Rcpp::compileAttributes()
.
Achievements
Package
The R package version RcppArmadillo 0.7.960.1.1 with enhanced sparse matrix support has been released to CRAN. You can have access to it by install.packages("RcppArmadillo")
in R.
Future
Although the end of GSOC approaches, I will continue to contribute to sparse matrix support in RcppArmadillo in the future. Recently, there will be a new compatibility for COO format in Armadillo, more sparse matrix conversion will be needed on the side of RcppArmadillo.
Moreover, time for me to learn more on sparse matrix algorithms and Rcpp. Hopefully, I can participate in other development or projects on them.