xtensor
Loading...
Searching...
No Matches
xt::xconst_iterable< D > Class Template Reference

Base class for multidimensional iterable constant expressions. More...

#include <xiterable.hpp>

Inheritance diagram for xt::xconst_iterable< D >:
xt::xiterable< xarray_adaptor< EC, L, SC, Tag > > xt::xiterable< xarray_container< EC, L, SC, Tag > > xt::xiterable< xchunked_array< chunk_storage > > xt::xiterable< xfixed_adaptor< EC, S, L, SH, Tag > > xt::xiterable< xfixed_container< ET, S, L, SH, Tag > > xt::xiterable< xindex_view< CT, I > > xt::xiterable< xmasked_view< CTD, CTM > > xt::xiterable< xoptional_assembly< VE, FE > > xt::xiterable< xoptional_assembly_adaptor< VEC, FEC > > xt::xiterable< xscalar< CT > > xt::xiterable< xtensor_adaptor< EC, N, L, Tag > > xt::xiterable< xtensor_container< EC, N, L, Tag > > xt::xiterable< xtensor_view< EC, N, L, Tag > > xt::xiterable< D >

Public Types

using derived_type = D
 
using iterable_types = xiterable_inner_types<D>
 
using inner_shape_type = typename iterable_types::inner_shape_type
 
using stepper = typename iterable_types::stepper
 
using const_stepper = typename iterable_types::const_stepper
 
template<layout_type L>
using layout_iterator = xiterator<stepper, inner_shape_type*, L>
 
template<layout_type L>
using const_layout_iterator = xiterator<const_stepper, inner_shape_type*, L>
 
template<layout_type L>
using reverse_layout_iterator = std::reverse_iterator<layout_iterator<L>>
 
template<layout_type L>
using const_reverse_layout_iterator = std::reverse_iterator<const_layout_iterator<L>>
 
using linear_iterator = layout_iterator< ::xt::layout_type::row_major >
 
using const_linear_iterator = const_layout_iterator< ::xt::layout_type::row_major >
 
using reverse_linear_iterator = reverse_layout_iterator< ::xt::layout_type::row_major >
 
using const_reverse_linear_iterator = const_reverse_layout_iterator< ::xt::layout_type::row_major >
 
template<class S , layout_type L>
using broadcast_iterator = xiterator<stepper, S, L>
 
template<class S , layout_type L>
using const_broadcast_iterator = xiterator<const_stepper, S, L>
 
template<class S , layout_type L>
using reverse_broadcast_iterator = std::reverse_iterator<broadcast_iterator<S, L>>
 
template<class S , layout_type L>
using const_reverse_broadcast_iterator = std::reverse_iterator<const_broadcast_iterator<S, L>>
 
using iterator = layout_iterator< ::xt::layout_type::row_major >
 
using const_iterator = const_layout_iterator< ::xt::layout_type::row_major >
 
using reverse_iterator = reverse_layout_iterator< ::xt::layout_type::row_major >
 
using const_reverse_iterator = const_reverse_layout_iterator< ::xt::layout_type::row_major >
 

Public Member Functions

template<layout_type L = ::xt::layout_type::row_major>
const_layout_iterator< Lbegin () const noexcept
 
template<layout_type L = ::xt::layout_type::row_major>
const_layout_iterator< Lend () const noexcept
 
template<layout_type L = ::xt::layout_type::row_major>
const_layout_iterator< Lcbegin () const noexcept
 
template<layout_type L = ::xt::layout_type::row_major>
const_layout_iterator< Lcend () const noexcept
 
template<layout_type L = ::xt::layout_type::row_major>
const_reverse_layout_iterator< Lrbegin () const noexcept
 
template<layout_type L = ::xt::layout_type::row_major>
const_reverse_layout_iterator< Lrend () const noexcept
 
template<layout_type L = ::xt::layout_type::row_major>
const_reverse_layout_iterator< Lcrbegin () const noexcept
 
template<layout_type L = ::xt::layout_type::row_major>
const_reverse_layout_iterator< Lcrend () const noexcept
 
template<layout_type L = ::xt::layout_type::row_major, class S >
const_broadcast_iterator< S, Lbegin (const S &shape) const noexcept
 
template<layout_type L = ::xt::layout_type::row_major, class S >
const_broadcast_iterator< S, Lend (const S &shape) const noexcept
 
