max@0: // Copyright (C) 2008-2011 NICTA (www.nicta.com.au) max@0: // Copyright (C) 2008-2011 Conrad Sanderson max@0: // max@0: // This file is part of the Armadillo C++ library. max@0: // It is provided without any warranty of fitness max@0: // for any purpose. You can redistribute this file max@0: // and/or modify it under the terms of the GNU max@0: // Lesser General Public License (LGPL) as published max@0: // by the Free Software Foundation, either version 3 max@0: // of the License or (at your option) any later version. max@0: // (see http://www.opensource.org/licenses for more info) max@0: max@0: max@0: //! \addtogroup arma_ostream max@0: //! @{ max@0: max@0: max@0: max@0: class arma_ostream_state max@0: { max@0: private: max@0: max@0: const ios::fmtflags orig_flags; max@0: const std::streamsize orig_precision; max@0: const std::streamsize orig_width; max@0: const char orig_fill; max@0: max@0: max@0: public: max@0: max@0: inline arma_ostream_state(const std::ostream& o); max@0: max@0: inline void restore(std::ostream& o) const; max@0: }; max@0: max@0: max@0: max@0: class arma_ostream max@0: { max@0: public: max@0: max@0: template inline static std::streamsize modify_stream(std::ostream& o, const eT* data, const uword n_elem); max@0: template inline static std::streamsize modify_stream(std::ostream& o, const std::complex* data, const uword n_elem); max@0: max@0: template inline static void print_elem_zero(std::ostream& o); max@0: max@0: template arma_inline static void print_elem(std::ostream& o, const eT& x); max@0: template inline static void print_elem(std::ostream& o, const std::complex& x); max@0: max@0: template inline static void print(std::ostream& o, const Mat& m, const bool modify); max@0: template inline static void print(std::ostream& o, const Cube& m, const bool modify); max@0: max@0: template inline static void print(std::ostream& o, const field& m); max@0: template inline static void print(std::ostream& o, const subview_field& m); max@0: }; max@0: max@0: max@0: max@0: //! @}