Skip to content

Commit

Permalink
[bug] Fix mmwrite format. (#8292)
Browse files Browse the repository at this point in the history
Issue: #

### Brief Summary

There is an extra white space in the current `mmwrite()` method, which causes reading errors:

![image](https://github.com/taichi-dev/taichi/assets/2747993/1c7423f8-638e-401b-9c7b-4723e3e8fef0)

This PR removes this white space.
  • Loading branch information
houkensjtu authored Jul 20, 2023
1 parent 0ecd0ad commit 772199e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion taichi/program/sparse_matrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ const std::string EigenSparseMatrix<EigenMatrix>::to_string() const {
template <class EigenMatrix>
void EigenSparseMatrix<EigenMatrix>::mmwrite(const std::string &filename) {
std::ofstream file(filename);
file << "%%MatrixMarket matrix coordinate real general\n %" << std::endl;
file << "%%MatrixMarket matrix coordinate real general\n%" << std::endl;
file << matrix_.rows() << " " << matrix_.cols() << " " << matrix_.nonZeros()
<< std::endl;
for (int k = 0; k < matrix_.outerSize(); ++k) {
Expand Down

0 comments on commit 772199e

Please sign in to comment.