xtensor
Loading...
Searching...
No Matches
xt::xmasked_view< CTD, CTM > Class Template Reference

View on an xoptional_assembly or xoptional_assembly_adaptor hiding values depending on a given mask. More...

#include <xmasked_view.hpp>

Inheritance diagram for xt::xmasked_view< CTD, CTM >:
xt::xview_semantic< xmasked_view< CTD, CTM > > xt::xaccessible< xmasked_view< CTD, CTM > > xt::xiterable< xmasked_view< CTD, CTM > > xt::xsemantic_base< D >

Public Types

using self_type = xmasked_view<CTD, CTM>
using semantic_base = xview_semantic<xmasked_view<CTD, CTM>>
using accessible_base = xaccessible<self_type>
using inner_types = xcontainer_inner_types<self_type>
using temporary_type = typename inner_types::temporary_type
using data_type = typename inner_types::data_type
using mask_type = typename inner_types::mask_type
using value_expression = CTD
using mask_expression = CTM
using base_value_type = typename inner_types::base_value_type
using base_reference = typename data_type::reference
using base_const_reference = typename data_type::const_reference
using flag_type = typename inner_types::flag_type
using flag_reference = typename mask_type::reference
using flag_const_reference = typename mask_type::const_reference
using val_reference = typename inner_types::val_reference
using mask_reference = typename inner_types::mask_reference
using value_type = typename inner_types::value_type
using reference = typename inner_types::reference
using const_reference = typename inner_types::const_reference
using pointer = xtl::xclosure_pointer<reference>
using const_pointer = xtl::xclosure_pointer<const_reference>
using size_type = typename inner_types::size_type
using difference_type = typename data_type::difference_type
using bool_load_type = xtl::xmasked_value<typename data_type::bool_load_type, mask_type>
using shape_type = typename data_type::shape_type
using strides_type = typename data_type::strides_type
using inner_shape_type = typename data_type::inner_shape_type
using inner_strides_type = typename data_type::inner_strides_type
using inner_backstrides_type = typename data_type::inner_backstrides_type
using expression_tag = xtensor_expression_tag
using iterable_base = xiterable<xmasked_view<CTD, CTM>>
using stepper = typename iterable_base::stepper
using const_stepper = typename iterable_base::const_stepper
template<layout_type L>
using layout_iterator = typename iterable_base::template layout_iterator<L>
template<layout_type L>
using const_layout_iterator = typename iterable_base::template const_layout_iterator<L>
template<layout_type L>
using reverse_layout_iterator = typename iterable_base::template reverse_layout_iterator<L>
template<layout_type L>
using const_reverse_layout_iterator = typename iterable_base::template const_reverse_layout_iterator<L>
template<class S, layout_type L>
using broadcast_iterator = typename iterable_base::template broadcast_iterator<S, L>
template<class S, layout_type L>
using const_broadcast_iterator = typename iterable_base::template const_broadcast_iterator<S, L>
template<class S, layout_type L>
using reverse_broadcast_iterator = typename iterable_base::template reverse_broadcast_iterator<S, L>
template<class S, layout_type L>
using const_reverse_broadcast_iterator = typename iterable_base::template const_reverse_broadcast_iterator<S, L>
using iterator = typename iterable_base::iterator
using const_iterator = typename iterable_base::const_iterator
using reverse_iterator = typename iterable_base::reverse_iterator
using const_reverse_iterator = typename iterable_base::const_reverse_iterator
Public Types inherited from xt::xview_semantic< xmasked_view< CTD, CTM > >
using base_type
using derived_type
using temporary_type
Public Types inherited from xt::xsemantic_base< D >
using base_type = select_expression_base_t<D>
using derived_type = typename base_type::derived_type
using temporary_type = typename xcontainer_inner_types<D>::temporary_type

Public Member Functions

 xmasked_view (const xmasked_view &)=default
reference at (Args... args)
 Returns a reference to the element at the specified position in the expression, after dimension and bounds checking.
const_reference at (Args... args) const
 Returns a constant reference to the element at the specified position in the expression, after dimension and bounds checking.
disable_integral_t< S, reference > operator[] (const S &index)
 Returns a reference to the element at the specified position in the expression.
reference operator[] (std::initializer_list< I > index)
reference operator[] (size_type i)
disable_integral_t< S, const_reference > operator[] (const S &index) const
 Returns a constant reference to the element at the specified position in the expression.
const_reference operator[] (std::initializer_list< I > index) const
const_reference operator[] (size_type i) const
reference back ()
 Returns a reference to the last element of the expression.
const_reference back () const
 Returns a constant reference to last the element of the expression.
reference front ()
 Returns a reference to the first element of the expression.
const_reference front () const
 Returns a constant reference to first the element of the expression.
reference periodic (Args... args)
 Returns a reference to the element at the specified position in the expression, after applying periodicity to the indices (negative and 'overflowing' indices are changed).
const_reference periodic (Args... args) const
 Returns a constant reference to the element at the specified position in the expression, after applying periodicity to the indices (negative and 'overflowing' indices are changed).
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.
Constructors
template<class D, class M>
 xmasked_view (D &&data, M &&mask)
 Creates an xmasked_view, given the xoptional_assembly or xoptional_assembly_adaptor and the mask.
