xiterable

Defined in xtensor/xiterable.hpp

template<class D>
class xconst_iterable

Base class for multidimensional iterable constant expressions.

The xconst_iterable class defines the interface for multidimensional constant expressions that can be iterated.

Template Parameters:

D – The derived type, i.e. the inheriting class for which xconst_iterable provides the interface.

Subclassed by xt::xbroadcast< E, X >, xt::xfunction< value_functor, xt::detail::value_expression_t< CT >… >, xt::xfunction< flag_functor, xt::detail::flag_expression_t< CT >… >, xt::xgenerator< OF, OR, S >, xt::xgenerator< value_functor, value_closure, S >, xt::xgenerator< flag_functor, flag_closure, S >, xt::xiterable< xmasked_view< CTD, CTM > >, xt::xreducer< flag_reducer, xt::detail::flag_expression_t< CT >, X, rebound_reduce_options_flag >, xt::xreducer< rebound_functors_type, xt::detail::value_expression_t< CT >, X, rebound_reduce_options_values >, xt::xreducer< Func, E, X, Opts >, xt::xiterable< D >

Constant iterators

template<layout_type L>
inline const_layout_iterator<L> begin() const noexcept

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

Template Parameters:

L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

template<layout_type L>
inline const_layout_iterator<L> end() const noexcept

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

Template Parameters:

L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

template<layout_type L>
inline const_layout_iterator<L> cbegin() const noexcept

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

Template Parameters:

L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

template<layout_type L>
inline const_layout_iterator<L> cend() const noexcept

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

Template Parameters:

L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

Constant reverse iterators

template<layout_type L>
inline const_reverse_layout_iterator<L> rbegin() const noexcept

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

Template Parameters:

L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

template<layout_type L>
inline const_reverse_layout_iterator<L> rend() const noexcept

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

Template Parameters:

L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

template<layout_type L>
inline const_reverse_layout_iterator<L> crbegin() const noexcept

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

Template Parameters:

L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

template<layout_type L>
inline const_reverse_layout_iterator<L> crend() const noexcept

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

Template Parameters:

L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

Constant broadcast iterators

template<layout_type L, class S>
inline const_broadcast_iterator<S, L> begin(const S &shape) const noexcept

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

The iteration is broadcasted to the specified shape.

Parameters:

shape – the shape used for broadcasting

Template Parameters:
  • S – type of the shape parameter.

  • L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

template<layout_type L, class S>
inline 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.

The iteration is broadcasted to the specified shape.

Parameters:

shape – the shape used for broadcasting

Template Parameters:
  • S – type of the shape parameter.

  • L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

template<layout_type L, class S>
inline const_broadcast_iterator<S, L> cbegin(const S &shape) const noexcept

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

The iteration is broadcasted to the specified shape.

Parameters:

shape – the shape used for broadcasting

Template Parameters:
  • S – type of the shape parameter.

  • L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

template<layout_type L, class S>
inline const_broadcast_iterator<S, L> cend(const S &shape) const noexcept

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

The iteration is broadcasted to the specified shape.

Parameters:

shape – the shape used for broadcasting

Template Parameters:
  • S – type of the shape parameter.

  • L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

Constant reverse broadcast iterators

template<layout_type L, class S>
inline const_reverse_broadcast_iterator<S, L> rbegin(const S &shape) const noexcept

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

The iteration is broadcasted to the specified shape.

Parameters:

shape – the shape used for broadcasting

Template Parameters:
  • S – type of the shape parameter.

  • L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

template<layout_type L, class S>
inline 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.

The iteration is broadcasted to the specified shape.

Parameters:

shape – the shape used for broadcasting

Template Parameters:
  • S – type of the shape parameter.

  • L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

template<layout_type L, class S>
inline const_reverse_broadcast_iterator<S, L> crbegin(const S &shape) const noexcept

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

The iteration is broadcasted to the specified shape.

Parameters:

shape – the shape used for broadcasting

Template Parameters:
  • S – type of the shape parameter.

  • L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

template<layout_type L, class S>
inline const_reverse_broadcast_iterator<S, L> crend(const S &shape) const noexcept

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

