xtensor
Loading...
Searching...
No Matches
xt::xindex_view< CT, I > Class Template Reference

View of an xexpression from vector of indices. More...

#include <xindex_view.hpp>

Inheritance diagram for xt::xindex_view< CT, I >:
xt::xview_semantic< xindex_view< CT, I > > xt::xiterable< xindex_view< CT, I > > xt::xsemantic_base< D > xt::xconst_iterable< D >

Public Types

using self_type = xindex_view<CT, I>
 
using xexpression_type = std::decay_t<CT>
 
using semantic_base = xview_semantic<self_type>
 
using extension_base = extension::xindex_view_base_t<CT, I>
 
using expression_tag = typename extension_base::expression_tag
 
using value_type = typename xexpression_type::value_type
 
using reference = inner_reference_t<CT>
 
using const_reference = typename xexpression_type::const_reference
 
using pointer = typename xexpression_type::pointer
 
using const_pointer = typename xexpression_type::const_pointer
 
using size_type = typename xexpression_type::size_type
 
using difference_type = typename xexpression_type::difference_type
 
using iterable_base = xiterable<self_type>
 
using inner_shape_type = typename iterable_base::inner_shape_type
 
using shape_type = inner_shape_type
 
using indices_type = I
 
using stepper = typename iterable_base::stepper
 
using const_stepper = typename iterable_base::const_stepper
 
using temporary_type = typename xcontainer_inner_types<self_type>::temporary_type
 
using base_index_type = xindex_type_t<shape_type>
 
using bool_load_type = typename xexpression_type::bool_load_type
 
template<class E >
using rebind_t = xindex_view<E, I>
 
- Public Types inherited from xt::xview_semantic< xindex_view< CT, I > >
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 Types inherited from xt::xiterable< xindex_view< CT, I > >
using derived_type
 
using base_type
 
using inner_shape_type
 
using stepper
 
using const_stepper
 
using linear_iterator
 
using reverse_linear_iterator
 
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 iterator
 
using const_iterator
 
using reverse_iterator
 
using const_reverse_iterator
 
- Public Types inherited from xt::xconst_iterable< D >
using derived_type = D
 
using iterable_types = xiterable_inner_types<D>
 
using inner_shape_type = typename iterable_types::inner_shape_type
 
using stepper = typename iterable_types::stepper
 
using const_stepper = typename iterable_types::const_stepper
 
template<layout_type L>
using layout_iterator = xiterator<stepper, inner_shape_type*, L>
 
template<layout_type L>
using const_layout_iterator = xiterator<const_stepper, inner_shape_type*, L>
 
template<layout_type L>
using reverse_layout_iterator = std::reverse_iterator<layout_iterator<L>>
 
template<layout_type L>
using const_reverse_layout_iterator = std::reverse_iterator<const_layout_iterator<L>>
 
using linear_iterator = layout_iterator< ::xt::layout_type::row_major >
 
using const_linear_iterator = const_layout_iterator< ::xt::layout_type::row_major >
 
using reverse_linear_iterator = reverse_layout_iterator< ::xt::layout_type::row_major >
 
using const_reverse_linear_iterator = const_reverse_layout_iterator< ::xt::layout_type::row_major >
 
template<class S , layout_type L>
using broadcast_iterator = xiterator<stepper, S, L>
 
template<class S , layout_type L>
using const_broadcast_iterator = xiterator<const_stepper, S, L>
 
template<class S , layout_type L>
using reverse_broadcast_iterator = std::reverse_iterator<broadcast_iterator<S, L>>
 
template<class S , layout_type L>
using const_reverse_broadcast_iterator = std::reverse_iterator<const_broadcast_iterator<S, L>>
 
using iterator = layout_iterator< ::xt::layout_type::row_major >
 
using const_iterator = const_layout_iterator< ::xt::layout_type::row_major >
 
using reverse_iterator = reverse_layout_iterator< ::xt::layout_type::row_major >
 
using const_reverse_iterator = const_reverse_layout_iterator< ::xt::layout_type::row_major >
 

Public Member Functions

template<class E >
self_typeoperator= (const xexpression< E > &e)
 
template<class E >
disable_xexpression< E, self_type > & operator= (const E &e)
 
template<class... Args>
reference operator() (size_type idx0, size_type idx1, Args... args)
 
template<class S >
disable_integral_t< S, referenceoperator[] (const S &index)
 
template<class OI >
reference operator[] (std::initializer_list< OI > index)
 
template<class It >
reference element (It first, It last)
 
template<class... Args>
const_reference operator() (size_type idx0, size_type idx1, Args... args) const
 
template<class S >
disable_integral_t< S, const_reference > operator[] (const S &index) const
 
template<class OI >
const_reference operator[] (std::initializer_list< OI > index) const
 
template<class It >
const_reference element (It first, It last) const
 
template<class ST >
stepper stepper_begin (const ST &shape)
 
template<class ST >
stepper stepper_end (const ST &shape, layout_type)
 
