You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
When assigning with a scalar on a xadaptor with non-contiguous strides, there is some problem where contiguous assignment is done instead, producing unexpected results.
For instance, the following does not work:
void test_strided_scalar_assign() {
auto data = std::vector<double>(8);
std::fill(data.begin(), data.end(), 0.);
auto adapter_strided_noncont = xt::adapt(
data.data(), 6, xt::no_ownership(), std::vector<size_t>{2, 3},
std::vector<size_t>{4, 1});
xt::noalias(adapter_strided_noncont) += 1;
auto expected = std::vector<double>({1, 1, 1, 0, 1, 1, 1, 0});
assert(expected == data);
}
When running this, the first 6 values of data are incremented, instead of taking into account the {4,1} strides.
What's do you think the best way is to fix this?
The text was updated successfully, but these errors were encountered:
Hi,
When assigning with a scalar on a xadaptor with non-contiguous strides, there is some problem where contiguous assignment is done instead, producing unexpected results.
For instance, the following does not work:
When running this, the first 6 values of
data
are incremented, instead of taking into account the {4,1} strides.What's do you think the best way is to fix this?
The text was updated successfully, but these errors were encountered: