10#ifndef XTENSOR_OFFSET_VIEW_HPP
11#define XTENSOR_OFFSET_VIEW_HPP
13#include <xtl/xcomplex.hpp>
15#include "xtensor/xfunctor_view.hpp"
21 template <
class M, std::
size_t I>
22 struct offset_forwarder
26 using const_reference =
const M&;
28 using const_pointer =
const M*;
30 using proxy = xtl::xproxy_wrapper<M>;
32 template <
class value_type,
class requested_type>
33 using simd_return_type = xt_simd::simd_return_type<value_type, requested_type>;
36 decltype(
auto)
operator()(T&& t)
const
38 return xtl::forward_offset<M, I>(std::forward<T>(t));
47 class = std::enable_if_t<
48 (std::is_same<MF, double>::value || std::is_same<MF, float>::value) && I <=
sizeof(MF),
50 auto proxy_simd_load(
const E& expr, std::size_t n)
const
53 auto batch = expr.template load_simd<align, requested_type, N>(n);
69 class = std::enable_if_t<
70 (std::is_same<MF, double>::value || std::is_same<MF, float>::value) && I <=
sizeof(MF),
72 auto proxy_simd_store(E& expr, std::size_t n,
const simd& batch)
const
74 auto x = expr.template load_simd<align, double, simd::size>(n);
83 expr.template store_simd<align>(n, x);
88 template <
class CT,
class M, std::
size_t I>
89 using xoffset_view = xfunctor_view<detail::offset_forwarder<M, I>, CT>;
91 template <
class CT,
class M, std::
size_t I>
92 using xoffset_adaptor = xfunctor_adaptor<detail::offset_forwarder<M, I>, CT>;
standard mathematical functions for xexpressions