template<class ST >
const_stepper stepper_begin (const ST &shape) const
 
template<class ST >
const_stepper stepper_end (const ST &shape, layout_type) const
 
template<class E >
rebind_t< E > build_index_view (E &&e) const
 
Constructor
template<class CTA , class I2 >
 xindex_view (CTA &&e, I2 &&indices) noexcept
 Constructs an xindex_view, selecting the indices specified by indices.
 
Size and shape
size_type size () const noexcept
 Returns the size of the xindex_view.
 
size_type dimension () const noexcept
 Returns the number of dimensions of the xindex_view.
 
const inner_shape_type & shape () const noexcept
 Returns the shape of the xindex_view.
 
size_type shape (size_type index) const
 Returns the i-th dimension of the expression.
 
layout_type layout () const noexcept
 
bool is_contiguous () const noexcept
 
Data
template<class T >
void fill (const T &value)
 Fills the view with the given value.
 
reference operator() (size_type idx=size_type(0))
 Returns a reference to the element at the specified position in the xindex_view.
 
reference unchecked (size_type idx)
 Returns a reference to the element at the specified position in the xindex_view.
 
reference operator[] (size_type i)
 
const_reference operator() (size_type idx=size_type(0)) const
 Returns a constant reference to the element at the specified position in the xindex_view.
 
const_reference unchecked (size_type idx) const
 Returns a constant reference to the element at the specified position in the xindex_view.
 
const_reference operator[] (size_type i) const
 
xexpression_type & expression () noexcept
 Returns a reference to the underlying expression of the view.
 
const xexpression_type & expression () const noexcept
 Returns a constant reference to the underlying expression of the view.
 
template<class... Args>
auto operator() (size_type, size_type idx1, Args... args) -> reference
 
template<class... Args>
auto operator() (size_type, size_type idx1, Args... args) const -> const_reference
 
template<class S >
auto operator[] (const S &index) -> disable_integral_t< S, reference >
 Returns a reference to the element at the specified position in the container.
 
template<class OI >
auto operator[] (std::initializer_list< OI > index) -> reference
 
template<class S >
auto operator[] (const S &index) const -> disable_integral_t< S, const_reference >
 Returns a constant reference to the element at the specified position in the container.
 
template<class OI >
auto operator[] (std::initializer_list< OI > index) const -> const_reference
 
template<class It >
auto element (It first, It) -> reference
 Returns a reference to the element at the specified position in the xindex_view.
 
template<class It >
auto element (It first, It) const -> const_reference
 Returns a reference to the element at the specified position in the xindex_view.
 
Broadcasting
template<class O >
bool broadcast_shape (O &shape, bool reuse_cache=false) const
 Broadcast the shape of the xindex_view to the specified parameter.
 
template<class O >
bool has_linear_assign (const O &) const noexcept
 Checks whether the xindex_view can be linearly assigned to an expression with the specified strides.
 
template<class ST >
auto stepper_begin (const ST &shape) -> stepper
 
template<class ST >
auto stepper_end (const ST &shape, layout_type) -> stepper
 
template<class ST >
auto stepper_begin (const ST &shape) const -> const_stepper
 
template<class ST >
auto stepper_end (const ST &shape, layout_type) const -> const_stepper
 
template<class E >
auto build_index_view (E &&e) const -> rebind_t< E >
 
- Public Member Functions inherited from xt::xview_semantic< xindex_view< CT, I > >
derived_typeassign_xexpression (const xexpression< E > &e)
 
derived_typecomputed_assign (const xexpression< E > &e)
 
derived_typescalar_computed_assign (const E &e, F &&f)
 
derived_typeassign_temporary (temporary_type &&)
 Assigns the temporary tmp to *this.
 
auto assign_xexpression (const xexpression< E > &e) -> derived_type &
 
auto computed_assign (const xexpression< E > &e) -> derived_type &
 
auto scalar_computed_assign (const E &e, F &&f) -> derived_type &
 
auto operator= (const xexpression< E > &rhs) -> derived_type &
 
- Public Member Functions inherited from xt::xsemantic_base< D >
template<class E >
disable_xexpression< E, derived_type & > operator+= (const E &)
 
template<class E >
disable_xexpression< E, derived_type & > operator-= (const E &)
 
template<class E >
disable_xexpression< E, derived_type & > operator*= (const E &)
 
template<class E >
disable_xexpression< E, derived_type & > operator/= (const E &)
 
template<class E >
disable_xexpression< E, derived_type & > operator%= (const E &)
 
template<class E >
disable_xexpression< E, derived_type & > operator&= (const E &)
 
template<class E >
disable_xexpression< E, derived_type & > operator|= (const E &)
 
template<class E >
disable_xexpression< E, derived_type & > operator^= (const E &)
 
template<class E >
derived_type & operator+= (const xexpression< E > &)
 
template<class E >
derived_type & operator-= (const xexpression< E > &)
 
