xaxis_slice_iterator

Defined in xtensor/xaxis_slice_iterator.hpp

template<class CT>
class xaxis_slice_iterator

Class for iteration over one-dimensional slices.

The xaxis_slice_iterator iterates over one-dimensional slices oriented along the specified axis

Template Parameters

Constructors

template<class CTA>
xaxis_slice_iterator(CTA &&e, size_type axis)

Constructs an xaxis_slice_iterator.

Parameters
  • e: the expression to iterate over

  • axis: the axis to iterate over taking one dimensional slices

template<class CTA>
xaxis_slice_iterator(CTA &&e, size_type axis, size_type index, size_type offset)

Constructs an xaxis_slice_iterator starting at specified index and offset.

Parameters
  • e: the expression to iterate over

  • axis: the axis to iterate over taking one dimensional slices

  • index: the starting index for the iterator

  • offset: the starting offset for the iterator

Increment

auto operator++()

Increments the iterator to the next position and returns it.

auto operator++(int)

Makes a copy of the iterator, increments it to the next position, and returns the copy.

Reference

auto operator*() const

Returns the strided view at the current iteration position.

Return

a strided_view

auto operator->() const

Returns a pointer to the strided view at the current iteration position.

Return

a pointer to a strided_view

Unnamed Group

bool equal(const self_type &rhs) const

Checks equality of the xaxis_slice_iterator and rhs.

Return

true if the iterators are equivalent, false otherwise

template<class CT>
bool xt::operator==(const xaxis_slice_iterator<CT> &lhs, const xaxis_slice_iterator<CT> &rhs)

Checks equality of the iterators.

Return

true if the iterators are equivalent, false otherwise

template<class CT>
bool xt::operator!=(const xaxis_slice_iterator<CT> &lhs, const xaxis_slice_iterator<CT> &rhs)

Checks inequality of the iterators.

Return

true if the iterators are different, true otherwise

template<class E>
auto xt::axis_slice_begin(E &&e)

Returns an iterator to the first element of the expression for axis 0.

Return

an instance of xaxis_slice_iterator

Parameters
  • e: the expession to iterate over

template<class E>
auto xt::axis_slice_begin(E &&e, typename std::decay_t<E>::size_type axis)

Returns an iterator to the first element of the expression for the specified axis.

Return

an instance of xaxis_slice_iterator

Parameters
  • e: the expession to iterate over

  • axis: the axis to iterate over

template<class E>
auto xt::axis_slice_end(E &&e)

Returns an iterator to the element following the last element of the expression for axis 0.

Return

an instance of xaxis_slice_iterator

Parameters
  • e: the expession to iterate over

template<class E>
auto xt::axis_slice_end(E &&e, typename std::decay_t<E>::size_type axis)

Returns an iterator to the element following the last element of the expression for the specified axis.

Return

an instance of xaxis_slice_iterator

Parameters
  • e: the expession to iterate over

  • axis: the axis to iterate over