The iteration is broadcasted to the specified shape.

Parameters:

shape – the shape used for broadcasting

Template Parameters:
  • S – type of the shape parameter.

  • L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

template<class D>
class xiterable : public xt::xconst_iterable<D>

Base class for multidimensional iterable expressions.

The xiterable class defines the interface for multidimensional expressions that can be iterated.

Template Parameters:

D – The derived type, i.e. the inheriting class for which xiterable provides the interface.

Subclassed by xt::xdynamic_view< CT, S, L, FST >, xt::xdynamic_view< E, S, L, typename FST::template rebind_t< E > >, xt::xdynamic_view< uvt, S, L, typename FST::template rebind_t< uvt > >, xt::xdynamic_view< uft, S, L, typename FST::template rebind_t< uft > >, xt::xdynamic_view< ucvt, S, L, typename FST::template rebind_t< ucvt > >, xt::xdynamic_view< ucft, S, L, typename FST::template rebind_t< ucft > >, xt::xindex_view< E, I >, xt::xindex_view< uvt, I >, xt::xindex_view< uft, I >, xt::xindex_view< ucvt, I >, xt::xindex_view< ucft, I >, xt::xscalar< xtl::closure_type_t< E > >, xt::xscalar< xtl::const_closure_type_t< E > >, xt::xscalar< T >, xt::xscalar< bool >, xt::xscalar< std::conditional_t< is_const, const_value_closure, value_closure > >, xt::xscalar< std::conditional_t< is_const, const_flag_closure, flag_closure > >, xt::xscalar< const_value_closure >, xt::xscalar< const_flag_closure >, xt::xcontiguous_iterable< D >, xt::xdynamic_view< CT, S, L, FST >, xt::xoptional_assembly_base< D >

Iterators

template<layout_type L>
inline layout_iterator<L> begin() noexcept

Returns an iterator to the first element of the expression.

Template Parameters:

L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

template<layout_type L>
inline layout_iterator<L> end() noexcept

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

Template Parameters:

L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

Reverse iterators

template<layout_type L>
inline reverse_layout_iterator<L> rbegin() noexcept

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

Template Parameters:

L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

template<layout_type L>
inline reverse_layout_iterator<L> rend() noexcept

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

Template Parameters:

L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

Broadcast iterators

template<layout_type L, class S>
inline broadcast_iterator<S, L> begin(const S &shape) noexcept

Returns an iterator to the first element of the expression.

The iteration is broadcasted to the specified shape.

Parameters:

shape – the shape used for broadcasting

Template Parameters:
  • S – type of the shape parameter.

  • L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

template<layout_type L, class S>
inline broadcast_iterator<S, L> 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:

shape – the shape used for broadcasting

Template Parameters:
  • S – type of the shape parameter.

  • L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

Reverse broadcast iterators

template<layout_type L, class S>
inline reverse_broadcast_iterator<S, L> 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:

shape – the shape used for broadcasting

Template Parameters:
  • S – type of the shape parameter.

  • L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

template<layout_type L, class S>
inline reverse_broadcast_iterator<S, L> 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:

shape – the shape used for broadcasting

Template Parameters:
  • S – type of the shape parameter.

  • L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

template<class D>
class xcontiguous_iterable : private xt::xiterable<D>

Base class for multidimensional iterable expressions with contiguous storage.

The xcontiguous_iterable class defines the interface for multidimensional expressions with contiguous that can be iterated.

Template Parameters:

D – The derived type, i.e. the inheriting class for which xcontiguous_iterable provides the interface.

Subclassed by xt::xcontainer< self_type >, xt::xcontainer< D >

Iterators

template<layout_type L>
inline select_iterator<L> begin() noexcept

Returns an iterator to the first element of the expression.

Template Parameters:

L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

template<layout_type L>
inline select_iterator<L> end() noexcept

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

Template Parameters:

L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

template<layout_type L>
inline select_const_iterator<L> begin() const noexcept

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

Template Parameters:

L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

template<layout_type L>
inline select_const_iterator<L> end() const noexcept

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

