operator_ostream.hpp

Go to the documentation of this file.
00001 // Copyright (C) 2010 NICTA and the authors listed below
00002 // http://nicta.com.au
00003 // 
00004 // Authors:
00005 // - Conrad Sanderson (conradsand at ieee dot org)
00006 // 
00007 // This file is part of the Armadillo C++ library.
00008 // It is provided without any warranty of fitness
00009 // for any purpose. You can redistribute this file
00010 // and/or modify it under the terms of the GNU
00011 // Lesser General Public License (LGPL) as published
00012 // by the Free Software Foundation, either version 3
00013 // of the License or (at your option) any later version.
00014 // (see http://www.opensource.org/licenses for more info)
00015 
00016 
00017 //! \addtogroup operator_ostream
00018 //! @{
00019 
00020 
00021 
00022 template<typename eT, typename T1>
00023 inline
00024 std::ostream&
00025 operator<< (std::ostream& o, const Base<eT,T1>& X)
00026   {
00027   arma_extra_debug_sigprint();
00028   
00029   const unwrap<T1> tmp(X.get_ref());
00030   
00031   arma_ostream::print(o, tmp.M, true);
00032   
00033   return o;
00034   }
00035 
00036 
00037 
00038 template<typename T1>
00039 inline
00040 std::ostream&
00041 operator<< (std::ostream& o, const BaseCube<typename T1::elem_type,T1>& X)
00042   {
00043   arma_extra_debug_sigprint();
00044   
00045   const unwrap_cube<T1> tmp(X.get_ref());
00046   
00047   arma_ostream::print(o, tmp.M, true);
00048   
00049   return o;
00050   }
00051 
00052 
00053 
00054 //! Print the contents of a field to the specified stream.
00055 template<typename T1>
00056 inline
00057 std::ostream&
00058 operator<< (std::ostream& o, const field<T1>& X)
00059   {
00060   arma_extra_debug_sigprint();
00061   
00062   arma_ostream::print(o, X);
00063   
00064   return o;
00065   }
00066 
00067 
00068 
00069 //! Print the contents of a subfield to the specified stream
00070 template<typename T1>
00071 inline
00072 std::ostream&
00073 operator<< (std::ostream& o, const subview_field<T1>& X)
00074   {
00075   arma_extra_debug_sigprint();
00076   
00077   arma_ostream::print(o, X);
00078 
00079   return o;
00080   }
00081 
00082 
00083 
00084 //! @}