How large matrix can be fit into Eigen library? [closed]

拈花ヽ惹草 提交于 2020-03-21 05:59:17

问题


I am working on large scale data like 300000 x 300000 matrix currently may interest. It is really hard to process in matlab due to "Out of memory" error so I decide to use EIGEN. Is there any restriciton for eigen in the matrix size?


回答1:


The dense matrices in EIGEN are stored in a contiguous block of memory, which cannot exceed 2 GB in 32-bit application, so if you're running a 32-bit application, the allocation will start to crash for matrices half this size, that is to say around 10,000x10,000. See for example this duplicated question.

The same issue will happen with other libraries, since you're bounded by your RAM, not by the library.

Yet, if your big matrix has a vast majority of 0 in it, you can resort to SparseMatrix.

If your matrix isn't sparse, then you may store it on disk, but you'll get terrible performance when manipulating it.



来源:https://stackoverflow.com/questions/18407059/how-large-matrix-can-be-fit-into-eigen-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!