xtensor
Loading...
Searching...
No Matches
xt::xoptional_assembly_adaptor< VEC, FEC > Class Template Reference

Dense multidimensional adaptor holding optional values, optimized for tensor operations. More...

#include <xoptional_assembly.hpp>

Inheritance diagram for xt::xoptional_assembly_adaptor< VEC, FEC >:
xt::xoptional_assembly_base< xoptional_assembly_adaptor< VEC, FEC > > xt::xcontainer_semantic< xoptional_assembly_adaptor< VEC, FEC > > xt::xiterable< xoptional_assembly_adaptor< VEC, FEC > > xt::xsemantic_base< xoptional_assembly_adaptor< VEC, FEC > >

Public Types

using self_type = xoptional_assembly_adaptor<VEC, FEC>
using base_type = xoptional_assembly_base<self_type>
using semantic_base = xcontainer_semantic<self_type>
using storage_type = typename base_type::storage_type
using value_expression = typename base_type::value_expression
using flag_expression = typename base_type::flag_expression
using const_value_expression = typename base_type::const_value_expression
using const_flag_expression = typename base_type::const_flag_expression
using value_type = typename base_type::value_type
using reference = typename base_type::reference
using const_reference = typename base_type::const_reference
using pointer = typename base_type::pointer
using const_pointer = typename base_type::const_pointer
using shape_type = typename base_type::shape_type
using strides_type = typename base_type::strides_type
using temporary_type = typename semantic_base::temporary_type
using assembly_type = base_type
Public Types inherited from xt::xoptional_assembly_base< xoptional_assembly_adaptor< VEC, FEC > >
using self_type
using derived_type
using inner_types
using raw_value_expression
using base_value_type
using base_reference
using base_const_reference
using raw_flag_expression
using flag_type
using flag_reference
using flag_const_reference
using storage_type
using value_type
using reference
using const_reference
using pointer
using const_pointer
using size_type
using difference_type
using simd_value_type
using bool_load_type
using shape_type
using strides_type
using backstrides_type
using inner_shape_type
using inner_strides_type
using inner_backstrides_type
using iterable_base
using stepper
using const_stepper
using expression_tag
using value_expression
using flag_expression
using const_value_expression
using const_flag_expression
using layout_iterator
using const_layout_iterator
using reverse_layout_iterator
using const_reverse_layout_iterator
using broadcast_iterator
using const_broadcast_iterator
using reverse_broadcast_iterator
using const_reverse_broadcast_iterator
using linear_iterator
using const_linear_iterator
using reverse_linear_iterator
using const_reverse_linear_iterator
using iterator
using const_iterator
using reverse_iterator
using const_reverse_iterator
Public Types inherited from xt::xcontainer_semantic< xoptional_assembly_adaptor< VEC, FEC > >
using base_type
using derived_type
using temporary_type
Public Types inherited from xt::xsemantic_base< xoptional_assembly_adaptor< VEC, FEC > >
using base_type
using derived_type
using temporary_type

Public Member Functions

template<class E>
xoptional_assembly_adaptoroperator= (const xexpression< E > &e)
Constructors
template<class OVE, class OFE>
 xoptional_assembly_adaptor (OVE &&ve, OFE &&fe)
 Constructs an xoptional_assembly_adaptor of the given value and missing mask expressions.
 xoptional_assembly_adaptor (const xoptional_assembly_adaptor &)
xoptional_assembly_adaptoroperator= (const xoptional_assembly_adaptor &)
 xoptional_assembly_adaptor (xoptional_assembly_adaptor &&)
xoptional_assembly_adaptoroperator= (xoptional_assembly_adaptor &&)
xoptional_assembly_adaptoroperator= (temporary_type &&)
Public Member Functions inherited from xt::xoptional_assembly_base< xoptional_assembly_adaptor< VEC, FEC > >
layout_iterator< L > begin () noexcept
 Returns an iterator to the first element of the expression.
broadcast_iterator< S, L > begin (const S &shape) noexcept
 Returns an iterator to the first element of the expression.
const_layout_iterator< L > begin () const noexcept
 Returns a constant iterator to the first element of the expression.
const_broadcast_iterator< S, L > begin (const S &shape) const noexcept
 Returns a constant iterator to the first element of the expression.
layout_iterator< L > end () noexcept
 Returns an iterator to the element following the last element of the expression.
broadcast_iterator< S, L > end (const S &shape) noexcept
 Returns an iterator to the element following the last element of the expression.
const_layout_iterator< L > end () const noexcept
 Returns a constant iterator to the element following the last element of the expression.
const_broadcast_iterator< S, L > end (const S &shape) const noexcept
 Returns a constant iterator to the element following the last element of the expression.
reverse_layout_iterator< L > rbegin () noexcept
 Returns an iterator to the first element of the reversed expression.
reverse_broadcast_iterator< S, L > rbegin (const S &shape) noexcept
 Returns an iterator to the first element of the reversed expression.
const_reverse_layout_iterator< L > rbegin () const noexcept
 Returns a constant iterator to the first element of the reversed expression.
const_reverse_broadcast_iterator< S, L > rbegin (const S &shape) const noexcept
 Returns a constant iterator to the first element of the reversed expression.
reverse_layout_iterator< L > rend () noexcept
 Returns an iterator to the element following the last element of the reversed expression.
reverse_broadcast_iterator< S, L > rend (const S &shape) noexcept
 Returns an iterator to the element following the last element of the reversed expression.
const_reverse_layout_iterator< L > rend () const noexcept
 Returns a constant iterator to the element following the last element of the reversed expression.
const_reverse_broadcast_iterator< S, L > rend (const S &shape) const noexcept
 Returns a constant iterator to the element following the last element of the reversed expression.
size_type size () const noexcept
 Returns the number of element in the optional assembly.
constexpr size_type dimension () const noexcept
 Returns the number of dimensions of the optional assembly.
const inner_shape_type & shape () const noexcept
 Returns the shape of the optional assembly.
const inner_strides_type & strides () const noexcept
 Returns the strides of the optional assembly.
const inner_backstrides_type & backstrides () const noexcept
 Returns the backstrides of the optional assembly.
void resize (const S &shape, bool force=false)
 Resizes the optional assembly.
auto & reshape (const S &shape, layout_type layout=static_layout) &
 Reshapes the optional assembly.
layout_type layout () const noexcept
 Return the layout_type of the container.
bool is_contiguous () const noexcept
void fill (const T &value)
 Fills the data with the given value.
reference operator() (Args... args)
 Returns a reference to the element at the specified position in the optional assembly.
reference at (Args... args)
 Returns a reference to the element at the specified position in the optional assembly, after dimension and bounds checking.
reference unchecked (Args... args)
 Returns a reference to the element at the specified position in the optional assembly.
disable_integral_t< S, reference > operator[] (const S &index)
 Returns a reference to the element at the specified position in the optional assembly.
reference periodic (Args... args)
 Returns a reference to the element at the specified position in the optional assembly, after applying periodicity to the indices (negative and 'overflowing' indices are changed).
reference front ()
 Returns a reference to the first element of the optional assembly.
reference back ()
 Returns a reference to the last element of the optional assembly.
reference flat (size_type args)
 Returns a reference to the element at the specified position of the underlying storage in the optional assembly.
reference element (It first, It last)
 Returns a reference to the element at the specified position in the optional assembly.
bool in_bounds (Args... args) const
 Returns true only if the the specified position is a valid entry in the expression.
storage_type & storage () noexcept
value_type * data () noexcept
const size_type data_offset () const noexcept
bool broadcast_shape (S &shape, bool reuse_cache=false) const
 Broadcast the shape of the optional assembly to the specified parameter.
bool has_linear_assign (const S &strides) const noexcept
 Checks whether the xoptional_assembly_base can be linearly assigned to an expression with the specified strides.
linear_iterator linear_begin () noexcept
linear_iterator linear_end () noexcept
const_linear_iterator linear_cbegin () const noexcept
const_linear_iterator linear_cend () const noexcept
reverse_linear_iterator linear_rbegin () noexcept
reverse_linear_iterator linear_rend () noexcept
const_reverse_linear_iterator linear_crbegin () const noexcept
const_reverse_linear_iterator linear_crend () const noexcept
stepper stepper_begin (const S &shape) noexcept
stepper stepper_end (const S &shape, layout_type l) noexcept
value_expression value () noexcept
 Return an expression for the values of the optional assembly.
flag_expression has_value () noexcept
 Return an expression for the missing mask of the optional assembly.
Public Member Functions inherited from xt::xcontainer_semantic< xoptional_assembly_adaptor< VEC, FEC > >
derived_type & assign_temporary (temporary_type &&)
 Assigns the temporary tmp to *this.
derived_type & assign_xexpression (const xexpression< E > &e)
derived_type & computed_assign (const xexpression< E > &e)
derived_type & scalar_computed_assign (const E &e, F &&f)
Public Member Functions inherited from xt::xsemantic_base< xoptional_assembly_adaptor< VEC, FEC > >
disable_xexpression< E, derived_type & > operator+= (const E &)
 Adds the scalar e to *this.
disable_xexpression< E, derived_type & > operator-= (const E &)
 Subtracts the scalar e from *this.
disable_xexpression< E, derived_type & > operator*= (const E &)
 Multiplies *this with the scalar e.
disable_xexpression< E, derived_type & > operator/= (const E &)
 Divides *this by the scalar e.
disable_xexpression< E, derived_type & > operator%= (const E &)
 Computes the remainder of *this after division by the scalar e.
disable_xexpression< E, derived_type & > operator&= (const E &)
 Computes the bitwise and of *this and the scalar e and assigns it to *this.
disable_xexpression< E, derived_type & > operator|= (const E &)
 Computes the bitwise or of *this and the scalar e and assigns it to *this.
disable_xexpression< E, derived_type & > operator^= (const E &)
 Computes the bitwise xor of *this and the scalar e and assigns it to *this.
derived_type & assign (const xexpression< E > &)
 Assigns the xexpression e to *this.
derived_type & plus_assign (const xexpression< E > &)
 Adds the xexpression e to *this.
derived_type & minus_assign (const xexpression< E > &)
 Subtracts the xexpression e to *this.
derived_type & multiplies_assign (const xexpression< E > &)
 Multiplies *this with the xexpression e.
derived_type & divides_assign (const xexpression< E > &)
 Divides *this by the xexpression e.
derived_type & modulus_assign (const xexpression< E > &)
 Computes the remainder of *this after division by the xexpression e.
derived_type & bit_and_assign (const xexpression< E > &)
 Computes the bitwise and of e to *this.
derived_type & bit_or_assign (const xexpression< E > &)
 Computes the bitwise or of e to *this.
derived_type & bit_xor_assign (const xexpression< E > &)
 Computes the bitwise xor of e to *this.

Friends

class xoptional_assembly_base< xoptional_assembly_adaptor< VEC, FEC > >

Extended copy semantic

template<class E>
auto operator= (const xexpression< E > &e) -> self_type &
 The extended assignment operator.

Additional Inherited Members

Static Public Attributes inherited from xt::xoptional_assembly_base< xoptional_assembly_adaptor< VEC, FEC > >
static constexpr layout_type static_layout
static constexpr bool contiguous_layout
Protected Member Functions inherited from xt::xoptional_assembly_base< xoptional_assembly_adaptor< VEC, FEC > >
xoptional_assembly_base & operator= (const xoptional_assembly_base &)=default
Protected Member Functions inherited from xt::xcontainer_semantic< xoptional_assembly_adaptor< VEC, FEC > >
xcontainer_semantic & operator= (const xcontainer_semantic &)=default
Protected Member Functions inherited from xt::xsemantic_base< xoptional_assembly_adaptor< VEC, FEC > >
xsemantic_base & operator= (const xsemantic_base &)=default

Detailed Description

template<class VEC, class FEC>
class xt::xoptional_assembly_adaptor< VEC, FEC >

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

The xoptional_assembly_adaptor class implements a dense multidimensional adaptor hoding optional values. It is used to provide an optional expression semantic to two tensor expressions, one holding the value, the hother holding the missing mask.

Template Parameters
VECThe closure for the type of expression holding the values.
FEThe closure for the type of expression holding the missing mask.

Definition at line 190 of file xoptional_assembly.hpp.

Member Typedef Documentation

◆ assembly_type

template<class VEC, class FEC>
using xt::xoptional_assembly_adaptor< VEC, FEC >::assembly_type = base_type

Definition at line 212 of file xoptional_assembly.hpp.

◆ base_type

template<class VEC, class FEC>
using xt::xoptional_assembly_adaptor< VEC, FEC >::base_type = xoptional_assembly_base<self_type>

Definition at line 196 of file xoptional_assembly.hpp.

◆ const_flag_expression

template<class VEC, class FEC>
using xt::xoptional_assembly_adaptor< VEC, FEC >::const_flag_expression = typename base_type::const_flag_expression

Definition at line 202 of file xoptional_assembly.hpp.

◆ const_pointer

template<class VEC, class FEC>
using xt::xoptional_assembly_adaptor< VEC, FEC >::const_pointer = typename base_type::const_pointer

Definition at line 207 of file xoptional_assembly.hpp.

◆ const_reference

template<class VEC, class FEC>
using xt::xoptional_assembly_adaptor< VEC, FEC >::const_reference = typename base_type::const_reference

Definition at line 205 of file xoptional_assembly.hpp.

◆ const_value_expression

template<class VEC, class FEC>
using xt::xoptional_assembly_adaptor< VEC, FEC >::const_value_expression = typename base_type::const_value_expression

Definition at line 201 of file xoptional_assembly.hpp.

◆ flag_expression

template<class VEC, class FEC>
using xt::xoptional_assembly_adaptor< VEC, FEC >::flag_expression = typename base_type::flag_expression

Definition at line 200 of file xoptional_assembly.hpp.

◆ pointer

template<class VEC, class FEC>
using xt::xoptional_assembly_adaptor< VEC, FEC >::pointer = typename base_type::pointer

