Closed wildmichael closed 3 years ago
In xstrides.hpp there is the (undocumented) function ravel_index() (as opposed to the documented ravel_indices()). It is also not covered by any unit test, and from my tests, it seems like it's really broken. Calling it like this fails to compile:
xstrides.hpp
ravel_index()
ravel_indices()
xt::svector<size_t> index = { 2, 1, 1 }; xt::svector<size_t> shape = { 10, 20, 30 }; auto rav_index = xt::ravel_index(index, shape, xt::layout_type::row_major);
The relevant part of the error message (g++ 9.3):
xstrides.hpp:504:35: error: invalid static_cast from type ‘const xt::svector<long unsigned int, 4, std::allocator<long unsigned int>, true>’ to type ‘strides_value_type’ {aka ‘long int’} 504 | return ravel_from_strides(static_cast<strides_value_type>(index), strides);
@wildmichael, I took your example for test/test_xstrides.cpp should be fixed by https://github.com/xtensor-stack/xtensor/pull/2344.
In
xstrides.hpp
there is the (undocumented) functionravel_index()
(as opposed to the documentedravel_indices()
). It is also not covered by any unit test, and from my tests, it seems like it's really broken. Calling it like this fails to compile:The relevant part of the error message (g++ 9.3):