Go to the documentation of this file.00001
00002 #ifndef vbl_sparse_array_3d_h_
00003 #define vbl_sparse_array_3d_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include <vcl_iosfwd.h>
00027 #include <vbl/vbl_sparse_array_base.h>
00028 #include <vbl/vbl_triple.h>
00029
00030
00031
00032
00033 template <class T>
00034 class vbl_sparse_array_3d : public vbl_sparse_array_base<T, vbl_triple<unsigned, unsigned, unsigned> >
00035 {
00036 public:
00037
00038
00039 bool put(unsigned i, unsigned j, unsigned k, const T& t)
00040 {
00041 return vbl_sparse_array_base<T,
00042 vbl_triple<unsigned, unsigned, unsigned> >::
00043 put(vbl_make_triple(i, j, k), t);
00044 }
00045
00046
00047
00048
00049 T& operator () (unsigned i, unsigned j, unsigned k)
00050 {
00051 return vbl_sparse_array_base<T,
00052 vbl_triple<unsigned, unsigned, unsigned> >::
00053 operator() (vbl_make_triple(i, j, k));
00054 }
00055
00056
00057 const T& operator () (unsigned i, unsigned j, unsigned k) const
00058 {
00059 return vbl_sparse_array_base<T,
00060 vbl_triple<unsigned, unsigned, unsigned> >::
00061 operator() (vbl_make_triple(i, j, k));
00062 }
00063
00064
00065 bool fullp(unsigned i, unsigned j, unsigned k) const
00066 {
00067 return vbl_sparse_array_base<T,
00068 vbl_triple<unsigned, unsigned, unsigned> >::
00069 fullp(vbl_make_triple(i, j, k));
00070 }
00071
00072
00073 T* get_addr(unsigned i, unsigned j, unsigned k)
00074 {
00075 return vbl_sparse_array_base<T,
00076 vbl_triple<unsigned, unsigned, unsigned> >::
00077 get_addr(vbl_make_triple(i, j, k));
00078 }
00079
00080
00081 vcl_ostream& print(vcl_ostream&) const;
00082 };
00083
00084
00085 template <class T>
00086 inline vcl_ostream& operator <<
00087 (vcl_ostream& s, const vbl_sparse_array_3d<T>& a)
00088 {
00089 return a.print(s);
00090 }
00091
00092
00093 #ifndef VBL_SPARSE_ARRAY_BASE_INSTANTIATE
00094 #define VBL_SPARSE_ARRAY_BASE_INSTANTIATE(T) \
00095 extern "please include vbl/vbl_sparse_array_base.txx instead"
00096 #endif // VBL_SPARSE_ARRAY_BASE_INSTANTIATE
00097 #define VBL_SPARSE_ARRAY_3D_INSTANTIATE(T) \
00098 extern "please include vbl/vbl_sparse_array_3d.txx instead"
00099
00100 #endif // vbl_sparse_array_3d_h_