diff --git a/Eigen/src/Core/IO.h b/Eigen/src/Core/IO.h index 3fb61300b..7a823d225 100644 --- a/Eigen/src/Core/IO.h +++ b/Eigen/src/Core/IO.h @@ -155,6 +155,12 @@ struct ei_significant_decimals_impl template std::ostream & ei_print_matrix(std::ostream & s, const Derived& _m, const IOFormat& fmt) { + if(_m.size() == 0) + { + s << fmt.matPrefix << fmt.matSuffix; + return s; + } + const typename Derived::Nested m = _m; typedef typename Derived::Scalar Scalar; typedef typename Derived::Index Index;