ostream_field.hpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 template<typename T1>
00024 inline
00025 std::ostream&
00026 operator<< (std::ostream& o, const field<T1>& X)
00027 {
00028 arma_extra_debug_sigprint();
00029
00030 const ios::fmtflags orig_flags = o.flags();
00031
00032 for(u32 col=0; col<X.n_cols; ++col)
00033 {
00034 o << "[field column " << col << ']' << '\n';
00035 for(u32 row=0; row<X.n_rows; ++row)
00036 {
00037 o << X.at(row,col) << '\n';
00038 }
00039
00040 o << '\n';
00041 }
00042
00043 o.flush();
00044 o.flags(orig_flags);
00045
00046 return o;
00047 }
00048
00049
00050
00051
00052
00053
00054 template<typename T1>
00055 inline
00056 std::ostream&
00057 operator<< (std::ostream& o, const subview_field<T1>& X)
00058 {
00059 arma_extra_debug_sigprint();
00060
00061 const ios::fmtflags orig_flags = o.flags();
00062
00063 for(u32 col=0; col<X.n_cols; ++col)
00064 {
00065 for(u32 row=0; row<X.n_rows; ++row)
00066 {
00067 o << X.at(row,col) << '\n';
00068 }
00069
00070 o << '\n';
00071 }
00072
00073 o.flush();
00074 o.flags(orig_flags);
00075
00076 return o;
00077 }
00078
00079
00080
00081