|
| | MultiArray () |
| | Empty constructor.
|
| |
| | MultiArray (const Coords< dim > &sz) |
| | Constructor (known size).
|
| |
| | MultiArray (const MultiArray &A) |
| | Copy constructor.
|
| |
| template<typename T2> |
| | MultiArray (const MultiArray< T2, dim > &A) |
| | Constructor (different type).
|
| |
| | MultiArray (int s0, int s1) |
| | Constructor (2D shorcut).
|
| |
| | MultiArray (int s0, int s1, int s2) |
| | Constructor (3D shorcut).
|
| |
| | MultiArray (T *ptr, const Coords< dim > &sz, bool handleDelete=false) |
| | Constructor (pre-allocated).
|
| |
| | MultiArray (T *ptr, int s0, int s1, bool handleDelete=false) |
| | Constructor (pre-allocated) 2D alias.
|
| |
| | MultiArray (T *ptr, int s0, int s1, int s2, bool handleDelete=false) |
| | Constructor (pre-allocated) 3D alias.
|
| |
| virtual | ~MultiArray () |
| | Destructor.
|
| |
| MultiArray | clone () const |
| | Cloning.
|
| |
| CoordsIterator< dim > | coordsBegin () const |
| | Begin coords iterator.
|
| |
| CoordsIterator< dim > | coordsEnd () const |
| | End coords iterator.
|
| |
| int | depth () const |
| | Size alias 2.
|
| |
| MultiArray & | fill (T x) |
| | Filling.
|
| |
| MultiArray | getSubArray (const Coords< dim > &offset, const Coords< dim > &sz) const |
| | Sub array.
|
| |
| int | height () const |
| | Size alias 1.
|
| |
| size_t | offset (const Coords< dim > &c) const |
| | Offset.
|
| |
| size_t | offset (int x, int y) const |
| | Offset (2D alias).
|
| |
| size_t | offset (int x, int y, int z) const |
| | Offset (3D alias).
|
| |
| T & | operator() (const Coords< dim > &c) |
| | Write access.
|
| |
| const T & | operator() (const Coords< dim > &c) const |
| | Read access.
|
| |
| T & | operator() (int x, int y) |
| | Write access 2D alias.
|
| |
| const T & | operator() (int x, int y) const |
| | Read access 2D alias.
|
| |
| T & | operator() (int x, int y, int z) |
| | Write access 3D alias.
|
| |
| const T & | operator() (int x, int y, int z) const |
| | Read access 3D alias.
|
| |
| MultiArray & | operator= (const MultiArray &A) |
| | Assignment.
|
| |
| template<typename T2> |
| MultiArray & | operator= (const MultiArray< T2, dim > &A) |
| | Assignment (different type).
|
| |
| void | setSize (const Coords< dim > &sz) |
| | Change sizes.
|
| |
| void | setSize (int s0, int s1) |
| | Change size 2D alias.
|
| |
| void | setSize (int s0, int s1, int s2) |
| | Change size 3D alias.
|
| |
| int | size (int i) const |
| | ith size.
|
| |
| Coords< dim > | sizes () const |
| | Sizes.
|
| |
| FArray< size_t, dim > | stride () const |
| | Stride.
|
| |
| size_t | stride (int i) const |
| | ith stride.
|
| |
| size_t | totalSize () const |
| | Total Size.
|
| |
| int | width () const |
| | Size alias 0.
|
| |
| | Array () |
| | Empty constructor.
|
| |
| | Array (const Array &A) |
| | Copy constructor.
|
| |
| template<typename T2> |
| | Array (const Array< T2 > &A) |
| | Constructor (different type).
|
| |
| | Array (const std::list< T > &L) |
| | Constructor (from list).
|
| |
| | Array (size_t size) |
| | Constructor (known size).
|
| |
| | Array (T *ptr, size_t size, bool handleDelete=false) |
| | Constructor (pre-allocated).
|
| |
| virtual | ~Array () |
| | Destructor.
|
| |
| iterator | begin () |
| | Begin iterator.
|
| |
| const_iterator | begin () const |
| | Begin const iterator.
|
| |
| Array | clone () const |
| | Cloning.
|
| |
| T * | data () |
| | Data pointer (read/write).
|
| |
| const T * | data () const |
| | Data pointer (read).
|
| |
| bool | empty () const |
| | Is empty.
|
| |
| iterator | end () |
| | End iterator.
|
| |
| const_iterator | end () const |
| | End const iterator.
|
| |
| Array & | fill (const T &x) |
| | Filling.
|
| |
| Array | getSubArray (size_t offset, size_t size) const |
| | Sub array.
|
| |
| bool | operator!= (const Array &A) const |
| | Inequality test.
|
| |
| Array & | operator= (const Array &A) |
| | Assignment.
|
| |
| template<typename T2> |
| Array & | operator= (const Array< T2 > &A) |
| | Assignment (different type).
|
| |
| bool | operator== (const Array &A) const |
| | Equality test.
|
| |
| T & | operator[] (size_t i) |
| | Write access.
|
| |
| const T & | operator[] (size_t i) const |
| | Read access.
|
| |
| void | setSize (size_t size) |
| | Change size.
|
| |
| size_t | size () const |
| | Size.
|
| |
template<typename T, int dim>
class Imagine::MultiArray< T, dim >
nD array of variable size. Memory is reference counted, i.e.:
- a=b results in a and b sharing the same memory
- the last object using memory frees it when it dies
- use clone() when this sharing is not desired
- Parameters
-
- Examples
- Common/test/test.cpp.
template<typename T, int dim>
Constructs an array of variables of type T and dimension dim, stored at an already allocated memory. ptr contains elements (0,0,...), (1,0,...), ... Does not allocate fresh memory. Does not free given memory at object destruction unless handleDelete=true. This memory must indeed stay available during object life.
- Parameters
-
| ptr | address of memory |
| sz | array sizes |
| handleDelete | delete memory at destruction? (default=false) |
char t[6]={'a','b','c','d','e','f'};
char *t2=new char[6];
template<typename T, int dim>
| Imagine::MultiArray< T, dim >::MultiArray |
( |
T * | ptr, |
|
|
int | s0, |
|
|
int | s1, |
|
|
bool | handleDelete = false ) |
|
inline |
Constructs an array of variables of type T and dimension 2, stored at an already allocated memory. ptr contains elements (0,0), (1,0), ... Does not allocate fresh memory. Does not free given memory at object destruction unless handleDelete=true. This memory must indeed stay available during object life.
- Parameters
-
| ptr | address of memory |
| s0 | array size for dimension 0 |
| s1 | array size for dimension 1 |
| handleDelete | delete memory at destruction? (default=false) |
template<typename T, int dim>
| Imagine::MultiArray< T, dim >::MultiArray |
( |
T * | ptr, |
|
|
int | s0, |
|
|
int | s1, |
|
|
int | s2, |
|
|
bool | handleDelete = false ) |
|
inline |
Constructs an array of variables of type T and dimension 3, stored at an already allocated memory. ptr contains elements (0,0,0), (1,0,0), ... Does not allocate fresh memory. Does not free given memory at object destruction unless handleDelete=true. This memory must indeed stay available during object life.
- Parameters
-
| ptr | address of memory |
| s0 | array size for dimension 0 |
| s1 | array size for dimension 1 |
| s2 | array size for dimension 2 |
| handleDelete | delete memory at destruction? (default=false) |