Skip to content
Open
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
2 changes: 1 addition & 1 deletion include/xtensor/core/xfunction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ namespace xt
{
if (m_cache.is_initialized && reuse_cache)
{
std::copy(m_cache.shape.cbegin(), m_cache.shape.cend(), shape.begin());
std::copy_n(m_cache.shape.cbegin(), m_cache.shape.size(), shape.begin());
return m_cache.is_trivial;
}
else
Expand Down
2 changes: 1 addition & 1 deletion include/xtensor/core/xmath.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1960,7 +1960,7 @@ namespace xt
);
}

std::copy(e.shape().begin(), e.shape().end(), broadcast_shape.begin());
std::copy_n(e.shape().begin(), e.shape().size(), broadcast_shape.begin());
}

constexpr layout_type L = default_assignable_layout(std::decay_t<W>::static_layout);
Expand Down
4 changes: 2 additions & 2 deletions include/xtensor/misc/xmanipulation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -840,12 +840,12 @@ namespace xt

shape_type shape;
resize_container(shape, e.shape().size());
std::copy(e.shape().cbegin(), e.shape().cend(), shape.begin());
std::copy_n(e.shape().cbegin(), e.shape().size(), shape.begin());

get_strides_t<shape_type> strides;
decltype(auto) old_strides = detail::get_strides<XTENSOR_DEFAULT_LAYOUT>(e);
resize_container(strides, old_strides.size());
std::copy(old_strides.cbegin(), old_strides.cend(), strides.begin());
std::copy_n(old_strides.cbegin(), old_strides.size(), strides.begin());

strides[axis] *= -1;
std::size_t offset = static_cast<std::size_t>(
Expand Down
2 changes: 1 addition & 1 deletion include/xtensor/views/xbroadcast.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ namespace xt
XTENSOR_THROW(xt::broadcast_error, "Broadcast shape has fewer elements than original expression.");
}
xt::resize_container(m_shape, s.size());
std::copy(s.begin(), s.end(), m_shape.begin());
std::copy_n(s.begin(), s.size(), m_shape.begin());
xt::broadcast_shape(m_e.shape(), m_shape);
}

Expand Down
Loading