Size and shape
size_type size () const noexcept
 Returns the number of elements in the xmasked_view.
const inner_shape_type & shape () const noexcept
 Returns the shape of the xmasked_view.
const inner_strides_type & strides () const noexcept
 Returns the strides of the xmasked_view.
const inner_backstrides_type & backstrides () const noexcept
 Returns the backstrides of the xmasked_view.
layout_type layout () const noexcept
 Return the layout_type of the xmasked_view.
bool is_contiguous () const noexcept
template<class T>
void fill (const T &value)
 Fills the data with the given value.
Public Member Functions inherited from xt::xview_semantic< xmasked_view< CTD, CTM > >
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< D >
template<class E>
disable_xexpression< E, derived_type & > operator+= (const E &)
 Adds the scalar e to *this.
template<class E>
disable_xexpression< E, derived_type & > operator-= (const E &)
 Subtracts the scalar e from *this.
template<class E>
disable_xexpression< E, derived_type & > operator*= (const E &)
 Multiplies *this with the scalar e.
template<class E>
disable_xexpression< E, derived_type & > operator/= (const E &)
 Divides *this by the scalar e.
template<class E>
disable_xexpression< E, derived_type & > operator%= (const E &)
 Computes the remainder of *this after division by the scalar e.
template<class E>
disable_xexpression< E, derived_type & > operator&= (const E &)
 Computes the bitwise and of *this and the scalar e and assigns it to *this.
template<class E>
disable_xexpression< E, derived_type & > operator|= (const E &)
 Computes the bitwise or of *this and the scalar e and assigns it to *this.
template<class E>
disable_xexpression< E, derived_type & > operator^= (const E &)
 Computes the bitwise xor of *this and the scalar e and assigns it to *this.
template<class E>
derived_type & operator+= (const xexpression< E > &)
 Adds the xexpression e to *this.
template<class E>
derived_type & operator-= (const xexpression< E > &)
 Subtracts the xexpression e from *this.
template<class E>
derived_type & operator*= (const xexpression< E > &)
 Multiplies *this with the xexpression e.
template<class E>
derived_type & operator/= (const xexpression< E > &)
 Divides *this by the xexpression e.
template<class E>
derived_type & operator%= (const xexpression< E > &)
 Computes the remainder of *this after division by the xexpression e.
template<class E>
derived_type & operator&= (const xexpression< E > &)
 Computes the bitwise and of *this and the xexpression e and assigns it to *this.
template<class E>
derived_type & operator|= (const xexpression< E > &)
 Computes the bitwise or of *this and the xexpression e and assigns it to *this.
template<class E>
derived_type & operator^= (const xexpression< E > &)
 Computes the bitwise xor of *this and the xexpression e and assigns it to *this.
template<class E>
derived_type & assign (const xexpression< E > &)
 Assigns the xexpression e to *this.
template<class E>
derived_type & plus_assign (const xexpression< E > &)
 Adds the xexpression e to *this.
template<class E>
derived_type & minus_assign (const xexpression< E > &)
 Subtracts the xexpression e to *this.
template<class E>
derived_type & multiplies_assign (const xexpression< E > &)
 Multiplies *this with the xexpression e.
template<class E>
derived_type & divides_assign (const xexpression< E > &)
 Divides *this by the xexpression e.
template<class E>
derived_type & modulus_assign (const xexpression< E > &)
 Computes the remainder of *this after division by the xexpression e.
template<class E>
derived_type & bit_and_assign (const xexpression< E > &)
 Computes the bitwise and of e to *this.
template<class E>
derived_type & bit_or_assign (const xexpression< E > &)
 Computes the bitwise or of e to *this.
template<class E>
derived_type & bit_xor_assign (const xexpression< E > &)
 Computes the bitwise xor of e to *this.

Static Public Attributes

static constexpr bool is_data_const = std::is_const<std::remove_reference_t<value_expression>>::value
static constexpr layout_type static_layout = data_type::static_layout
static constexpr bool contiguous_layout = false

Friends

class xiterable< self_type >
class xconst_iterable< self_type >
class xview_semantic< self_type >
class xaccessible< self_type >
class xconst_accessible< self_type >

Data

template<class... Args>
reference operator() (Args... args)
 Returns a reference to the element at the specified position in the xmasked_view.
template<class... Args>
const_reference operator() (Args... args) const
 Returns a constant reference to the element at the specified position in the xmasked_view.
template<class... Args>
reference unchecked (Args... args)
 Returns a reference to the element at the specified position in the xmasked_view.
template<class... Args>
const_reference unchecked (Args... args) const
 Returns a constant reference to the element at the specified position in the xmasked_view.
template<class It>
reference element (It first, It last)
 Returns a reference to the element at the specified position in the xmasked_view.
template<class It>
const_reference element (It first, It last) const
 Returns a constant reference to the element at the specified position in the xmasked_view.
template<class S>
bool has_linear_assign (const S &strides) const noexcept
data_type & value () noexcept
 Return an expression for the values of the xmasked_view.
