This bugzilla service is closed. All entries have been migrated to
Bug 710 - SparseMatrix< shared_ptr<X> > is not working (patch attached)
Summary: SparseMatrix< shared_ptr<X> > is not working (patch attached)
Status: NEW
Alias: None
Product: Eigen
Classification: Unclassified
Component: Sparse (show other bugs)
Version: 3.2
Hardware: All All
: Normal Unknown
Assignee: Nobody
Depends on:
Reported: 2013-12-06 16:26 UTC by Takaki Makino
Modified: 2019-12-04 12:51 UTC (History)
0 users

Proposed patch file for 3.2.0 (8.00 KB, text/plain)
2013-12-06 16:26 UTC, Takaki Makino
no flags Details

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'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:

Note You need to log in before you can comment on or make changes to this bug.