Classes | Macros | Functions
vbl_big_sparse_array_3d.h File Reference

Sparse 3D array. More...

#include <functional>
#include <map>
#include <iosfwd>
#include <vxl_config.h>

Go to the source code of this file.

Classes

class  vbl_big_sparse_array_3d< T >
 

Macros

#define VBL_BIG_SPARSE_ARRAY_3D_INSTANTIATE(T)   extern "Please #include <vbl/vbl_big_sparse_array_3d.hxx> instead"
 

Functions

template<class T >
std::ostream & operator<< (std::ostream &s, vbl_big_sparse_array_3d< T >const &a)
 

Detailed Description

Sparse 3D array.

Author
Andrew W. Fitzgibbon, Oxford RRG, 02 Oct 96

vbl_big_sparse_array_3d is a sparse 3D array allowing space efficient access of the form s(300,700,900) = 2; It uses the 64-bit integer type "long long" (whenever supported by the compiler) to store the 3D index: 21 bits per dimension. Hence the largest possible coordinate in each dimension is 2^21-1 = 2097151. On platforms that do not have 64-bit integers, the maximum is 2^10-1 = 1023. (Actually, for some dimensions, it could be a factor 2 higher.)

Example usage:

x(1,2,3) = 1.23;
x(100,200,3) = 100.2003;
x.put(200,300,4, 200.3004);
std::cout << "123 = " << x(1,2,3) << std::endl
<< "222 = " << x(2,2,2) << std::endl
<< "333 is full? " << x.fullp(3,3,3) << std::endl
<< x;
  Modifications
   180497 AWF - Moved to Basics
   261001 Peter Vanroose - documentation added about implementation
   261001 Peter Vanroose - bug fixed in bigencode - had 11,22 instead of 21,42.
   271001 Peter Vanroose - ported to vxl from BigSparseArray3; removed n1,n2,n3

Definition in file vbl_big_sparse_array_3d.h.

Macro Definition Documentation

◆ VBL_BIG_SPARSE_ARRAY_3D_INSTANTIATE

#define VBL_BIG_SPARSE_ARRAY_3D_INSTANTIATE (   T)    extern "Please #include <vbl/vbl_big_sparse_array_3d.hxx> instead"

Definition at line 99 of file vbl_big_sparse_array_3d.h.

Function Documentation

◆ operator<<()

template<class T >
std::ostream& operator<< ( std::ostream &  s,
vbl_big_sparse_array_3d< T >const &  a 
)
inline

Definition at line 94 of file vbl_big_sparse_array_3d.h.