|
TRIQS/h5 2.0.0
C++ interface to HDF5
|
#include <h5/array_interface.hpp>
Struct representing an HDF5 hyperslab.
A hyperslab is used to select elements from an n-dimensional array/dataspace and it is defined by 4 arrays of the same size as the rank of the underlying dataspace:
The imaginary part of a complex array/dataspace is treated as just another dimension, i.e. its rank is increased by one.
The following example selects every second column in a 7x7 dataspace:
For a complex valued dataspace, the same example would look like this:
Definition at line 90 of file array_interface.hpp.
Public Member Functions | |
| hyperslab ()=default | |
| Default constructor leaves the hyperslab empty (uninitialized). | |
| hyperslab (int rank, bool has_cplx_trailing_dim) | |
| Construct a new empty hyperslab for a dataspace of a given rank. | |
| bool | empty () const |
| Check whether the hyperslab is empty (has been initialized). | |
| int | rank () const |
| Get the rank of the hyperslab (including the possible added imaginary dimension). | |
| v_t | shape () const |
| Get the shape of the selected hyperslab. | |
| auto | size () const |
| Get the total number of elements in the hyperslab. | |
Public Attributes | |
| v_t | block |
| Shape of a single block selected from the dataspace. | |
| v_t | count |
| Number of elements or blocks to select along each dimension. | |
| v_t | offset |
| Index offset for each dimension. | |
| v_t | stride |
| Stride in each dimension (in the HDF5 sense). | |
|
inline |
Construct a new empty hyperslab for a dataspace of a given rank.
If has_cplx_trailing_dim is true, the hyperslab gets an extra trailing dimension of size 2 to encode the imaginary part (TRIQS trailing-2 FLOAT convention for complex data). By default, offset and count are set to zero and stride and block are set to one. If has_cplx_trailing_dim, count.back() = 2.
| rank | Rank of the underlying dataspace (excluding the possible added imaginary dimension). |
| has_cplx_trailing_dim | True if the buffer encodes complex values via a trailing dim of size 2 (TRIQS convention). |
Definition at line 113 of file array_interface.hpp.