1

I have

 Eigen::MatrixXd noise(61, 400000);
 // I populate the noise matrix
 Eigen::MatrixXd chol(61, 61);
 // I populate the chol matrix
 Eigen::MatrixXd corr_noise(61, 400000); 
 // i define the corr_noise matrix as above and 
 // then try to perform the matrix multiplication as below   
 corr_noise = chol * noise;

I get a bad allocation error.

The computation works if the size of the matrix is smaller say 61 x 5000.

I have 16 GB ram installed and when I see the the memory used in the task manager I see the memory is well below the maximum allowed.

Can someone please give me some pointer as to what is going wrong ?

Thanks in advance.

valiano
  • 16,433
  • 7
  • 64
  • 79
user1612986
  • 1,373
  • 3
  • 22
  • 38
  • Your numbers aren't this big but http://stackoverflow.com/questions/33365043/c-bad-allocation-when-matrix-size-exceeds-a-certain-limit-with-eigen-matrix-ty (i.e. try a 64-bit build) or possibly look itno aliasing: http://stackoverflow.com/questions/24259998/no-copy-multiplication-in-eigen – doctorlove Feb 28 '17 at 16:23
  • Works fine for me, even with a 32 bits build. Writing `corr_noise.noalias() = chol * noise` will save you a 186MB temporary, but that cannot explain your issue. – ggael Feb 28 '17 at 21:55

0 Answers0