From dbd081ad1808d4e8550dd23971b60b862c7904e0 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Mon, 11 Oct 2010 19:01:41 -0400 Subject: Add a test for a system of vector equations. --- src/vZ/Vector.hpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/vZ') diff --git a/src/vZ/Vector.hpp b/src/vZ/Vector.hpp index 66b9a68..0f5cf49 100644 --- a/src/vZ/Vector.hpp +++ b/src/vZ/Vector.hpp @@ -24,6 +24,7 @@ #include #include #include +#include namespace vZ { @@ -182,6 +183,19 @@ namespace vZ lhs.x()*rhs.y() - lhs.y()*rhs.x()); } + // Stream output + + template + std::ostream& + operator<<(std::ostream& ostr, const Vector& v) + { + ostr << "(" << v[0]; + for (std::size_t i = 1; i < N; ++i) { + ostr << ", " << v[i]; + } + return ostr << ")"; + } + // Implementation template -- cgit v1.2.3