xtensor
Loading...
Searching...
No Matches
xt::xfunction< F, CT > Class Template Reference

Multidimensional function operating on xtensor expressions. More...

#include <xfunction.hpp>

Inheritance diagram for xt::xfunction< F, CT >:
xt::xconst_iterable< xfunction< F, CT... > > xt::xsharable_expression< xfunction< F, CT... > > xt::xconst_accessible< xfunction< F, CT... > > xt::xexpression< D >

Public Types

using self_type = xfunction<F, CT...>
 
using accessible_base = xconst_accessible<self_type>
 
using extension_base = extension::xfunction_base_t<F, CT...>
 
using expression_tag = typename extension_base::expression_tag
 
using only_scalar = all_xscalar<CT...>
 
using functor_type = typename std::remove_reference<F>::type
 
using tuple_type = std::tuple<CT...>
 
using inner_types = xcontainer_inner_types<self_type>
 
using value_type = typename inner_types::value_type
 
using reference = typename inner_types::reference
 
using const_reference = typename inner_types::const_reference
 
using pointer = value_type*
 
using const_pointer = const value_type*
 
using size_type = typename inner_types::size_type
 
using difference_type = common_difference_type_t<std::decay_t<CT>...>
 
using simd_value_type = xt_simd::simd_type<value_type>
 
using bool_load_type = detail::xfunction_bool_load_type_t<CT...>
 
template<class requested_type >
using simd_return_type = xt_simd::simd_return_type<value_type, requested_type>
 
using iterable_base = xconst_iterable<xfunction<F, CT...>>
 
using inner_shape_type = typename iterable_base::inner_shape_type
 
using shape_type = inner_shape_type
 
using stepper = typename iterable_base::stepper
 
using const_stepper = typename iterable_base::const_stepper
 
template<layout_type L>
using layout_iterator = typename iterable_base::template layout_iterator<L>
 
template<layout_type L>
using const_layout_iterator = typename iterable_base::template const_layout_iterator<L>
 
template<layout_type L>
using reverse_layout_iterator = typename iterable_base::template reverse_layout_iterator<L>
 
template<layout_type L>
using const_reverse_layout_iterator = typename iterable_base::template const_reverse_layout_iterator<L>
 
template<class S , layout_type L>
using broadcast_iterator = typename iterable_base::template broadcast_iterator<S, L>
 
template<class S , layout_type L>
using const_broadcast_iterator = typename iterable_base::template const_broadcast_iterator<S, L>
 
template<class S , layout_type L>
using reverse_broadcast_iterator = typename iterable_base::template reverse_broadcast_iterator<S, L>
 
template<class S , layout_type L>
using const_reverse_broadcast_iterator = typename iterable_base::template const_reverse_broadcast_iterator<S, L>
 
using const_linear_iterator = xfunction_iterator<F, CT...>
 
using linear_iterator = const_linear_iterator
 
using const_reverse_linear_iterator = std::reverse_iterator<const_linear_iterator>
 
using reverse_linear_iterator = std::reverse_iterator<linear_iterator>
 
using iterator = typename iterable_base::iterator
 
using const_iterator = typename iterable_base::const_iterator
 
using reverse_iterator = typename iterable_base::reverse_iterator
 
using const_reverse_iterator = typename iterable_base::const_reverse_iterator
 
- Public Types inherited from xt::xexpression< D >
using derived_type = D
 

Public Member Functions

 xfunction (const xfunction &)=default
 
xfunctionoperator= (const xfunction &)=default
 
 xfunction (xfunction &&)=default
 
xfunctionoperator= (xfunction &&)=default
 
template<class... Args>
const_reference operator() (Args... args) const
 
template<class... Args>
const_reference unchecked (Args... args) const
 
template<class It >
const_reference element (It first, It last) const
 
template<class S >
const_stepper stepper_begin (const S &shape) const noexcept
 
template<class S >
const_stepper stepper_end (const S &shape, layout_type l) const noexcept
 
