-
Notifications
You must be signed in to change notification settings - Fork 64
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
[DAPHNE-#822] Added MatrixMarket write support #832
base: main
Are you sure you want to change the base?
Conversation
ldirry
commented
Sep 25, 2024
- Write support for CSRMatrix in coordinate system
- Write support for DenseMatrix in array format
- Support for recognizing symmetric, skew-symmetric matrices, and storing them accordingly in .mtx
- Added testcases, calling readMM, then writeMM and then comparing if the files are still the same
9714923
to
bfa0a93
Compare
- Write support for CSRMatrix in coordinate system - Write support for DenseMatrix in array format - Support for recognizing symmetric, skew-symmetric matrices, and storing them accordingly in .mtx - Added testcases, calling readMM, then writeMM and then comparing if the files are still the same
bfa0a93
to
e199dcc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally, this is looking good. Maybe in addition to the things I mentioned in the inline comments to the code, you could separate your code into header and cpp file?
src/runtime/local/io/WriteMM.h
Outdated
for (size_t j = 0; j < rows; ++j) { | ||
size_t idx = j * cols + i; | ||
if (strcmp(field, MM_REAL_STR) == 0) | ||
f << std::scientific << std::setprecision(13) << values[idx] << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this value be a candidate for an item in our user configuration?
src/runtime/local/io/WriteMM.h
Outdated
if (strcmp(symmetry, MM_GENERAL_STR) == 0) { | ||
nnz = arg->getNumNonZeros(); | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I don't fully understand why the computation above is needed if you return getNumNonZeros or fail.
test/api/cli/io/WriteTest.cpp
Outdated
#include <string> | ||
|
||
const std::string dirPath = "test/api/cli/io/"; | ||
const std::string dirPath2 = "test/runtime/local/io/"; | ||
|
||
bool compareFiles(const std::string &filePath1, const std::string &filePath2) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this one could go into Utils.h? Ideally with a documenting comment (doxygen format) above the function signature ;-)
6e43df2
to
7e7b4fe
Compare
7e7b4fe
to
c150a45
Compare