|
| Array2D () |
| Creates null instance. More...
|
|
| Array2D (int w, int h) |
| Creates an uninitialized matrix of given size. More...
|
|
| Array2D (const Size &s) |
| Creates an uninitialized matrix of given size. More...
|
|
template<class Init > |
| Array2D (int w, int h, Init init) |
| Creates an initialized matrix with given initializer. More...
|
|
template<class Init > |
| Array2D (const Size &s, Init init) |
| Creates an initialized matrix with given initializer. More...
|
|
| Array2D (int w, int h, T *data, bool deepCopy=false) |
| Creates a matrix of size w x h, using given (optionally shared) data. More...
|
|
| Array2D (const Size &s, T *data, bool deepCopy=false) |
| Creates a matrix of given Size, using given (optionally shared) data. More...
|
|
| Array2D (int w, int h, const T *data) |
| Creates a matrix of size w x h, using given const data (always deep copy) More...
|
|
| Array2D (const Size &s, const T *data) |
| Creates a matrix of given Size using given const data (always deep copy) More...
|
|
template<class Iterator > |
| Array2D (int w, int h, Iterator begin, Iterator end) |
| Creates a matrix of size w x h, initialized with content from given range. More...
|
|
template<class Iterator > |
| Array2D (const Size &s, Iterator begin, Iterator end) |
| Creates a matrix of size w x h, initialized with content from given range. More...
|
|
template<class Value > |
void | fill (Value val) |
| fills the matrix with given value More...
|
|
template<class Iterator > |
void | assign (Iterator begin, Iterator end) |
| Assigns the matrix from given range. More...
|
|
int | getWidth () const |
| returns the matrix width More...
|
|
int | getHeight () const |
| returns the matrix height More...
|
|
int | getDim () const |
| returns the matrix dimension (width*height) More...
|
|
const Size & | getSize () const |
| returns the matrix size More...
|
|
T & | operator[] (int idx) |
| returns element at given linear index More...
|
|
const T & | operator[] (int idx) const |
| returns element at given linear index (const) More...
|
|
T & | operator() (int x, int y) |
| returns element at given x,y position More...
|
|
const T & | operator() (int x, int y) const |
| returns element at given x,y position (const) More...
|
|
iterator | begin () |
| upper left matrix element iterator More...
|
|
const_iterator | begin () const |
| upper left matrix element iterator (const) More...
|
|
iterator | end () |
| upper left matrix element iterator More...
|
|
const_iterator | end () const |
| upper left matrix element iterator More...
|
|
Array2D< T > | deepCopy () const |
| returns a deep copy of this matrix More...
|
|
void | detach () |
| ensures that the contained data is not shared by other instances More...
|
|
T * | data () |
| returns the data pointer More...
|
|
const T * | data () const |
| returns the data pointer (const version) More...
|
|
const T & | minElem (Point *pos=0) const |
| returns the minumum element of the matrix (operator < must be defined on T) More...
|
|
const T & | maxElem (Point *pos=0) const |
| returns the maximum element of the matrix (operator < must be defined on T) More...
|
|
void | setSize (const Size &size) |
| sets a new size More...
|
|
template<class Init > |
void | setSize (const Size &size, const Init &init) |
| sets size and fills with new entries More...
|
|
template<class T>
class icl::utils::Array2D< T >
Simple 2D-Array class that provides shallow copy per default.
This class replaces the former SimpleMatrix class
In contrast to the DynMatrix<T>-class template, the Array2D is designed for simple 2D data storage. The internal data layout is row-major i.e. the data is stored row-by-row. Array2D instances can be set up to have their own data, that is managed internally using a SmartArray<T> instance, or they can be wrapped around an existing data data pointer. In the latter case, the given data is not copied deeply which implicates that the data must remain valid.
Simplicity
In order to keep the class interface simple, Array2D instances cannot be resized. Simply assign a new instance with new size. Due to the internally used smart pointer, this entails only a very small and constant overhead