Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading in sparse matrix #50

Open
mannickutd opened this issue Jun 27, 2021 · 1 comment
Open

Reading in sparse matrix #50

mannickutd opened this issue Jun 27, 2021 · 1 comment
Assignees

Comments

@mannickutd
Copy link

Is there an example of how to read in a sparse matrix stored in a .mat file?

@S-Dafarra
Copy link
Member

Hi @mannickutd, thank you for opening the issue. Indeed, dealing with sparse matrices is something I missed.

For the moment, you can read any variable (even sparse ones) with the read method. The output is a Variable, that is basically an interface to a matvar_t variable. You can get this underline variable with the toMatio method and then use its interface (see https://github.com/tbeu/matio/blob/master/src/matio.h) to access the data. Clearly, this would force you to use the C interface instead.

For a long-term solution instead, it would be better to have a proper C++ interface. This is currently missing. The implementation shares similar difficulties as those needed to deal with complex variables (see #5), so this could take some time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants