Skip to content

Commit

Permalink
[Numerics] Remove trailing commas when printing Array2D and BandMatrix
Browse files Browse the repository at this point in the history
  • Loading branch information
speth committed Nov 12, 2016
1 parent 454f156 commit 43f7bc8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions include/cantera/base/Array.h
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,9 @@ inline std::ostream& operator<<(std::ostream& s, const Array2D& m)
size_t nr = m.nRows();
size_t nc = m.nColumns();
for (size_t i = 0; i < nr; i++) {
for (size_t j = 0; j < nc; j++) {
s << m(i,j) << ", ";
s << m(i,0);
for (size_t j = 1; j < nc; j++) {
s << ", " << m(i,j);
}
s << std::endl;
}
Expand Down
5 changes: 3 additions & 2 deletions src/numerics/BandMatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,9 @@ vector_fp::const_iterator BandMatrix::end() const
ostream& operator<<(ostream& s, const BandMatrix& m)
{
for (size_t i = 0; i < m.nRows(); i++) {
for (size_t j = 0; j < m.nColumns(); j++) {
s << m(i,j) << ", ";
s << m(i, 0);
for (size_t j = 1; j < m.nColumns(); j++) {
s << ", " << m(i,j);
}
s << endl;
}
Expand Down

0 comments on commit 43f7bc8

Please sign in to comment.