0

我正在尝试Ax=b在基于 Eigen libary c++ 的项目中使用 Cholmod 超节点求解器求解(我通过 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 源代码的一部分,cholmod_super_symbolic.c line: 683我认为第二个错误是由于第一个错误。

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 索引溢出但我不知道如何修复它,我尝试过更小的矩阵并且效果很好。我也试图改变特征定义()中稀疏矩阵A的_StorageIndexint到,但我有这个编译错误:.long intEigen::SparseMatrix<double,0,long int > SPaMtrcannot convert argument 3 from 'const long *' to 'const int *'

4

1 回答 1

0

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

于 2021-07-23T01:46:06.853 回答