I would like to store and operate over arrays of matrices (or pointers to them), which could be either arma::mat
or arma::sp_mat
of varying dimensions (passed from R via Rcpp). What would be the easiest way to achieve this? For example, given the extent of shared operations between the two types, perhaps there is already a parent class that arma::mat
& arma::sp_mat
derive from? That would allow me to derive pointers to the different matrices and populate my array with. Thank you!
Edit: Would simply using Rcpp::List suffice? Can it handle both arma::mat & arma::sp_mat?