See the code snippet below:
int main()
{
auto [a, b] = xt::meshgrid(xt::arange(10), xt::arange(10));
auto a1 = xt::eval(a);
auto b1 = xt::eval(b);
using namespace std::complex_literals;
auto v = xt::view(a1, xt::all(), xt::range(2, 4));
xt::dump_hdf5("test.h5", "dataset_a", v);
std::cout << v;
}
The output from std::cout does not match the result in the file. The implementation will accept any input presenting the T::data(). The data interface from the view does not add an offset into the valid region and simply yields a begin pointer to the underlying container.
Expected result:
{{2, 2, 2, 2, 2, 2, 2, 2, 2, 2},
{3, 3, 3, 3, 3, 3, 3, 3, 3, 3}}
Result:
0 0 0 0 0 0 0 0 0 0
1 1 1 1 1 1 1 1 1 1