当稀疏矩阵变得太大(Int Overflow错误)时,通过特征的Cholmod失败



我正试图在基于Eigen库c++的项目中使用Cholmod超节点解算器求解Ax=b(我通过Eigen调用Cholmod(,A是一个尺寸为5Mx5M的稀疏矩阵,我在运行时出现以下错误:

CHOLMOD error: problem too large. file: C:suitesparseSuiteSparseCHOLMODInclude../Supernodal/cholmod_super_symbolic.c line: 683
CHOLMOD error: argument missing. file: C:suitesparseSuiteSparseCHOLMODInclude../Cholesky/cholmod_factorize.c line: 121

这是文件cholmod_super_symbolic.c line: 683中cholmod源代码的一部分,我认为第二个错误是由第一个错误引起的。

if (ssize < 0 ||(find_xsize && xxsize > Int_max))
{
/* Int overflow, clear workspace and return.
QR factorization will not use xxsize, so that error is ignored.
For Cholesky factorization, however, memory of space xxsize
will be allocated, so this is a failure.  Both QR and Cholesky
fail if ssize overflows. */
ERROR (CHOLMOD_TOO_LARGE, "problem too large") ;
FREE_WORKSPACE ;
return (FALSE) ;
}

我想可能是因为int索引溢出,但我不知道如何修复它,我尝试过更小的矩阵,效果很好。此外,我还试图将特征定义(Eigen::SparseMatrix<double,0,long int > SPaMtr(中稀疏矩阵A的_StorageIndexint改为long int,但我有一个复杂的错误:cannot convert argument 3 from 'const long *' to 'const int *'

我在求解30Mx30M线性系统时遇到了同样的问题。我根据你的解释来解决这个问题。首先,你应该检查一下内存是否足够。然后,您可以转换索引存储的类型,如SparseMatrix<double,ColMajor,long-int>对于程序中的每个稀疏矩阵。

最新更新