xoptional_assembly

Defined in xtensor/xoptional_assembly.hpp

template <class VE, class FE>
class xt::xoptional_assembly

Dense multidimensional container holding optional values, optimized for tensor operations.

The xoptional_assembly class implements a dense multidimensional container hoding optional values. This container is optimized of tensor operations: contrary to xarray_optional, xoptional_assembly holds two separated expressions, one for the values, the other for the missing mask.

Template Parameters
  • VE: The type of expression holding the values.
  • FE: The type of expression holding the missing mask.

Inherits from xt::xoptional_assembly_base< xoptional_assembly< VE, FE > >, xt::xcontainer_semantic< xoptional_assembly< VE, FE > >

Constructors

xoptional_assembly()

Allocates an uninitialized xoptional_assembly that holds 0 element.

xoptional_assembly(const shape_type &shape, layout_type l = base_type::static_layout)

Allocates an uninitialized xoptional_assembly with the specified shape and layout_type.

Parameters

xoptional_assembly(const shape_type &shape, const value_type &value, layout_type l = base_type::static_layout)

Allocates an xoptional_assembly with the specified shape and layout_type.

Elements are initialized to the specified value.

Parameters

xoptional_assembly(const shape_type &shape, const strides_type &strides)

Allocates an uninitialized xoptional_assembly with the specified shape and strides.

Parameters

xoptional_assembly(const shape_type &shape, const strides_type &strides, const value_type &value)

Allocates an uninitialized xoptional_assembly with the specified shape and strides.

Elements are initialized to the specified value.

Parameters

xoptional_assembly(const VE &ve)

Allocates an xoptional_assembly from the specified value expression.

The flag expression is initialized as if no value is missing.

Parameters
  • ve: the expression holding the values

xoptional_assembly(VE &&ve)

Allocates an xoptional_assembly from the specified value expression.

The flag expression is initialized as if no value is missing. The value expression is moved inside the xoptional_assembly and is therefore not available after the xoptional_assembly has been constructed.

Parameters
  • ve: the expression holding the values

template <class OVE, class OFE, typename = concept_check <is_xexpression<OVE>::value && is_xexpression<OFE>::value>>
xoptional_assembly(OVE &&ove, OFE &&ofe)

Allocates an xoptional_assembly from the specified value expression and missing mask expression.

Parameters
  • ove: the expression holding the values
  • ofe: the expression holding the missing mask

xoptional_assembly(const value_type &value)

Allocates an xoptional_assembly that holds a single element initialized to the specified value.

Parameters
  • value: the value of the element

Constructors from initializer list

xoptional_assembly(nested_initializer_list_t<value_type, 1> t)

Allocates a one-dimensional xoptional_assembly.

Parameters

xoptional_assembly(nested_initializer_list_t<value_type, 2> t)

Allocates a two-dimensional xoptional_assembly.

Parameters

xoptional_assembly(nested_initializer_list_t<value_type, 3> t)

Allocates a three-dimensional xoptional_assembly.

Parameters

xoptional_assembly(nested_initializer_list_t<value_type, 4> t)

Allocates a four-dimensional xoptional_assembly.

Parameters

xoptional_assembly(nested_initializer_list_t<value_type, 5> t)

Allocates a five-dimensional xoptional_assembly.

Parameters

Extended copy semantic

template <class E>
xoptional_assembly(const xexpression<E> &e)

The extended copy constructor.

template <class E>
auto operator=(const xexpression<E> &e)

The extended assignment operator.

Public Functions

template <class S>
xoptional_assembly<VE, FE> from_shape(S &&s)

Allocates and returns an xoptional_assembly with the specified shape.

Parameters