|Summary:||SparseMatrix< shared_ptr<X> > is not working (patch attached)|
|Product:||Eigen||Reporter:||Takaki Makino <t-eigen-bugzilla>|
Description Takaki Makino 2013-12-06 16:26:17 UTC
Created attachment 404 [details] Proposed patch file for 3.2.0 When we use a custom Scalar type that require initialization (like std::shared_ptr), the sparse matrix classes do not work correctly. The problem is that some classes in SparseCore use memcpy() and memmove() functions, which breaks the C++ object semantics. I found smart_copy function in Core/Memory.h, which seems currently abandoned, but perfectly suitable for replacing these memcpy()s. As a replacement of memmove(), I make an extension to smart_copy, which detects overlapping region and uses C++11 move semantics if applicable. Attached please find a proposed patch that replaces all memcpy() into smart_copy.
Comment 1 Nobody 2019-12-04 12:51:00 UTC
-- 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/710.