xaxis_iterator¶
Defined in xtensor/xaxis_iterator.hpp
- template <class CT>
-
class
xt::xaxis_iterator¶ Class for iteration over (N-1)-dimensional slices, where N is the dimension of the underlying expression.
If N is the number of dimensions of an expression, the xaxis_iterator iterates over (N-1)-dimensional slices oriented along the specified axis.
- Template Parameters
CT: the closure type of the xexpression
Constructors
- template <class CTA>
-
xaxis_iterator(CTA &&e, size_type axis)¶ Constructs an xaxis_iterator.
- Parameters
e: the expression to iterate overaxis: the axis to iterate over taking N-1 dimensional slices
- template <class CTA>
-
xaxis_iterator(CTA &&e, size_type axis, size_type index, size_type offset)¶ Constructs an xaxis_iterator starting at specified index and offset.
- Parameters
e: the expression to iterate overaxis: the axis to iterate over taking N-1 dimensional slicesindex: the starting index for the iteratoroffset: 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
-
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
- Parameters
- template <class CT>
-
bool
xt::operator==(const xaxis_iterator<CT> &lhs, const xaxis_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_iterator<CT> &lhs, const xaxis_iterator<CT> &rhs) Checks inequality of the iterators.
- Return
- true if the iterators are different, true otherwise
- template <class E>
-
auto
xt::axis_begin(E &&e) Returns an iterator to the first element of the expression for axis 0.
- Return
- an instance of xaxis_iterator
- Parameters
e: the expession to iterate over
- template <class E>
-
auto
xt::axis_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_iterator
- Parameters
e: the expession to iterate overaxis: the axis to iterate over
- template <class E>
-
auto
xt::axis_end(E &&e) Returns an iterator to the element following the last element of the expression for axis 0.
- Return
- an instance of xaxis_iterator
- Parameters
e: the expession to iterate over
- template <class E>
-
auto
xt::axis_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_iterator
- Parameters
e: the expession to iterate overaxis: the axis to iterate over