template<layout_type L = ::xt::layout_type::row_major, class S >
const_broadcast_iterator< S, Lcbegin (const S &shape) const noexcept
 
template<layout_type L = ::xt::layout_type::row_major, class S >
const_broadcast_iterator< S, Lcend (const S &shape) const noexcept
 
template<layout_type L = ::xt::layout_type::row_major, class S >
const_reverse_broadcast_iterator< S, Lrbegin (const S &shape) const noexcept
 
template<layout_type L = ::xt::layout_type::row_major, class S >
const_reverse_broadcast_iterator< S, Lrend (const S &shape) const noexcept
 
template<layout_type L = ::xt::layout_type::row_major, class S >
const_reverse_broadcast_iterator< S, Lcrbegin (const S &shape) const noexcept
 
template<layout_type L = ::xt::layout_type::row_major, class S >
const_reverse_broadcast_iterator< S, Lcrend (const S &shape) const noexcept
 
Constant iterators
template<layout_type L>
auto begin () const noexcept -> const_layout_iterator< L >
 Returns a constant iterator to the first element of the expression.
 
template<layout_type L>
auto end () const noexcept -> const_layout_iterator< L >
 Returns a constant iterator to the element following the last element of the expression.
 
template<layout_type L>
auto cbegin () const noexcept -> const_layout_iterator< L >
 Returns a constant iterator to the first element of the expression.
 
template<layout_type L>
auto cend () const noexcept -> const_layout_iterator< L >
 Returns a constant iterator to the element following the last element of the expression.
 
Constant reverse iterators
template<layout_type L>
auto rbegin () const noexcept -> const_reverse_layout_iterator< L >
 Returns a constant iterator to the first element of the reversed expression.
 
template<layout_type L>
auto rend () const noexcept -> const_reverse_layout_iterator< L >
 Returns a constant iterator to the element following the last element of the reversed expression.
 
template<layout_type L>
auto crbegin () const noexcept -> const_reverse_layout_iterator< L >
 Returns a constant iterator to the first element of the reversed expression.
 
template<layout_type L>
auto crend () const noexcept -> const_reverse_layout_iterator< L >
 Returns a constant iterator to the element following the last element of the reversed expression.
 
Constant broadcast iterators
template<layout_type L, class S >
auto begin (const S &shape) const noexcept -> const_broadcast_iterator< S, L >
 Returns a constant iterator to the first element of the expression.
 
template<layout_type L, class S >
auto end (const S &shape) const noexcept -> const_broadcast_iterator< S, L >
 Returns a constant iterator to the element following the last element of the expression.
 
template<layout_type L, class S >
auto cbegin (const S &shape) const noexcept -> const_broadcast_iterator< S, L >
 Returns a constant iterator to the first element of the expression.
 
template<layout_type L, class S >
auto cend (const S &shape) const noexcept -> const_broadcast_iterator< S, L >
 Returns a constant iterator to the element following the last element of the expression.
 

Constant reverse broadcast iterators

template<layout_type L, class S >
auto rbegin (const S &shape) const noexcept -> const_reverse_broadcast_iterator< S, L >
 Returns a constant iterator to the first element of the reversed expression.
 
template<layout_type L, class S >
auto rend (const S &shape) const noexcept -> const_reverse_broadcast_iterator< S, L >
 Returns a constant iterator to the element following the last element of the reversed expression.
 
template<layout_type L, class S >
auto crbegin (const S &shape) const noexcept -> const_reverse_broadcast_iterator< S, L >
 Returns a constant iterator to the first element of the reversed expression.
 
template<layout_type L, class S >
auto crend (const S &shape) const noexcept -> const_reverse_broadcast_iterator< S, L >
 Returns a constant iterator to the element following the last element of the reversed expression.
 
template<layout_type L>
auto get_cbegin (bool end_index) const noexcept -> const_layout_iterator< L >
 
template<layout_type L>
auto get_cend (bool end_index) const noexcept -> const_layout_iterator< L >
 
template<layout_type L, class S >
auto get_cbegin (const S &shape, bool end_index) const noexcept -> const_broadcast_iterator< S, L >
 
template<layout_type L, class S >
auto get_cend (const S &shape, bool end_index) const noexcept -> const_broadcast_iterator< S, L >
 
template<class S >
auto get_stepper_begin (const S &shape) const noexcept -> const_stepper
 