const data_type & value () const noexcept
 Return a constant expression for the values of the xmasked_view.
mask_type & visible () noexcept
 Return an expression for the mask of the xmasked_view.
const mask_type & visible () const noexcept
 Return a constant expression for the mask of the xmasked_view.
template<class S>
stepper stepper_begin (const S &shape) noexcept
template<class S>
stepper stepper_end (const S &shape, layout_type l) noexcept
template<class S>
const_stepper stepper_begin (const S &shape) const noexcept
template<class S>
const_stepper stepper_end (const S &shape, layout_type l) const noexcept
self_type & operator= (const self_type &rhs)
template<class E>
self_type & operator= (const xexpression< E > &e)
template<class E>
disable_xexpression< E, self_type > & operator= (const E &e)

Additional Inherited Members

Protected Member Functions inherited from xt::xview_semantic< xmasked_view< CTD, CTM > >
 xview_semantic (const xview_semantic &)=default
xview_semantic & operator= (const xview_semantic &)=default
 xview_semantic (xview_semantic &&)=default
xview_semantic & operator= (xview_semantic &&)=default
derived_type & operator= (const xexpression< E > &)
Protected Member Functions inherited from xt::xsemantic_base< D >
 xsemantic_base (const xsemantic_base &)=default
xsemantic_base & operator= (const xsemantic_base &)=default
 xsemantic_base (xsemantic_base &&)=default
xsemantic_base & operator= (xsemantic_base &&)=default
template<class E>
derived_type & operator= (const xexpression< E > &)

Detailed Description

template<class CTD, class CTM>
class xt::xmasked_view< CTD, CTM >

View on an xoptional_assembly or xoptional_assembly_adaptor hiding values depending on a given mask.

The xmasked_view class implements a view on an xoptional_assembly or xoptional_assembly_adaptor, it takes this xoptional_assembly and a mask as input. The mask is an xexpression containing boolean values, whenever the value of the mask is false, the optional value of xmasked_view is considered missing, otherwise it depends on the underlying xoptional_assembly.

Template Parameters
CTDThe type of expression holding the values.
CTMThe type of expression holding the mask.

Definition at line 78 of file xmasked_view.hpp.

Member Typedef Documentation

◆ accessible_base

template<class CTD, class CTM>
using xt::xmasked_view< CTD, CTM >::accessible_base = xaccessible<self_type>

Definition at line 86 of file xmasked_view.hpp.

◆ base_const_reference

template<class CTD, class CTM>
using xt::xmasked_view< CTD, CTM >::base_const_reference = typename data_type::const_reference

Definition at line 99 of file xmasked_view.hpp.

◆ base_reference

template<class CTD, class CTM>
using xt::xmasked_view< CTD, CTM >::base_reference = typename data_type::reference

Definition at line 98 of file xmasked_view.hpp.

◆ base_value_type

template<class CTD, class CTM>
using xt::xmasked_view< CTD, CTM >::base_value_type = typename inner_types::base_value_type

Definition at line 97 of file xmasked_view.hpp.

◆ bool_load_type

template<class CTD, class CTM>
using xt::xmasked_view< CTD, CTM >::bool_load_type = xtl::xmasked_value<typename data_type::bool_load_type, mask_type>

Definition at line 118 of file xmasked_view.hpp.

◆ broadcast_iterator

template<class CTD, class CTM>
template<class S, layout_type L>
using xt::xmasked_view< CTD, CTM >::broadcast_iterator = typename iterable_base::template broadcast_iterator<S, L>

Definition at line 146 of file xmasked_view.hpp.

◆ const_broadcast_iterator

template<class CTD, class CTM>
template<class S, layout_type L>
using xt::xmasked_view< CTD, CTM >::const_broadcast_iterator = typename iterable_base::template const_broadcast_iterator<S, L>

Definition at line 148 of file xmasked_view.hpp.

◆ const_iterator

template<class CTD, class CTM>
using xt::xmasked_view< CTD, CTM >::const_iterator = typename iterable_base::const_iterator

Definition at line 155 of file xmasked_view.hpp.

◆ const_layout_iterator

template<class CTD, class CTM>
template<layout_type L>
using xt::xmasked_view< CTD, CTM >::const_layout_iterator = typename iterable_base::template const_layout_iterator<L>

Definition at line 139 of file xmasked_view.hpp.

◆ const_pointer

template<class CTD, class CTM>
using xt::xmasked_view< CTD, CTM >::const_pointer = xtl::xclosure_pointer<const_reference>

Definition at line 113 of file xmasked_view.hpp.

◆ const_reference

template<class CTD, class CTM>
using xt::xmasked_view< CTD, CTM >::const_reference = typename inner_types::const_reference

Definition at line 110 of file xmasked_view.hpp.

◆ const_reverse_broadcast_iterator

template<class CTD, class CTM>
template<class S, layout_type L>
using xt::xmasked_view< CTD, CTM >::const_reverse_broadcast_iterator = typename iterable_base::template const_reverse_broadcast_iterator<S, L>

Definition at line 152 of file xmasked_view.hpp.

◆ const_reverse_iterator

template<class CTD, class CTM>
using xt::xmasked_view< CTD, CTM >::const_reverse_iterator = typename iterable_base::const_reverse_iterator

Definition at line 157 of file xmasked_view.hpp.

◆ const_reverse_layout_iterator

template<class CTD, class CTM>
template<layout_type L>
using xt::xmasked_view< CTD, CTM >::const_reverse_layout_iterator = typename iterable_base::template const_reverse_layout_iterator<L>

Definition at line 143 of file xmasked_view.hpp.

◆ const_stepper

template<class CTD, class CTM>
using xt::xmasked_view< CTD, CTM >::const_stepper = typename iterable_base::const_stepper

Definition at line 134 of file xmasked_view.hpp.

◆ data_type

template<class CTD, class CTM>
using xt::xmasked_view< CTD, CTM >::data_type = typename inner_types::data_type

Definition at line 90 of file xmasked_view.hpp.

◆ difference_type

template<class CTD, class CTM>
using xt::xmasked_view< CTD, CTM >::difference_type = typename data_type::difference_type

Definition at line 116 of file xmasked_view.hpp.

◆ expression_tag

template<class CTD, class CTM>
using xt::xmasked_view< CTD, CTM >::expression_tag = xtensor_expression_tag

Definition at line 130 of file xmasked_view.hpp.

◆ flag_const_reference

template<class CTD, class CTM>
using xt::xmasked_view< CTD, CTM >::flag_const_reference = typename mask_type::const_reference

Definition at line 103 of file xmasked_view.hpp.

◆ flag_reference

template<class CTD, class CTM>
using xt::xmasked_view< CTD, CTM >::flag_reference = typename mask_type::reference

Definition at line 102 of file xmasked_view.hpp.

◆ flag_type

template<class CTD, class CTM>
using xt::xmasked_view< CTD, CTM >::flag_type = typename inner_types::flag_type

Definition at line 101 of file xmasked_view.hpp.

◆ inner_backstrides_type

template<class CTD, class CTM>
using xt::xmasked_view< CTD, CTM >::inner_backstrides_type = typename data_type::inner_backstrides_type

Definition at line 128 of file xmasked_view.hpp.

◆ inner_shape_type

template<class CTD, class CTM>
using xt::xmasked_view< CTD, CTM >::inner_shape_type = typename data_type::inner_shape_type

Definition at line 126 of file xmasked_view.hpp.

◆ inner_strides_type

template<class CTD, class CTM>
using xt::xmasked_view< CTD, CTM >::inner_strides_type = typename data_type::inner_strides_type

Definition at line 127 of file xmasked_view.hpp.

◆ inner_types

template<class CTD, class CTM>
using xt::xmasked_view< CTD, CTM >::inner_types = xcontainer_inner_types<self_type>

Definition at line 87 of file xmasked_view.hpp.

◆ iterable_base

template<class CTD, class CTM>
using xt::xmasked_view< CTD, CTM >::iterable_base = xiterable<xmasked_view<CTD, CTM>>

Definition at line 132 of file xmasked_view.hpp.

◆ iterator

template<class CTD, class CTM>
using xt::xmasked_view< CTD, CTM >::iterator = typename iterable_base::iterator

Definition at line 154 of file xmasked_view.hpp.

◆ layout_iterator

template<class CTD, class CTM>
template<layout_type L>
using xt::xmasked_view< CTD, CTM >::layout_iterator = typename iterable_base::template layout_iterator<L>

Definition at line 137 of file xmasked_view.hpp.

◆ mask_expression

template<class CTD, class CTM>
using xt::xmasked_view< CTD, CTM >::mask_expression = CTM

Definition at line 93 of file xmasked_view.hpp.

◆ mask_reference

template<class CTD, class CTM>
using xt::xmasked_view< CTD, CTM >::mask_reference = typename inner_types::mask_reference

Definition at line 106 of file xmasked_view.hpp.

◆ mask_type

template<class CTD, class CTM>
using xt::xmasked_view< CTD, CTM >::mask_type = typename inner_types::mask_type

Definition at line 91 of file xmasked_view.hpp.

◆ pointer

template<class CTD, class CTM>
using xt::xmasked_view< CTD, CTM >::pointer = xtl::xclosure_pointer<reference>

Definition at line 112 of file xmasked_view.hpp.

◆ reference

template<class CTD, class CTM>
using xt::xmasked_view< CTD, CTM >::reference = typename inner_types::reference

Definition at line 109 of file xmasked_view.hpp.

◆ reverse_broadcast_iterator

template<class CTD, class CTM>
template<class S, layout_type L>
using xt::xmasked_view< CTD, CTM >::reverse_broadcast_iterator = typename iterable_base::template reverse_broadcast_iterator<S, L>

Definition at line 150 of file xmasked_view.hpp.

◆ reverse_iterator

template<class CTD, class CTM>
using xt::xmasked_view< CTD, CTM >::reverse_iterator = typename iterable_base::reverse_iterator

Definition at line 156 of file xmasked_view.hpp.

◆ reverse_layout_iterator

template<class CTD, class CTM>
template<layout_type L>
using xt::xmasked_view< CTD, CTM >::reverse_layout_iterator = typename iterable_base::template reverse_layout_iterator<L>

Definition at line 141 of file xmasked_view.hpp.

◆ self_type

template<class CTD, class CTM>
using xt::xmasked_view< CTD, CTM >::self_type = xmasked_view<CTD, CTM>

Definition at line 84 of file xmasked_view.hpp.

◆ semantic_base

template<class CTD, class CTM>
using xt::xmasked_view< CTD, CTM >::semantic_base = xview_semantic<xmasked_view<CTD, CTM>>

Definition at line 85 of file xmasked_view.hpp.

◆ shape_type

template<class CTD, class CTM>
using xt::xmasked_view< CTD, CTM >::shape_type = typename data_type::shape_type

Definition at line 120 of file xmasked_view.hpp.

◆ size_type

template<class CTD, class CTM>
using xt::xmasked_view< CTD, CTM >::size_type = typename inner_types::size_type

Definition at line 115 of file xmasked_view.hpp.

◆ stepper

template<class CTD, class CTM>
using xt::xmasked_view< CTD, CTM >::stepper = typename iterable_base::stepper

Definition at line 133 of file xmasked_view.hpp.

◆ strides_type

template<class CTD, class CTM>
using xt::xmasked_view< CTD, CTM >::strides_type = typename data_type::strides_type

Definition at line 121 of file xmasked_view.hpp.

◆ temporary_type

template<class CTD, class CTM>
using xt::xmasked_view< CTD, CTM >::temporary_type = typename inner_types::temporary_type

Definition at line 88 of file xmasked_view.hpp.

◆ val_reference

template<class CTD, class CTM>
using xt::xmasked_view< CTD, CTM >::val_reference = typename inner_types::val_reference

Definition at line 105 of file xmasked_view.hpp.

◆ value_expression

template<class CTD, class CTM>
using xt::xmasked_view< CTD, CTM >::value_expression = CTD

Definition at line 92 of file xmasked_view.hpp.

◆ value_type

template<class CTD, class CTM>
using xt::xmasked_view< CTD, CTM >::value_type = typename inner_types::value_type

Definition at line 108 of file xmasked_view.hpp.

Constructor & Destructor Documentation

◆ xmasked_view()

template<class CTD, class CTM>
template<class D, class M>
xt::xmasked_view< CTD, CTM >::xmasked_view ( D && data,
M && mask )
inline

Creates an xmasked_view, given the xoptional_assembly or xoptional_assembly_adaptor and the mask.

Parameters
datathe underlying xoptional_assembly or xoptional_assembly_adaptor
maskthe mask.

Definition at line 309 of file xmasked_view.hpp.

Member Function Documentation

◆ at() [1/2]

template<class CTD, class CTM>
reference xt::xaccessible< self_type >::at ( Args... args)

Returns a reference to the element at the specified position in the expression, after dimension and bounds checking.

Parameters
argsa list of indices specifying the position in the expression. Indices must be unsigned integers, the number of indices should be equal to the number of dimensions of the expression.
Exceptions
std::out_of_rangeif the number of argument is greater than the number of dimensions or if indices are out of bounds.

◆ at() [2/2]

template<class CTD, class CTM>
( Args... args) const-> const_reference

Returns a constant reference to the element at the specified position in the expression, after dimension and bounds checking.

Parameters
argsa list of indices specifying the position in the expression. Indices must be unsigned integers, the number of indices should be equal to the number of dimensions of the expression.
Exceptions
std::out_of_rangeif the number of argument is greater than the number of dimensions or if indices are out of bounds.

◆ backstrides()

template<class CTD, class CTM>
auto xt::xmasked_view< CTD, CTM >::backstrides ( ) const
inlinenoexcept

Returns the backstrides of the xmasked_view.

Definition at line 350 of file xmasked_view.hpp.

◆ begin() [1/4]

template<class CTD, class CTM>
( ) const -> const_layout_iterator< L >

Returns a constant iterator to the first element of the expression.

Template Parameters
Lorder used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

◆ begin() [2/4]

template<class CTD, class CTM>
layout_iterator< L > xt::xiterable< xmasked_view< CTD, CTM > >::begin ( )
noexcept

Returns an iterator to the first element of the expression.

Template Parameters
Lorder used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

◆ begin() [3/4]

template<class CTD, class CTM>
( const S & shape) const

Returns a constant iterator to the first element of the expression.

The iteration is broadcasted to the specified shape.

Parameters
shapethe shape used for broadcasting
Template Parameters
Stype of the shape parameter.
Lorder used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

◆ begin() [4/4]

template<class CTD, class CTM>
broadcast_iterator< S, L > xt::xiterable< xmasked_view< CTD, CTM > >::begin ( const S & shape)
noexcept

Returns an iterator to the first element of the expression.

The iteration is broadcasted to the specified shape.

Parameters
shapethe shape used for broadcasting
Template Parameters
Stype of the shape parameter.
Lorder used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

◆ element() [1/2]

