Skip to content
Snippets Groups Projects
Verified Commit 77c8684c authored by Justin Carpentier's avatar Justin Carpentier
Browse files

sparse: fix potential compilation issues with GCC

parent b2f20b04
No related branches found
No related tags found
No related merge requests found
......@@ -144,12 +144,13 @@ void eigen_sparse_matrix_from_py_construct(
StorageIndexVector indptr =
bp::extract<StorageIndexVector>(obj.attr("indptr"));
MapMatOrRefType map(bp::extract<Eigen::Index>(shape[0]),
bp::extract<Eigen::Index>(shape[1]),
bp::extract<Eigen::Index>(obj.attr("nnz")),
indptr.data(), indices.data(), data.data());
const Eigen::Index m = bp::extract<Eigen::Index>(shape[0]),
n = bp::extract<Eigen::Index>(shape[1]),
nnz = bp::extract<Eigen::Index>(obj.attr("nnz"));
MapMatOrRefType sparse_map(m, n, nnz, indptr.data(), indices.data(),
data.data());
new (raw_ptr) MatOrRefType(map);
new (raw_ptr) MatOrRefType(sparse_map);
}
memory->convertible = storage->storage.bytes;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment