#include <iostream>
#include <sstream> // <-- Added
#include "Eigen/Dense"
using std::cout;
using std::endl;
using std::string;
using std::ostringstream;
using Eigen::MatrixXd;
using Eigen::EigenBase;
template <typename Derived>
std::string get_shape(const EigenBase<Derived>& x)
{
std::ostringstream oss;
oss << "(" << x.rows() << ", " << x.cols() << ")";
return oss.str();
}
int main(int argc, char**argv)
{
MatrixXd m(2, 3);
m << 1, 2, 3, 10, 20, 30;
cout << "shape: " << get_shape(m) << endl;
return 0;
}