21 template<
typename Derived>
55 const std::string& _coeffSeparator =
" ",
56 const std::string& _rowSeparator =
"\n",
const std::string& _rowPrefix=
"",
const std::string& _rowSuffix=
"",
57 const std::string& _matPrefix=
"",
const std::string& _matSuffix=
"",
const char _fill=
' ')
58 : matPrefix(_matPrefix), matSuffix(_matSuffix), rowPrefix(_rowPrefix), rowSuffix(_rowSuffix), rowSeparator(_rowSeparator),
59 rowSpacer(
""), coeffSeparator(_coeffSeparator), fill(_fill),
precision(_precision), flags(_flags)
65 int i =
int(matSuffix.length())-1;
66 while (i>=0 && matSuffix[i]!=
'\n')
73 std::string rowPrefix,
rowSuffix, rowSeparator, rowSpacer;
95 template<
typename ExpressionType>
101 : m_matrix(matrix), m_format(format)
119 template<
typename Scalar>
130 template<
typename Derived>
142 typename Derived::Nested
m = _m;
163 std::streamsize explicit_precision;
166 explicit_precision = 0;
172 explicit_precision = 0;
184 std::streamsize old_precision = 0;
185 if(explicit_precision) old_precision = s.precision(explicit_precision);
194 std::stringstream sstr;
196 sstr << static_cast<PrintType>(m.coeff(
i,
j));
197 width = std::max<Index>(width,
Index(sstr.str().length()));
200 std::streamsize old_width = s.width();
201 char old_fill_character = s.fill();
212 s << static_cast<PrintType>(m.coeff(
i, 0));
220 s << static_cast<PrintType>(m.coeff(
i,
j));
223 if(
i < m.rows() - 1)
227 if(explicit_precision) s.precision(old_precision);
229 s.fill(old_fill_character);
248 template<
typename Derived>
249 std::ostream &
operator <<
#define EIGEN_DEFAULT_IO_FORMAT
Namespace containing all symbols from the Eigen library.
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.
std::string format(const std::string &str, const std::vector< std::string > &find, const std::vector< std::string > &replace)
Map< Matrix< T, Dynamic, Dynamic, ColMajor >, 0, OuterStride<> > matrix(T *data, int rows, int cols, int stride)
std::ostream & operator<<(std::ostream &s, const Packet16c &v)