C++ doesn't define an ostream operator << for vectors, most likely because there are a lot of different ways you could output them. One entry per line, like below, or comma separated, or contained within brackets.
You can define your own << operator for vectors using "operator overloading". This allows the same operator to call different code depending on the calling parameters.
Global operator overload methods have a specific calling convention, the first parameter is a reference to the object on the left of the operator (e.g. the cout in cout << v, the second parameter is the value on the right of the operator (the v). For the << operator, you normally define the parameter as a const reference, as you don't normally change the value when it is output.
The return value for a << operator is normally the first parameter. This allows you to chain calls to << like cout << vec << "Done" << std::endl.
e.g.:
ostream &operator << (ostream &out, const vector<int> &vec)
{
for (auto &&val : vec)
out << val << std::endl;
return out;
}
If you can't use c++11, you can use the older style loop like this:
ostream &operator << (ostream &out, const vector<int> &vec)
{
for (vector<int>::size_type i = 0; i < vec.size(); i++)
out << vec[i] << std::endl;
return out;
}
or other similar loops using iterators.
PS. Unrelated note - you need to initialise the size of sumat in your code, or use push_back. At the moment it will crash.