What is the maximum size of matrix in Eigen?
c++, eigen, eigen3
Solution
You're trying to allocate `100000*100000` elements of 8 bytes each, or 80,000,000,000 bytes (74.5GB), which is failing as you only have 16GB of memory. This causes the memory allocation to fail, as it can't find a single continuous block of memory that large.
There is no fixed limit in Eigen, but the array does need to be allocatable on your system.
Problem
In my case (64bit ubuntu with 16GB memory, using Eigen3), I write MatrixXd m(M,M); where M = 100,000, while running, the program crashed, and reported: what(): std::bad_alloc Aborted (core dumped) Using a dynamic 2 dim array, the program works fine. Is there a hard limit on the size of (dense) matrix in Eigen?