The template class Array1D is a 1D array (vector) able to hold any type of object as datatype. If the compilation flag NOSAFECHECKS is used, bounds check is turned off (leading to increased performances).
#include <Array1D.h>
Public Member Functions | |
Array1D (const size_t &asize=0) | |
Array1D (const size_t &asize, const T &init) | |
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 | size (size_t &nx) const |
size_t | size () const |
size_t | getNx () const |
void | resize (const size_t &asize) |
void | resize (const size_t &asize, const T &init) |
void | clear () |
bool | empty () const |
void | insertAt (const int &index, T e) |
void | removeAt (const size_t &index) |
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 Array1D< 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 Array1D< double > &rhs, const double &epsilon) const |
T & | operator[] (const size_t &index) |
const T | operator[] (const size_t &index) const |
T & | operator() (const size_t &index) |
const T | operator() (const size_t &index) const |
Array1D< T > & | operator= (const T &value) |
Array1D< T > & | operator+= (const T &rhs) |
const Array1D< T > | operator+ (const T &rhs) const |
Array1D< T > & | operator+= (const Array1D< T > &rhs) |
const Array1D< T > | operator+ (const Array1D< T > &rhs) const |
Array1D< T > & | operator-= (const T &rhs) |
const Array1D< T > | operator- (const T &rhs) const |
Array1D< T > & | operator-= (const Array1D< T > &rhs) |
const Array1D< T > | operator- (const Array1D< T > &rhs) const |
Array1D< T > & | operator*= (const T &rhs) |
const Array1D< T > | operator* (const T &rhs) const |
Array1D< T > & | operator*= (const Array1D< T > &rhs) |
const Array1D< T > | operator* (const Array1D< T > &rhs) const |
Array1D< T > & | operator/= (const T &rhs) |
const Array1D< T > | operator/ (const T &rhs) const |
Array1D< T > & | operator/= (const Array1D< T > &rhs) |
const Array1D< T > | operator/ (const Array1D< T > &rhs) const |
bool | operator== (const Array1D< T > &) const |
Operator that tests for equality. More... | |
bool | operator!= (const Array1D< T > &) const |
Operator that tests for inequality. More... | |
Static Public Member Functions | |
static bool | checkEpsilonEquality (const Array1D< double > &rhs1, const Array1D< double > &rhs2, const double &epsilon) |
Protected Attributes | |
std::vector< T > | vecData |
the actual data structure, that holds the objects of type T More... | |
size_t | nx |
this is introduced to omit the costly vecData.size() More... | |
bool | keep_nodata |
Friends | |
template<class P > | |
std::ostream & | operator<< (std::ostream &os, const Array1D< P > &array) |
template<class P > | |
std::istream & | operator>> (std::istream &is, Array1D< P > &array) |
mio::Array1D< T >::Array1D | ( | const size_t & | asize = 0 | ) |
mio::Array1D< T >::Array1D | ( | const size_t & | asize, |
const T & | init | ||
) |
A constructor that creates an array filled with constant values
asize | size of the new array |
init | initial value to fill the array with |
void mio::Array1D< T >::abs |
bool mio::Array1D< T >::checkEpsilonEquality | ( | const Array1D< double > & | rhs, |
const double & | epsilon | ||
) | const |
|
static |
void mio::Array1D< T >::clear |
bool mio::Array1D< T >::empty |
const Array1D< T > mio::Array1D< T >::getAbs |
returns the grid of the absolute value of values contained in the grid
size_t mio::Array1D< 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::Array1D< T >::getKeepNodata |
get how to process nodata values (ie: as nodata or as normal numbers)
T mio::Array1D< T >::getMax |
returns the maximum value contained in the grid
T mio::Array1D< T >::getMean |
returns the mean value contained in the grid
T mio::Array1D< T >::getMin |
returns the minimum value contained in the grid
size_t mio::Array1D< T >::getNx |
void mio::Array1D< T >::insertAt | ( | const int & | index, |
T | e | ||
) |
bool mio::Array1D< T >::operator!= | ( | const Array1D< T > & | in | ) | const |
Operator that tests for inequality.
|
inline |
|
inline |
const Array1D< T > mio::Array1D< T >::operator* | ( | const Array1D< T > & | rhs | ) | const |
const Array1D< T > mio::Array1D< T >::operator* | ( | const T & | rhs | ) | const |
Array1D< T > & mio::Array1D< T >::operator*= | ( | const Array1D< T > & | rhs | ) |
Array1D< T > & mio::Array1D< T >::operator*= | ( | const T & | rhs | ) |
const Array1D< T > mio::Array1D< T >::operator+ | ( | const Array1D< T > & | rhs | ) | const |
const Array1D< T > mio::Array1D< T >::operator+ | ( | const T & | rhs | ) | const |
Array1D< T > & mio::Array1D< T >::operator+= | ( | const Array1D< T > & | rhs | ) |
Array1D< T > & mio::Array1D< T >::operator+= | ( | const T & | rhs | ) |
const Array1D< T > mio::Array1D< T >::operator- | ( | const Array1D< T > & | rhs | ) | const |
const Array1D< T > mio::Array1D< T >::operator- | ( | const T & | rhs | ) | const |
Array1D< T > & mio::Array1D< T >::operator-= | ( | const Array1D< T > & | rhs | ) |
Array1D< T > & mio::Array1D< T >::operator-= | ( | const T & | rhs | ) |
const Array1D< T > mio::Array1D< T >::operator/ | ( | const Array1D< T > & | rhs | ) | const |
const Array1D< T > mio::Array1D< T >::operator/ | ( | const T & | rhs | ) | const |
Array1D< T > & mio::Array1D< T >::operator/= | ( | const Array1D< T > & | rhs | ) |
Array1D< T > & mio::Array1D< T >::operator/= | ( | const T & | rhs | ) |
Array1D< T > & mio::Array1D< T >::operator= | ( | const T & | value | ) |
bool mio::Array1D< T >::operator== | ( | const Array1D< T > & | in | ) | const |
Operator that tests for equality.
|
inline |
|
inline |
void mio::Array1D< T >::removeAt | ( | const size_t & | index | ) |
void mio::Array1D< T >::resize | ( | const size_t & | asize | ) |
void mio::Array1D< T >::resize | ( | const size_t & | asize, |
const T & | init | ||
) |
void mio::Array1D< 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::Array1D< T >::size |
void mio::Array1D< T >::size | ( | size_t & | nx | ) | const |
const std::string mio::Array1D< T >::toString |
|
friend |
|
friend |
|
protected |
|
protected |
this is introduced to omit the costly vecData.size()
|
protected |
the actual data structure, that holds the objects of type T