Skip to content

Commit 772199e

Browse files
authored
[bug] Fix mmwrite format. (#8292)
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.
1 parent 0ecd0ad commit 772199e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

taichi/program/sparse_matrix.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ const std::string EigenSparseMatrix<EigenMatrix>::to_string() const {
271271
template <class EigenMatrix>
272272
void EigenSparseMatrix<EigenMatrix>::mmwrite(const std::string &filename) {
273273
std::ofstream file(filename);
274-
file << "%%MatrixMarket matrix coordinate real general\n %" << std::endl;
274+
file << "%%MatrixMarket matrix coordinate real general\n%" << std::endl;
275275
file << matrix_.rows() << " " << matrix_.cols() << " " << matrix_.nonZeros()
276276
<< std::endl;
277277
for (int k = 0; k < matrix_.outerSize(); ++k) {

0 commit comments

Comments
 (0)