vbl_array_2d.hxx
Go to the documentation of this file.
1 // This is core/vbl/vbl_array_2d.hxx
2 #ifndef vbl_array_2d_hxx_
3 #define vbl_array_2d_hxx_
4 
5 #include <iostream>
6 #include "vbl_array_2d.h"
7 
8 #ifdef _MSC_VER
9 # include <vcl_msvc_warnings.h>
10 #endif
11 
12 template<class T>
13 std::ostream& operator<<(std::ostream &os, vbl_array_2d<T> const &array)
14 {
15  typedef typename vbl_array_2d<T>::size_type size_type;
16  os << "vbl_array_2d [";
17  for ( size_type i=0; i< array.rows(); i++)
18  {
19  os << std::endl << " ";
20  for ( size_type j=0; j< array.columns(); j++)
21  os << ' ' << array(i,j);
22  }
23  os << "\n ]" << std::endl;
24 
25  return os;
26 }
27 
28 #undef VBL_ARRAY_2D_INSTANTIATE
29 #define VBL_ARRAY_2D_INSTANTIATE(type) \
30 template class vbl_array_2d<type >;\
31 template std::ostream& operator<< (std::ostream& , vbl_array_2d<type > const& )
32 
33 #endif // vbl_array_2d_hxx_
simple 2D array.
Definition: vbl_array_2d.h:25
std::size_t size_type
Definition: vbl_array_2d.h:28
size_type rows() const
Return number of rows.
Definition: vbl_array_2d.h:122
size_type columns() const
Return number of columns.
Definition: vbl_array_2d.h:128
std::ostream & operator<<(std::ostream &os, vbl_array_2d< T > const &array)
Contains class for a templated 2d array.