Template Parameters:

L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

template<layout_type L>
inline select_const_iterator<L> cbegin() const noexcept

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

Template Parameters:

L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

template<layout_type L>
inline select_const_iterator<L> cend() const noexcept

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

Template Parameters:

L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

Reverse iterators

template<layout_type L>
inline select_reverse_iterator<L> rbegin() noexcept

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

Template Parameters:

L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

template<layout_type L>
inline select_reverse_iterator<L> rend() noexcept

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

Template Parameters:

L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

template<layout_type L>
inline select_const_reverse_iterator<L> rbegin() const noexcept

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

Template Parameters:

L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

template<layout_type L>
inline select_const_reverse_iterator<L> rend() const noexcept

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

Template Parameters:

L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

template<layout_type L>
inline select_const_reverse_iterator<L> crbegin() const noexcept

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

Template Parameters:

L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

template<layout_type L>
inline select_const_reverse_iterator<L> crend() const noexcept

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

Template Parameters:

L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

Broadcast iterators

template<layout_type L, class S>
inline broadcast_iterator<S, L> begin(const S &shape) noexcept

Returns an iterator to the first element of the expression.

The iteration is broadcasted to the specified shape.

Parameters:

shape – the shape used for broadcasting

Template Parameters:
  • S – type of the shape parameter.

  • L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

template<layout_type L, class S>
inline broadcast_iterator<S, L> 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:

shape – the shape used for broadcasting

Template Parameters:
  • S – type of the shape parameter.

  • L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

template<layout_type L, class S>
inline const_broadcast_iterator<S, L> begin(const S &shape) const noexcept

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

The iteration is broadcasted to the specified shape.

Parameters:

shape – the shape used for broadcasting

Template Parameters:
  • S – type of the shape parameter.

  • L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

template<layout_type L, class S>
inline 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.

The iteration is broadcasted to the specified shape.

Parameters:

shape – the shape used for broadcasting

Template Parameters:
  • S – type of the shape parameter.

  • L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

template<layout_type L, class S>
inline const_broadcast_iterator<S, L> cbegin(const S &shape) const noexcept

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

The iteration is broadcasted to the specified shape.

Parameters:

shape – the shape used for broadcasting

Template Parameters:
  • S – type of the shape parameter.

  • L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

template<layout_type L, class S>
inline const_broadcast_iterator<S, L> cend(const S &shape) const noexcept

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

The iteration is broadcasted to the specified shape.

Parameters:

shape – the shape used for broadcasting

Template Parameters:
  • S – type of the shape parameter.

  • L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

Reverse broadcast iterators

template<layout_type L, class S>
inline reverse_broadcast_iterator<S, L> 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:

shape – the shape used for broadcasting

Template Parameters:
  • S – type of the shape parameter.

  • L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

template<layout_type L, class S>
inline reverse_broadcast_iterator<S, L> 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:

shape – the shape used for broadcasting

Template Parameters:
  • S – type of the shape parameter.

  • L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

template<layout_type L, class S>
inline const_reverse_broadcast_iterator<S, L> rbegin(const S &shape) const noexcept

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

The iteration is broadcasted to the specified shape.

Parameters:

shape – the shape used for broadcasting

Template Parameters:
  • S – type of the shape parameter.

  • L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

template<layout_type L, class S>
inline 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.

The iteration is broadcasted to the specified shape.

Parameters:

shape – the shape used for broadcasting

Template Parameters:
  • S – type of the shape parameter.

  • L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

template<layout_type L, class S>
inline const_reverse_broadcast_iterator<S, L> crbegin(const S &shape) const noexcept

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

The iteration is broadcasted to the specified shape.

Parameters:

shape – the shape used for broadcasting

Template Parameters:
  • S – type of the shape parameter.

  • L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

template<layout_type L, class S>
inline const_reverse_broadcast_iterator<S, L> crend(const S &shape) const noexcept

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

The iteration is broadcasted to the specified shape.

Parameters:

shape – the shape used for broadcasting

Template Parameters:
  • S – type of the shape parameter.

  • L – order used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.