template<class align , class requested_type = value_type, std::size_t N = xt_simd::simd_traits<requested_type>::size>
simd_return_type< requested_typeload_simd (size_type i) const
 
size_type size () const noexcept
 Returns the size 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... 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>
bool in_bounds (Args... args) const
 Returns true only if the the specified position is a valid entry in 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).
 
Constructor
template<class Func , class... CTA, class U = std::enable_if_t<!std::is_base_of<std::decay_t<Func>, self_type>::value>>
 xfunction (Func &&f, CTA &&... e) noexcept
 Constructs an xfunction applying the specified function to the given arguments.
 
template<class FA , class... CTA>
 xfunction (xfunction< FA, CTA... > xf) noexcept
 Constructs an xfunction applying the specified function given by another xfunction with its arguments.
 
Data
const_reference flat (size_type i) const
 Returns a constant reference to the element at the specified position of the underlying contiguous storage of the function.
 
template<class... Args>
auto operator() (Args... args) const -> const_reference
 Returns a constant reference to the element at the specified position in the function.
 
template<class... Args>
auto unchecked (Args... args) const -> const_reference
 Returns a constant reference to the element at the specified position in the expression.
 
template<class It >
auto element (It first, It last) const -> const_reference
 Returns a constant reference to the element at the specified position in the function.
 
- Public Member Functions inherited from xt::xexpression< D >
derived_typederived_cast () &noexcept
 Returns a reference to the actual derived type of the xexpression.
 
const derived_typederived_cast () const &noexcept
 Returns a constant reference to the actual derived type of the xexpression.
 
derived_type derived_cast () &&noexcept
 Returns a constant reference to the actual derived type of the xexpression.
 

Static Public Attributes

static constexpr layout_type static_layout = compute_layout(std::decay_t<CT>::static_layout...)
 
static constexpr bool contiguous_layout = static_layout != layout_type::dynamic
 

Friends

class xfunction_iterator< F, CT... >
 
class xfunction_stepper< F, CT... >
 
class xconst_iterable< self_type >
 
class xconst_accessible< self_type >
 

Size and shape

size_type dimension () const noexcept
 Returns the number of dimensions of the function.
 
const inner_shape_type & shape () const
 Returns the shape of the xfunction.
 
layout_type layout () const noexcept
 Returns the layout_type of the xfunction.
 
bool is_contiguous () const noexcept
 

Broadcasting

template<class S >
bool broadcast_shape (S &shape, bool reuse_cache=false) const
 Broadcast the shape of the function to the specified parameter.
 
template<class S >
bool has_linear_assign (const S &strides) const noexcept
 Checks whether the xfunction can be linearly assigned to an expression with the specified strides.
 
const_linear_iterator linear_begin () const noexcept
 
const_linear_iterator linear_end () const noexcept
 
const_linear_iterator linear_cbegin () const noexcept
 
const_linear_iterator linear_cend () const noexcept
 
const_reverse_linear_iterator linear_rbegin () const noexcept
 
const_reverse_linear_iterator linear_rend () const noexcept
 
const_reverse_linear_iterator linear_crbegin () const noexcept
 
const_reverse_linear_iterator linear_crend () const noexcept
 
const_reference data_element (size_type i) const
 
template<class UT = self_type, class = typename std::enable_if<UT::only_scalar::value>::type>
 operator value_type () const
 
const tuple_type & arguments () const noexcept
 
const functor_type & functor () const noexcept
 
template<class S >
auto stepper_begin (const S &shape) const noexcept -> const_stepper
 
template<class S >
auto stepper_end (const S &shape, layout_type l) const noexcept -> const_stepper
 
template<class align , class requested_type , std::size_t N>
auto load_simd (size_type i) const -> simd_return_type< requested_type >
 
template<std::size_t... I, class... Args>
auto access_impl (std::index_sequence< I... >, Args... args) const -> const_reference
 
template<std::size_t... I, class... Args>
auto unchecked_impl (std::index_sequence< I... >, Args... args) const -> const_reference
 
