X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fmoof%2Fcml%2Fvector%2Fvector_print.h;fp=src%2Fmoof%2Fcml%2Fvector%2Fvector_print.h;h=7106b324d6a404c42ac428fd509110f0420bcc5e;hb=831f04d4bc19a390415ac0bbac4331c7a65509bc;hp=0000000000000000000000000000000000000000;hpb=299af4f2047e767e5d79501c26444473bda64c64;p=chaz%2Fyoink diff --git a/src/moof/cml/vector/vector_print.h b/src/moof/cml/vector/vector_print.h new file mode 100644 index 0000000..7106b32 --- /dev/null +++ b/src/moof/cml/vector/vector_print.h @@ -0,0 +1,45 @@ +/* -*- C++ -*- ------------------------------------------------------------ + +Copyright (c) 2007 Jesse Anders and Demian Nave http://cmldev.net/ + +The Configurable Math Library (CML) is distributed under the terms of the +Boost Software License, v1.0 (see cml/LICENSE for details). + + *-----------------------------------------------------------------------*/ +/** @file + * @brief + */ + +#ifndef vector_print_h +#define vector_print_h + +#include + +namespace cml { + +/** Output a vector to a std::ostream. */ +template inline std::ostream& +operator<<(std::ostream& os, const vector& v) +{ + for (size_t i = 0; i < v.size(); ++i) { + os << " " << v[i]; + } + return os; +} + +/** Output a vector expression to a std::ostream. */ +template< class XprT > inline std::ostream& +operator<<(std::ostream& os, const et::VectorXpr& v) +{ + for (size_t i = 0; i < v.size(); ++i) { + os << " " << v[i]; + } + return os; +} + +} // namespace cml + +#endif + +// ------------------------------------------------------------------------- +// vim:ft=cpp