Created attachment 947 [details]
GeneralizedSelfAdjointEigenSolver and components it depends on (SelfAdjointEigenSolver, Tridiagonalization and Householder) are dynamically creating temporary objects, even when the constructor with memory preallocation is used.
Source code with repro case is attached.
Created attachment 948 [details]
Adding preallocations in GeneralizedSelfAdjointEigenSolver
Here's a patch for the top level component to get the ball rolling.
GeneralizedSelfAdjointEigenSolver supports 3 types of eigenproblems, and they have different memory requirements. This patch preallocates the LLT object and the matC matrix. This meets all the preallocation requirements for eigenproblem Ax_lBx.
Eigenproblems ABx_lx and BAx_lx involve an additional triple matrix product L'*A*L which requires a temporary matrix. The patch doesn't preallocate this temporary, since I don't know what Eigen's memory usage policy/philosophy is. If we preallocate the temporary yet the user only cares about Ax_lBx, then we're wasting memory. The user might care if they're working with huge matrices.
-- GitLab Migration Automatic Message --
This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity.
You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/1739.