template<class S >
auto get_stepper_end (const S &shape, layout_type l) const noexcept -> const_stepper
 
const inner_shape_type & get_shape () const
 

Detailed Description

template<class D>
class xt::xconst_iterable< D >

Base class for multidimensional iterable constant expressions.

The xconst_iterable class defines the interface for multidimensional constant expressions that can be iterated.

Template Parameters
DThe derived type, i.e. the inheriting class for which xconst_iterable provides the interface.

Definition at line 36 of file xiterable.hpp.

Member Typedef Documentation

◆ broadcast_iterator

template<class D >
template<class S , layout_type L>
using xt::xconst_iterable< D >::broadcast_iterator = xiterator<stepper, S, L>

Definition at line 63 of file xiterable.hpp.

◆ const_broadcast_iterator

template<class D >
template<class S , layout_type L>
using xt::xconst_iterable< D >::const_broadcast_iterator = xiterator<const_stepper, S, L>

Definition at line 65 of file xiterable.hpp.

◆ const_iterator

Definition at line 72 of file xiterable.hpp.

◆ const_layout_iterator

template<class D >
template<layout_type L>
using xt::xconst_iterable< D >::const_layout_iterator = xiterator<const_stepper, inner_shape_type*, L>

Definition at line 51 of file xiterable.hpp.

◆ const_linear_iterator

Definition at line 58 of file xiterable.hpp.

◆ const_reverse_broadcast_iterator

template<class D >
template<class S , layout_type L>
using xt::xconst_iterable< D >::const_reverse_broadcast_iterator = std::reverse_iterator<const_broadcast_iterator<S, L>>

Definition at line 69 of file xiterable.hpp.

◆ const_reverse_iterator

template<class D >
using xt::xconst_iterable< D >::const_reverse_iterator = const_reverse_layout_iterator< ::xt::layout_type::row_major >

Definition at line 74 of file xiterable.hpp.

◆ const_reverse_layout_iterator

template<class D >
template<layout_type L>
using xt::xconst_iterable< D >::const_reverse_layout_iterator = std::reverse_iterator<const_layout_iterator<L>>

Definition at line 55 of file xiterable.hpp.

◆ const_reverse_linear_iterator

template<class D >
using xt::xconst_iterable< D >::const_reverse_linear_iterator = const_reverse_layout_iterator< ::xt::layout_type::row_major >

Definition at line 60 of file xiterable.hpp.

◆ const_stepper

template<class D >
using xt::xconst_iterable< D >::const_stepper = typename iterable_types::const_stepper

Definition at line 46 of file xiterable.hpp.

◆ derived_type

template<class D >
using xt::xconst_iterable< D >::derived_type = D

Definition at line 40 of file xiterable.hpp.

◆ inner_shape_type

template<class D >
using xt::xconst_iterable< D >::inner_shape_type = typename iterable_types::inner_shape_type

Definition at line 43 of file xiterable.hpp.

◆ iterable_types

template<class D >
using xt::xconst_iterable< D >::iterable_types = xiterable_inner_types<D>

Definition at line 42 of file xiterable.hpp.

◆ iterator

Definition at line 71 of file xiterable.hpp.

◆ layout_iterator

template<class D >
template<layout_type L>
using xt::xconst_iterable< D >::layout_iterator = xiterator<stepper, inner_shape_type*, L>

Definition at line 49 of file xiterable.hpp.

◆ linear_iterator

Definition at line 57 of file xiterable.hpp.

◆ reverse_broadcast_iterator

template<class D >
template<class S , layout_type L>
using xt::xconst_iterable< D >::reverse_broadcast_iterator = std::reverse_iterator<broadcast_iterator<S, L>>

Definition at line 67 of file xiterable.hpp.

◆ reverse_iterator

template<class D >
using xt::xconst_iterable< D >::reverse_iterator = reverse_layout_iterator< ::xt::layout_type::row_major >

Definition at line 73 of file xiterable.hpp.

◆ reverse_layout_iterator

template<class D >
template<layout_type L>
using xt::xconst_iterable< D >::reverse_layout_iterator = std::reverse_iterator<layout_iterator<L>>

Definition at line 53 of file xiterable.hpp.

◆ reverse_linear_iterator

template<class D >
using xt::xconst_iterable< D >::reverse_linear_iterator = reverse_layout_iterator< ::xt::layout_type::row_major >