template<std::size_t... I, class It >
auto element_access_impl (std::index_sequence< I... >, It first, It last) const -> const_reference
 
template<std::size_t... I>
auto data_element_impl (std::index_sequence< I... >, size_type i) const -> const_reference
 
template<class Func , std::size_t... I>
auto build_stepper (Func &&f, std::index_sequence< I... >) const noexcept -> const_stepper
 

Additional Inherited Members

- Protected Member Functions inherited from xt::xsharable_expression< xfunction< F, CT... > >
 xsharable_expression (const xsharable_expression &)=default
 
 xsharable_expression (xsharable_expression &&)=default
 
xsharable_expressionoperator= (const xsharable_expression &)=default
 
xsharable_expressionoperator= (xsharable_expression &&)=default
 
- Protected Member Functions inherited from xt::xexpression< D >
 xexpression (const xexpression &)=default
 
xexpressionoperator= (const xexpression &)=default
 
 xexpression (xexpression &&)=default
 
xexpressionoperator= (xexpression &&)=default
 

Detailed Description

template<class F, class... CT>
class xt::xfunction< F, CT >

Multidimensional function operating on xtensor expressions.

The xfunction class implements a multidimensional function operating on xtensor expressions.

Template Parameters
Fthe function type
CTthe closure types for arguments of the function

Definition at line 217 of file xfunction.hpp.

Member Typedef Documentation

◆ accessible_base

template<class F , class... CT>
using xt::xfunction< F, CT >::accessible_base = xconst_accessible<self_type>

Definition at line 225 of file xfunction.hpp.

◆ bool_load_type

template<class F , class... CT>
using xt::xfunction< F, CT >::bool_load_type = detail::xfunction_bool_load_type_t<CT...>

Definition at line 244 of file xfunction.hpp.

◆ broadcast_iterator

template<class F , class... CT>
template<class S , layout_type L>
using xt::xfunction< F, CT >::broadcast_iterator = typename iterable_base::template broadcast_iterator<S, L>

Definition at line 269 of file xfunction.hpp.

◆ const_broadcast_iterator

template<class F , class... CT>
template<class S , layout_type L>
using xt::xfunction< F, CT >::const_broadcast_iterator = typename iterable_base::template const_broadcast_iterator<S, L>

Definition at line 271 of file xfunction.hpp.

◆ const_iterator

template<class F , class... CT>
using xt::xfunction< F, CT >::const_iterator = typename iterable_base::const_iterator

Definition at line 283 of file xfunction.hpp.

◆ const_layout_iterator

template<class F , class... CT>
template<layout_type L>
using xt::xfunction< F, CT >::const_layout_iterator = typename iterable_base::template const_layout_iterator<L>

Definition at line 262 of file xfunction.hpp.

◆ const_linear_iterator

template<class F , class... CT>
using xt::xfunction< F, CT >::const_linear_iterator = xfunction_iterator<F, CT...>

Definition at line 277 of file xfunction.hpp.

◆ const_pointer

template<class F , class... CT>
using xt::xfunction< F, CT >::const_pointer = const value_type*

Definition at line 237 of file xfunction.hpp.

◆ const_reference

template<class F , class... CT>
using xt::xfunction< F, CT >::const_reference = typename inner_types::const_reference

Definition at line 235 of file xfunction.hpp.

◆ const_reverse_broadcast_iterator

template<class F , class... CT>
template<class S , layout_type L>
using xt::xfunction< F, CT >::const_reverse_broadcast_iterator = typename iterable_base::template const_reverse_broadcast_iterator<S, L>

Definition at line 275 of file xfunction.hpp.

◆ const_reverse_iterator

template<class F , class... CT>
using xt::xfunction< F, CT >::const_reverse_iterator = typename iterable_base::const_reverse_iterator

Definition at line 285 of file xfunction.hpp.

◆ const_reverse_layout_iterator

template<class F , class... CT>
template<layout_type L>
using xt::xfunction< F, CT >::const_reverse_layout_iterator = typename iterable_base::template const_reverse_layout_iterator<L>

Definition at line 266 of file xfunction.hpp.

◆ const_reverse_linear_iterator

template<class F , class... CT>
using xt::xfunction< F, CT >::const_reverse_linear_iterator = std::reverse_iterator<const_linear_iterator>

Definition at line 279 of file xfunction.hpp.

◆ const_stepper

template<class F , class... CT>
using xt::xfunction< F, CT >::const_stepper = typename iterable_base::const_stepper

Definition at line 254 of file xfunction.hpp.

◆ difference_type

template<class F , class... CT>
using xt::xfunction< F, CT >::difference_type = common_difference_type_t<std::decay_t<CT>...>

Definition at line 239 of file xfunction.hpp.

◆ expression_tag

template<class F , class... CT>
using xt::xfunction< F, CT >::expression_tag = typename extension_base::expression_tag

Definition at line 227 of file xfunction.hpp.

◆ extension_base

template<class F , class... CT>
using xt::xfunction< F, CT >::extension_base = extension::xfunction_base_t<F, CT...>

Definition at line 226 of file xfunction.hpp.

◆ functor_type

template<class F , class... CT>
using xt::xfunction< F, CT >::functor_type = typename std::remove_reference<F>::type

Definition at line 229 of file xfunction.hpp.

◆ inner_shape_type

template<class F , class... CT>
using xt::xfunction< F, CT >::inner_shape_type = typename iterable_base::inner_shape_type

Definition at line 250 of file xfunction.hpp.

◆ inner_types

template<class F , class... CT>
using xt::xfunction< F, CT >::inner_types = xcontainer_inner_types<self_type>

Definition at line 232 of file xfunction.hpp.

◆ iterable_base

template<class F , class... CT>
using xt::xfunction< F, CT >::iterable_base = xconst_iterable<xfunction<F, CT...>>

Definition at line 249 of file xfunction.hpp.

◆ iterator

template<class F , class... CT>
using xt::xfunction< F, CT >::iterator = typename iterable_base::iterator

Definition at line 282 of file xfunction.hpp.

◆ layout_iterator

template<class F , class... CT>
template<layout_type L>
using xt::xfunction< F, CT >::layout_iterator = typename iterable_base::template layout_iterator<L>

Definition at line 260 of file xfunction.hpp.

◆ linear_iterator

template<class F , class... CT>
using xt::xfunction< F, CT >::linear_iterator = const_linear_iterator

Definition at line 278 of file xfunction.hpp.

◆ only_scalar

template<class F , class... CT>
using xt::xfunction< F, CT >::only_scalar = all_xscalar<CT...>

Definition at line 228 of file xfunction.hpp.

◆ pointer

template<class F , class... CT>
using xt::xfunction< F, CT >::pointer = value_type*

Definition at line 236 of file xfunction.hpp.

◆ reference

template<class F , class... CT>
using xt::xfunction< F, CT >::reference = typename inner_types::reference

Definition at line 234 of file xfunction.hpp.

◆ reverse_broadcast_iterator

template<class F , class... CT>
template<class S , layout_type L>
using xt::xfunction< F, CT >::reverse_broadcast_iterator = typename iterable_base::template reverse_broadcast_iterator<S, L>

Definition at line 273 of file xfunction.hpp.

◆ reverse_iterator

template<class F , class... CT>
using xt::xfunction< F, CT >::reverse_iterator = typename iterable_base::reverse_iterator

Definition at line 284 of file xfunction.hpp.

◆ reverse_layout_iterator

template<class F , class... CT>
template<layout_type L>
using xt::xfunction< F, CT >::reverse_layout_iterator = typename iterable_base::template reverse_layout_iterator<L>

Definition at line 264 of file xfunction.hpp.

◆ reverse_linear_iterator

template<class F , class... CT>
using xt::xfunction< F, CT >::reverse_linear_iterator = std::reverse_iterator<linear_iterator>

Definition at line 280 of file xfunction.hpp.

◆ self_type

template<class F , class... CT>
using xt::xfunction< F, CT >::self_type = xfunction<F, CT...>

Definition at line 224 of file xfunction.hpp.

◆ shape_type

template<class F , class... CT>
using xt::xfunction< F, CT >::shape_type = inner_shape_type

Definition at line 251 of file xfunction.hpp.

◆ simd_return_type

template<class F , class... CT>
template<class requested_type >
using xt::xfunction< F, CT >::simd_return_type = xt_simd::simd_return_type<value_type, requested_type>

Definition at line 247 of file xfunction.hpp.

◆ simd_value_type

template<class F , class... CT>
using xt::xfunction< F, CT >::simd_value_type = xt_simd::simd_type<value_type>

Definition at line 241 of file xfunction.hpp.

◆ size_type

template<class F , class... CT>
using xt::xfunction< F, CT >::size_type = typename inner_types::size_type

Definition at line 238 of file xfunction.hpp.

◆ stepper

template<class F , class... CT>
using xt::xfunction< F, CT >::stepper = typename iterable_base::stepper

Definition at line 253 of file xfunction.hpp.

◆ tuple_type

template<class F , class... CT>
using xt::xfunction< F, CT >::tuple_type = std::tuple<CT...>

Definition at line 230 of file xfunction.hpp.

◆ value_type

template<class F , class... CT>
using xt::xfunction< F, CT >::value_type = typename inner_types::value_type

Definition at line 233 of file xfunction.hpp.

Constructor & Destructor Documentation

◆ xfunction() [1/2]

template<class F , class... CT>
template<class Func , class... CTA, class U >
xt::xfunction< F, CT >::xfunction ( Func && f,
CTA &&... e )
inlinenoexcept

Constructs an xfunction applying the specified function to the given arguments.

Parameters
fthe function to apply
ethe xexpression arguments

Definition at line 541 of file xfunction.hpp.

◆ xfunction() [2/2]

template<class F , class... CT>
template<class FA , class... CTA>
xt::xfunction< F, CT >::xfunction ( xfunction< FA, CTA... > xf)
inlinenoexcept

Constructs an xfunction applying the specified function given by another xfunction with its arguments.

Parameters
xfthe xfunction to apply

Definition at line 554 of file xfunction.hpp.

Member Function Documentation

◆ access_impl()

template<class F , class... CT>
template<std::size_t... I, class... Args>
auto xt::xfunction< F, CT >::access_impl ( std::index_sequence< I... > ,
Args... args ) const -> const_reference
inline

Definition at line 875 of file xfunction.hpp.

◆ arguments()

template<class F , class... CT>
auto xt::xfunction< F, CT >::arguments ( ) const
inlinenoexcept

Definition at line 855 of file xfunction.hpp.

◆ at()

template<class F , class... CT>
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 F , class... CT>
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.

◆ broadcast_shape()

template<class F , class... CT>
template<class S >
bool xt::xfunction< F, CT >::broadcast_shape ( S & shape,
bool reuse_cache = false ) const
inline

Broadcast the shape of the function to the specified parameter.

Parameters
shapethe result shape
reuse_cacheboolean for reusing a previously computed shape
Returns
a boolean indicating whether the broadcasting is trivial

Definition at line 720 of file xfunction.hpp.

◆ build_stepper()

template<class F , class... CT>
template<class Func , std::size_t... I>
auto xt::xfunction< F, CT >::build_stepper ( Func && f,
std::index_sequence< I... >  ) const -> const_stepper
inlinenoexcept

Definition at line 917 of file xfunction.hpp.

◆ data_element()

template<class F , class... CT>
auto xt::xfunction< F, CT >::data_element ( size_type i) const
inline

Definition at line 835 of file xfunction.hpp.

◆ data_element_impl()

template<class F , class... CT>
template<std::size_t... I>
auto xt::xfunction< F, CT >::data_element_impl ( std::index_sequence< I... > ,
size_type i ) const -> const_reference
inline

Definition at line 902 of file xfunction.hpp.

◆ dimension()

template<class F , class... CT>
auto xt::xfunction< F, CT >::dimension ( ) const
inlinenoexcept

Returns the number of dimensions of the function.

Definition at line 570 of file xfunction.hpp.

◆ element()

template<class F , class... CT>
template<class It >
auto xt::xfunction< F, CT >::element ( It first,
It last ) const -> const_reference
inline

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

Parameters
firstiterator starting the sequence of indices
lastiterator ending the sequence of indices The number of indices in the sequence should be equal to or greater than the number of dimensions of the container.

Definition at line 701 of file xfunction.hpp.

◆ element_access_impl()

template<class F , class... CT>
template<std::size_t... I, class It >
auto xt::xfunction< F, CT >::element_access_impl ( std::index_sequence< I... > ,
It first,
It last ) const -> const_reference
inline

Definition at line 893 of file xfunction.hpp.

◆ flat()

template<class F , class... CT>
auto xt::xfunction< F, CT >::flat ( size_type index) const
inline

Returns a constant reference to the element at the specified position of the underlying contiguous storage of the function.

Parameters
indexindex to underlying flat storage.

Definition at line 659 of file xfunction.hpp.

◆ front()

template<class F , class... CT>
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.

◆ functor()

template<class F , class... CT>
auto xt::xfunction< F, CT >::functor ( ) const
inlinenoexcept

Definition at line 861 of file xfunction.hpp.

◆ has_linear_assign()

template<class F , class... CT>
template<class S >
bool xt::xfunction< F, CT >::has_linear_assign ( const S & strides) const
inlinenoexcept

Checks whether the xfunction can be linearly assigned to an expression with the specified strides.

Returns
a boolean indicating whether a linear assign is possible

Definition at line 745 of file xfunction.hpp.

◆ in_bounds()

template<class F , class... CT>
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 56 of file xaccessible.hpp.

◆ is_contiguous()

template<class F , class... CT>
bool xt::xfunction< F, CT >::is_contiguous ( ) const
inlinenoexcept

Definition at line 615 of file xfunction.hpp.

◆ layout()

template<class F , class... CT>
layout_type xt::xfunction< F, CT >::layout ( ) const
inlinenoexcept

Returns the layout_type of the xfunction.

Definition at line 609 of file xfunction.hpp.

◆ linear_begin()

template<class F , class... CT>
auto xt::xfunction< F, CT >::linear_begin ( ) const
inlinenoexcept

Definition at line 757 of file xfunction.hpp.

◆ linear_cbegin()

template<class F , class... CT>
auto xt::xfunction< F, CT >::linear_cbegin ( ) const
inlinenoexcept

Definition at line 769 of file xfunction.hpp.

◆ linear_cend()

template<class F , class... CT>
auto xt::xfunction< F, CT >::linear_cend ( ) const
inlinenoexcept

Definition at line 779 of file xfunction.hpp.

◆ linear_crbegin()

template<class F , class... CT>
auto xt::xfunction< F, CT >::linear_crbegin ( ) const
inlinenoexcept

Definition at line 801 of file xfunction.hpp.

◆ linear_crend()

template<class F , class... CT>
auto xt::xfunction< F, CT >::linear_crend ( ) const
inlinenoexcept

Definition at line 807 of file xfunction.hpp.

◆ linear_end()

template<class F , class... CT>
auto xt::xfunction< F, CT >::linear_end ( ) const
inlinenoexcept

Definition at line 763 of file xfunction.hpp.

◆ linear_rbegin()

template<class F , class... CT>
auto xt::xfunction< F, CT >::linear_rbegin ( ) const
inlinenoexcept

Definition at line 789 of file xfunction.hpp.

◆ linear_rend()

template<class F , class... CT>
auto xt::xfunction< F, CT >::linear_rend ( ) const
inlinenoexcept

Definition at line 795 of file xfunction.hpp.

◆ load_simd()

template<class F , class... CT>
template<class align , class requested_type , std::size_t N>
auto xt::xfunction< F, CT >::load_simd ( size_type i) const -> simd_return_type<requested_type>
inline

