vector_print.h

Go to the documentation of this file.
00001 /* -*- C++ -*- ------------------------------------------------------------
00002  
00003 Copyright (c) 2007 Jesse Anders and Demian Nave http://cmldev.net/
00004 
00005 The Configurable Math Library (CML) is distributed under the terms of the
00006 Boost Software License, v1.0 (see cml/LICENSE for details).
00007 
00008  *-----------------------------------------------------------------------*/
00013 #ifndef vector_print_h
00014 #define vector_print_h
00015 
00016 #include <iostream>
00017 
00018 namespace cml {
00019 
00021 template<typename E, class AT > inline std::ostream&
00022 operator<<(std::ostream& os, const vector<E,AT>& v)
00023 {
00024     for (size_t i = 0; i < v.size(); ++i) {
00025         os << " " << v[i];
00026     }
00027     return os;
00028 }
00029 
00031 template< class XprT > inline std::ostream&
00032 operator<<(std::ostream& os, const et::VectorXpr<XprT>& v)
00033 {
00034     for (size_t i = 0; i < v.size(); ++i) {
00035         os << " " << v[i];
00036     }
00037     return os;
00038 }
00039 
00040 } // namespace cml
00041 
00042 #endif
00043 
00044 // -------------------------------------------------------------------------
00045 // vim:ft=cpp

Generated on Sat Jul 18 19:35:35 2009 for CML 1.0 by  doxygen 1.5.9