MeteoIODoc  MeteoIODoc-2.6.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mio::Array4D< T > Class Template Reference

Detailed Description

template<class T>
class mio::Array4D< T >

The template class Array4D is a 4D Array (Tensor) able to hold any type of object as datatype.

Date
2012-12-20
Author
Till Schumann

#include <Array4D.h>

Public Member Functions

 Array4D ()
 
 Array4D (const Array4D< T > &i_array4D, const size_t &i_nw, const size_t &i_nx, const size_t &i_ny, const size_t &i_nz, const size_t &i_sizeW, const size_t &i_sizeX, const size_t &i_sizeY, const size_t &i_sizeZ)
 
 Array4D (const size_t &anw, const size_t &anx, const size_t &any, const size_t &anz)
 
 Array4D (const size_t &i_sizeW, const size_t &i_sizeX, const size_t &i_sizeY, const size_t &i_sizeZ, const T &init)
 
void subset (const Array4D< T > &i_array4D, const size_t &i_nw, const size_t &i_nx, const size_t &i_ny, const size_t &i_nz, const size_t &i_sizeW, const size_t &i_sizeX, const size_t &i_sizeY, const size_t &i_sizeZ)
 
void fill (const Array4D< T > &i_array4D, const size_t &i_nw, const size_t &i_nx, const size_t &i_ny, const size_t &i_nz, const size_t &i_sizeW, const size_t &i_sizeX, const size_t &i_sizeY, const size_t &i_sizeZ)
 A method that can be used to insert a subplane into an existing Array4D object that is passed as i_array4D argument. This is exactly the opposite of the subset method an can be used to rebuild an array from subsets. More...
 
void fill (const Array4D< T > &i_array4D, const size_t &i_nw, const size_t &i_nx, const size_t &i_ny, const size_t &i_nz)
 
void setKeepNodata (const bool i_keep_nodata)
 set how to process nodata values (ie: as nodata or as normal numbers) More...
 
bool getKeepNodata ()
 get how to process nodata values (ie: as nodata or as normal numbers) More...
 
void resize (const size_t &anw, const size_t &anx, const size_t &any, const size_t &anz)
 
void resize (const size_t &anw, const size_t &anx, const size_t &any, const size_t &anz, const T &init)
 
void size (size_t &anw, size_t &anx, size_t &any, size_t &anz) const
 
size_t size () const
 
size_t getNw () const
 
size_t getNx () const
 
size_t getNy () const
 
size_t getNz () const
 
void clear ()
 
bool empty () const
 
getMin () const
 returns the minimum value contained in the grid More...
 
getMax () const
 returns the maximum value contained in the grid More...
 
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 Array4D< 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 Array4D< 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 &w, const size_t &x, const size_t &y, const size_t &z)
 
const T operator() (const size_t &w, const size_t &x, const size_t &y, const size_t &z) const
 
Array4D< T > & operator= (const Array4D< T > &)
 
Array4D< T > & operator= (const T &value)
 
Array4D< T > & operator+= (const T &rhs)
 
const Array4D< T > operator+ (const T &rhs) const
 
Array4D< T > & operator+= (const Array4D< T > &rhs)
 
const Array4D< T > operator+ (const Array4D< T > &rhs) const
 
Array4D< T > & operator-= (const T &rhs)
 
const Array4D< T > operator- (const T &rhs) const
 
Array4D< T > & operator-= (const Array4D< T > &rhs)
 
const Array4D< T > operator- (const Array4D< T > &rhs) const
 
Array4D< T > & operator*= (const T &rhs)
 
const Array4D< T > operator* (const T &rhs) const
 
Array4D< T > & operator*= (const Array4D< T > &rhs)
 
const Array4D< T > operator* (const Array4D< T > &rhs) const
 
Array4D< T > & operator/= (const T &rhs)
 
const Array4D< T > operator/ (const T &rhs) const
 
Array4D< T > & operator/= (const Array4D< T > &rhs)
 
const Array4D< T > operator/ (const Array4D< T > &rhs) const
 
bool operator== (const Array4D< T > &) const
 Operator that tests for equality. More...
 
bool operator!= (const Array4D< T > &) const
 Operator that tests for inequality. More...
 

Static Public Member Functions

static bool checkEpsilonEquality (const Array4D< double > &rhs1, const Array4D< double > &rhs2, const double &epsilon)
 

Protected Attributes

std::vector< T > vecData
 The actual objects are stored in a one-dimensional vector. More...
 
size_t nw
 
size_t nx
 
size_t ny
 
size_t nz
 
size_t nwnx
 
size_t nwnxny
 
bool keep_nodata
 

Friends

template<class P >
std::iostream & operator<< (std::iostream &os, const Array4D< P > &array)
 
template<class P >
std::iostream & operator>> (std::iostream &is, Array4D< P > &array)
 

Constructor & Destructor Documentation

