The template class Array3D is a 3D Array (Tensor) able to hold any type of object as datatype. It relies on the Array3DProxy2 class to provide the [][][] operator (slower than the (i,j,k) call). If the compilation flag NOSAFECHECKS is used, bounds check is turned off (leading to increased performances).
#include <Array3D.h>
Public Member Functions | |
Array3D () | |
Array3D (const Array3D< T > &i_array3D, const size_t &i_nx, const size_t &i_ny, const size_t &i_nz, const size_t &i_ncols, const size_t &i_nrows, const size_t &i_ndepth) | |
Array3D (const size_t &anx, const size_t &any, const size_t &anz) | |
Array3D (const size_t &anx, const size_t &any, const size_t &anz, const T &init) | |
void | subset (const Array3D< T > &i_array3D, const size_t &i_nx, const size_t &i_ny, const size_t &i_nz, const size_t &i_ncols, const size_t &i_nrows, const size_t &i_ndepth) |
void | fill (const Array3D< T > &i_array3D, const size_t &i_nx, const size_t &i_ny, const size_t &i_nz, const size_t &i_ncols, const size_t &i_nrows, const size_t &i_ndepth) |
A method that can be used to insert a subplane into an existing Array3D object that is passed as i_array3D argument. This is exactly the opposite of the subset method an can be used to rebuild an array from subsets. More... | |
void | fill (const Array3D< T > &i_array3D, const size_t &i_nx, const size_t &i_ny, const size_t &i_nz) |
void | insert (const Array2D< T > &layer, const size_t &depth) |
insert a 2D layer in an Array3D object The (nx ,ny) dimensions of the 2D and the 3D arrays must match and the insertion depth must exist in the Array3D. More... | |
void | setKeepNodata (const bool i_keep_nodata) |
set how to process nodata values (ie: as nodata or as normal numbers) More... | |
bool | getKeepNodata () const |
get how to process nodata values (ie: as nodata or as normal numbers) More... | |
void | resize (const size_t &anx, const size_t &any, const size_t &anz) |
void | resize (const size_t &anx, const size_t &any, const size_t &anz, const T &init) |
void | size (size_t &anx, size_t &any, size_t &anz) const |
size_t | size () const |
size_t | getNx () const |
size_t | getNy () const |
size_t | getNz () const |
void | clear () |
bool | empty () const |
T | getMin () const |
returns the minimum value contained in the grid More... | |
T | getMax () const |
returns the maximum value contained in the grid More... | |
T | getMean () const |
returns the mean value contained in the grid More... | |
size_t | getCount () const |
returns the number of points contained in the grid. If setNodataHandling(IOUtils::RAW_NODATA), then the number of points is the size of the grid. If setNodataHandling(IOUtils::PARSE_NODATA), then it is the number of non-nodata values in the grid More... | |
const Array3D< T > | getAbs () const |
returns the grid of the absolute value of values contained in the grid More... | |
void | abs () |
const std::string | toString () const |
bool | checkEpsilonEquality (const Array3D< double > &rhs, const double &epsilon) const |
T & | operator() (const size_t &i) |
const T | operator() (const size_t &i) const |
T & | operator() (const size_t &x, const size_t &y, const size_t &z) |
const T | operator() (const size_t &x, const size_t &y, const size_t &z) const |
Array3DProxy< T > | operator[] (const size_t &i) |
Array3D< T > & | operator= (const T &value) |
Array3D< T > & | operator+= (const T &rhs) |
const Array3D< T > | operator+ (const T &rhs) const |
Array3D< T > & | operator+= (const Array3D< T > &rhs) |
const Array3D< T > | operator+ (const Array3D< T > &rhs) const |
Array3D< T > & | operator-= (const T &rhs) |
const Array3D< T > | operator- (const T &rhs) const |
Array3D< T > & | operator-= (const Array3D< T > &rhs) |
const Array3D< T > | operator- (const Array3D< T > &rhs) const |
Array3D< T > & | operator*= (const T &rhs) |
const Array3D< T > | operator* (const T &rhs) const |
Array3D< T > & | operator*= (const Array3D< T > &rhs) |
const Array3D< T > | operator* (const Array3D< T > &rhs) const |
Array3D< T > & | operator/= (const T &rhs) |
const Array3D< T > | operator/ (const T &rhs) const |
Array3D< T > & | operator/= (const Array3D< T > &rhs) |
const Array3D< T > | operator/ (const Array3D< T > &rhs) const |
bool | operator== (const Array3D< T > &) const |
Operator that tests for equality. More... | |
bool | operator!= (const Array3D< T > &) const |
Operator that tests for inequality. More... | |
Static Public Member Functions | |
static bool | checkEpsilonEquality (const Array3D< double > &rhs1, const Array3D< double > &rhs2, const double &epsilon) |
Protected Attributes | |
std::vector< T > | vecData |
The actual objects are stored in a one-dimensional vector. More... | |
size_t | nx |
size_t | ny |
size_t | nz |
size_t | nxny |
bool | keep_nodata |
Friends | |
template<class P > | |
std::ostream & | operator<< (std::ostream &os, const Array3D< P > &array) |
template<class P > | |
std::istream & | operator>> (std::istream &is, Array3D< P > &array) |
mio::Array3D< T >::Array3D |
mio::Array3D< T >::Array3D | ( | const Array3D< T > & | i_array3D, |
const size_t & | i_nx, | ||
const size_t & | i_ny, | ||
const size_t & | i_nz, | ||
const size_t & | i_ncols, | ||
const size_t & | i_nrows, | ||
const size_t & | i_ndepth | ||
) |
A constructor that can be used to create an Array3D object that is contained in the one passed as i_array3D argument. The resulting Array3D object is a by value copy of a subvolume of the volume spanned by the i_array3D
i_array3D | array containing to extract the values from |
i_nx | lower left corner cell X index |
i_ny | lower left corner cell Y index |
i_nz | lower left corner cell Z index |
i_ncols | number of columns of the new array |
i_nrows | number of rows of the new array |
i_ndepth | number of depths of the new array |
mio::Array3D< T >::Array3D | ( | const size_t & | anx, |
const size_t & | any, | ||
const size_t & | anz | ||
) |
A constructor that creates an array of a given size
anx | number of columns of the new array |
any | number of rows of the new array |
anz | number of rows of the new array |
mio::Array3D< T >::Array3D | ( | const size_t & | anx, |
const size_t & | any, | ||
const size_t & | anz, | ||
const T & | init | ||
) |
A constructor that creates an array filled with constant values
anx | number of columns of the new array |
any | number of rows of the new array |
anz | number of depths of the new array |
init | initial value to fill the array with |
void mio::Array3D< T >::abs |
bool mio::Array3D< T >::checkEpsilonEquality | ( | const Array3D< double > & | rhs, |
const double & | epsilon | ||
) | const |
|
static |
void mio::Array3D< T >::clear |
bool mio::Array3D< T >::empty |
void mio::Array3D< T >::fill | ( | const Array3D< T > & | i_array3D, |
const size_t & | i_nx, | ||
const size_t & | i_ny, | ||
const size_t & | i_nz | ||
) |
void mio::Array3D< T >::fill | ( | const Array3D< T > & | i_array3D, |
const size_t & | i_nx, | ||
const size_t & | i_ny, | ||
const size_t & | i_nz, | ||
const size_t & | i_ncols, | ||
const size_t & | i_nrows, | ||
const size_t & | i_ndepth | ||
) |
A method that can be used to insert a subplane into an existing Array3D object that is passed as i_array3D argument. This is exactly the opposite of the subset method an can be used to rebuild an array from subsets.
i_array3D | array containing to extract the values from |
i_nx | lower left corner cell X index |
i_ny | lower left corner cell Y index |
i_nz | lower left corner cell Z index |
i_ncols | number of columns of the new array |
i_nrows | number of rows of the new array |
i_ndepth | number of depths of the new array |
const Array3D< T > mio::Array3D< T >::getAbs |
returns the grid of the absolute value of values contained in the grid
size_t mio::Array3D< T >::getCount |
returns the number of points contained in the grid. If setNodataHandling(IOUtils::RAW_NODATA), then the number of points is the size of the grid. If setNodataHandling(IOUtils::PARSE_NODATA), then it is the number of non-nodata values in the grid
bool mio::Array3D< T >::getKeepNodata |
get how to process nodata values (ie: as nodata or as normal numbers)
T mio::Array3D< T >::getMax |
returns the maximum value contained in the grid
T mio::Array3D< T >::getMean |
returns the mean value contained in the grid
T mio::Array3D< T >::getMin |
returns the minimum value contained in the grid
size_t mio::Array3D< T >::getNx |
size_t mio::Array3D< T >::getNy |
size_t mio::Array3D< T >::getNz |
void mio::Array3D< T >::insert | ( | const Array2D< T > & | layer, |
const size_t & | depth | ||
) |
bool mio::Array3D< T >::operator!= | ( | const Array3D< T > & | in | ) | const |
Operator that tests for inequality.
|
inline |
|
inline |
|
inline |
|
inline |
const Array3D< T > mio::Array3D< T >::operator* | ( | const Array3D< T > & | rhs | ) | const |
const Array3D< T > mio::Array3D< T >::operator* | ( | const T & | rhs | ) | const |
Array3D< T > & mio::Array3D< T >::operator*= | ( | const Array3D< T > & | rhs | ) |
Array3D< T > & mio::Array3D< T >::operator*= | ( | const T & | rhs | ) |
const Array3D< T > mio::Array3D< T >::operator+ | ( | const Array3D< T > & | rhs | ) | const |
const Array3D< T > mio::Array3D< T >::operator+ | ( | const T & | rhs | ) | const |
Array3D< T > & mio::Array3D< T >::operator+= | ( | const Array3D< T > & | rhs | ) |
Array3D< T > & mio::Array3D< T >::operator+= | ( | const T & | rhs | ) |
const Array3D< T > mio::Array3D< T >::operator- | ( | const Array3D< T > & | rhs | ) | const |
const Array3D< T > mio::Array3D< T >::operator- | ( | const T & | rhs | ) | const |
Array3D< T > & mio::Array3D< T >::operator-= | ( | const Array3D< T > & | rhs | ) |
Array3D< T > & mio::Array3D< T >::operator-= | ( | const T & | rhs | ) |
const Array3D< T > mio::Array3D< T >::operator/ | ( | const Array3D< T > & | rhs | ) | const |
const Array3D< T > mio::Array3D< T >::operator/ | ( | const T & | rhs | ) | const |
Array3D< T > & mio::Array3D< T >::operator/= | ( | const Array3D< T > & | rhs | ) |
Array3D< T > & mio::Array3D< T >::operator/= | ( | const T & | rhs | ) |
Array3D< T > & mio::Array3D< T >::operator= | ( | const T & | value | ) |
bool mio::Array3D< T >::operator== | ( | const Array3D< T > & | in | ) | const |
Operator that tests for equality.
Array3DProxy< T > mio::Array3D< T >::operator[] | ( | const size_t & | i | ) |
void mio::Array3D< T >::resize | ( | const size_t & | anx, |
const size_t & | any, | ||
const size_t & | anz | ||
) |
void mio::Array3D< T >::resize | ( | const size_t & | anx, |
const size_t & | any, | ||
const size_t & | anz, | ||
const T & | init | ||
) |
void mio::Array3D< T >::setKeepNodata | ( | const bool | i_keep_nodata | ) |
set how to process nodata values (ie: as nodata or as normal numbers)
i_keep_nodata | true means that NODATA is interpreted as NODATA, false means that it is a normal number By default, arrays keep nodata. |
size_t mio::Array3D< T >::size |
void mio::Array3D< T >::size | ( | size_t & | anx, |
size_t & | any, | ||
size_t & | anz | ||
) | const |
void mio::Array3D< T >::subset | ( | const Array3D< T > & | i_array3D, |
const size_t & | i_nx, | ||
const size_t & | i_ny, | ||
const size_t & | i_nz, | ||
const size_t & | i_ncols, | ||
const size_t & | i_nrows, | ||
const size_t & | i_ndepth | ||
) |
A method that can be used to create an Array3D object that is contained in the one passed as i_array3D argument. The resulting Array3D object is a by value copy of a subvolume of the volume spanned by the i_array3D
i_array3D | array containing to extract the values from |
i_nx | lower left corner cell X index |
i_ny | lower left corner cell Y index |
i_nz | lower left corner cell Z index |
i_ncols | number of columns of the new array |
i_nrows | number of rows of the new array |
i_ndepth | number of depths of the new array |
const std::string mio::Array3D< T >::toString |
|
friend |
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
The actual objects are stored in a one-dimensional vector.