Definition at line 59 of file xiterable.hpp.

◆ stepper

template<class D >
using xt::xconst_iterable< D >::stepper = typename iterable_types::stepper

Definition at line 45 of file xiterable.hpp.

Member Function Documentation

◆ begin() [1/2]

template<class D >
template<layout_type L>
auto xt::xconst_iterable< D >::begin ( ) const -> const_layout_iterator<L>
inlinenoexcept

Returns a constant iterator to the first element of the expression.

Template Parameters
Lorder used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

Definition at line 464 of file xiterable.hpp.

◆ begin() [2/2]

template<class D >
template<layout_type L, class S >
auto xt::xconst_iterable< D >::begin ( const S & shape) const -> const_broadcast_iterator<S, L>
inlinenoexcept

Returns a constant iterator to the first element of the expression.

The iteration is broadcasted to the specified shape.

Parameters
shapethe shape used for broadcasting
Template Parameters
Stype of the shape parameter.
Lorder used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

Definition at line 571 of file xiterable.hpp.

◆ cbegin() [1/2]

template<class D >
template<layout_type L>
auto xt::xconst_iterable< D >::cbegin ( ) const -> const_layout_iterator<L>
inlinenoexcept

Returns a constant iterator to the first element of the expression.

Template Parameters
Lorder used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

Definition at line 487 of file xiterable.hpp.

◆ cbegin() [2/2]

template<class D >
template<layout_type L, class S >
auto xt::xconst_iterable< D >::cbegin ( const S & shape) const -> const_broadcast_iterator<S, L>
inlinenoexcept

Returns a constant iterator to the first element of the expression.

The iteration is broadcasted to the specified shape.

Parameters
shapethe shape used for broadcasting
Template Parameters
Stype of the shape parameter.
Lorder used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

Definition at line 599 of file xiterable.hpp.

◆ cend() [1/2]

template<class D >
template<layout_type L>
auto xt::xconst_iterable< D >::cend ( ) const -> const_layout_iterator<L>
inlinenoexcept

Returns a constant iterator to the element following the last element of the expression.

Template Parameters
Lorder used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

Definition at line 499 of file xiterable.hpp.

◆ cend() [2/2]

template<class D >
template<layout_type L, class S >
auto xt::xconst_iterable< D >::cend ( const S & shape) const -> const_broadcast_iterator<S, L>
inlinenoexcept

Returns a constant iterator to the element following the last element of the expression.

The iteration is broadcasted to the specified shape.

Parameters
shapethe shape used for broadcasting
Template Parameters
Stype of the shape parameter.
Lorder used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

Definition at line 613 of file xiterable.hpp.

◆ crbegin() [1/2]

template<class D >
template<layout_type L>
auto xt::xconst_iterable< D >::crbegin ( ) const -> const_reverse_layout_iterator<L>
inlinenoexcept

Returns a constant iterator to the first element of the reversed expression.

Template Parameters
Lorder used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

Definition at line 539 of file xiterable.hpp.

◆ crbegin() [2/2]

template<class D >
template<layout_type L, class S >
auto xt::xconst_iterable< D >::crbegin ( const S & shape) const -> const_reverse_broadcast_iterator<S, L>
inlinenoexcept

Returns a constant iterator to the first element of the reversed expression.

The iteration is broadcasted to the specified shape.

Parameters
shapethe shape used for broadcasting
Template Parameters
Stype of the shape parameter.
Lorder used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

Definition at line 663 of file xiterable.hpp.

◆ crend() [1/2]

template<class D >
template<layout_type L>
auto xt::xconst_iterable< D >::crend ( ) const -> const_reverse_layout_iterator<L>
inlinenoexcept

Returns a constant iterator to the element following the last element of the reversed expression.

Template Parameters
Lorder used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

Definition at line 551 of file xiterable.hpp.

◆ crend() [2/2]

template<class D >
template<layout_type L, class S >
auto xt::xconst_iterable< D >::crend ( const S & shape) const -> const_reverse_broadcast_iterator<S, L>
inlinenoexcept

Returns a constant iterator to the element following the last element of the reversed expression.

The iteration is broadcasted to the specified shape.

Parameters
shapethe shape used for broadcasting
Template Parameters
Stype of the shape parameter.
Lorder used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

Definition at line 678 of file xiterable.hpp.

