|
| | AllocArray1D (Allocator *allocator, size_t maxElem) |
| | Rank-1 AllocArray from *allocator with capacity maxElem and size 0.
|
| |
| | AllocArray1D (Allocator &allocator, size_t maxElem) |
| | Rank-1 AllocArray from allocator with capacity maxElem and size 0.
|
| |
| | AllocArray1D (const AllocArray1D< T > &other) |
| | Share other's block (AllocArray copy constructor) and copy its capacity.
|
| |
| AllocArray1D< T > & | operator= (const AllocArray1D< T > &other) |
| | Assign other as AllocArray::operator= does and copy its capacity.
|
| |
| void | push_back (const T &i) |
| | Copy-construct i at index size() and increment the size.
|
| |
| void | clear () |
| | Call the destructor of each element and set the size to 0.
|
| |
| uint32_t | capacity () |
| | Return the capacity given to the constructor.
|
| |
| uint32_t | size () |
| | Return the number of elements (shape entry 0).
|
| |
| | AllocArray (Allocator &allocator, size_t maxElem, uint32_t rank) |
| | Allocate one block for the shape, the reference count and maxElem elements, and set the rank, every shape entry to 0 and the count to 1.
|
| |
| | AllocArray (const AllocArray< T > &other) |
| | Share other's block and increment the reference count.
|
| |
| AllocArray< T > & | operator= (const AllocArray< T > &other) |
| | Decrement this object's count, freeing its block with its allocator when the count reaches 0, then share other's block and increment that count.
|
| |
| virtual | ~AllocArray () |
| | Log a syslog error if the count is already <= 0, decrement it, and when it reaches 0 call the destructor of each of the num_elem() elements and free the block.
|
| |
| void | incRefCnt () |
| | Increment the shared reference count.
|
| |
| void | decRefCnt () |
| | Decrement the shared reference count.
|
| |
| uint32_t & | _refCnt () |
| | Return a reference to the shared reference count; public so cython can reach it (per the comment above).
|
| |
| | Array (void *data, uint32_t *shape, uint32_t rank) |
| | Wrap data (reinterpreted as T*), shape and rank; nothing is copied.
|
| |
| | Array () |
| | Construct an empty view: null data and shape pointers, rank 0.
|
| |
| | Array (const Array &a) |
| | Copy the data pointer, shape pointer and rank of a (shallow copy).
|
| |
| Array & | operator= (const Array &o) |
| | Copy the data pointer, shape pointer and rank of o (shallow); self-assignment does nothing.
|
| |
| T & | operator() (unsigned i) |
| | Return a reference to element i.
|
| |
| T & | operator() (unsigned i, unsigned j) |
| | Return a reference to element (i, j) at offset i*shape[1]+j.
|
| |
| T & | operator() (unsigned i, unsigned j, unsigned k) |
| | Return a reference to element (i, j, k) at the row-major offset.
|
| |
| T & | operator() (unsigned i, unsigned j, unsigned k, unsigned l) |
| | Return a reference to element (i, j, k, l) at the row-major offset.
|
| |
| T & | operator() (unsigned i, unsigned j, unsigned k, unsigned l, unsigned m) |
| | Return a reference to element (i, j, k, l, m) at the row-major offset.
|
| |
| uint32_t | rank () const |
| | Return the rank.
|
| |
| uint32_t * | shape () const |
| | Return the shape pointer (not a copy).
|
| |
| T * | data () |
| | Return the data pointer.
|
| |
| const T * | const_data () const |
| | Return the data pointer as const T*.
|
| |
| uint64_t | num_elem () const |
| | Return the product of shape[0] .
|
| |
| void | shape (uint32_t a, uint32_t b=0, uint32_t c=0, uint32_t d=0, uint32_t e=0) |
| | Write a, b, c, d, e into shape[0..4] (always five entries).
|
| |
| void | set_rank (uint32_t rank) |
| | Set the rank.
|
| |
| void | set_shape (uint32_t *shape) |
| | Set the shape pointer.
|
| |
| void | set_data (void *data) |
| | Set the data pointer (reinterpreted as T*).
|
| |
template<
typename T>
class psalg::AllocArray1D< T >
Rank-1 AllocArray with std::vector-like push_back(), clear(), size() and capacity().