template<class E >
derived_type & operator*= (const xexpression< E > &)
 
template<class E >
derived_type & operator/= (const xexpression< E > &)
 
template<class E >
derived_type & operator%= (const xexpression< E > &)
 
template<class E >
derived_type & operator&= (const xexpression< E > &)
 
template<class E >
derived_type & operator|= (const xexpression< E > &)
 
template<class E >
derived_type & operator^= (const xexpression< E > &)
 
template<class E >
derived_type & assign (const xexpression< E > &)
 
template<class E >
derived_type & plus_assign (const xexpression< E > &)
 
template<class E >
derived_type & minus_assign (const xexpression< E > &)
 
template<class E >
derived_type & multiplies_assign (const xexpression< E > &)
 
template<class E >
derived_type & divides_assign (const xexpression< E > &)
 
template<class E >
derived_type & modulus_assign (const xexpression< E > &)
 
template<class E >
derived_type & bit_and_assign (const xexpression< E > &)
 
template<class E >
derived_type & bit_or_assign (const xexpression< E > &)
 
template<class E >
derived_type & bit_xor_assign (const xexpression< E > &)
 
template<class E >
auto operator+= (const E &e) -> disable_xexpression< E, derived_type & >
 Adds the scalar e to *this.
 
template<class E >
auto operator-= (const E &e) -> disable_xexpression< E, derived_type & >
 Subtracts the scalar e from *this.
 
template<class E >
auto operator*= (const E &e) -> disable_xexpression< E, derived_type & >
 Multiplies *this with the scalar e.
 
template<class E >
auto operator/= (const E &e) -> disable_xexpression< E, derived_type & >
 Divides *this by the scalar e.
 
template<class E >
auto operator%= (const E &e) -> disable_xexpression< E, derived_type & >
 Computes the remainder of *this after division by the scalar e.
 
template<class E >
auto operator&= (const E &e) -> disable_xexpression< E, derived_type & >
 Computes the bitwise and of *this and the scalar e and assigns it to *this.
 
template<class E >
auto operator|= (const E &e) -> disable_xexpression< E, derived_type & >
 Computes the bitwise or of *this and the scalar e and assigns it to *this.
 
template<class E >
auto operator^= (const E &e) -> disable_xexpression< E, derived_type & >
 Computes the bitwise xor of *this and the scalar e and assigns it to *this.
 
template<class E >
auto operator+= (const xexpression< E > &e) -> derived_type &
 Adds the xexpression e to *this.
 
template<class E >
auto operator-= (const xexpression< E > &e) -> derived_type &
 Subtracts the xexpression e from *this.
 
template<class E >
auto operator*= (const xexpression< E > &e) -> derived_type &
 Multiplies *this with the xexpression e.
 
template<class E >
auto operator/= (const xexpression< E > &e) -> derived_type &
 Divides *this by the xexpression e.
 
template<class E >
auto operator%= (const xexpression< E > &e) -> derived_type &
 Computes the remainder of *this after division by the xexpression e.
 
template<class E >
auto operator&= (const xexpression< E > &e) -> derived_type &
 Computes the bitwise and of *this and the xexpression e and assigns it to *this.
 
template<class E >
auto operator|= (const xexpression< E > &e) -> derived_type &
 Computes the bitwise or of *this and the xexpression e and assigns it to *this.
 
template<class E >
auto operator^= (const xexpression< E > &e) -> derived_type &
 Computes the bitwise xor of *this and the xexpression e and assigns it to *this.
 
template<class E >
auto assign (const xexpression< E > &e) -> derived_type &
 Assigns the xexpression e to *this.
 
template<class E >
auto plus_assign (const xexpression< E > &e) -> derived_type &
 Adds the xexpression e to *this.
 
template<class E >
auto minus_assign (const xexpression< E > &e) -> derived_type &
 Subtracts the xexpression e to *this.
 
template<class E >
auto multiplies_assign (const xexpression< E > &e) -> derived_type &
 Multiplies *this with the xexpression e.
 
template<class E >
auto divides_assign (const xexpression< E > &e) -> derived_type &
 Divides *this by the xexpression e.
 
template<class E >
auto modulus_assign (const xexpression< E > &e) -> derived_type &
 Computes the remainder of *this after division by the xexpression e.
 
template<class E >
auto bit_and_assign (const xexpression< E > &e) -> derived_type &
 Computes the bitwise and of e to *this.
 
template<class E >
auto bit_or_assign (const xexpression< E > &e) -> derived_type &
 Computes the bitwise or of e to *this.
 
template<class E >
auto bit_xor_assign (const xexpression< E > &e) -> derived_type &
 Computes the bitwise xor of e to *this.
 
template<class E >
auto operator= (const xexpression< E > &e) -> derived_type &
 
- Public Member Functions inherited from xt::xiterable< xindex_view< CT, I > >
layout_iterator< Lbegin () noexcept
 
broadcast_iterator< S, Lbegin (const S &shape) noexcept
 
