From 21f8f3da99ee1551b2acb003d9dadc8b8fbbdb36 Mon Sep 17 00:00:00 2001 From: Ryan Curtin Date: Wed, 4 Jul 2012 17:20:19 +0000 Subject: [PATCH] Remove extraneous spaces --- .../arma_extend/sparse/arma_ostream_meat.hpp | 94 +++++++++---------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/src/mlpack/core/arma_extend/sparse/arma_ostream_meat.hpp b/src/mlpack/core/arma_extend/sparse/arma_ostream_meat.hpp index eb9e3df5c2..809665b92f 100644 --- a/src/mlpack/core/arma_extend/sparse/arma_ostream_meat.hpp +++ b/src/mlpack/core/arma_extend/sparse/arma_ostream_meat.hpp @@ -1,6 +1,6 @@ // Copyright (C) 2008-2011 NICTA (www.nicta.com.au) // Copyright (C) 2008-2011 Conrad Sanderson -// +// // This file is part of the Armadillo C++ library. // It is provided without any warranty of fitness // for any purpose. You can redistribute this file @@ -81,9 +81,9 @@ arma_ostream_new::modify_stream(std::ostream& o, typename SpMat::const_itera return cell_width; } -template -inline -void +template +inline +void arma_ostream_new::print(std::ostream& o, const SpMat& m, const bool modify) { arma_extra_debug_sigprint(); @@ -101,16 +101,16 @@ arma_ostream_new::print(std::ostream& o, const SpMat& m, const bool modify) typename SpMat::const_iterator end = m.end(); if(m.is_empty() == false) - { + { if(m_n_cols > 0) - { + { if(cell_width > 0) { // An efficient row_iterator would make this simpler and faster for(uword row=0; row < m_n_rows; ++row) - { + { for(uword col=0; col < m_n_cols; ++col) - { + { // the cell width appears to be reset after each element is printed, // hence we need to restore it o.width(cell_width); @@ -124,18 +124,18 @@ arma_ostream_new::print(std::ostream& o, const SpMat& m, const bool modify) } } arma_ostream::print_elem(o,eT(val)); - } - + } + o << '\n'; - } - } + } + } else - { + { // An efficient row_iterator would make this simpler and faster for(uword row=0; row < m_n_rows; ++row) - { + { for(uword col=0; col < m_n_cols; ++col) - { + { eT val = 0; for(typename SpMat::const_iterator it = begin; it != end; ++it) { @@ -147,26 +147,26 @@ arma_ostream_new::print(std::ostream& o, const SpMat& m, const bool modify) } arma_ostream::print_elem(o,eT(val)); o << ' '; - } - + } + o << '\n'; - } - } - } - } + } + } + } + } else - { + { o << "[matrix size: " << m_n_rows << 'x' << m_n_cols << "]\n"; - } - + } + o.flush(); stream_state.restore(o); } -template -inline -void +template +inline +void arma_ostream_new::print_trans(std::ostream& o, const SpMat& m, const bool modify) { arma_extra_debug_sigprint(); @@ -185,15 +185,15 @@ arma_ostream_new::print_trans(std::ostream& o, const SpMat& m, const bool mo typename SpMat::const_iterator end = m.end(); if(m.is_empty() == false) - { + { if(m_n_cols > 0) - { + { if(cell_width > 0) { for(uword row=0; row < m_n_rows; ++row) - { + { for(uword col=0; col < m_n_cols; ++col) - { + { o.width(cell_width); if(it != end && it.row == col && it.col == row ) { @@ -204,17 +204,17 @@ arma_ostream_new::print_trans(std::ostream& o, const SpMat& m, const bool mo { arma_ostream::print_elem(o,eT(0)); } - } - + } + o << '\n'; - } - } + } + } else - { + { for(uword row=0; row < m_n_rows; ++row) - { + { for(uword col=0; col < m_n_cols; ++col) - { + { eT val = 0; if(it != end && it.row == col && it.col == row ) { @@ -226,18 +226,18 @@ arma_ostream_new::print_trans(std::ostream& o, const SpMat& m, const bool mo arma_ostream::print_elem(o,eT(0)); } o << ' '; - } - + } + o << '\n'; - } - } - } - } + } + } + } + } else - { + { o << "[matrix size: " << m_n_rows << 'x' << m_n_cols << "]\n"; - } - + } + o.flush(); stream_state.restore(o);