21 : orig_flags (o.flags())
22 , orig_precision(o.precision())
23 , orig_width (o.width())
24 , orig_fill (o.fill())
52 o.unsetf(ios::showbase);
53 o.unsetf(ios::uppercase);
54 o.unsetf(ios::showpos);
58 std::streamsize cell_width;
60 bool use_layout_B =
false;
61 bool use_layout_C =
false;
63 for(
uword i=0; i<n_elem; ++i)
65 const eT val = data[i];
86 if(use_layout_C ==
true)
88 o.setf(ios::scientific);
95 if(use_layout_B ==
true)
97 o.unsetf(ios::scientific);
105 o.unsetf(ios::scientific);
126 o.unsetf(ios::showbase);
127 o.unsetf(ios::uppercase);
130 o.setf(ios::scientific);
131 o.setf(ios::showpos);
133 o.unsetf(ios::fixed);
135 std::streamsize cell_width;
138 cell_width = 2 + 2*(1 + 3 + o.precision() + 5) + 1;
145 template<
typename eT>
156 o.precision(orig_precision);
162 template<
typename eT>
173 arma_ostream::print_elem_zero<eT>(o);
185 if( (x.real() != T(0)) || (x.imag() != T(0)) )
187 std::ostringstream ss;
190 ss.precision(o.precision());
192 ss <<
'(' << x.real() <<
',' << x.imag() <<
')';
204 template<
typename eT>
224 for(
uword row=0; row < m_n_rows; ++row)
226 for(
uword col=0; col < m_n_cols; ++col)
239 for(
uword row=0; row < m_n_rows; ++row)
241 for(
uword col=0; col < m_n_cols-1; ++col)
255 o <<
"[matrix size: " << m_n_rows <<
'x' << m_n_cols <<
"]\n";
265 template<
typename eT>
280 o <<
"[cube slice " << slice <<
']' <<
'\n';
299 template<
typename oT>
308 const std::streamsize cell_width = o.width();
315 for(
uword col=0; col<x_n_cols; ++col)
317 o <<
"[field column " << col <<
']' <<
'\n';
319 for(
uword row=0; row<x_n_rows; ++row)
322 o << x.
at(row,col) <<
'\n';
330 o <<
"[field size: " << x_n_rows <<
'x' << x_n_cols <<
"]\n";
341 template<
typename oT>
350 const std::streamsize cell_width = o.width();
355 for(
uword col=0; col<x_n_cols; ++col)
357 o <<
"[field column " << col <<
']' <<
'\n';
358 for(
uword row=0; row<x_n_rows; ++row)
361 o << x.
at(row,col) <<
'\n';
arma_inline arma_warn_unused eT * memptr()
returns a pointer to array of eTs used by the matrix
arma_inline bool is_empty() const
returns true if the field has no objects
const std::streamsize orig_precision
const uword n_rows
number of rows in the field (read-only)
arma_ostream_state(const std::ostream &o)
const uword n_cols
number of columns in the field (read-only)
const uword n_cols
number of columns in the matrix (read-only)
const uword n_elem
number of elements in the matrix (read-only)
const uword n_rows
number of rows in the matrix (read-only)
const std::streamsize orig_width
arma_inline arma_warn_unused eT * memptr()
returns a pointer to array of eTs used by the cube
const uword n_cols
number of columns in each slice (read-only)
static void print(std::ostream &o, const Mat< eT > &m, const bool modify)
Print a matrix to the specified stream.
static arma_inline void print_elem(std::ostream &o, const eT &x)
Print an element to the specified stream.
arma_inline Mat< eT > & slice(const uword in_slice)
provide the reference to the matrix representing a single slice
arma_inline arma_warn_unused eT & at(const uword i)
linear element accessor (treats the matrix as a vector); no bounds check.
#define arma_ignore(variable)
static void print_elem_zero(std::ostream &o)
arma_inline oT & at(const uword row, const uword col)
static std::streamsize modify_stream(std::ostream &o, const eT *data, const uword n_elem)
const ios::fmtflags orig_flags
#define arma_extra_debug_sigprint
arma_inline arma_warn_unused bool is_empty() const
returns true if the cube has no elements
void restore(std::ostream &o) const
const uword n_elem
number of elements in the cube (read-only)
arma_inline arma_warn_unused bool is_empty() const
returns true if the matrix has no elements
const uword n_slices
number of slices in the cube (read-only)
const uword n_rows
number of rows in each slice (read-only)
arma_inline oT & at(const uword i)
linear element accessor (treats the field as a vector); no bounds check