Go to the documentation of this file.00001
00002 #ifndef vbl_big_sparse_array_3d_h_
00003 #define vbl_big_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
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 #include <vxl_config.h>
00044
00045 #if VXL_HAS_INT_64
00046 typedef vxl_uint_64 ulonglong;
00047 #elif VXL_HAS_INT_32
00048 typedef vxl_uint_32 ulonglong;
00049 #else
00050 # error "only implemented with 32 and 64-bit ints"
00051 #endif
00052
00053 #include <vcl_functional.h>
00054 #include <vcl_map.h>
00055 #include <vcl_iosfwd.h>
00056
00057 template <class T>
00058 class vbl_big_sparse_array_3d
00059 {
00060 protected:
00061
00062 typedef vcl_map<ulonglong, T, vcl_less<ulonglong> > Map;
00063 Map storage_;
00064
00065 public:
00066
00067
00068
00069 vbl_big_sparse_array_3d() {}
00070 ~vbl_big_sparse_array_3d() {}
00071
00072
00073 vbl_big_sparse_array_3d(vbl_big_sparse_array_3d<T> const& b) : storage_(b.storage_) {}
00074
00075 vbl_big_sparse_array_3d<T>& operator=(vbl_big_sparse_array_3d<T> const& b)
00076 { storage_ = b.storage_; return *this; }
00077
00078
00079 T & operator() (unsigned, unsigned, unsigned);
00080 T const& operator() (unsigned, unsigned, unsigned) const;
00081
00082
00083 bool fullp(unsigned, unsigned, unsigned) const;
00084
00085 bool put(unsigned, unsigned, unsigned, T const&);
00086
00087
00088 unsigned int count_nonempty() const { return (unsigned int)(storage_.size()); }
00089
00090
00091 vcl_ostream& print(vcl_ostream&) const;
00092 };
00093
00094 template <class T>
00095 inline vcl_ostream& operator<<(vcl_ostream&s,vbl_big_sparse_array_3d<T>const& a)
00096 {
00097 return a.print(s);
00098 }
00099
00100 #define VBL_BIG_SPARSE_ARRAY_3D_INSTANTIATE(T) \
00101 extern "Please #include <vbl/vbl_big_sparse_array_3d.txx> instead"
00102
00103 #endif // vbl_big_sparse_array_3d_h_