10#ifndef XTENSOR_EXPRESSION_TRAITS_HPP
11#define XTENSOR_EXPRESSION_TRAITS_HPP
13#include "xexpression.hpp"
23 template <
class E,
class enable =
void>
24 struct xvalue_type_impl
30 struct xvalue_type_impl<E, std::enable_if_t<is_xexpression<E>::value>>
32 using type =
typename E::value_type;
37 using xvalue_type = detail::xvalue_type_impl<E>;
40 using xvalue_type_t =
typename xvalue_type<E>::type;
49 using type = std::common_type_t<typename std::decay_t<C>::value_type...>;
59 template <
class...
Args>
62 using type = std::common_type_t<
typename Args::size_type...>;
68 using type = std::size_t;
71 template <
class...
Args>
78 template <
class...
Args>
81 using type = std::common_type_t<
typename Args::difference_type...>;
87 using type = std::ptrdiff_t;
90 template <
class...
Args>
100 struct xtype_for_shape
102 template <
class T, layout_type L>
106#if defined(__GNUC__) && (__GNUC__ > 6)
107#if __cplusplus == 201703L
108 template <
template <
class, std::
size_t,
class,
bool>
class S,
class X, std::size_t N,
class A,
bool Init>
109 struct xtype_for_shape<S<X, N, A, Init>>
111 template <
class T, layout_type L>
112 using type = xarray<T, L>;
117 template <
template <
class, std::
size_t>
class S,
class X, std::size_t N>
118 struct xtype_for_shape<S<X, N>>
120 template <
class T, layout_type L>
121 using type = xtensor<T, N, L>;
124 template <
template <std::size_t...>
class S, std::size_t... X>
125 struct xtype_for_shape<S<X...>>
127 template <
class T, layout_type L>
132 template <
class Tag,
class T>
138 using I = std::decay_t<T>;
139 using shape_type =
typename I::shape_type;
140 using value_type =
typename I::value_type;
141 static constexpr layout_type static_layout = XTENSOR_DEFAULT_LAYOUT;
145 template <
class T,
class =
void>
154 using type =
typename std::decay_t<T>::temporary_type;
158 using temporary_type_t =
typename temporary_type<T>::type;
166 template <
class...
C>
167 struct common_tensor_type_impl
170 using value_type = common_value_type_t<
C...>;
171 using shape_type = promote_shape_t<
typename C::shape_type...>;
176 template <
class... C>
181 template <
class...
C>
191 using type = xtl::big_promote_type_t<typename std::decay_t<E>::value_type>;
195 using big_promote_value_type_t =
typename big_promote_value_type<E>::type;
standard mathematical functions for xexpressions
constexpr layout_type compute_layout(Args... args) noexcept
Implementation of the following logical table:
fixed_shape< N... > xshape
Alias template for fixed_shape allows for a shorter template shape definition in xtensor_fixed.
xfixed_container< T, FSH, L, Sharable > xtensor_fixed
Alias template on xfixed_container with default parameters for layout type.