xtensor_adaptor¶
Defined in xtensor/xtensor.hpp
- template <class EC, std::size_t N, layout_type L>
-
class
xt::
xtensor_adaptor
¶ Dense multidimensional container adaptor with tensor semantic and fixed dimension.
The xtensor_adaptor class implements a dense multidimensional container adaptor with tensor semantic and fixed dimension. It is used to provide a multidimensional container semantic and a tensor semantic to stl-like containers.
- Template Parameters
EC
: The container type to adapt.N
: The dimension of the adaptor.L
: The layout_type of the adaptor.
Inherits from xt::xstrided_container< xtensor_adaptor< EC, N, L >, L >, xt::xadaptor_semantic< xtensor_adaptor< EC, N, L > >
Constructors
-
xtensor_adaptor
(container_closure_type data)¶ Constructs an xtensor_adaptor of the given stl-like container.
- Parameters
data
: the container to adapt
-
xtensor_adaptor
(container_closure_type data, const shape_type &shape, layout_type l = layout_type::row_major)¶ Constructs an xtensor_adaptor of the given stl-like container, with the specified shape and layout_type.
- Parameters
data
: the container to adaptshape
: the shape of the xtensor_adaptorl
: the layout_type of the xtensor_adaptor
-
xtensor_adaptor
(container_closure_type data, const shape_type &shape, const strides_type &strides)¶ Constructs an xtensor_adaptor of the given stl-like container, with the specified shape and strides.
- Parameters
data
: the container to adaptshape
: the shape of the xtensor_adaptorstrides
: the strides of the xtensor_adaptor
Extended copy semantic
- template <class E>
-
auto
operator=
(const xexpression<E> &e)¶ The extended assignment operator.
xadapt (xtensor_adaptor)¶
Defined in xtensor/xadapt.hpp
- template <class C, std::size_t N, layout_type L = DEFAULT_LAYOUT>
-
xtensor_adaptor<C, N, L>
xt::
xadapt
(C &container, const std::array<typename C::size_type, N> &shape, layout_type l = L)¶ Constructs an xtensor_adaptor of the given stl-like container, with the specified shape and layout_type.
- Parameters
container
: the container to adaptshape
: the shape of the xtensor_adaptorl
: the layout_type of the xtensor_adaptor
- template <class C, std::size_t N>
-
xtensor_adaptor<C, N, layout_type::dynamic>
xt::
xadapt
(C &container, const std::array<typename C::size_type, N> &shape, const std::array<typename C::size_type, N> &strides)¶ Constructs an xtensor_adaptor of the given stl-like container, with the specified shape and strides.
- Parameters
container
: the container to adaptshape
: the shape of the xtensor_adaptorstrides
: the strides of the xtensor_adaptor
- template <class P, std::size_t N, class O, layout_type L = DEFAULT_LAYOUT, class A = std::allocator<std::remove_pointer_t<P>>>
-
xtensor_adaptor<xbuffer_adaptor<std::remove_pointer_t<P>, O, A>, N, L>
xt::
xadapt
(P &pointer, typename A::size_type size, O ownership, const std::array<typename A::size_type, N> &shape, layout_type l = L, const A &alloc = A())¶ Constructs an xtensor_adaptor of the given dynamically allocated C array, with the specified shape and layout.
- Parameters
pointer
: the pointer to the beginning of the dynamic arraysize
: the size of the dynamic arrayownership
: indicates whether the adaptor takes ownership of the array. Possible values areno_ownerhsip()
oraccept_ownership()
shape
: the shape of the xtensor_adaptorl
: the layout_type of the xtensor_adaptoralloc
: the allocator used for allocating / deallocating the dynamic array
- template <class P, std::size_t N, class O, class A = std::allocator<std::remove_pointer_t<P>>>
-
xtensor_adaptor<xbuffer_adaptor<std::remove_pointer_t<P>, O, A>, N, layout_type::dynamic>
xt::
xadapt
(P &pointer, typename A::size_type size, O ownership, const std::array<typename A::size_type, N> &shape, const std::array<typename A::size_type, N> &strides, const A &alloc = A())¶ Constructs an xtensor_adaptor of the given dynamically allocated C array, with the specified shape and layout.
- Parameters
pointer
: the pointer to the beginning of the dynamic arraysize
: the size of the dynamic arrayownership
: indicates whether the adaptor takes ownership of the array. Possible values areno_ownerhsip()
oraccept_ownership()
shape
: the shape of the xtensor_adaptorstrides
: the strides of the xtensor_adaptoralloc
: the allocator used for allocating / deallocating the dynamic array