const_layout_iterator< Lbegin () const noexcept
 
const_broadcast_iterator< S, Lbegin (const S &shape) const noexcept
 
auto begin () const noexcept -> const_layout_iterator< L >
 Returns a constant iterator to the first element of the expression.
 
auto begin (const S &shape) const noexcept -> const_broadcast_iterator< S, L >
 Returns a constant iterator to the first element of the expression.
 
layout_iterator< Lend () noexcept
 
broadcast_iterator< S, Lend (const S &shape) noexcept
 
const_layout_iterator< Lend () const noexcept
 
const_broadcast_iterator< S, Lend (const S &shape) const noexcept
 
auto end () const noexcept -> const_layout_iterator< L >
 Returns a constant iterator to the element following the last element of the expression.
 
auto end (const S &shape) const noexcept -> const_broadcast_iterator< S, L >
 Returns a constant iterator to the element following the last element of the expression.
 
reverse_layout_iterator< Lrbegin () noexcept
 
reverse_broadcast_iterator< S, Lrbegin (const S &shape) noexcept
 
const_reverse_layout_iterator< Lrbegin () const noexcept
 
const_reverse_broadcast_iterator< S, Lrbegin (const S &shape) const noexcept
 
auto rbegin () const noexcept -> const_reverse_layout_iterator< L >
 Returns a constant iterator to the first element of the reversed expression.
 
auto rbegin (const S &shape) const noexcept -> const_reverse_broadcast_iterator< S, L >
 Returns a constant iterator to the first element of the reversed expression.
 
reverse_layout_iterator< Lrend () noexcept
 
reverse_broadcast_iterator< S, Lrend (const S &shape) noexcept
 
const_reverse_layout_iterator< Lrend () const noexcept
 
const_reverse_broadcast_iterator< S, Lrend (const S &shape) const noexcept
 
auto rend () const noexcept -> const_reverse_layout_iterator< L >
 Returns a constant iterator to the element following the last element of the reversed expression.
 
auto rend (const S &shape) const noexcept -> const_reverse_broadcast_iterator< S, L >
 Returns a constant iterator to the element following the last element of the reversed expression.
 
auto begin () noexcept -> layout_iterator< L >
 Returns an iterator to the first element of the expression.
 
auto end () noexcept -> layout_iterator< L >
 Returns an iterator to the element following the last element of the expression.
 
auto begin (const S &shape) noexcept -> broadcast_iterator< S, L >
 Returns an iterator to the first element of the expression.
 
auto end (const S &shape) noexcept -> broadcast_iterator< S, L >
 Returns an iterator to the element following the last element of the expression.
 
auto rbegin () noexcept -> reverse_layout_iterator< L >
 Returns an iterator to the first element of the reversed expression.
 
auto rend () noexcept -> reverse_layout_iterator< L >
 Returns an iterator to the element following the last element of the reversed expression.
 
auto rbegin (const S &shape) noexcept -> reverse_broadcast_iterator< S, L >
 Returns an iterator to the first element of the reversed expression.
 
auto rend (const S &shape) noexcept -> reverse_broadcast_iterator< S, L >
 Returns an iterator to the element following the last element of the reversed expression.
 
auto get_begin (bool end_index) noexcept -> layout_iterator< L >
 
auto get_begin (const S &shape, bool end_index) noexcept -> broadcast_iterator< S, L >
 
auto get_end (bool end_index) noexcept -> layout_iterator< L >
 
auto get_end (const S &shape, bool end_index) noexcept -> broadcast_iterator< S, L >
 
auto get_stepper_begin (const S &shape) noexcept -> stepper
 
auto get_stepper_begin (const S &shape) const noexcept -> const_stepper
 
auto get_stepper_end (const S &shape, layout_type l) noexcept -> stepper
 
auto get_stepper_end (const S &shape, layout_type l) const noexcept -> const_stepper
 
- Public Member Functions inherited from xt::xconst_iterable< D >
template<layout_type L = ::xt::layout_type::row_major>
const_layout_iterator< Lbegin () const noexcept
 
template<layout_type L = ::xt::layout_type::row_major>
const_layout_iterator< Lend () const noexcept
 
template<layout_type L = ::xt::layout_type::row_major>
const_layout_iterator< Lcbegin () const noexcept
 
template<layout_type L = ::xt::layout_type::row_major>
const_layout_iterator< Lcend () const noexcept
 
template<layout_type L = ::xt::layout_type::row_major>
const_reverse_layout_iterator< Lrbegin () const noexcept
 
template<layout_type L = ::xt::layout_type::row_major>
const_reverse_layout_iterator< Lrend () const noexcept
 
template<layout_type L = ::xt::layout_type::row_major>
const_reverse_layout_iterator< Lcrbegin () const noexcept
 
template<layout_type L = ::xt::layout_type::row_major>
const_reverse_layout_iterator< Lcrend () const noexcept
 
template<layout_type L = ::xt::layout_type::row_major, class S >
const_broadcast_iterator< S, Lbegin (const S &shape) const noexcept
 
template<layout_type L = ::xt::layout_type::row_major, class S >
const_broadcast_iterator< S, Lend (const S &shape) const noexcept
 
template<layout_type L = ::xt::layout_type::row_major, class S >
const_broadcast_iterator< S, Lcbegin (const S &shape) const noexcept
 
template<layout_type L = ::xt::layout_type::row_major, class S >
const_broadcast_iterator< S, Lcend (const S &shape) const noexcept
 
template<layout_type L = ::xt::layout_type::row_major, class S >
const_reverse_broadcast_iterator< S, Lrbegin (const S &shape) const noexcept
 
template<layout_type L = ::xt::layout_type::row_major, class S >
const_reverse_broadcast_iterator< S, Lrend (const S &shape) const noexcept
 
template<layout_type L = ::xt::layout_type::row_major, class S >
const_reverse_broadcast_iterator< S, Lcrbegin (const S &shape) const noexcept
 
template<layout_type L = ::xt::layout_type::row_major, class S >
const_reverse_broadcast_iterator< S, Lcrend (const S &shape) const noexcept
 
template<layout_type L>
auto begin () const noexcept -> const_layout_iterator< L >
 Returns a constant iterator to the first element of the expression.
 
template<layout_type L>
auto end () const noexcept -> const_layout_iterator< L >
 Returns a constant iterator to the element following the last element of the expression.
 
template<layout_type L>
auto cbegin () const noexcept -> const_layout_iterator< L >
 Returns a constant iterator to the first element of the expression.
 
template<layout_type L>
auto cend () const noexcept -> const_layout_iterator< L >
 Returns a constant iterator to the element following the last element of the expression.
 
template<layout_type L>
auto rbegin () const noexcept -> const_reverse_layout_iterator< L >
 Returns a constant iterator to the first element of the reversed expression.
 
template<layout_type L>
auto rend () const noexcept -> const_reverse_layout_iterator< L >
 Returns a constant iterator to the element following the last element of the reversed expression.
 
template<layout_type L>
auto crbegin () const noexcept -> const_reverse_layout_iterator< L >
 Returns a constant iterator to the first element of the reversed expression.
 
template<layout_type L>
auto crend () const noexcept -> const_reverse_layout_iterator< L >
 Returns a constant iterator to the element following the last element of the reversed expression.
 
template<layout_type L, class S >
auto begin (const S &shape) const noexcept -> const_broadcast_iterator< S, L >
 Returns a constant iterator to the first element of the expression.
 
template<layout_type L, class S >
auto end (const S &shape) const noexcept -> const_broadcast_iterator< S, L >
 Returns a constant iterator to the element following the last element of the expression.
 
template<layout_type L, class S >
auto cbegin (const S &shape) const noexcept -> const_broadcast_iterator< S, L >
 Returns a constant iterator to the first element of the expression.
 
template<layout_type L, class S >
auto cend (const S &shape) const noexcept -> const_broadcast_iterator< S, L >
 Returns a constant iterator to the element following the last element of the expression.
 
template<layout_type L, class S >
auto rbegin (const S &shape) const noexcept -> const_reverse_broadcast_iterator< S, L >
 Returns a constant iterator to the first element of the reversed expression.
 
template<layout_type L, class S >
auto rend (const S &shape) const noexcept -> const_reverse_broadcast_iterator< S, L >
 Returns a constant iterator to the element following the last element of the reversed expression.
 
template<layout_type L, class S >
auto crbegin (const S &shape) const noexcept -> const_reverse_broadcast_iterator< S, L >
 Returns a constant iterator to the first element of the reversed expression.
 
template<layout_type L, class S >
auto crend (const S &shape) const noexcept -> const_reverse_broadcast_iterator< S, L >
 Returns a constant iterator to the element following the last element of the reversed expression.
 
template<layout_type L>
auto get_cbegin (bool end_index) const noexcept -> const_layout_iterator< L >
 
template<layout_type L>
auto get_cend (bool end_index) const noexcept -> const_layout_iterator< L >
 
template<layout_type L, class S >
auto get_cbegin (const S &shape, bool end_index) const noexcept -> const_broadcast_iterator< S, L >
 
template<layout_type L, class S >
auto get_cend (const S &shape, bool end_index) const noexcept -> const_broadcast_iterator< S, L >
 
template<class S >
auto get_stepper_begin (const S &shape) const noexcept -> const_stepper
 
template<class S >
auto get_stepper_end (const S &shape, layout_type l) const noexcept -> const_stepper
 

Static Public Attributes

static constexpr layout_type static_layout = layout_type::dynamic
 
static constexpr bool contiguous_layout = false
 

Friends

class xview_semantic< xindex_view< CT, I > >
 

Extended copy semantic

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

Additional Inherited Members

- Protected Member Functions inherited from xt::xview_semantic< xindex_view< CT, I > >
 xview_semantic (const xview_semantic &)=default
 
 xview_semantic (xview_semantic &&)=default
 
xview_semanticoperator= (const xview_semantic &)=default
 
xview_semanticoperator= (xview_semantic &&)=default
 
derived_typeoperator= (const xexpression< E > &)
 
- Protected Member Functions inherited from xt::xsemantic_base< D >
 xsemantic_base (const xsemantic_base &)=default
 
xsemantic_baseoperator= (const xsemantic_base &)=default
 
 xsemantic_base (xsemantic_base &&)=default
 
xsemantic_baseoperator= (xsemantic_base &&)=default
 
template<class E >
derived_type & operator= (const xexpression< E > &)
 
- Protected Member Functions inherited from xt::xconst_iterable< D >
const inner_shape_type & get_shape () const
 

Detailed Description

template<class CT, class I>
class xt::xindex_view< CT, I >

View of an xexpression from vector of indices.

The xindex_view class implements a flat (1D) view into a multidimensional xexpression yielding the values at the indices of the index array. xindex_view is not meant to be used directly, but only with the index_view and filter helper functions.

Template Parameters
CTthe closure type of the xexpression type underlying this view
Ithe index array type of the view
See also
index_view, filter

Definition at line 91 of file xindex_view.hpp.

Member Typedef Documentation

◆ base_index_type

template<class CT , class I >
using xt::xindex_view< CT, I >::base_index_type = xindex_type_t<shape_type>

Definition at line 122 of file xindex_view.hpp.

◆ bool_load_type

template<class CT , class I >
using xt::xindex_view< CT, I >::bool_load_type = typename xexpression_type::bool_load_type

Definition at line 124 of file xindex_view.hpp.

◆ const_pointer

template<class CT , class I >
using xt::xindex_view< CT, I >::const_pointer = typename xexpression_type::const_pointer

Definition at line 108 of file xindex_view.hpp.

◆ const_reference

template<class CT , class I >
using xt::xindex_view< CT, I >::const_reference = typename xexpression_type::const_reference

Definition at line 106 of file xindex_view.hpp.

◆ const_stepper

template<class CT , class I >
using xt::xindex_view< CT, I >::const_stepper = typename iterable_base::const_stepper

Definition at line 119 of file xindex_view.hpp.

◆ difference_type

template<class CT , class I >
using xt::xindex_view< CT, I >::difference_type = typename xexpression_type::difference_type

Definition at line 110 of file xindex_view.hpp.

◆ expression_tag

template<class CT , class I >
using xt::xindex_view< CT, I >::expression_tag = typename extension_base::expression_tag

Definition at line 102 of file xindex_view.hpp.

◆ extension_base

template<class CT , class I >
using xt::xindex_view< CT, I >::extension_base = extension::xindex_view_base_t<CT, I>

Definition at line 101 of file xindex_view.hpp.

◆ indices_type

template<class CT , class I >
using xt::xindex_view< CT, I >::indices_type = I

Definition at line 116 of file xindex_view.hpp.

◆ inner_shape_type

template<class CT , class I >
using xt::xindex_view< CT, I >::inner_shape_type = typename iterable_base::inner_shape_type

Definition at line 113 of file xindex_view.hpp.

◆ iterable_base

template<class CT , class I >
using xt::xindex_view< CT, I >::iterable_base = xiterable<self_type>

Definition at line 112 of file xindex_view.hpp.

◆ pointer

template<class CT , class I >
using xt::xindex_view< CT, I >::pointer = typename xexpression_type::pointer

Definition at line 107 of file xindex_view.hpp.

◆ rebind_t

template<class CT , class I >
template<class E >
using xt::xindex_view< CT, I >::rebind_t = xindex_view<E, I>

Definition at line 194 of file xindex_view.hpp.

◆ reference

template<class CT , class I >
using xt::xindex_view< CT, I >::reference = inner_reference_t<CT>

Definition at line 105 of file xindex_view.hpp.

◆ self_type

template<class CT , class I >
using xt::xindex_view< CT, I >::self_type = xindex_view<CT, I>

Definition at line 97 of file xindex_view.hpp.

◆ semantic_base

template<class CT , class I >
using xt::xindex_view< CT, I >::semantic_base = xview_semantic<self_type>

Definition at line 99 of file xindex_view.hpp.

◆ shape_type

template<class CT , class I >
using xt::xindex_view< CT, I >::shape_type = inner_shape_type

Definition at line 114 of file xindex_view.hpp.

◆ size_type

template<class CT , class I >
using xt::xindex_view< CT, I >::size_type = typename xexpression_type::size_type

Definition at line 109 of file xindex_view.hpp.

◆ stepper

template<class CT , class I >
using xt::xindex_view< CT, I >::stepper = typename iterable_base::stepper

Definition at line 118 of file xindex_view.hpp.

◆ temporary_type

template<class CT , class I >
using xt::xindex_view< CT, I >::temporary_type = typename xcontainer_inner_types<self_type>::temporary_type

Definition at line 121 of file xindex_view.hpp.

◆ value_type

template<class CT , class I >
using xt::xindex_view< CT, I >::value_type = typename xexpression_type::value_type

Definition at line 104 of file xindex_view.hpp.

◆ xexpression_type

template<class CT , class I >
using xt::xindex_view< CT, I >::xexpression_type = std::decay_t<CT>

Definition at line 98 of file xindex_view.hpp.

Constructor & Destructor Documentation

◆ xindex_view()

template<class CT , class I >
template<class CTA , class I2 >
xt::xindex_view< CT, I >::xindex_view ( CTA && e,
I2 && indices )
inlinenoexcept

Constructs an xindex_view, selecting the indices specified by indices.

The resulting xexpression has a 1D shape with a length of n for n indices.

Parameters
ethe underlying xexpression for this view
indicesthe indices to select

Definition at line 288 of file xindex_view.hpp.

Member Function Documentation

◆ broadcast_shape()

template<class CT , class I >
template<class O >
bool xt::xindex_view< CT, I >::broadcast_shape ( O & shape,
bool reuse_cache = false ) const
inline

Broadcast the shape of the xindex_view to the specified parameter.

Parameters
shapethe result shape
reuse_cacheparameter for internal optimization
Returns
a boolean indicating whether the broadcasting is trivial

Definition at line 561 of file xindex_view.hpp.

◆ build_index_view()

template<class CT , class I >
template<class E >
auto xt::xindex_view< CT, I >::build_index_view ( E && e) const -> rebind_t<E>
inline

Definition at line 618 of file xindex_view.hpp.

◆ dimension()

template<class CT , class I >
auto xt::xindex_view< CT, I >::dimension ( ) const
inlinenoexcept

Returns the number of dimensions of the xindex_view.

Definition at line 344 of file xindex_view.hpp.

◆ element() [1/2]

template<class CT , class I >
template<class It >
auto xt::xindex_view< CT, I >::element ( It first,
It  ) -> reference
inline

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

Parameters
firstiterator starting the sequence of indices The number of indices in the sequence should be equal to or greater 1.

Definition at line 512 of file xindex_view.hpp.

◆ element() [2/2]

template<class CT , class I >
template<class It >
auto xt::xindex_view< CT, I >::element ( It first,
It  ) const -> const_reference
inline

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

Parameters
firstiterator starting the sequence of indices The number of indices in the sequence should be equal to or greater 1.

Definition at line 524 of file xindex_view.hpp.

◆ expression() [1/2]

template<class CT , class I >
auto xt::xindex_view< CT, I >::expression ( ) const
inlinenoexcept

Returns a constant reference to the underlying expression of the view.

Definition at line 542 of file xindex_view.hpp.

◆ expression() [2/2]

template<class CT , class I >
auto xt::xindex_view< CT, I >::expression ( )
inlinenoexcept

Returns a reference to the underlying expression of the view.

Definition at line 533 of file xindex_view.hpp.

◆ fill()

template<class CT , class I >
template<class T >
void xt::xindex_view< CT, I >::fill ( const T & value)
inline

Fills the view with the given value.

Parameters
valuethe value to fill the view with.

Definition at line 392 of file xindex_view.hpp.

◆ has_linear_assign()

template<class CT , class I >
template<class O >
bool xt::xindex_view< CT, I >::has_linear_assign ( const O & ) const
inlinenoexcept

Checks whether the xindex_view can be linearly assigned to an expression with the specified strides.

Returns
a boolean indicating whether a linear assign is possible

Definition at line 573 of file xindex_view.hpp.

◆ is_contiguous()

template<class CT , class I >
bool xt::xindex_view< CT, I >::is_contiguous ( ) const
inlinenoexcept

Definition at line 374 of file xindex_view.hpp.

◆ layout()

template<class CT , class I >
layout_type xt::xindex_view< CT, I >::layout ( ) const
inlinenoexcept

Definition at line 368 of file xindex_view.hpp.

◆ operator()() [1/4]

template<class CT , class I >
auto xt::xindex_view< CT, I >::operator() ( size_type idx = size_type(0))
inline

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

Parameters
idxindex specifying the position in the index_view. More indices may be provided, only the last one will be used.

Definition at line 403 of file xindex_view.hpp.

◆ operator()() [2/4]

template<class CT , class I >
auto xt::xindex_view< CT, I >::operator() ( size_type idx = size_type(0)) const
inline

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

Parameters
idxindex specifying the position in the index_view. More indices may be provided, only the last one will be used.

Definition at line 431 of file xindex_view.hpp.

◆ operator()() [3/4]

template<class CT , class I >
template<class... Args>
auto xt::xindex_view< CT, I >::operator() ( size_type ,
size_type idx1,
Args... args ) -> reference
inline

Definition at line 410 of file xindex_view.hpp.

◆ operator()() [4/4]

template<class CT , class I >
template<class... Args>
auto xt::xindex_view< CT, I >::operator() ( size_type ,
size_type idx1,
Args... args ) const -> const_reference
inline

Definition at line 438 of file xindex_view.hpp.

◆ operator=() [1/2]

template<class CT , class I >
template<class E >
auto xt::xindex_view< CT, I >::operator= ( const E & e) -> disable_xexpression<E, self_type>&
inline

Definition at line 315 of file xindex_view.hpp.

◆ operator=() [2/2]

template<class CT , class I >
template<class E >
auto xt::xindex_view< CT, I >::operator= ( const xexpression< E > & e) -> self_type&
inline

The extended assignment operator.

Definition at line 306 of file xindex_view.hpp.

◆ operator[]() [1/6]

template<class CT , class I >
template<class S >
auto xt::xindex_view< CT, I >::operator[] ( const S & index) -> disable_integral_t<S, reference>
inline

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

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

Definition at line 461 of file xindex_view.hpp.

◆ operator[]() [2/6]

template<class CT , class I >
template<class S >
auto xt::xindex_view< CT, I >::operator[] ( const S & index) const -> disable_integral_t<S, const_reference>
inline

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

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

Definition at line 487 of file xindex_view.hpp.

◆ operator[]() [3/6]

template<class CT , class I >
auto xt::xindex_view< CT, I >::operator[] ( size_type i)
inline

Definition at line 474 of file xindex_view.hpp.

◆ operator[]() [4/6]

template<class CT , class I >
auto xt::xindex_view< CT, I >::operator[] ( size_type i) const
inline

Definition at line 500 of file xindex_view.hpp.

◆ operator[]() [5/6]

template<class CT , class I >
template<class OI >
auto xt::xindex_view< CT, I >::operator[] ( std::initializer_list< OI > index) -> reference
inline

Definition at line 468 of file xindex_view.hpp.

◆ operator[]() [6/6]

template<class CT , class I >
template<class OI >
auto xt::xindex_view< CT, I >::operator[] ( std::initializer_list< OI > index) const -> const_reference
inline

Definition at line 494 of file xindex_view.hpp.

◆ shape() [1/2]

template<class CT , class I >
auto xt::xindex_view< CT, I >::shape ( ) const
inlinenoexcept

Returns the shape of the xindex_view.

Definition at line 353 of file xindex_view.hpp.

◆ shape() [2/2]

template<class CT , class I >
auto xt::xindex_view< CT, I >::shape ( size_type index) const
inline

Returns the i-th dimension of the expression.

Definition at line 362 of file xindex_view.hpp.

◆ size()

template<class CT , class I >
auto xt::xindex_view< CT, I >::size ( ) const
inlinenoexcept

Returns the size of the xindex_view.

Definition at line 335 of file xindex_view.hpp.

◆ stepper_begin() [1/2]

template<class CT , class I >
template<class ST >
auto xt::xindex_view< CT, I >::stepper_begin ( const ST & shape) -> stepper
inline

Definition at line 586 of file xindex_view.hpp.

◆ stepper_begin() [2/2]

template<class CT , class I >
template<class ST >
auto xt::xindex_view< CT, I >::stepper_begin ( const ST & shape) const -> const_stepper
inline

Definition at line 602 of file xindex_view.hpp.

◆ stepper_end() [1/2]

template<class CT , class I >
template<class ST >
auto xt::xindex_view< CT, I >::stepper_end ( const ST & shape,
layout_type  ) -> stepper
inline

Definition at line 594 of file xindex_view.hpp.

◆ stepper_end() [2/2]

template<class CT , class I >
template<class ST >
auto xt::xindex_view< CT, I >::stepper_end ( const ST & shape,
layout_type  ) const -> const_stepper
inline

Definition at line 610 of file xindex_view.hpp.

◆ unchecked() [1/2]

template<class CT , class I >
auto xt::xindex_view< CT, I >::unchecked ( size_type idx)
inline

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

Parameters
idxindex specifying the position in the index_view.

Definition at line 420 of file xindex_view.hpp.

◆ unchecked() [2/2]

template<class CT , class I >
auto xt::xindex_view< CT, I >::unchecked ( size_type idx) const
inline

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

Parameters
idxindex specifying the position in the index_view.

Definition at line 448 of file xindex_view.hpp.

Friends And Related Symbol Documentation

◆ xview_semantic< xindex_view< CT, I > >

template<class CT , class I >
friend class xview_semantic< xindex_view< CT, I > >
friend

Definition at line 205 of file xindex_view.hpp.

Member Data Documentation

◆ contiguous_layout

template<class CT , class I >
constexpr bool xt::xindex_view< CT, I >::contiguous_layout = false
staticconstexpr

Definition at line 127 of file xindex_view.hpp.

◆ static_layout

template<class CT , class I >
constexpr layout_type xt::xindex_view< CT, I >::static_layout = layout_type::dynamic
staticconstexpr

Definition at line 126 of file xindex_view.hpp.


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