Definition at line 206 of file xoptional_assembly.hpp.

◆ reference

template<class VEC, class FEC>
using xt::xoptional_assembly_adaptor< VEC, FEC >::reference = typename base_type::reference

Definition at line 204 of file xoptional_assembly.hpp.

◆ self_type

template<class VEC, class FEC>
using xt::xoptional_assembly_adaptor< VEC, FEC >::self_type = xoptional_assembly_adaptor<VEC, FEC>

Definition at line 195 of file xoptional_assembly.hpp.

◆ semantic_base

template<class VEC, class FEC>
using xt::xoptional_assembly_adaptor< VEC, FEC >::semantic_base = xcontainer_semantic<self_type>

Definition at line 197 of file xoptional_assembly.hpp.

◆ shape_type

template<class VEC, class FEC>
using xt::xoptional_assembly_adaptor< VEC, FEC >::shape_type = typename base_type::shape_type

Definition at line 208 of file xoptional_assembly.hpp.

◆ storage_type

template<class VEC, class FEC>
using xt::xoptional_assembly_adaptor< VEC, FEC >::storage_type = typename base_type::storage_type

Definition at line 198 of file xoptional_assembly.hpp.

◆ strides_type

template<class VEC, class FEC>
using xt::xoptional_assembly_adaptor< VEC, FEC >::strides_type = typename base_type::strides_type

Definition at line 209 of file xoptional_assembly.hpp.

◆ temporary_type

template<class VEC, class FEC>
using xt::xoptional_assembly_adaptor< VEC, FEC >::temporary_type = typename semantic_base::temporary_type

Definition at line 210 of file xoptional_assembly.hpp.

◆ value_expression

template<class VEC, class FEC>
using xt::xoptional_assembly_adaptor< VEC, FEC >::value_expression = typename base_type::value_expression

Definition at line 199 of file xoptional_assembly.hpp.

◆ value_type

template<class VEC, class FEC>
using xt::xoptional_assembly_adaptor< VEC, FEC >::value_type = typename base_type::value_type

Definition at line 203 of file xoptional_assembly.hpp.

Constructor & Destructor Documentation

◆ xoptional_assembly_adaptor() [1/3]

template<class VEC, class FEC>
template<class OVE, class OFE>
xt::xoptional_assembly_adaptor< VEC, FEC >::xoptional_assembly_adaptor ( OVE && ve,
OFE && fe )
inline

Constructs an xoptional_assembly_adaptor of the given value and missing mask expressions.

Parameters
vethe expression holding the values
fethe expression holding the missing mask

Definition at line 637 of file xoptional_assembly.hpp.

◆ xoptional_assembly_adaptor() [2/3]

template<class VEC, class FEC>
xt::xoptional_assembly_adaptor< VEC, FEC >::xoptional_assembly_adaptor ( const xoptional_assembly_adaptor< VEC, FEC > & rhs)
inline

Definition at line 647 of file xoptional_assembly.hpp.

◆ xoptional_assembly_adaptor() [3/3]

template<class VEC, class FEC>
xt::xoptional_assembly_adaptor< VEC, FEC >::xoptional_assembly_adaptor ( xoptional_assembly_adaptor< VEC, FEC > && rhs)
inline

Definition at line 666 of file xoptional_assembly.hpp.

Member Function Documentation

◆ operator=() [1/4]

template<class VEC, class FEC>
template<class E>
auto xt::xoptional_assembly_adaptor< VEC, FEC >::operator= ( const xexpression< E > & e) -> self_type &
inline

The extended assignment operator.

Definition at line 701 of file xoptional_assembly.hpp.

◆ operator=() [2/4]

template<class VEC, class FEC>
auto xt::xoptional_assembly_adaptor< VEC, FEC >::operator= ( const xoptional_assembly_adaptor< VEC, FEC > & rhs)
inline

Definition at line 657 of file xoptional_assembly.hpp.

◆ operator=() [3/4]

template<class VEC, class FEC>
auto xt::xoptional_assembly_adaptor< VEC, FEC >::operator= ( temporary_type && tmp)
inline

Definition at line 685 of file xoptional_assembly.hpp.

◆ operator=() [4/4]

template<class VEC, class FEC>
auto xt::xoptional_assembly_adaptor< VEC, FEC >::operator= ( xoptional_assembly_adaptor< VEC, FEC > && rhs)
inline

Definition at line 676 of file xoptional_assembly.hpp.

◆ xoptional_assembly_base< xoptional_assembly_adaptor< VEC, FEC > >

template<class VEC, class FEC>
friend class xoptional_assembly_base< xoptional_assembly_adaptor< VEC, FEC > >
friend

Definition at line 242 of file xoptional_assembly.hpp.


The documentation for this class was generated from the following files: