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