core/vbl/vbl_sparse_array_3d.txx
Go to the documentation of this file.
00001 // This is core/vbl/vbl_sparse_array_3d.txx
00002 #ifndef vbl_sparse_array_3d_txx_
00003 #define vbl_sparse_array_3d_txx_
00004 //:
00005 // \file
00006 
00007 #include "vbl_sparse_array_3d.h"
00008 #include "vbl_sparse_array_base.txx"
00009 #include <vcl_iostream.h>
00010 
00011 //: Print the array to a stream in "(i,j,k): value" format.
00012 template <class T>
00013 vcl_ostream& vbl_sparse_array_3d<T>::print(vcl_ostream& out) const
00014 {
00015   typedef typename vbl_sparse_array_base<T,vbl_triple<unsigned,unsigned,unsigned> >::const_iterator ci;
00016   for (ci p = this->begin(); p != this->end(); ++p)
00017     out << '(' << (*p).first.first
00018         << ',' << (*p).first.second
00019         << ',' << (*p).first.third
00020         << "): " << (*p).second << '\n';
00021   return out;
00022 }
00023 
00024 #undef VBL_SPARSE_ARRAY_3D_INSTANTIATE
00025 #define VBL_SPARSE_ARRAY_3D_INSTANTIATE(T) \
00026 VBL_SPARSE_ARRAY_BASE_INSTANTIATE(T, vbl_triple<unsigned VCL_COMMA unsigned VCL_COMMA unsigned >); \
00027 template class vbl_sparse_array_3d<T >; \
00028 VCL_INSTANTIATE_INLINE(vcl_ostream& operator<< (vcl_ostream&, const vbl_sparse_array_3d<T > &))
00029 
00030 #endif // vbl_sparse_array_3d_txx_