xiterable

Defined in xtensor/xiterable.hpp

template <class D>
class xt::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< xchunked_array< chunk_storage, extension > >, xt::xiterable< xdynamic_view< CT, S, layout_type::dynamic, detail::flat_storage_getter< CT, ::xt::layout_type::row_major > > >, xt::xiterable< xindex_view< CT, I > >, xt::xiterable< xmasked_view< CTD, CTM > >, xt::xiterable< xscalar< CT > >, xt::xiterable< D >

Constant iterators

template <layout_type L>
auto begin() const

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>
auto end() const

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>
auto cbegin() const

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>
auto cend() const

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>
auto rbegin() const

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>
auto rend() const

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>
auto crbegin() const

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>
auto crend() const

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>
auto begin(const S &shape) const

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>
auto end(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
  • 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>
auto cbegin(const S &shape) const

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>
auto cend(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
  • 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>
auto rbegin(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
  • 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>
auto rend(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
  • 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>
auto crbegin(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
  • 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>
auto crend(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
  • 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 xt::xiterable

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.

Inherits from xt::xconst_iterable< D >

Subclassed by xt::xoptional_assembly_base< xoptional_assembly< VE, FE > >, xt::xoptional_assembly_base< xoptional_assembly_adaptor< VEC, FEC > >, xt::xcontiguous_iterable< D >, xt::xoptional_assembly_base< D >

Iterators

template <layout_type L>
auto begin()

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>
auto end()

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>
auto rbegin()

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>
auto rend()

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>
auto begin(const S &shape)

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>
auto end(const S &shape)

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>
auto rbegin(const S &shape)

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>
auto rend(const S &shape)

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.

Public Functions

template <layout_type L>
auto begin() const

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, class S>
auto begin(const S &shape) const

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>
auto end() const

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, class S>
auto end(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
  • 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>
auto rbegin() const

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, class S>
auto rbegin(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
  • 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>
auto rend() const

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, class S>
auto rend(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
  • 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 xt::xcontiguous_iterable

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.

Inherits from xt::xiterable< D >

Subclassed by xt::xcontainer< xfixed_adaptor< EC, S, L, SH, Tag > >, xt::xcontainer< xfixed_container< ET, S, L, SH, Tag > >, xt::xcontainer< D >

Iterators

template <layout_type L>
auto begin()

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>
auto end()

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>
auto begin() const

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>
auto end() const

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>
auto cbegin() const

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>
auto cend() const

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>
auto rbegin()

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>
auto rend()

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>
auto rbegin() const

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>
auto rend() const

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>
auto crbegin() const

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>
auto crend() const

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>
auto begin(const S &shape)

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>
auto end(const S &shape)

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>
auto begin(const S &shape) const

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>
auto end(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
  • 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>
auto cbegin(const S &shape) const

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>
auto cend(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
  • 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>
auto rbegin(const S &shape)

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>
auto rend(const S &shape)

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>
auto rbegin(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
  • 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>
auto rend(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
  • 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>
auto crbegin(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
  • 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>
auto crend(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
  • 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.