#include #include //From http://www.richelbilderbeek.nl/CppConvertMatrix.htm template const std::vector > ConvertMatrix( const std::vector >& v) { const int maxy = static_cast(v.size()); assert(maxy>0); const int maxx = static_cast(v[0].size()); std::vector > t(maxy, std::vector(maxx)); for (int y=0; y!=maxy; ++y) { for (int x=0; x!=maxx; ++x) { t[y][x] = static_cast(v[y][x]); } } return t; }