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)
117 template<
typename Scalar>
128 template<
typename Derived>
137 typename Derived::Nested m = _m;
138 typedef typename Derived::Scalar Scalar;
142 std::streamsize explicit_precision;
145 explicit_precision = 0;
151 explicit_precision = 0;
163 std::streamsize old_precision = 0;
164 if(explicit_precision) old_precision = s.precision(explicit_precision);
170 for(
Index j = 0; j < m.cols(); ++j)
171 for(
Index i = 0; i < m.rows(); ++i)
173 std::stringstream sstr;
175 sstr << m.coeff(i,j);
176 width = std::max<Index>(width,
Index(sstr.str().length()));
180 for(
Index i = 0; i < m.rows(); ++i)
185 if(width) s.width(width);
187 for(
Index j = 1; j < m.cols(); ++j)
190 if (width) s.width(width);
194 if( i < m.rows() - 1)
198 if(explicit_precision) s.precision(old_precision);
215 template<
typename Derived>
216 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.