template<class T >
mio::Array4D< T >::Array4D ( )
template<class T >
mio::Array4D< T >::Array4D ( const Array4D< T > &  i_array4D,
const size_t &  i_nw,
const size_t &  i_nx,
const size_t &  i_ny,
const size_t &  i_nz,
const size_t &  i_sizeW,
const size_t &  i_sizeX,
const size_t &  i_sizeY,
const size_t &  i_sizeZ 
)

A constructor that can be used to create an Array4D object that is contained in the one passed as i_array4D argument. The resulting Array4D object is a by value copy of a subvolume of the volume spanned by the i_array4D

Parameters
i_array4Darray containing to extract the values from
i_nwlower left corner cell W index
i_nxlower left corner cell X index
i_nylower left corner cell Y index
i_nzlower left corner cell Z index
i_sizeWlength of the w dimension of the new array
i_sizeXlength of the x dimension of the new array
i_sizeYlength of the y dimension of the new array
i_sizeZlength of the z dimension of the new array
template<class T >
mio::Array4D< T >::Array4D ( const size_t &  anw,
const size_t &  anx,
const size_t &  any,
const size_t &  anz 
)
template<class T >
mio::Array4D< T >::Array4D ( const size_t &  i_sizeW,
const size_t &  i_sizeX,
const size_t &  i_sizeY,
const size_t &  i_sizeZ,
const T &  init 
)

A constructor that creates an array filled with constant values

Parameters
i_sizeWlength of the w dimension of the new array
i_sizeXlength of the x dimension of the new array
i_sizeYlength of the y dimension of the new array
i_sizeZlength of the z dimension of the new array
initinitial value to fill the array with

Member Function Documentation

template<class T >
void mio::Array4D< T >::abs ( )
template<class T >
bool mio::Array4D< T >::checkEpsilonEquality ( const Array4D< double > &  rhs,
const double &  epsilon 
) const
template<class T >
bool mio::Array4D< T >::checkEpsilonEquality ( const Array4D< double > &  rhs1,
const Array4D< double > &  rhs2,
const double &  epsilon 
)
static
template<class T >
void mio::Array4D< T >::clear ( )
template<class T >
bool mio::Array4D< T >::empty ( ) const
template<class T >
void mio::Array4D< T >::fill ( const Array4D< T > &  i_array4D,
const size_t &  i_nw,
const size_t &  i_nx,
const size_t &  i_ny,
const size_t &  i_nz,
const size_t &  i_sizeW,
const size_t &  i_sizeX,
const size_t &  i_sizeY,
const size_t &  i_sizeZ 
)

A method that can be used to insert a subplane into an existing Array4D object that is passed as i_array4D argument. This is exactly the opposite of the subset method an can be used to rebuild an array from subsets.

Parameters
i_array4Darray containing to extract the values from
i_nwlower left corner cell W index
i_nxlower left corner cell X index
i_nylower left corner cell Y index
i_nzlower left corner cell Z index
i_sizeWlength of the w dimension of the new array
i_sizeXlength of the x dimension of the new array
i_sizeYlength of the y dimension of the new array
i_sizeZlength of the z dimension of the new array
template<class T >
void mio::Array4D< T >::fill ( const Array4D< T > &  i_array4D,
const size_t &  i_nw,
const size_t &  i_nx,
const size_t &  i_ny,
const size_t &  i_nz 
)
template<class T >
const Array4D< T > mio::Array4D< T >::getAbs ( ) const

returns the grid of the absolute value of values contained in the grid

Returns
grid of abs(grid)
template<class T >
size_t mio::Array4D< 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

Returns
count
template<class T >
bool mio::Array4D< T >::getKeepNodata ( )

get how to process nodata values (ie: as nodata or as normal numbers)

Returns
true means that NODATA is interpreted as NODATA, false means that it is a normal number
template<class T >
T mio::Array4D< T >::getMax ( ) const

returns the maximum value contained in the grid

Returns
maximum value
template<class T >
T mio::Array4D< T >::getMean ( ) const

returns the mean value contained in the grid

Returns
mean value
template<class T >
T mio::Array4D< T >::getMin ( ) const

returns the minimum value contained in the grid

Returns
minimum value
template<class T >
size_t mio::Array4D< T >::getNw ( ) const
template<class T >
size_t mio::Array4D< T >::getNx ( ) const
template<class T >
size_t mio::Array4D< T >::getNy ( ) const
template<class T >
size_t mio::Array4D< T >::getNz ( ) const
template<class T >
bool mio::Array4D< T >::operator!= ( const Array4D< T > &  in) const

Operator that tests for inequality.

