Non-owning view of an array of T: a data pointer, a pointer to a shape array and a rank.
More...
#include <Array.hh>
Inherited by psalg::NDArray< float >, psalg::NDArray< common_mode_t >, psalg::NDArray< pedestals_t >, psalg::NDArray< pixel_rms_t >, psalg::NDArray< pixel_status_t >, psalg::NDArray< pixel_gain_t >, psalg::NDArray< pixel_offset_t >, psalg::NDArray< pixel_bkgd_t >, psalg::NDArray< pixel_mask_t >, psalg::NDArray< const pixel_size_t >, psalg::NDArray< double >, psalg::NDArray< uint16_t >, psalg::NDArray< uint32_t >, psalg::NDArray< raw_t >, psalg::NDArray< calib_t >, psalg::NDArray< image_t >, psalg::NDArray< raw_cspad_t >, psalg::NDArray< raw_jungfrau_t >, psalg::NDArray< opal_raw_t >, psalg::NDArray< opal_calib_t >, psalg::NDArray< opal_pedestals_t >, psalg::NDArray< pnccd_raw_t >, psalg::NDArray< pnccd_calib_t >, psalg::NDArray< pnccd_pedestals_t >, psalg::AllocArray< T >, and psalg::NDArray< T >.
|
| | 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 XtcData::Array< T >
Non-owning view of an array of T: a data pointer, a pointer to a shape array and a rank.
Copies are shallow (pointers only). operator() computes C-order (row-major) offsets and aborts with a message if an index is out of range.
◆ Array() [1/3]
Wrap data (reinterpreted as T*), shape and rank; nothing is copied.
◆ Array() [2/3]
Construct an empty view: null data and shape pointers, rank 0.
◆ Array() [3/3]
Copy the data pointer, shape pointer and rank of a (shallow copy).
◆ const_data()
Return the data pointer as const T*.
◆ data()
◆ num_elem()
Return the product of shape[0] .
. shape[rank-1], or 0 if the shape pointer is null. With rank 0 and a non-null shape it returns shape[0].
◆ operator()() [1/5]
Return a reference to element i.
Aborts with a message if i >= shape[0]; the rank is not checked.
◆ operator()() [2/5]
Return a reference to element (i, j) at offset i*shape[1]+j.
Aborts with a message if an index is out of range; the rank is not checked.
◆ operator()() [3/5]
Return a reference to element (i, j, k) at the row-major offset.
Aborts with a message if an index is out of range; the rank is not checked.
◆ operator()() [4/5]
Return a reference to element (i, j, k, l) at the row-major offset.
Aborts with a message if an index is out of range; the rank is not checked.
◆ operator()() [5/5]
Return a reference to element (i, j, k, l, m) at the row-major offset.
Aborts with a message if an index is out of range; the rank is not checked.
◆ operator=()
Copy the data pointer, shape pointer and rank of o (shallow); self-assignment does nothing.
- Returns
- *this.
◆ rank()
◆ set_data()
Set the data pointer (reinterpreted as T*).
◆ set_rank()
◆ set_shape()
◆ shape() [1/2]
Return the shape pointer (not a copy).
◆ shape() [2/2]
Write a, b, c, d, e into shape[0..4] (always five entries).
Aborts with a message if the rank is 0 or >= MaxRank.
◆ _data
◆ _rank
◆ _shape
The documentation for this class was generated from the following file: