xtensor¶
Defined in xtensor/xtensor.hpp
- template <class EC, size_t N, layout_type L>
-
class
xt::xtensor_container¶ Dense multidimensional container with tensor semantic and fixed dimension.
The xtensor_container class implements a dense multidimensional container with tensor semantic and fixed dimension
- See
- xtensor
- Template Parameters
EC: The type of the container holding the elements.N: The dimension of the container.L: The layout_type of the tensor.
Inherits from xt::xstrided_container< xtensor_container< EC, N, L >, L >, xt::xcontainer_semantic< xtensor_container< EC, N, L > >
Constructors
-
xtensor_container()¶ Allocates an uninitialized xtensor_container that holds 0 element.
-
xtensor_container(nested_initializer_list_t<value_type, N> t)¶ Allocates an xtensor_container with nested initializer lists.
-
xtensor_container(const shape_type &shape, layout_type l = L)¶ Allocates an uninitialized xtensor_container with the specified shape and layout_type.
- Parameters
shape: the shape of the xtensor_containerl: the layout_type of the xtensor_container
-
xtensor_container(const shape_type &shape, const_reference value, layout_type l = L)¶ Allocates an xtensor_container with the specified shape and layout_type.
Elements are initialized to the specified value.
- Parameters
shape: the shape of the xtensor_containervalue: the value of the elementsl: the layout_type of the xtensor_container
-
xtensor_container(const shape_type &shape, const strides_type &strides)¶ Allocates an uninitialized xtensor_container with the specified shape and strides.
- Parameters
shape: the shape of the xtensor_containerstrides: the strides of the xtensor_container
-
xtensor_container(const shape_type &shape, const strides_type &strides, const_reference value)¶ Allocates an uninitialized xtensor_container with the specified shape and strides.
Elements are initialized to the specified value.
- Parameters
shape: the shape of the xtensor_containerstrides: the strides of the xtensor_containervalue: the value of the elements
-
xtensor_container(container_type &&data, inner_shape_type &&shape, inner_strides_type &&strides)¶ Allocates an xtensor_container by moving specified data, shape and strides.
- Parameters
data: the data for the xtensor_containershape: the shape of the xtensor_containerstrides: the strides of the xtensor_container
Extended copy semantic
- template <class E>
-
xtensor_container(const xexpression<E> &e)¶ The extended copy constructor.
- template <class E>
-
auto
operator=(const xexpression<E> &e)¶ The extended assignment operator.
-
typedef
xt::xtensor¶ Alias template on xtensor_container with default parameters for data container type.
This allows to write
xt::xtensor<double, 2> a = {{1., 2.}, {3., 4.}};
instead of the heavier syntax
xt::xtensor_container<std::vector<double>, 2> a = ...
- Template Parameters
T: The value type of the elements.N: The dimension of the tensor.L: The layout_type of the tensor (default: row_major).A: The allocator of the containers holding the elements.