[mlpack-svn] r13158 - mlpack/trunk/src/mlpack/core/arma_extend/sparse
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Wed Jul 4 13:20:19 EDT 2012
Author: rcurtin
Date: 2012-07-04 13:20:19 -0400 (Wed, 04 Jul 2012)
New Revision: 13158
Modified:
mlpack/trunk/src/mlpack/core/arma_extend/sparse/arma_ostream_meat.hpp
Log:
Remove extraneous spaces
Modified: mlpack/trunk/src/mlpack/core/arma_extend/sparse/arma_ostream_meat.hpp
===================================================================
--- mlpack/trunk/src/mlpack/core/arma_extend/sparse/arma_ostream_meat.hpp 2012-07-04 17:19:23 UTC (rev 13157)
+++ mlpack/trunk/src/mlpack/core/arma_extend/sparse/arma_ostream_meat.hpp 2012-07-04 17:20:19 UTC (rev 13158)
@@ -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 @@
return cell_width;
}
-template<typename eT>
-inline
-void
+template<typename eT>
+inline
+void
arma_ostream_new::print(std::ostream& o, const SpMat<eT>& m, const bool modify)
{
arma_extra_debug_sigprint();
@@ -101,16 +101,16 @@
typename SpMat<eT>::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::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<eT>::const_iterator it = begin; it != end; ++it)
{
@@ -147,26 +147,26 @@
}
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<typename eT>
-inline
-void
+template<typename eT>
+inline
+void
arma_ostream_new::print_trans(std::ostream& o, const SpMat<eT>& m, const bool modify)
{
arma_extra_debug_sigprint();
@@ -185,15 +185,15 @@
typename SpMat<eT>::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::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::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);
More information about the mlpack-svn
mailing list