C++ 犰狳princomp内存不足
我试图使用犰狳库的C++ 犰狳princomp内存不足,c++,out-of-memory,pca,armadillo,C++,Out Of Memory,Pca,Armadillo,我试图使用犰狳库的princomp函数从fmat矩阵m(67584 x 396)中提取PCA成分。 代码如下: fmat eigenVec, score; fvec eigenVal, t; princomp(eigenVec, score, eigenVal, t, trans(m)); 我得到这个错误: error: arma::memory::acquire(): out of memory terminate called after throwing an instance of
princomp
函数从fmat
矩阵m
(67584 x 396)中提取PCA成分。
代码如下:
fmat eigenVec, score;
fvec eigenVal, t;
princomp(eigenVec, score, eigenVal, t, trans(m));
我得到这个错误:
error: arma::memory::acquire(): out of memory
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
然而,在代码的其他部分,我管理比这个更大的矩阵(m
)
我在Debian上运行这段代码,8GB内存
编辑:我有这个错误
error: Mat::init(): requested size is too large
terminate called after throwing an instance of 'std::logic_error'
what(): Mat::init(): requested size is too large
之前,我修改了config.hpp文件来解析(如中所示)