The square bracket operator for xgenerator is not working like other implementations (for example xarray), the following code:
auto a = xt::eye<int>(9);
std::cout << "a (xgenerator): ";
for (std::size_t i = 0; i < 9; ++i)
{
std::cout << a[i] << ", ";
}
std::cout << std::endl;
auto b = xt::xarray<int>({{1, 0, 0},
{0, 1, 0},
{0, 0, 1}});
std::cout << "b (xarray): ";
for (std::size_t i = 0; i < 9; ++i)
{
std::cout << b[i] << ", ";
}
std::cout << std::endl;
outputs:
a (xgenerator): 1, 0, 0, 0, 0, 0, 0, 0, 0,
b (xarray): 1, 0, 0, 0, 1, 0, 0, 0, 1,
The square bracket operator for xgenerator is not working like other implementations (for example xarray), the following code:
outputs: