繁体   English   中英

当稀疏矩阵变得太大时,通过 Eigen 的 Cholmod 失败(Int 溢出错误)

[英]Cholmod via Eigen fails when sparse matrix becomes too large (Int Overflow error)

我正在尝试在基于 Eigen 库 c++ 的项目中使用 Cholmod 超节点求解器求解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 索引溢出但我不知道如何修复它,我尝试了更小的矩阵并且效果很好。 我还尝试将_StorageIndexint更改为 Eigen 定义( Eigen::SparseMatrix<double,0,long int > SPaMtr long int中稀疏矩阵 A 的 long int,但我有这个编译错误: cannot convert argument 3 from 'const long *' to 'const int *'

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM