xtensor
|
Base class for implementation of common expression constant access methods. More...
#include <xaccessible.hpp>
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_accessible & | operator= (const xconst_accessible &)=default |
xconst_accessible (xconst_accessible &&)=default | |
xconst_accessible & | operator= (xconst_accessible &&)=default |
Base class for implementation of common expression constant access methods.
The xaccessible class implements constant access methods common to all expressions.
D | The derived type, i.e. the inheriting class for which xconst_accessible provides the interface. |
Definition at line 29 of file xaccessible.hpp.
using xt::xconst_accessible< D >::const_reference = typename inner_types::const_reference |
Definition at line 36 of file xaccessible.hpp.
Definition at line 33 of file xaccessible.hpp.
using xt::xconst_accessible< D >::inner_types = xcontainer_inner_types<D> |
Definition at line 34 of file xaccessible.hpp.
Definition at line 35 of file xaccessible.hpp.
Definition at line 37 of file xaccessible.hpp.
|
inline |
Returns a constant reference to the element at the specified position in the expression, after dimension and bounds checking.
args | a 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. |
std::out_of_range | if 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.
|
inline |
Returns a constant reference to last the element of the expression.
Definition at line 236 of file xaccessible.hpp.
|
inlinenoexcept |
Returns the number of dimensions of the expression.
Definition at line 150 of file xaccessible.hpp.
|
inline |
Returns a constant reference to first the element of the expression.
Definition at line 227 of file xaccessible.hpp.
|
inline |
Returns true
only if the the specified position is a valid entry in the expression.
args | a list of indices specifying the position in the expression. |
Definition at line 248 of file xaccessible.hpp.
|
inline |
Returns a constant reference to the element at the specified position in the expression.
index | a 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.
|
inline |
Definition at line 203 of file xaccessible.hpp.
|
inline |
Definition at line 197 of file xaccessible.hpp.
|
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).
args | a 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.
|
inline |
Returns the i-th dimension of the expression.
Definition at line 159 of file xaccessible.hpp.
|
inlinenoexcept |
Returns the size of the expression.
Definition at line 141 of file xaccessible.hpp.