Definition at line 849 of file xfunction.hpp.

◆ operator value_type()

template<class F , class... CT>
template<class UT , class >
xt::xfunction< F, CT >::operator value_type ( ) const
inline

Definition at line 842 of file xfunction.hpp.

◆ operator()()

template<class F , class... CT>
template<class... Args>
auto xt::xfunction< F, CT >::operator() ( Args... args) const -> const_reference
inline

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

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

Definition at line 642 of file xfunction.hpp.

◆ periodic()

template<class F , class... CT>
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() [1/2]

template<class F , class... CT>
auto xt::xfunction< F, CT >::shape ( ) const
inline

Returns the shape of the xfunction.

Definition at line 590 of file xfunction.hpp.

◆ shape() [2/2]

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

Returns the i-th dimension of the expression.

Definition at line 41 of file xaccessible.hpp.

◆ size()

template<class F , class... CT>
auto xt::xconst_accessible< D >::size ( ) const
inlinenoexcept

Returns the size of the expression.

Definition at line 39 of file xaccessible.hpp.

◆ stepper_begin()

template<class F , class... CT>
template<class S >
auto xt::xfunction< F, CT >::stepper_begin ( const S & shape) const -> const_stepper
inlinenoexcept

Definition at line 814 of file xfunction.hpp.

◆ stepper_end()

template<class F , class... CT>
template<class S >
auto xt::xfunction< F, CT >::stepper_end ( const S & shape,
layout_type l ) const -> const_stepper
inlinenoexcept

Definition at line 825 of file xfunction.hpp.

◆ unchecked()

template<class F , class... CT>
template<class... Args>
auto xt::xfunction< F, CT >::unchecked ( Args... args) const -> const_reference
inline

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

Parameters
argsa list of indices specifying the position in the expression. Indices must be unsigned integers, the number of indices must be equal to the number of dimensions of the expression, else the behavior is undefined.
Warning
This method is meant for performance, for expressions with a dynamic number of dimensions (i.e. not known at compile time). Since it may have undefined behavior (see parameters), operator() should be preferred whenever it is possible.
This method is NOT compatible with broadcasting, meaning the following code has undefined behavior:
xt::xarray<double> a = {{0, 1}, {2, 3}};
xt::xarray<double> b = {0, 1};
auto fd = a + b;
double res = fd.unchecked(0, 1);

Definition at line 685 of file xfunction.hpp.

◆ unchecked_impl()

template<class F , class... CT>
template<std::size_t... I, class... Args>
auto xt::xfunction< F, CT >::unchecked_impl ( std::index_sequence< I... > ,
Args... args ) const -> const_reference
inline

Definition at line 885 of file xfunction.hpp.

Friends And Related Symbol Documentation

◆ xconst_accessible< self_type >

template<class F , class... CT>
friend class xconst_accessible< self_type >
friend

Definition at line 400 of file xfunction.hpp.

◆ xconst_iterable< self_type >

template<class F , class... CT>
friend class xconst_iterable< self_type >
friend

Definition at line 400 of file xfunction.hpp.

◆ xfunction_iterator< F, CT... >

template<class F , class... CT>
friend class xfunction_iterator< F, CT... >
friend

Definition at line 400 of file xfunction.hpp.

◆ xfunction_stepper< F, CT... >

template<class F , class... CT>
friend class xfunction_stepper< F, CT... >
friend

Definition at line 400 of file xfunction.hpp.

Member Data Documentation

◆ contiguous_layout

template<class F , class... CT>
constexpr bool xt::xfunction< F, CT >::contiguous_layout = static_layout != layout_type::dynamic
staticconstexpr

Definition at line 257 of file xfunction.hpp.

◆ static_layout

template<class F , class... CT>
constexpr layout_type xt::xfunction< F, CT >::static_layout = compute_layout(std::decay_t<CT>::static_layout...)
staticconstexpr

Definition at line 256 of file xfunction.hpp.


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