21 template<
typename Derived>
54 const std::string& _coeffSeparator =
" ",
55 const std::string& _rowSeparator =
"\n",
const std::string& _rowPrefix=
"",
const std::string& _rowSuffix=
"",
56 const std::string& _matPrefix=
"",
const std::string& _matSuffix=
"")
57 : matPrefix(_matPrefix), matSuffix(_matSuffix), rowPrefix(_rowPrefix), rowSuffix(_rowSuffix), rowSeparator(_rowSeparator),
58 rowSpacer(
""), coeffSeparator(_coeffSeparator), precision(_precision), flags(_flags)
64 int i = int(matSuffix.length())-1;
65 while (i>=0 && matSuffix[i]!=
'\n')
72 std::string rowPrefix,
rowSuffix, rowSeparator, rowSpacer;
93 template<
typename ExpressionType>
99 : m_matrix(matrix), m_format(format)
119 template<
typename Derived>
131 template<
typename Scalar>
142 template<
typename Derived>
151 typename Derived::Nested m = _m;
152 typedef typename Derived::Scalar Scalar;
156 std::streamsize explicit_precision;
159 explicit_precision = 0;
165 explicit_precision = 0;
177 std::streamsize old_precision = 0;
178 if(explicit_precision) old_precision = s.precision(explicit_precision);
184 for(
Index j = 0; j < m.cols(); ++j)
185 for(
Index i = 0; i < m.rows(); ++i)
187 std::stringstream sstr;
189 sstr << m.coeff(i,j);
190 width = std::max<Index>(width,
Index(sstr.str().length()));
194 for(
Index i = 0; i < m.rows(); ++i)
199 if(width) s.width(width);
201 for(
Index j = 1; j < m.cols(); ++j)
204 if (width) s.width(width);
208 if( i < m.rows() - 1)
212 if(explicit_precision) s.precision(old_precision);
229 template<
typename Derived>
230 std::ostream &
operator <<
std::ostream & operator<<(std::ostream &s, const Packet16uc &v)
#define EIGEN_DEFAULT_IO_FORMAT
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
Base class for all dense matrices, vectors, and arrays.
std::ostream & print_matrix(std::ostream &s, const Derived &_m, const IOFormat &fmt)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
const WithFormat< Derived > format(const IOFormat &fmt) const