diff --git a/stim/math/matrix.h b/stim/math/matrix.h index 01f20e6..8f6e080 100644 --- a/stim/math/matrix.h +++ b/stim/math/matrix.h @@ -189,9 +189,9 @@ public: std::string csv() { std::stringstream csvss; - for (size_t i = 0; i < B; i++) { + for (size_t i = 0; i < R; i++) { csvss << M[i]; - for (size_t j = 0; j < B; j++) csvss << ", " << M[j * B + i]; + for (size_t j = 0; j < C; j++) csvss << ", " << M[j * R + i]; csvss << std::endl; } return csvss.str(); -- libgit2 0.21.4