xtensor
Loading...
Searching...
No Matches
xt::xaxis_slice_iterator< CT > Class Template Reference

Class for iteration over one-dimensional slices. More...

#include <xaxis_slice_iterator.hpp>

Public Types

using self_type = xaxis_slice_iterator<CT>
 
using xexpression_type = std::decay_t<CT>
 
using size_type = typename xexpression_type::size_type
 
using difference_type = typename xexpression_type::difference_type
 
using shape_type = typename xexpression_type::shape_type
 
using strides_type = typename xexpression_type::strides_type
 
using value_type = xstrided_view<CT, shape_type>
 
using reference = std::remove_reference_t<apply_cv_t<CT, value_type>>
 
using pointer = xtl::xclosure_pointer<std::remove_reference_t<apply_cv_t<CT, value_type>>>
 
using iterator_category = std::forward_iterator_tag
 

Public Member Functions

Constructors
template<class CTA >
 xaxis_slice_iterator (CTA &&e, size_type axis)
 Constructs an xaxis_slice_iterator.
 
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.
 
Increment
self_typeoperator++ ()
 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.
 
pointer operator-> () const
 Returns a pointer to the strided view at the current iteration position.
 
bool equal (const self_type &rhs) const
 Checks equality of the xaxis_slice_iterator and rhs.
 

Detailed Description

template<class CT>
class xt::xaxis_slice_iterator< CT >

Class for iteration over one-dimensional slices.

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

Template Parameters
CTthe closure type of the xexpression

Definition at line 28 of file xaxis_slice_iterator.hpp.

Member Typedef Documentation

◆ difference_type

template<class CT >
using xt::xaxis_slice_iterator< CT >::difference_type = typename xexpression_type::difference_type

Definition at line 36 of file xaxis_slice_iterator.hpp.

◆ iterator_category

template<class CT >
using xt::xaxis_slice_iterator< CT >::iterator_category = std::forward_iterator_tag

Definition at line 43 of file xaxis_slice_iterator.hpp.

◆ pointer

template<class CT >
using xt::xaxis_slice_iterator< CT >::pointer = xtl::xclosure_pointer<std::remove_reference_t<apply_cv_t<CT, value_type>>>

Definition at line 41 of file xaxis_slice_iterator.hpp.

◆ reference

template<class CT >
using xt::xaxis_slice_iterator< CT >::reference = std::remove_reference_t<apply_cv_t<CT, value_type>>

Definition at line 40 of file xaxis_slice_iterator.hpp.

◆ self_type

Definition at line 32 of file xaxis_slice_iterator.hpp.

◆ shape_type

template<class CT >
using xt::xaxis_slice_iterator< CT >::shape_type = typename xexpression_type::shape_type

Definition at line 37 of file xaxis_slice_iterator.hpp.

◆ size_type

template<class CT >
using xt::xaxis_slice_iterator< CT >::size_type = typename xexpression_type::size_type

Definition at line 35 of file xaxis_slice_iterator.hpp.

◆ strides_type

template<class CT >
using xt::xaxis_slice_iterator< CT >::strides_type = typename xexpression_type::strides_type

Definition at line 38 of file xaxis_slice_iterator.hpp.

◆ value_type

template<class CT >
using xt::xaxis_slice_iterator< CT >::value_type = xstrided_view<CT, shape_type>

Definition at line 39 of file xaxis_slice_iterator.hpp.

◆ xexpression_type

template<class CT >
using xt::xaxis_slice_iterator< CT >::xexpression_type = std::decay_t<CT>

Definition at line 34 of file xaxis_slice_iterator.hpp.

Constructor & Destructor Documentation

◆ xaxis_slice_iterator() [1/2]

template<class CT >
template<class CTA >
xt::xaxis_slice_iterator< CT >::xaxis_slice_iterator ( CTA && e,
size_type axis )
inline

Constructs an xaxis_slice_iterator.

Parameters
ethe expression to iterate over
axisthe axis to iterate over taking one dimensional slices

Definition at line 128 of file xaxis_slice_iterator.hpp.

◆ xaxis_slice_iterator() [2/2]

template<class CT >
template<class CTA >
xt::xaxis_slice_iterator< CT >::xaxis_slice_iterator ( CTA && e,
size_type axis,
size_type index,
size_type offset )
inline

Constructs an xaxis_slice_iterator starting at specified index and offset.

Parameters
ethe expression to iterate over
axisthe axis to iterate over taking one dimensional slices
indexthe starting index for the iterator
offsetthe starting offset for the iterator

Definition at line 143 of file xaxis_slice_iterator.hpp.

Member Function Documentation

◆ equal()

template<class CT >
bool xt::xaxis_slice_iterator< CT >::equal ( const self_type & rhs) const
inline

Checks equality of the xaxis_slice_iterator and rhs.

Returns
true if the iterators are equivalent, false otherwise

Definition at line 260 of file xaxis_slice_iterator.hpp.

◆ operator*()

template<class CT >
auto xt::xaxis_slice_iterator< CT >::operator* ( ) const
inline

Returns the strided view at the current iteration position.

Returns
a strided_view

Definition at line 232 of file xaxis_slice_iterator.hpp.

◆ operator++() [1/2]

template<class CT >
auto xt::xaxis_slice_iterator< CT >::operator++ ( )
inline

Increments the iterator to the next position and returns it.

Definition at line 195 of file xaxis_slice_iterator.hpp.

◆ operator++() [2/2]

template<class CT >
auto xt::xaxis_slice_iterator< CT >::operator++ ( int )
inline

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

Definition at line 213 of file xaxis_slice_iterator.hpp.

◆ operator->()

template<class CT >
auto xt::xaxis_slice_iterator< CT >::operator-> ( ) const
inline

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

Returns
a pointer to a strided_view

Definition at line 243 of file xaxis_slice_iterator.hpp.


The documentation for this class was generated from the following file: