Home Construct Sparse Matrix in Matlab from Compressed Sparse Column (CSC) format
Reply: 0

Construct Sparse Matrix in Matlab from Compressed Sparse Column (CSC) format

The_Anomaly
1#
The_Anomaly Published in 2017-03-25 21:00:43Z

I have a large sparse matrix (~5 billion non-zero values) in Python, stored in the csc_matrix format. I need to open it as a sparse matrix in Matlab. savemat apparently cannot save data of this size (seems to be capped at ~5GB), so I am resorting to saving it as an hdf5 file, as detailed here. However, I am having trouble opening it in matlab.

Given these three vectors: data, indices, indptr, whose meaning is explained:

standard CSC representation where the row indices for column i are stored in indices[indptr[i]:indptr[i+1]] and their corresponding values are stored in data[indptr[i]:indptr[i+1]].

How can I construct this matrix in Matlab? I can open these three vectors in Matlab using h5read no problem, but I don't know how to use them to construct the sparse matrix. This is not the format of the sparse command I usually use to construct a sparse matrix.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.352774 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO