xaxis_iterator¶
Defined in xtensor/xaxis_iterator.hpp
-
template<class
CT>
classxt::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
-
self_type &
operator++()¶ Increments the iterator to the next position and returns it.
-
self_type
operator++(int)¶ Makes a copy of the iterator, increments it to the next position, and returns the copy.
Reference
-
reference
operator*() const¶ Returns the strided view at the current iteration position.
- Return
a strided_view
-
pointer
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.- Parameters
-
template<class
CT>
boolxt::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>
boolxt::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>
autoxt::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>
autoxt::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>
autoxt::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>
autoxt::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