Created attachment 485 [details]
Use matching desctructor
While searching for a bug, valgrind discovered some discrepancies in the unsupported ArpackGeneralizedSelfAdjointEigenSolver module. A memory allocation by new was freed by calling delete.
Enclosed please find a version using new and delete.
Using new and delete as suggested is not exception-safe (delete instead of delete is entirely wrong, of course). I would suggest replacing all news by ei_declare_aligned_stack_constructed_variable (this falls back to an automatically destructed malloc for arrays above EIGEN_STACK_ALLOCATION_LIMIT). This should be more efficient and safely avoid memory leaks.
It would be nice to have some unit-tests for ArpackSupport.
I have fixed this and a few other things in my branch at https://bitbucket.org/garrison/eigen-arpack/commits/branch/arpack
This branch includes a couple other fixes as well -- see bug #230, where I initially posted some of these changes.
Feel free to pull this branch any time. I also plan to continue working on it to make the Arpack wrapper support complex matrices as well (which I will follow up on in bug #230).
-- 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/858.