Skip to content
Open

Assign #2964

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 CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ set(XTENSOR_HEADERS
${XTENSOR_INCLUDE_DIR}/xtensor/containers/xtensor.hpp
${XTENSOR_INCLUDE_DIR}/xtensor/core/xaccessible.hpp
${XTENSOR_INCLUDE_DIR}/xtensor/core/xassign.hpp
${XTENSOR_INCLUDE_DIR}/xtensor/core/xassign_proxy.hpp
${XTENSOR_INCLUDE_DIR}/xtensor/core/xeval.hpp
${XTENSOR_INCLUDE_DIR}/xtensor/core/xexpression.hpp
${XTENSOR_INCLUDE_DIR}/xtensor/core/xexpression_traits.hpp
Expand All @@ -146,7 +147,6 @@ set(XTENSOR_HEADERS
${XTENSOR_INCLUDE_DIR}/xtensor/core/xlayout.hpp
${XTENSOR_INCLUDE_DIR}/xtensor/core/xmath.hpp
${XTENSOR_INCLUDE_DIR}/xtensor/core/xmultiindex_iterator.hpp
${XTENSOR_INCLUDE_DIR}/xtensor/core/xnoalias.hpp
${XTENSOR_INCLUDE_DIR}/xtensor/core/xoperation.hpp
${XTENSOR_INCLUDE_DIR}/xtensor/core/xsemantic.hpp
${XTENSOR_INCLUDE_DIR}/xtensor/core/xshape.hpp
Expand Down
1 change: 0 additions & 1 deletion benchmark/benchmark_adapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
// #include "xtensor/core/core/xshape.hpp"
#include "xtensor/containers/xadapt.hpp"
#include "xtensor/containers/xstorage.hpp"
#include "xtensor/core/xnoalias.hpp"
#include "xtensor/utils/xutils.hpp"

namespace xt
Expand Down
1 change: 0 additions & 1 deletion benchmark/benchmark_assign.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

#include "xtensor/containers/xarray.hpp"
#include "xtensor/containers/xtensor.hpp"
#include "xtensor/core/xnoalias.hpp"

namespace xt
{
Expand Down
1 change: 0 additions & 1 deletion benchmark/benchmark_builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

#include "xtensor/containers/xarray.hpp"
#include "xtensor/containers/xtensor.hpp"
#include "xtensor/core/xnoalias.hpp"

namespace xt
{
Expand Down
1 change: 0 additions & 1 deletion benchmark/benchmark_lambda_expressions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "xtensor/containers/xarray.hpp"
#include "xtensor/containers/xtensor.hpp"
#include "xtensor/core/xmath.hpp"
#include "xtensor/core/xnoalias.hpp"
#include "xtensor/generators/xbuilder.hpp"

namespace xt
Expand Down
1 change: 0 additions & 1 deletion benchmark/benchmark_math.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

#include "xtensor/containers/xarray.hpp"
#include "xtensor/containers/xtensor.hpp"
#include "xtensor/core/xnoalias.hpp"

// For how many sizes should math functions be tested?
#define MATH_RANGE 64, 64
Expand Down
1 change: 0 additions & 1 deletion benchmark/benchmark_random.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

#include "xtensor/containers/xarray.hpp"
#include "xtensor/containers/xtensor.hpp"
#include "xtensor/core/xnoalias.hpp"
#include "xtensor/generators/xrandom.hpp"

namespace xt
Expand Down
1 change: 0 additions & 1 deletion benchmark/benchmark_view_access.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
// #include "xtensor/core/core/xshape.hpp"
#include "xtensor/containers/xadapt.hpp"
#include "xtensor/containers/xstorage.hpp"
#include "xtensor/core/xnoalias.hpp"
#include "xtensor/generators/xbuilder.hpp"
#include "xtensor/generators/xrandom.hpp"
#include "xtensor/utils/xutils.hpp"
Expand Down
1 change: 0 additions & 1 deletion benchmark/benchmark_view_adapt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "xtensor/containers/xadapt.hpp"
#include "xtensor/containers/xfixed.hpp"
#include "xtensor/containers/xtensor.hpp"
#include "xtensor/core/xnoalias.hpp"
#include "xtensor/generators/xrandom.hpp"
#include "xtensor/views/xview.hpp"

Expand Down
1 change: 0 additions & 1 deletion benchmark/benchmark_view_assignment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "xtensor/containers/xarray.hpp"
#include "xtensor/containers/xfixed.hpp"
#include "xtensor/containers/xtensor.hpp"
#include "xtensor/core/xnoalias.hpp"
#include "xtensor/generators/xrandom.hpp"

namespace xt
Expand Down
1 change: 0 additions & 1 deletion benchmark/benchmark_views.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

#include "xtensor/containers/xarray.hpp"
#include "xtensor/containers/xtensor.hpp"
#include "xtensor/core/xnoalias.hpp"
#include "xtensor/core/xstrides.hpp"
#include "xtensor/misc/xmanipulation.hpp"
#include "xtensor/views/xstrided_view.hpp"
Expand Down
1 change: 0 additions & 1 deletion docs/source/container.rst
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ A mechanism is provided to forcibly prevent usage of a temporary variable:
.. code::

#include <xtensor/containers/xarray.hpp>
#include <xtensor/core/xnoalias.hpp>

// a, b, and c are xt::xarrays previously initialized
xt::noalias(b) = a + c;
Expand Down
26 changes: 13 additions & 13 deletions include/xtensor/chunk/xchunked_assign.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#ifndef XTENSOR_CHUNKED_ASSIGN_HPP
#define XTENSOR_CHUNKED_ASSIGN_HPP

#include "../core/xnoalias.hpp"
#include "../core/xassign_proxy.hpp"
#include "../views/xstrided_view.hpp"

namespace xt
Expand Down Expand Up @@ -44,14 +44,14 @@ namespace xt
using derived_type = D;
using temporary_type = typename base_type::temporary_type;

template <class E>
derived_type& assign_xexpression(const xexpression<E>& e);
template <class E, class P = assign_policy<>>
derived_type& assign_xexpression(const xexpression<E>& e, P p = P{});

template <class E>
derived_type& computed_assign(const xexpression<E>& e);
template <class E, class P = assign_policy<>>
derived_type& computed_assign(const xexpression<E>& e, P p = P{});

template <class E, class F>
derived_type& scalar_computed_assign(const E& e, F&& f);
template <class E, class F, class P = assign_policy<>>
derived_type& scalar_computed_assign(const E& e, F&& f, P p = P{});

protected:

Expand Down Expand Up @@ -201,8 +201,8 @@ namespace xt
}

template <class D>
template <class E>
inline auto xchunked_semantic<D>::assign_xexpression(const xexpression<E>& e) -> derived_type&
template <class E, class P>
inline auto xchunked_semantic<D>::assign_xexpression(const xexpression<E>& e, P) -> derived_type&
{
auto& d = this->derived_cast();
const auto& chunk_shape = d.chunk_shape();
Expand All @@ -225,8 +225,8 @@ namespace xt
}

template <class D>
template <class E>
inline auto xchunked_semantic<D>::computed_assign(const xexpression<E>& e) -> derived_type&
template <class E, class P>
inline auto xchunked_semantic<D>::computed_assign(const xexpression<E>& e, P) -> derived_type&
{
D& d = this->derived_cast();
if (e.derived_cast().dimension() > d.dimension() || e.derived_cast().shape() > d.shape())
Expand All @@ -240,8 +240,8 @@ namespace xt
}

template <class D>
template <class E, class F>
inline auto xchunked_semantic<D>::scalar_computed_assign(const E& e, F&& f) -> derived_type&
template <class E, class F, class P>
inline auto xchunked_semantic<D>::scalar_computed_assign(const E& e, F&& f, P) -> derived_type&
{
for (auto& c : this->derived_cast().chunks())
{
Expand Down
1 change: 0 additions & 1 deletion include/xtensor/chunk/xchunked_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

#include "../chunk/xchunked_array.hpp"
#include "../containers/xstorage.hpp"
#include "../core/xnoalias.hpp"
#include "../views/xstrided_view.hpp"

namespace xt
Expand Down
2 changes: 1 addition & 1 deletion include/xtensor/containers/xarray.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ namespace xt
{
detail::resize_data_container(m_storage, std::size_t(1));
}
semantic_base::assign(e);
semantic_base::assign(e, noalias);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion include/xtensor/containers/xfixed.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ namespace xt
template <class E>
inline xfixed_container<ET, S, L, SH, Tag>::xfixed_container(const xexpression<E>& e)
{
semantic_base::assign(e);
semantic_base::assign(e, noalias);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion include/xtensor/containers/xtensor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ namespace xt
{
detail::resize_data_container(m_storage, std::size_t(1));
}
semantic_base::assign(e);
semantic_base::assign(e, noalias);
}

/**
Expand Down
Loading
Loading