From c495d065190f6da988926de023e63fa81752a463 Mon Sep 17 00:00:00 2001 From: David Date: Mon, 26 Dec 2016 00:52:41 -0600 Subject: [PATCH] Fixed stim::matrix CSV output bug. --- stim/math/matrix.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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