template<class T >
T & mio::Array4D< T >::operator() ( const size_t &  i)
inline
template<class T >
const T mio::Array4D< T >::operator() ( const size_t &  i) const
inline
template<class T >
T & mio::Array4D< T >::operator() ( const size_t &  w,
const size_t &  x,
const size_t &  y,
const size_t &  z 
)
inline
template<class T >
const T mio::Array4D< T >::operator() ( const size_t &  w,
const size_t &  x,
const size_t &  y,
const size_t &  z 
) const
inline
template<class T >
const Array4D< T > mio::Array4D< T >::operator* ( const T &  rhs) const
template<class T >
const Array4D< T > mio::Array4D< T >::operator* ( const Array4D< T > &  rhs) const
template<class T >
Array4D< T > & mio::Array4D< T >::operator*= ( const T &  rhs)
template<class T >
Array4D< T > & mio::Array4D< T >::operator*= ( const Array4D< T > &  rhs)
template<class T >
const Array4D< T > mio::Array4D< T >::operator+ ( const T &  rhs) const
template<class T >
const Array4D< T > mio::Array4D< T >::operator+ ( const Array4D< T > &  rhs) const
template<class T >
Array4D< T > & mio::Array4D< T >::operator+= ( const T &  rhs)
template<class T >
Array4D< T > & mio::Array4D< T >::operator+= ( const Array4D< T > &  rhs)
template<class T >
const Array4D< T > mio::Array4D< T >::operator- ( const T &  rhs) const
template<class T >
const Array4D< T > mio::Array4D< T >::operator- ( const Array4D< T > &  rhs) const
template<class T >
Array4D< T > & mio::Array4D< T >::operator-= ( const T &  rhs)
template<class T >
Array4D< T > & mio::Array4D< T >::operator-= ( const Array4D< T > &  rhs)
template<class T >
const Array4D< T > mio::Array4D< T >::operator/ ( const T &  rhs) const
template<class T >
const Array4D< T > mio::Array4D< T >::operator/ ( const Array4D< T > &  rhs) const
template<class T >
Array4D< T > & mio::Array4D< T >::operator/= ( const T &  rhs)
template<class T >
Array4D< T > & mio::Array4D< T >::operator/= ( const Array4D< T > &  rhs)
template<class T >
Array4D< T > & mio::Array4D< T >::operator= ( const Array4D< T > &  source)
template<class T >
Array4D< T > & mio::Array4D< T >::operator= ( const T &  value)
template<class T >
bool mio::Array4D< T >::operator== ( const Array4D< T > &  in) const

Operator that tests for equality.

template<class T >
void mio::Array4D< T >::resize ( const size_t &  anw,
const size_t &  anx,
const size_t &  any,
const size_t &  anz 
)
template<class T >
void mio::Array4D< T >::resize ( const size_t &  anw,
const size_t &  anx,
const size_t &  any,
const size_t &  anz,
const T &  init 
)
template<class T >
void mio::Array4D< T >::setKeepNodata ( const bool  i_keep_nodata)

set how to process nodata values (ie: as nodata or as normal numbers)

Parameters
i_keep_nodatatrue means that NODATA is interpreted as NODATA, false means that it is a normal number By default, arrays keep nodata.
template<class T >
void mio::Array4D< T >::size ( size_t &  anw,
size_t &  anx,
size_t &  any,
size_t &  anz 
) const
template<class T >
size_t mio::Array4D< T >::size ( ) const
template<class T >
void mio::Array4D< T >::subset ( const Array4D< T > &  i_array4D,
const size_t &  i_nw,
const size_t &  i_nx,
const size_t &  i_ny,
const size_t &  i_nz,
const size_t &  i_sizeW,
const size_t &  i_sizeX,
const size_t &  i_sizeY,
const size_t &  i_sizeZ 
)

A method that can be used to create an Array4D object that is contained in the one passed as i_array4D argument. The resulting Array4D object is a by value copy of a subvolume of the volume spanned by the i_array4D

Parameters
i_array4Darray containing to extract the values from
i_nwlower left corner cell W index
i_nxlower left corner cell X index
i_nylower left corner cell Y index
i_nzlower left corner cell Z index
i_sizeWlength of the w dimension of the new array
i_sizeXlength of the x dimension of the new array
i_sizeYlength of the y dimension of the new array
i_sizeZlength of the z dimension of the new array
template<class T >
const std::string mio::Array4D< T >::toString ( ) const

Friends And Related Function Documentation

template<class T>
template<class P >
std::iostream& operator<< ( std::iostream &  os,
const Array4D< P > &  array 
)
friend
template<class T>
template<class P >
std::iostream& operator>> ( std::iostream &  is,
Array4D< P > &  array 
)
friend

Member Data Documentation

template<class T>
bool mio::Array4D< T >::keep_nodata
protected
template<class T>
size_t mio::Array4D< T >::nw
protected
template<class T>
size_t mio::Array4D< T >::nwnx
protected
template<class T>
size_t mio::Array4D< T >::nwnxny
protected
template<class T>
size_t mio::Array4D< T >::nx
protected
template<class T>
size_t mio::Array4D< T >::ny
protected
template<class T>
size_t mio::Array4D< T >::nz
protected
template<class T>
std::vector<T> mio::Array4D< T >::vecData
protected

The actual objects are stored in a one-dimensional vector.


The documentation for this class was generated from the following file: