vbl_sparse_array_2d.hxx
Go to the documentation of this file.
1 // This is core/vbl/vbl_sparse_array_2d.hxx
2 #ifndef vbl_sparse_array_2d_hxx_
3 #define vbl_sparse_array_2d_hxx_
4 //:
5 // \file
6 
7 #include <iostream>
8 #include "vbl_sparse_array_2d.h"
10 #include <vcl_compiler.h>
11 #ifdef _MSC_VER
12 # include <vcl_msvc_warnings.h>
13 #endif
14 
15 #if 0 // capes@robots - moved print implementation to header file
16 //: Print the array to a stream in "(i,j): value" format.
17 template <class T>
18 std::ostream& vbl_sparse_array_2d<T>::print(std::ostream& out) const
19 {
20  for (const_iterator p = storage_.begin(); p != storage_.end(); ++p)
21  out << "(" << (*p).first.first
22  << "," << (*p).first.second
23  << "): " << (*p).second << '\n';
24  return out;
25 }
26 #endif
27 
28 #undef VBL_SPARSE_ARRAY_2D_INSTANTIATE
29 #define VBL_SPARSE_ARRAY_2D_INSTANTIATE(T) \
30 VBL_SPARSE_ARRAY_BASE_INSTANTIATE(T, std::pair<unsigned VCL_COMMA unsigned >); \
31 template class vbl_sparse_array_2d<T >; \
32 /*template std::ostream& operator<< (std::ostream&, const vbl_sparse_array_2d<T > &) */
33 
34 #endif // vbl_sparse_array_2d_hxx_
a space efficient 2d array
std::ostream & print(std::ostream &out) const
Print the Array to a stream in "(i,j): value" format.
Contains a base class for sparse arrays.