"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "include/armadillo_bits/arma_ostream_meat.hpp" between
armadillo-10.2.0.tar.xz and armadillo-10.2.1.tar.xz

About: Armadillo is a C++ linear algebra library (matrix maths) aiming towards a good balance between speed and ease of use.

arma_ostream_meat.hpp  (armadillo-10.2.0.tar.xz):arma_ostream_meat.hpp  (armadillo-10.2.1.tar.xz)
skipping to change at line 248 skipping to change at line 248
o.setf(ios::right); o.setf(ios::right);
o.setf(ios::fixed); o.setf(ios::fixed);
o.precision(4); o.precision(4);
cell_width = 9; cell_width = 9;
} }
return cell_width; return cell_width;
} }
//! "better than nothing" settings for complex numbers //! "better than nothing" settings for complex numbers
template<typename T> template<typename eT>
inline inline
std::streamsize std::streamsize
arma_ostream::modify_stream(std::ostream& o, typename SpMat<T>::const_iterator b egin, const uword n_elem, const typename arma_cx_only<T>::result* junk) arma_ostream::modify_stream(std::ostream& o, typename SpMat<eT>::const_iterator begin, const uword n_elem, const typename arma_cx_only<eT>::result* junk)
{ {
arma_ignore(begin); arma_ignore(begin);
arma_ignore(n_elem); arma_ignore(n_elem);
arma_ignore(junk); arma_ignore(junk);
o.unsetf(ios::showbase); o.unsetf(ios::showbase);
o.unsetf(ios::uppercase); o.unsetf(ios::uppercase);
o.fill(' '); o.fill(' ');
o.setf(ios::scientific); o.setf(ios::scientific);
skipping to change at line 916 skipping to change at line 916
const std::streamsize cell_width = arma_ostream::modify_stream(o, X.memptr() , X.n_elem); const std::streamsize cell_width = arma_ostream::modify_stream(o, X.memptr() , X.n_elem);
for(uword row=0; row <= 2; ++row) for(uword row=0; row <= 2; ++row)
{ {
for(uword col=0; col <= 2; ++col) for(uword col=0; col <= 2; ++col)
{ {
o.width(cell_width); o.width(cell_width);
arma_ostream::print_elem(o, X.at(row,col), true); arma_ostream::print_elem(o, X.at(row,col), true);
} }
o.width(cell_width); o.width(6);
o << "..."; o << "...";
o.width(cell_width); o.width(cell_width);
o << X.at(row,3) << '\n'; o << X.at(row,3) << '\n';
} }
for(uword col=0; col <= 4; ++col) for(uword col=0; col <= 2; ++col)
{ {
o.width(cell_width); o.width(cell_width);
o << ':'; o << ':';
} }
o.width(6);
o << "...";
o.width(cell_width); o.width(cell_width);
o << '\n'; o << ':' << '\n';
const uword row = 3; const uword row = 3;
{ {
for(uword col=0; col <= 2; ++col) for(uword col=0; col <= 2; ++col)
{ {
o.width(cell_width); o.width(cell_width);
arma_ostream::print_elem(o, X.at(row,col), true); arma_ostream::print_elem(o, X.at(row,col), true);
} }
o.width(cell_width); o.width(6);
o << "..."; o << "...";
o.width(cell_width); o.width(cell_width);
o << X.at(row,3) << '\n'; o << X.at(row,3) << '\n';
} }
} }
if( (print_row_ellipsis == true) && (print_col_ellipsis == false) ) if( (print_row_ellipsis == true) && (print_col_ellipsis == false) )
{ {
Mat<eT> X(4, m.n_cols); Mat<eT> X(4, m.n_cols);
skipping to change at line 1006 skipping to change at line 1009
const std::streamsize cell_width = arma_ostream::modify_stream(o, X.memptr() , X.n_elem); const std::streamsize cell_width = arma_ostream::modify_stream(o, X.memptr() , X.n_elem);
for(uword row=0; row < m.n_rows; ++row) for(uword row=0; row < m.n_rows; ++row)
{ {
for(uword col=0; col <= 2; ++col) for(uword col=0; col <= 2; ++col)
{ {
o.width(cell_width); o.width(cell_width);
arma_ostream::print_elem(o, X.at(row,col), true); arma_ostream::print_elem(o, X.at(row,col), true);
} }
o.width(cell_width); o.width(6);
o << "..."; o << "...";
o.width(cell_width); o.width(cell_width);
o << X.at(row,3) << '\n'; o << X.at(row,3) << '\n';
} }
} }
o.flush(); o.flush();
stream_state.restore(o); stream_state.restore(o);
} }
skipping to change at line 1159 skipping to change at line 1162
++count; ++count;
} }
it = it_end; it = it_end;
--it; --it;
storage_row(count) = it.row(); storage_row(count) = it.row();
storage_col(count) = it.col(); storage_col(count) = it.col();
storage_val(count) = (*it); storage_val(count) = (*it);
const std::streamsize cell_width = arma_ostream::modify_stream<eT>(o, storage_ val.memptr(), 10); const std::streamsize cell_width = arma_ostream::modify_stream(o, storage_val. memptr(), 10);
for(uword i=0; i < 9; ++i) for(uword i=0; i < 9; ++i)
{ {
const uword row = storage_row(i); const uword row = storage_row(i);
const uword col = storage_col(i); const uword col = storage_col(i);
if(row < 10) { o << " "; } if(row < 10) { o << " "; }
else if(row < 100) { o << " "; } else if(row < 100) { o << " "; }
else if(row < 1000) { o << " "; } else if(row < 1000) { o << " "; }
else if(row < 10000) { o << " "; } else if(row < 10000) { o << " "; }
skipping to change at line 1182 skipping to change at line 1185
o << '(' << row << ", " << col << ") "; o << '(' << row << ", " << col << ") ";
if(col < 10) { o << " "; } if(col < 10) { o << " "; }
else if(col < 100) { o << " "; } else if(col < 100) { o << " "; }
else if(col < 1000) { o << " "; } else if(col < 1000) { o << " "; }
else if(col < 10000) { o << " "; } else if(col < 10000) { o << " "; }
else if(col < 100000) { o << " "; } else if(col < 100000) { o << " "; }
else if(col < 1000000) { o << ' '; } else if(col < 1000000) { o << ' '; }
if(cell_width > 0) { o.width(cell_width); } if(cell_width > 0) { o.width(cell_width); }
arma_ostream::print_elem(o, storage_val(i), true); arma_ostream::print_elem(o, storage_val(i), true);
o << '\n'; o << '\n';
} }
o << " (:, :) "; o << " (:, :) ";
if(cell_width > 0) { o.width(cell_width); } if(cell_width > 0) { o.width(cell_width); }
o << "...\n"; o << "...\n";
const uword i = 9; const uword i = 9;
{ {
const uword row = storage_row(i); const uword row = storage_row(i);
const uword col = storage_col(i); const uword col = storage_col(i);
if(row < 10) { o << " "; } if(row < 10) { o << " "; }
else if(row < 100) { o << " "; } else if(row < 100) { o << " "; }
else if(row < 1000) { o << " "; } else if(row < 1000) { o << " "; }
 End of changes. 11 change blocks. 
10 lines changed or deleted 13 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)