Matrix: Improved to_string() and overloaded << operator for ostream.