template<class CTD, class CTM>
template<class It>
auto xt::xmasked_view< CTD, CTM >::element ( It first,
It last ) -> reference
inline

Returns a reference to the element at the specified position in the xmasked_view.

Parameters
firstiterator starting the sequence of indices
lastiterator ending the sequence of indices The number of indices in the sequence should be equal to or greater than the number of dimensions of the xmasked_view.

Definition at line 475 of file xmasked_view.hpp.

◆ element() [2/2]

template<class CTD, class CTM>
template<class It>
auto xt::xmasked_view< CTD, CTM >::element ( It first,
It last ) const
inline

Returns a constant reference to the element at the specified position in the xmasked_view.

Parameters
firstiterator starting the sequence of indices
lastiterator ending the sequence of indices The number of indices in the sequence should be equal to or greater than the number of dimensions of the xmasked_view.

Definition at line 489 of file xmasked_view.hpp.

◆ end() [1/4]

template<class CTD, class CTM>
( ) const -> const_layout_iterator< L >

Returns a constant iterator to the element following the last element of the expression.

Template Parameters
Lorder used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

◆ end() [2/4]

template<class CTD, class CTM>
layout_iterator< L > xt::xiterable< xmasked_view< CTD, CTM > >::end ( )
noexcept

Returns an iterator to the element following the last element of the expression.

Template Parameters
Lorder used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

◆ end() [3/4]

template<class CTD, class CTM>
( const S & shape) const

Returns a constant iterator to the element following the last element of the expression.

The iteration is broadcasted to the specified shape.

Parameters
shapethe shape used for broadcasting
Template Parameters
Stype of the shape parameter.
Lorder used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

◆ end() [4/4]

template<class CTD, class CTM>
broadcast_iterator< S, L > xt::xiterable< xmasked_view< CTD, CTM > >::end ( const S & shape)
noexcept

Returns an iterator to the element following the last element of the expression.

The iteration is broadcasted to the specified shape.

Parameters
shapethe shape used for broadcasting
Template Parameters
Stype of the shape parameter.
Lorder used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

◆ fill()

template<class CTD, class CTM>
template<class T>
void xt::xmasked_view< CTD, CTM >::fill ( const T & value)
inline

Fills the data with the given value.

Parameters
valuethe value to fill the data with.

Definition at line 379 of file xmasked_view.hpp.

◆ has_linear_assign()

template<class CTD, class CTM>
template<class S>
bool xt::xmasked_view< CTD, CTM >::has_linear_assign ( const S & strides) const
inlinenoexcept

Definition at line 498 of file xmasked_view.hpp.

◆ is_contiguous()

template<class CTD, class CTM>
bool xt::xmasked_view< CTD, CTM >::is_contiguous ( ) const
inlinenoexcept

Definition at line 368 of file xmasked_view.hpp.

◆ layout()

template<class CTD, class CTM>
layout_type xt::xmasked_view< CTD, CTM >::layout ( ) const
inlinenoexcept

Return the layout_type of the xmasked_view.

Returns
layout_type of the xmasked_view

Definition at line 362 of file xmasked_view.hpp.

◆ operator()() [1/2]

template<class CTD, class CTM>
template<class... Args>
auto xt::xmasked_view< CTD, CTM >::operator() ( Args... args) -> reference
inline

Returns a reference to the element at the specified position in the xmasked_view.

Parameters
argsa list of indices specifying the position in the xmasked_view. Indices must be unsigned integers, the number of indices should be equal or greater than the number of dimensions of the xmasked_view.

Definition at line 396 of file xmasked_view.hpp.

◆ operator()() [2/2]

template<class CTD, class CTM>
template<class... Args>
auto xt::xmasked_view< CTD, CTM >::operator() ( Args... args) const
inline

Returns a constant reference to the element at the specified position in the xmasked_view.

Parameters
argsa list of indices specifying the position in the xmasked_view. Indices must be unsigned integers, the number of indices should be equal or greater than the number of dimensions of the xmasked_view.

Definition at line 409 of file xmasked_view.hpp.

◆ operator=() [1/3]

template<class CTD, class CTM>
template<class E>
auto xt::xmasked_view< CTD, CTM >::operator= ( const E & e)
inline

Definition at line 584 of file xmasked_view.hpp.

◆ operator=() [2/3]

template<class CTD, class CTM>
auto xt::xmasked_view< CTD, CTM >::operator= ( const self_type & rhs)
inline

Definition at line 569 of file xmasked_view.hpp.

◆ operator=() [3/3]

template<class CTD, class CTM>
template<class E>
auto xt::xmasked_view< CTD, CTM >::operator= ( const xexpression< E > & e) -> self_type &
inline

Definition at line 577 of file xmasked_view.hpp.

◆ operator[]() [1/2]

template<class CTD, class CTM>
disable_integral_t< S, reference > xt::xaccessible< self_type >::operator[] ( const S & index)

Returns a reference to the element at the specified position in the expression.

Parameters
indexa sequence of indices specifying the position in the expression. Indices must be unsigned integers, the number of indices in the list should be equal or greater than the number of dimensions of the expression.

◆ operator[]() [2/2]

