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

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

#include <xaccessible.hpp>

Inheritance diagram for xt::xaccessible< D >:
xt::xconst_accessible< D > xt::xcontainer< xarray_adaptor< EC, L, SC, Tag > > xt::xcontainer< xarray_container< EC, L, SC, Tag > > xt::xcontainer< xfixed_adaptor< EC, S, L, SH, Tag > > xt::xcontainer< xfixed_container< ET, S, L, SH, Tag > > xt::xcontainer< xtensor_adaptor< EC, N, L, Tag > > xt::xcontainer< xtensor_container< EC, N, L, Tag > > xt::xcontainer< xtensor_view< EC, N, L, Tag > > xt::xfunctor_applier_base< xfunctor_adaptor< F, CT > > xt::xfunctor_applier_base< xfunctor_view< F, CT > > xt::xcontainer< D > xt::xfunctor_applier_base< D > xt::xstrided_view_base< D >

Public Types

using base_type = xconst_accessible<D>
 
using derived_type = typename base_type::derived_type
 
using reference = typename base_type::reference
 
using size_type = typename base_type::size_type
 
- Public Types inherited from xt::xconst_accessible< D >
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

template<class... Args>
reference at (Args... args)
 
template<class S >
disable_integral_t< S, reference > operator[] (const S &index)
 
template<class I >
reference operator[] (std::initializer_list< I > index)
 
reference operator[] (size_type i)
 
template<class... Args>
reference periodic (Args... args)
 
reference front ()
 Returns a reference to the first element of the expression.
 
reference back ()
 Returns a reference to the last element of the expression.
 
template<class... Args>
auto at (Args... args) -> reference
 Returns a reference to the element at the specified position in the expression, after dimension and bounds checking.
 
template<class S >
auto operator[] (const S &index) -> disable_integral_t< S, reference >
 Returns a reference to the element at the specified position in the expression.
 
template<class I >
auto operator[] (std::initializer_list< I > index) -> reference
 
template<class... Args>
auto periodic (Args... args) -> reference
 Returns a reference to the element at the specified position in the expression, after applying periodicity to the indices (negative and 'overflowing' indices are changed).
 
template<class... Args>
const_reference at (Args... args) const
 
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.
 
const_reference back () const
 Returns a constant reference to last the element of the expression.
 
const_reference front () const
 Returns a constant reference to first the element of the expression.
 
template<class... Args>
const_reference periodic (Args... args) const
 
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).
 
- Public Member Functions inherited from xt::xconst_accessible< D >
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

 xaccessible (const xaccessible &)=default
 
xaccessibleoperator= (const xaccessible &)=default
 
 xaccessible (xaccessible &&)=default
 
xaccessibleoperator= (xaccessible &&)=default
 
- Protected Member Functions inherited from xt::xconst_accessible< D >
 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::xaccessible< D >

Base class for implementation of common expression access methods.

The xaccessible class implements access methods common to all expressions.

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

Definition at line 87 of file xaccessible.hpp.

Member Typedef Documentation

◆ base_type

template<class D >
using xt::xaccessible< D >::base_type = xconst_accessible<D>

Definition at line 91 of file xaccessible.hpp.

◆ derived_type

template<class D >
using xt::xaccessible< D >::derived_type = typename base_type::derived_type

Definition at line 92 of file xaccessible.hpp.

◆ reference

template<class D >
using xt::xaccessible< D >::reference = typename base_type::reference

Definition at line 93 of file xaccessible.hpp.

◆ size_type

template<class D >
using xt::xaccessible< D >::size_type = typename base_type::size_type

Definition at line 94 of file xaccessible.hpp.

Member Function Documentation

◆ at() [1/2]

template<class D >
template<class... Args>
auto xt::xaccessible< D >::at ( Args... args) -> reference
inline

Returns a 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 274 of file xaccessible.hpp.

◆ at() [2/2]

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() [1/2]

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

Returns a reference to the last element of the expression.

Definition at line 334 of file xaccessible.hpp.

◆ back() [2/2]

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 59 of file xaccessible.hpp.

◆ front() [1/2]

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

Returns a reference to the first element of the expression.

Definition at line 325 of file xaccessible.hpp.

◆ front() [2/2]

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 58 of file xaccessible.hpp.

◆ operator[]() [1/3]

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

Returns a 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 288 of file xaccessible.hpp.

◆ operator[]() [2/3]

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

Definition at line 301 of file xaccessible.hpp.

◆ operator[]() [3/3]

template<class D >
template<class I >
auto xt::xaccessible< D >::operator[] ( std::initializer_list< I > index) -> reference
inline

Definition at line 295 of file xaccessible.hpp.

◆ periodic() [1/2]

template<class D >
template<class... Args>
auto xt::xaccessible< D >::periodic ( Args... args) -> reference
inline

Returns a 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 315 of file xaccessible.hpp.

◆ periodic() [2/2]

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.


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