![]() |
QMCPACK
|
class to use file space hyperslab with a serialized container More...
Collaboration diagram for hyperslab_proxy< CT, RANK >:Public Types | |
| using | element_type = typename container_traits< CT >::element_type |
| using | SpaceType = h5_space_type< element_type, RANK > |
| type alias for h5_space_type encapsulates both RANK and ranks contributed by element_type for constructing an hdf5 dataspace. More... | |
Public Member Functions | |
| template<typename IT > | |
| hyperslab_proxy (CT &a, const std::array< IT, RANK > &dims_in, const std::array< IT, RANK > &selected_in, const std::array< IT, RANK > &offsets_in) | |
| constructor More... | |
| hsize_t | size (int i) const |
| return the size of the i-th dimension of global space More... | |
| void | checkUserRankSizes () const |
| checks if file_space, elected_space and offset are self-consistent More... | |
| bool | checkContainerCapacity () const |
| check if the container is large enough for the selected space and resize if requested More... | |
| template<typename IT > | |
| void | adaptShape (const std::vector< IT > &sizes_file) |
| adjust file_space and selected_space shapes based on sizes_file More... | |
Public Attributes | |
| SpaceType | file_space |
| global dimension of the hyperslab More... | |
| SpaceType | selected_space |
| local dimension of the hyperslab More... | |
| std::array< hsize_t, SpaceType::rank > | slab_offset |
| offset of the hyperslab More... | |
| CT & | ref_ |
| container reference More... | |
Static Public Attributes | |
| static const unsigned int | slab_rank = RANK |
| user rank of a hyperslab More... | |
class to use file space hyperslab with a serialized container
| CT | container type, std::vector, Vector, Matrix, Array, boost::multi::array |
| RANK | hyperslab user rank. The dimensions contributed by T are excluded. |
The container may get resized for sufficient space if the template specialization of container_traits<CT> is available additional restriction: 1D containers can be resized to hold any multi-dimensional data >1D containers can only be resize to hold data with matching dimensions.
Definition at line 35 of file hdf_hyperslab.h.
| using element_type = typename container_traits<CT>::element_type |
Definition at line 40 of file hdf_hyperslab.h.
| using SpaceType = h5_space_type<element_type, RANK> |
type alias for h5_space_type encapsulates both RANK and ranks contributed by element_type for constructing an hdf5 dataspace.
Definition at line 45 of file hdf_hyperslab.h.
|
inline |
constructor
| IT | integer type |
| a | data containter |
| dims_in | dimension sizes of a dataset. |
| selected_in | dimension sizes of the selected part of the dataset |
| offsets_in | offsets of the selected part of the dataset |
value 0 in any dimension of dims_in or selected_in is allowed when reading a dataset. The actual size is derived from file dataset.
element_type related dimensions always have offset 0
Definition at line 66 of file hdf_hyperslab.h.
References h5_space_type< T, RANK >::dims, hyperslab_proxy< CT, RANK >::file_space, h5_space_type< element_type, RANK >::rank, hyperslab_proxy< CT, RANK >::selected_space, hyperslab_proxy< CT, RANK >::slab_offset, and hyperslab_proxy< CT, RANK >::slab_rank.
|
inline |
adjust file_space and selected_space shapes based on sizes_file
| IT | integer type |
| sizes_file | sizes of all the user dimensions of a dataset |
This function can only be used when reading a dataset not writing if the size value of a dimension is 0, use the value based on the dataset on disk
Definition at line 130 of file hdf_hyperslab.h.
References h5_space_type< T, RANK >::dims, hyperslab_proxy< CT, RANK >::file_space, hyperslab_proxy< CT, RANK >::selected_space, and hyperslab_proxy< CT, RANK >::slab_rank.
Referenced by h5data_proxy< hyperslab_proxy< CT, RANK > >::read().
|
inline |
check if the container is large enough for the selected space and resize if requested
Definition at line 114 of file hdf_hyperslab.h.
References h5_space_type< T, RANK >::dims, hyperslab_proxy< CT, RANK >::ref_, hyperslab_proxy< CT, RANK >::selected_space, and hyperslab_proxy< CT, RANK >::slab_rank.
Referenced by h5data_proxy< hyperslab_proxy< CT, RANK > >::read(), and h5data_proxy< hyperslab_proxy< CT, RANK > >::write().
|
inline |
checks if file_space, elected_space and offset are self-consistent
Definition at line 92 of file hdf_hyperslab.h.
References h5_space_type< T, RANK >::dims, hyperslab_proxy< CT, RANK >::file_space, hyperslab_proxy< CT, RANK >::selected_space, hyperslab_proxy< CT, RANK >::slab_offset, and hyperslab_proxy< CT, RANK >::slab_rank.
Referenced by h5data_proxy< hyperslab_proxy< CT, RANK > >::read(), and h5data_proxy< hyperslab_proxy< CT, RANK > >::write().
|
inline |
return the size of the i-th dimension of global space
| i | dimension |
Definition at line 88 of file hdf_hyperslab.h.
References h5_space_type< T, RANK >::dims, hyperslab_proxy< CT, RANK >::file_space, and h5_space_type< element_type, RANK >::rank.
| SpaceType file_space |
global dimension of the hyperslab
Definition at line 47 of file hdf_hyperslab.h.
Referenced by hyperslab_proxy< CT, RANK >::adaptShape(), hyperslab_proxy< CT, RANK >::checkUserRankSizes(), hyperslab_proxy< CT, RANK >::hyperslab_proxy(), h5data_proxy< hyperslab_proxy< CT, RANK > >::read(), hyperslab_proxy< CT, RANK >::size(), and h5data_proxy< hyperslab_proxy< CT, RANK > >::write().
| CT& ref_ |
container reference
Definition at line 53 of file hdf_hyperslab.h.
Referenced by hyperslab_proxy< CT, RANK >::checkContainerCapacity(), h5data_proxy< hyperslab_proxy< CT, RANK > >::read(), and h5data_proxy< hyperslab_proxy< CT, RANK > >::write().
| SpaceType selected_space |
local dimension of the hyperslab
Definition at line 49 of file hdf_hyperslab.h.
Referenced by hyperslab_proxy< CT, RANK >::adaptShape(), hyperslab_proxy< CT, RANK >::checkContainerCapacity(), hyperslab_proxy< CT, RANK >::checkUserRankSizes(), hyperslab_proxy< CT, RANK >::hyperslab_proxy(), h5data_proxy< hyperslab_proxy< CT, RANK > >::read(), and h5data_proxy< hyperslab_proxy< CT, RANK > >::write().
| std::array<hsize_t, SpaceType::rank> slab_offset |
offset of the hyperslab
Definition at line 51 of file hdf_hyperslab.h.
Referenced by hyperslab_proxy< CT, RANK >::checkUserRankSizes(), hyperslab_proxy< CT, RANK >::hyperslab_proxy(), h5data_proxy< hyperslab_proxy< CT, RANK > >::read(), and h5data_proxy< hyperslab_proxy< CT, RANK > >::write().
|
static |
user rank of a hyperslab
Definition at line 38 of file hdf_hyperslab.h.
Referenced by hyperslab_proxy< CT, RANK >::adaptShape(), hyperslab_proxy< CT, RANK >::checkContainerCapacity(), hyperslab_proxy< CT, RANK >::checkUserRankSizes(), hyperslab_proxy< CT, RANK >::hyperslab_proxy(), and h5data_proxy< hyperslab_proxy< CT, RANK > >::read().