template<class CTD, class CTM>
( const S & index) const-> disable_integral_t< S, const_reference >

Returns a constant reference to the element at the specified position in the expression.

Parameters
indexa sequence of indices specifying the position in the expression. Indices must be unsigned integers, the number of indices in the list should be equal or greater than the number of dimensions of the expression.

◆ periodic() [1/2]

template<class CTD, class CTM>
reference xt::xaccessible< self_type >::periodic ( Args... args)

Returns a reference to the element at the specified position in the expression, after applying periodicity to the indices (negative and 'overflowing' indices are changed).

Parameters
argsa list of indices specifying the position in the expression. Indices must be integers, the number of indices should be equal to the number of dimensions of the expression.

◆ periodic() [2/2]

template<class CTD, class CTM>
( Args... args) const-> const_reference

Returns a constant reference to the element at the specified position in the expression, after applying periodicity to the indices (negative and 'overflowing' indices are changed).

Parameters
argsa list of indices specifying the position in the expression. Indices must be integers, the number of indices should be equal to the number of dimensions of the expression.

◆ rbegin() [1/4]

template<class CTD, class CTM>
( ) const -> const_reverse_layout_iterator< L >

Returns a constant iterator to the first element of the reversed expression.

Template Parameters
Lorder used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

◆ rbegin() [2/4]

template<class CTD, class CTM>
reverse_layout_iterator< L > xt::xiterable< xmasked_view< CTD, CTM > >::rbegin ( )
noexcept

Returns an iterator to the first element of the reversed expression.

Template Parameters
Lorder used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

◆ rbegin() [3/4]

template<class CTD, class CTM>
( const S & shape) const

Returns a constant iterator to the first element of the reversed expression.

The iteration is broadcasted to the specified shape.

Parameters
shapethe shape used for broadcasting
Template Parameters
Stype of the shape parameter.
Lorder used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

◆ rbegin() [4/4]

template<class CTD, class CTM>
reverse_broadcast_iterator< S, L > xt::xiterable< xmasked_view< CTD, CTM > >::rbegin ( const S & shape)
noexcept

Returns an iterator to the first element of the reversed expression.

The iteration is broadcasted to the specified shape.

Parameters
shapethe shape used for broadcasting
Template Parameters
Stype of the shape parameter.
Lorder used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

◆ rend() [1/4]

template<class CTD, class CTM>
( ) const -> const_reverse_layout_iterator< L >

Returns a constant iterator to the element following the last element of the reversed expression.

Template Parameters
Lorder used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

◆ rend() [2/4]

template<class CTD, class CTM>
reverse_layout_iterator< L > xt::xiterable< xmasked_view< CTD, CTM > >::rend ( )
noexcept

Returns an iterator to the element following the last element of the reversed expression.

Template Parameters
Lorder used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

◆ rend() [3/4]

template<class CTD, class CTM>
( const S & shape) const

Returns a constant iterator to the element following the last element of the reversed expression.

The iteration is broadcasted to the specified shape.

Parameters
shapethe shape used for broadcasting
Template Parameters
Stype of the shape parameter.
Lorder used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

◆ rend() [4/4]

template<class CTD, class CTM>
reverse_broadcast_iterator< S, L > xt::xiterable< xmasked_view< CTD, CTM > >::rend ( const S & shape)
noexcept

Returns an iterator to the element following the last element of the reversed expression.

The iteration is broadcasted to the specified shape.

Parameters
shapethe shape used for broadcasting
Template Parameters
Stype of the shape parameter.
Lorder used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

◆ shape()

template<class CTD, class CTM>
auto xt::xmasked_view< CTD, CTM >::shape ( ) const
inlinenoexcept

Returns the shape of the xmasked_view.

Definition at line 332 of file xmasked_view.hpp.

◆ size()

template<class CTD, class CTM>
auto xt::xmasked_view< CTD, CTM >::size ( ) const
inlinenoexcept

Returns the number of elements in the xmasked_view.

Definition at line 323 of file xmasked_view.hpp.

◆ stepper_begin() [1/2]

template<class CTD, class CTM>
template<class S>
auto xt::xmasked_view< CTD, CTM >::stepper_begin ( const S & shape) const
inlinenoexcept

Definition at line 555 of file xmasked_view.hpp.

◆ stepper_begin() [2/2]

template<class CTD, class CTM>
template<class S>
auto xt::xmasked_view< CTD, CTM >::stepper_begin ( const S & shape) -> stepper
inlinenoexcept

Definition at line 541 of file xmasked_view.hpp.

◆ stepper_end() [1/2]

template<class CTD, class CTM>
template<class S>
auto xt::xmasked_view< CTD, CTM >::stepper_end ( const S & shape,
layout_type l ) const
inlinenoexcept

Definition at line 562 of file xmasked_view.hpp.

◆ stepper_end() [2/2]

template<class CTD, class CTM>
template<class S>
auto xt::xmasked_view< CTD, CTM >::stepper_end ( const S & shape,
layout_type l ) -> stepper
inlinenoexcept

Definition at line 548 of file xmasked_view.hpp.

◆ strides()

