[Numerics] Remove trailing commas when printing Array2D and BandMatrix

This commit is contained in:
Ray Speth 2016-11-11 18:16:30 -05:00
parent 454f156764
commit 43f7bc8cdf
2 changed files with 6 additions and 4 deletions

View file

@ -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;
}

View file

@ -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;
}