I saved a scipy sparse csr matrix in a .npz file thanks to the save_sparse_csr(filename,array) given in this link:
Save / load scipy sparse csr_matrix in portable data format
So, I obtained an .npz archive Matrix.npz which contains data.npy, indices.npy, indptr.npy, shape.npy files.
However I am trying to load with these files the initial sparse matrix in C++. Unfortunately I am a beginner in C++ and I don't know how to do it. I found a library which reads .npz and .npy files in C++ in that link : https://github.com/rogersce/cnpy
I loaded the four arrays mentioned above in this code:
cnpy::NpyArray d = cnpy::npz_load("Matrix.npz","data");
cnpy::NpyArray ind = cnpy::npz_load("Matrix.npz","indices");
cnpy::NpyArray indptr = cnpy::npz_load("Matrix.npz","indptr");
cnpy::NpyArray sh = cnpy::npz_load("Matrix.npz","shape");
Any help? Thanks.