template<class CTD, class CTM>
auto xt::xmasked_view< CTD, CTM >::strides ( ) const
inlinenoexcept

Returns the strides of the xmasked_view.

Definition at line 341 of file xmasked_view.hpp.

◆ unchecked() [1/2]

template<class CTD, class CTM>
template<class... Args>
auto xt::xmasked_view< CTD, CTM >::unchecked ( Args... args) -> reference
inline

Returns a reference to the element at the specified position in the xmasked_view.

Parameters
argsa list of indices specifying the position in the xmasked_view. Indices must be unsigned integers, the number of indices must be equal to the number of dimensions of the xmasked_view, else the behavior is undefined.
Warning
This method is meant for performance, for expressions with a dynamic number of dimensions (i.e. not known at compile time). Since it may have undefined behavior (see parameters), operator() should be preferred whenever it is possible.
This method is NOT compatible with broadcasting, meaning the following code has undefined behavior:
xt::xarray<double> a = {{0, 1}, {2, 3}};
xt::xarray<double> b = {0, 1};
auto fd = a + b;
double res = fd.uncheked(0, 1);
xarray_container< uvector< T, A >, L, xt::svector< typename uvector< T, A >::size_type, 4, SA, true > > xarray
Alias template on xarray_container with default parameters for data container type and shape / stride...

Definition at line 435 of file xmasked_view.hpp.

◆ unchecked() [2/2]

template<class CTD, class CTM>
template<class... Args>
auto xt::xmasked_view< CTD, CTM >::unchecked ( Args... args) const
inline

Returns a constant reference to the element at the specified position in the xmasked_view.

Parameters
argsa list of indices specifying the position in the xmasked_view. Indices must be unsigned integers, the number of indices must be equal to the number of dimensions of the xmasked_view, else the behavior is undefined.
Warning
This method is meant for performance, for expressions with a dynamic number of dimensions (i.e. not known at compile time). Since it may have undefined behavior (see parameters), operator() should be preferred whenever it is possible.
This method is NOT compatible with broadcasting, meaning the following code has undefined behavior:
xt::xarray<double> a = {{0, 1}, {2, 3}};
xt::xarray<double> b = {0, 1};
auto fd = a + b;
double res = fd.uncheked(0, 1);

Definition at line 461 of file xmasked_view.hpp.

◆ value() [1/2]

template<class CTD, class CTM>
auto xt::xmasked_view< CTD, CTM >::value ( ) const
inlinenoexcept

Return a constant expression for the values of the xmasked_view.

Definition at line 516 of file xmasked_view.hpp.

◆ value() [2/2]

template<class CTD, class CTM>
auto xt::xmasked_view< CTD, CTM >::value ( )
inlinenoexcept

Return an expression for the values of the xmasked_view.

Definition at line 507 of file xmasked_view.hpp.

◆ visible() [1/2]

template<class CTD, class CTM>
auto xt::xmasked_view< CTD, CTM >::visible ( ) const
inlinenoexcept

Return a constant expression for the mask of the xmasked_view.

Definition at line 534 of file xmasked_view.hpp.

◆ visible() [2/2]

template<class CTD, class CTM>
auto xt::xmasked_view< CTD, CTM >::visible ( )
inlinenoexcept

Return an expression for the mask of the xmasked_view.

Definition at line 525 of file xmasked_view.hpp.

◆ xaccessible< self_type >

template<class CTD, class CTM>
friend class xaccessible< self_type >
friend

Definition at line 243 of file xmasked_view.hpp.

◆ xconst_accessible< self_type >

template<class CTD, class CTM>
friend class xconst_accessible< self_type >
friend

Definition at line 243 of file xmasked_view.hpp.

◆ xconst_iterable< self_type >

template<class CTD, class CTM>
friend class xconst_iterable< self_type >
friend

Definition at line 243 of file xmasked_view.hpp.

◆ xiterable< self_type >

template<class CTD, class CTM>
friend class xiterable< self_type >
friend

Definition at line 243 of file xmasked_view.hpp.

◆ xview_semantic< self_type >

template<class CTD, class CTM>
friend class xview_semantic< self_type >
friend

Definition at line 243 of file xmasked_view.hpp.

Member Data Documentation

◆ contiguous_layout

template<class CTD, class CTM>
bool xt::xmasked_view< CTD, CTM >::contiguous_layout = false
staticconstexpr

Definition at line 124 of file xmasked_view.hpp.

◆ is_data_const

template<class CTD, class CTM>
bool xt::xmasked_view< CTD, CTM >::is_data_const = std::is_const<std::remove_reference_t<value_expression>>::value
staticconstexpr

Definition at line 95 of file xmasked_view.hpp.

◆ static_layout

template<class CTD, class CTM>
layout_type xt::xmasked_view< CTD, CTM >::static_layout = data_type::static_layout
staticconstexpr

Definition at line 123 of file xmasked_view.hpp.


The documentation for this class was generated from the following files:
  • /home/runner/work/xtensor/xtensor/include/xtensor/io/xmime.hpp
  • /home/runner/work/xtensor/xtensor/include/xtensor/views/xmasked_view.hpp