vbl_sparse_array_3d.hxx
Go to the documentation of this file.
1 // This is core/vbl/vbl_sparse_array_3d.hxx
2 #ifndef vbl_sparse_array_3d_hxx_
3 #define vbl_sparse_array_3d_hxx_
4 //:
5 // \file
6 
7 #include <iostream>
8 #include "vbl_sparse_array_3d.h"
10 #include <vcl_compiler.h>
11 #ifdef _MSC_VER
12 # include <vcl_msvc_warnings.h>
13 #endif
14 
15 //: Print the array to a stream in "(i,j,k): value" format.
16 template <class T>
17 std::ostream& vbl_sparse_array_3d<T>::print(std::ostream& out) const
18 {
20  for (ci p = this->begin(); p != this->end(); ++p)
21  out << '(' << (*p).first.first
22  << ',' << (*p).first.second
23  << ',' << (*p).first.third
24  << "): " << (*p).second << '\n';
25  return out;
26 }
27 
28 #undef VBL_SPARSE_ARRAY_3D_INSTANTIATE
29 #define VBL_SPARSE_ARRAY_3D_INSTANTIATE(T) \
30 VBL_SPARSE_ARRAY_BASE_INSTANTIATE(T, vbl_triple<unsigned VCL_COMMA unsigned VCL_COMMA unsigned >); \
31 template class vbl_sparse_array_3d<T >; \
32 /*template std::ostream& operator<< (std::ostream&, const vbl_sparse_array_3d<T > &) */
33 
34 #endif // vbl_sparse_array_3d_hxx_
Map::const_iterator const_iterator
The type of iterators into the efficient storage.
a space efficient 3d array
std::ostream & print(std::ostream &) const
Print the Array to a stream in "(i,j,k): value" format.
A fully featured sparse array which devolves indexing to its templated type.
Contains a base class for sparse arrays.