我使用Rcpp(尤其是Rcpp Armadillo)执行一个方法,该方法返回几个大矩阵,例如大小为10000*10000的矩阵。如何保存这些矩阵以在R环境中使用它们。假设我在Rcpp中的代码如下所示:
list Output (20000);
for( int i(0);i<20000;++1 ){
...
...
// Suppose that the previous lines allow me to compute a matrix Gi of size 10000*10000
Output(i)=Gi;
}
return Output;
我编程的方式非常昂贵,需要足够的内存。但我需要20000矩阵来计算R环境中的估计量。如何保存矩阵?我不知道bigmatrix软件包是否可以帮助我。
最好的