23 template<
typename Derived>
24 std::ostream &
print_matrix(std::ostream & s,
const Derived& _m,
const IOFormat& fmt);
57 const std::string& _coeffSeparator =
" ",
58 const std::string& _rowSeparator =
"\n",
const std::string& _rowPrefix=
"",
const std::string& _rowSuffix=
"",
59 const std::string& _matPrefix=
"",
const std::string& _matSuffix=
"",
const char _fill=
' ')
97 template<
typename ExpressionType>
121 template<
typename Scalar>
122 struct significant_decimals_impl
124 static inline int run()
132 template<
typename Derived>
135 using internal::is_same;
143 typename Derived::Nested
m = _m;
144 typedef typename Derived::Scalar Scalar;
145 typedef std::conditional_t<
146 is_same<Scalar, char>::value ||
147 is_same<Scalar, unsigned char>::value ||
148 is_same<Scalar, numext::int8_t>::value ||
149 is_same<Scalar, numext::uint8_t>::value,
152 is_same<Scalar, std::complex<char> >::value ||
153 is_same<Scalar, std::complex<unsigned char> >::value ||
154 is_same<Scalar, std::complex<numext::int8_t> >::value ||
155 is_same<Scalar, std::complex<numext::uint8_t> >::value,
163 std::streamsize explicit_precision;
166 explicit_precision = 0;
172 explicit_precision = 0;
176 explicit_precision = significant_decimals_impl<Scalar>::run();
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 <<
256 template <
typename Derived>
#define EIGEN_DEFAULT_IO_FORMAT
Base class for all dense matrices, vectors, and arrays.
EvalReturnType eval() const
Base class for diagonal matrices and expressions.
std::ostream & print_matrix(std::ostream &s, const Derived &_m, const IOFormat &fmt)
std::ostream & operator<<(std::ostream &s, const DiagonalBase< Derived > &m)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.