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::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::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< 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.