我正在尝试使用基于特征库c++的项目中的Cholmod supernodal求解器来求解Ax=b
(我通过Eigen调用cholmod ),A
是一个维度为5Mx5M的稀疏矩阵,我在运行时遇到了以下错误:
CHOLMOD error: problem too large. file: C:\suitesparse\SuiteSparse\CHOLMOD\Include\../Supernodal/cholmod_super_symbolic.c line: 683
CHOLMOD error: argument missing. file: C:\suitesparse\SuiteSparse\CHOLMOD\Include\../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的_StorageIndex
从int
更改为long int
,但出现了这个编译错误:cannot convert argument 3 from 'const long *' to 'const int *'
。
发布于 2021-07-23 09:46:07
当我解决一个30Mx30M的线性系统时,我遇到了同样的问题。我根据你的解释解决了这个问题。首先,你应该检查内存是否足够。然后,您可以为程序中的每个稀疏矩阵转换索引存储的类型,如SparseMatrix。
https://stackoverflow.com/questions/67604190
复制相似问题