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

Base class for implementation of common expression constant access methods. More...

#include <xaccessible.hpp>

Inheritance diagram for xt::xconst_accessible< D >:
xt::xaccessible< xarray_adaptor< EC, L, SC, Tag > > xt::xaccessible< xarray_container< EC, L, SC, Tag > > xt::xaccessible< xchunked_array< chunk_storage > > xt::xaccessible< xfixed_adaptor< EC, S, L, SH, Tag > > xt::xaccessible< xfixed_container< ET, S, L, SH, Tag > > xt::xaccessible< xfunctor_adaptor< F, CT > > xt::xaccessible< xfunctor_view< F, CT > > xt::xaccessible< xmasked_view< CTD, CTM > > xt::xaccessible< xreducer< F, CT, X, O > > xt::xaccessible< xscalar< CT > > xt::xaccessible< xtensor_adaptor< EC, N, L, Tag > > xt::xaccessible< xtensor_container< EC, N, L, Tag > > xt::xaccessible< xtensor_view< EC, N, L, Tag > > xt::xaccessible< xview< CT, S... > > xt::xaccessible< D >

Public Types

using derived_type = D
 
using inner_types = xcontainer_inner_types<D>
 
using reference = typename inner_types::reference
 
using const_reference = typename inner_types::const_reference
 
using size_type = typename inner_types::size_type
 

Public Member Functions

size_type size () const noexcept
 Returns the size of the expression.
 
size_type dimension () const noexcept
 Returns the number of dimensions of the expression.
 
size_type shape (size_type index) const
 Returns the i-th dimension of the expression.
 
template<class... Args>
const_reference at (Args... args) const
 
template<class S >
disable_integral_t< S, const_reference > operator[] (const S &index) const
 
template<class I >
const_reference operator[] (std::initializer_list< I > index) const
 
const_reference operator[] (size_type i) const
 
template<class... Args>
const_reference periodic (Args... args) const
 
template<class... Args>
bool in_bounds (Args... args) const
 Returns true only if the the specified position is a valid entry in the expression.
 
const_reference front () const
 Returns a constant reference to first the element of the expression.
 
const_reference back () const
 Returns a constant reference to last the element of the expression.
 
template<class... Args>
auto at (Args... args) const -> const_reference
 Returns a constant reference to the element at the specified position in the expression, after dimension and bounds checking.
 
template<class S >
auto operator[] (const S &index) const -> disable_integral_t< S, const_reference >
 Returns a constant reference to the element at the specified position in the expression.
 
template<class I >
auto operator[] (std::initializer_list< I > index) const -> const_reference
 
template<class... Args>
auto periodic (Args... args) const -> const_reference
 Returns a constant reference to the element at the specified position in the expression, after applying periodicity to the indices (negative and 'overflowing' indices are changed).
 

Protected Member Functions

 xconst_accessible (const xconst_accessible &)=default
 
xconst_accessibleoperator= (const xconst_accessible &)=default
 
 xconst_accessible (xconst_accessible &&)=default
 
xconst_accessibleoperator= (xconst_accessible &&)=default
 

Detailed Description

template<class D>
class xt::xconst_accessible< D >

Base class for implementation of common expression constant access methods.

The xaccessible class implements constant access methods common to all expressions.

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

Definition at line 29 of file xaccessible.hpp.

Member Typedef Documentation

◆ const_reference

template<class D >
using xt::xconst_accessible< D >::const_reference = typename inner_types::const_reference

Definition at line 36 of file xaccessible.hpp.

◆ derived_type

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

Definition at line 33 of file xaccessible.hpp.

◆ inner_types

template<class D >
using xt::xconst_accessible< D >::inner_types = xcontainer_inner_types<D>

Definition at line 34 of file xaccessible.hpp.

◆ reference

template<class D >
using xt::xconst_accessible< D >::reference = typename inner_types::reference

Definition at line 35 of file xaccessible.hpp.

◆ size_type

template<class D >
using xt::xconst_accessible< D >::size_type = typename inner_types::size_type

Definition at line 37 of file xaccessible.hpp.

Member Function Documentation

◆ at()

template<class D >
template<class... Args>
auto xt::xconst_accessible< D >::at ( Args... args) const -> const_reference
inline

Returns a constant reference to the element at the specified position in the expression, after dimension and bounds checking.

Parameters
argsa list of indices specifying the position in the expression. Indices must be unsigned integers, the number of indices should be equal to the number of dimensions of the expression.
Exceptions
std::out_of_rangeif the number of argument is greater than the number of dimensions or if indices are out of bounds.

Definition at line 175 of file xaccessible.hpp.

◆ back()

template<class D >
auto xt::xconst_accessible< D >::back ( ) const
inline

Returns a constant reference to last the element of the expression.

Definition at line 236 of file xaccessible.hpp.

◆ dimension()

template<class D >
auto xt::xconst_accessible< D >::dimension ( ) const
inlinenoexcept

Returns the number of dimensions of the expression.

Definition at line 150 of file xaccessible.hpp.

◆ front()

template<class D >
auto xt::xconst_accessible< D >::front ( ) const
inline

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

Definition at line 227 of file xaccessible.hpp.

◆ in_bounds()

template<class D >
template<class... Args>
bool xt::xconst_accessible< D >::in_bounds ( Args... args) const
inline

Returns true only if the the specified position is a valid entry in the expression.

Parameters
argsa list of indices specifying the position in the expression.
Returns
bool

Definition at line 248 of file xaccessible.hpp.

◆ operator[]() [1/3]

template<class D >
template<class S >
auto xt::xconst_accessible< D >::operator[] ( const S & index) const -> disable_integral_t<S, const_reference>
inline

Returns a constant reference to the element at the specified position in the expression.

Parameters
indexa sequence of indices specifying the position in the expression. Indices must be unsigned integers, the number of indices in the list should be equal or greater than the number of dimensions of the expression.

Definition at line 189 of file xaccessible.hpp.

◆ operator[]() [2/3]

template<class D >
auto xt::xconst_accessible< D >::operator[] ( size_type i) const
inline

Definition at line 203 of file xaccessible.hpp.

◆ operator[]() [3/3]

template<class D >
template<class I >
auto xt::xconst_accessible< D >::operator[] ( std::initializer_list< I > index) const -> const_reference
inline

Definition at line 197 of file xaccessible.hpp.

◆ periodic()

template<class D >
template<class... Args>
auto xt::xconst_accessible< D >::periodic ( Args... args) const -> const_reference
inline

Returns a constant reference to the element at the specified position in the expression, after applying periodicity to the indices (negative and 'overflowing' indices are changed).

Parameters
argsa list of indices specifying the position in the expression. Indices must be integers, the number of indices should be equal to the number of dimensions of the expression.

Definition at line 217 of file xaccessible.hpp.

◆ shape()

template<class D >
auto xt::xconst_accessible< D >::shape ( size_type index) const
inline

Returns the i-th dimension of the expression.

Definition at line 159 of file xaccessible.hpp.

◆ size()

template<class D >
auto xt::xconst_accessible< D >::size ( ) const
inlinenoexcept

Returns the size of the expression.

Definition at line 141 of file xaccessible.hpp.


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