overloaded stream operator for matrices