I have a sparse matrix saved in a mat file. I want to process it in C++ but my library expects the sparse matrix to be represented as three vectors: colIdx (vector of indices of nonzero columns), rowIdx (vector of indices of nonzero rows), and val (vector of values).
How should I go about this? Are there any built-in commands doing similar operations?