Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions include/xtensor/containers/xstorage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1640,6 +1640,16 @@ namespace xt
return m_array.cend();
}

auto crbegin() const
{
return m_array.crbegin();
}

auto crend() const
{
return m_array.crend();
}

constexpr std::size_t operator[](std::size_t idx) const
{
return m_array[idx];
Expand Down
8 changes: 8 additions & 0 deletions test/test_xfixed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "xtensor/core/xnoalias.hpp"
#include "xtensor/io/xio.hpp"
#include "xtensor/misc/xmanipulation.hpp"
#include "xtensor/views/xview.hpp"

#include "test_common_macros.hpp"

Expand Down Expand Up @@ -306,6 +307,13 @@ namespace xt
using tiny_tensor = xtensor_fixed<double, xshape<2>, layout_type::row_major, false>;
EXPECT_GT(sizeof(fixed_tensor), sizeof(tiny_tensor));
}

TEST(xtensor_fixed, iterators)
{
auto arr = xt::xtensor<double, 1>({5, 5, 5, 5, 5});
auto fixed_arr = xt::xtensor_fixed<double, xt::xshape<3>>{1, 2, 3};
xt::view(arr, xt::range(0, 3)) = fixed_arr + 1;
}
}

#endif
Expand Down
Loading