Zero-copy construction of an Eigen SparseMatrix
问题 I have the following problem: I have an Eigen::SparseMatrix I need to send over the network, and my network library only supports sending arrays of primitive types. I can retrieve the pointers to the backing arrays of my SparseMatrix by doing something like (here's the backing object's code): // Get pointers to the indices and values, send data over the network int num_items = sparse_matrix.nonZeros() auto values_ptr = sparse_matrix.data().valuePtr() auto index_ptr = sparse_matrix.data()