◆ end() [1/2]

template<class D >
template<layout_type L>
auto xt::xconst_iterable< D >::end ( ) const -> const_layout_iterator<L>
inlinenoexcept

Returns a constant iterator to the element following the last element of the expression.

Template Parameters
Lorder used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

Definition at line 476 of file xiterable.hpp.

◆ end() [2/2]

template<class D >
template<layout_type L, class S >
auto xt::xconst_iterable< D >::end ( const S & shape) const -> const_broadcast_iterator<S, L>
inlinenoexcept

Returns a constant iterator to the element following the last element of the expression.

The iteration is broadcasted to the specified shape.

Parameters
shapethe shape used for broadcasting
Template Parameters
Stype of the shape parameter.
Lorder used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

Definition at line 585 of file xiterable.hpp.

◆ get_cbegin() [1/2]

template<class D >
template<layout_type L>
auto xt::xconst_iterable< D >::get_cbegin ( bool end_index) const -> const_layout_iterator<L>
inlinenoexcept

Definition at line 688 of file xiterable.hpp.

◆ get_cbegin() [2/2]

template<class D >
template<layout_type L, class S >
auto xt::xconst_iterable< D >::get_cbegin ( const S & shape,
bool end_index ) const -> const_broadcast_iterator<S, L>
inlinenoexcept

Definition at line 702 of file xiterable.hpp.

◆ get_cend() [1/2]

template<class D >
template<layout_type L>
auto xt::xconst_iterable< D >::get_cend ( bool end_index) const -> const_layout_iterator<L>
inlinenoexcept

Definition at line 695 of file xiterable.hpp.

◆ get_cend() [2/2]

template<class D >
template<layout_type L, class S >
auto xt::xconst_iterable< D >::get_cend ( const S & shape,
bool end_index ) const -> const_broadcast_iterator<S, L>
inlinenoexcept

Definition at line 710 of file xiterable.hpp.

◆ get_shape()

template<class D >
auto xt::xconst_iterable< D >::get_shape ( ) const
inlineprotected

Definition at line 732 of file xiterable.hpp.

◆ get_stepper_begin()

template<class D >
template<class S >
auto xt::xconst_iterable< D >::get_stepper_begin ( const S & shape) const -> const_stepper
inlinenoexcept

Definition at line 718 of file xiterable.hpp.

◆ get_stepper_end()

template<class D >
template<class S >
auto xt::xconst_iterable< D >::get_stepper_end ( const S & shape,
layout_type l ) const -> const_stepper
inlinenoexcept

Definition at line 725 of file xiterable.hpp.

◆ rbegin() [1/2]

template<class D >
template<layout_type L>
auto xt::xconst_iterable< D >::rbegin ( ) const -> const_reverse_layout_iterator<L>
inlinenoexcept

Returns a constant iterator to the first element of the reversed expression.

Template Parameters
Lorder used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

Definition at line 516 of file xiterable.hpp.

◆ rbegin() [2/2]

template<class D >
template<layout_type L, class S >
auto xt::xconst_iterable< D >::rbegin ( const S & shape) const -> const_reverse_broadcast_iterator<S, L>
inlinenoexcept

Returns a constant iterator to the first element of the reversed expression.

The iteration is broadcasted to the specified shape.

Parameters
shapethe shape used for broadcasting
Template Parameters
Stype of the shape parameter.
Lorder used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

Definition at line 633 of file xiterable.hpp.

◆ rend() [1/2]

template<class D >
template<layout_type L>
auto xt::xconst_iterable< D >::rend ( ) const -> const_reverse_layout_iterator<L>
inlinenoexcept

Returns a constant iterator to the element following the last element of the reversed expression.

Template Parameters
Lorder used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

Definition at line 528 of file xiterable.hpp.

◆ rend() [2/2]

template<class D >
template<layout_type L, class S >
auto xt::xconst_iterable< D >::rend ( const S & shape) const -> const_reverse_broadcast_iterator<S, L>
inlinenoexcept

Returns a constant iterator to the element following the last element of the reversed expression.

The iteration is broadcasted to the specified shape.

Parameters
shapethe shape used for broadcasting
Template Parameters
Stype of the shape parameter.
Lorder used for the traversal. Default value is XTENSOR_DEFAULT_TRAVERSAL.

Definition at line 648 of file xiterable.hpp.


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