HighFive icon indicating copy to clipboard operation
HighFive copied to clipboard

Implement `squeeze` and `reshape`.

Open 1uc opened this issue 1 year ago • 2 comments

These methods allow reshaping the memory space. This can be used as an alternative to broadcasting.

Example:

Let dset be a dataset with shape [3, 1, 1]. Then,

dset.reshapeMemSpace({3}).read<std::vector<double>>();
dset.squeezeMemSpace({1, 2}).read<std::vector<double>>();

can be used to read into a one-dimensional dataset.

1uc avatar May 06 '24 13:05 1uc

This is preparatory work to allow #992.

1uc avatar May 06 '24 13:05 1uc

Codecov Report

Attention: Patch coverage is 83.75000% with 13 lines in your changes are missing coverage. Please review.

Project coverage is 86.26%. Comparing base (070badf) to head (1f09187). Report is 1 commits behind head on master.

Files Patch % Lines
src/examples/broadcasting_arrays.cpp 0.00% 9 Missing :warning:
include/highfive/bits/H5Attribute_misc.hpp 72.72% 3 Missing :warning:
include/highfive/bits/H5Slice_traits_misc.hpp 92.85% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #991      +/-   ##
==========================================
- Coverage   86.31%   86.26%   -0.05%     
==========================================
  Files          92       94       +2     
  Lines        5919     5986      +67     
==========================================
+ Hits         5109     5164      +55     
- Misses        810      822      +12     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar May 06 '24 15:05 codecov-commenter