xtensor
Loading...
Searching...
No Matches
xt::xview< CT, S > Class Template Reference

Multidimensional view with tensor semantic. More...

#include <xview.hpp>

Inheritance diagram for xt::xview< CT, S >:
xt::xview_semantic< xview< CT, S... > > xt::xaccessible< xview< CT, S... > > xt::xsemantic_base< D > xt::xconst_accessible< D >

Public Types

using self_type = xview<CT, S...>
 
using inner_types = xcontainer_inner_types<self_type>
 
using xexpression_type = std::decay_t<CT>
 
using semantic_base = xview_semantic<self_type>
 
using temporary_type = typename xcontainer_inner_types<self_type>::temporary_type
 
using accessible_base = xaccessible<self_type>
 
using extension_base = extension::xview_base_t<CT, S...>
 
using expression_tag = typename extension_base::expression_tag
 
using value_type = typename xexpression_type::value_type
 
using simd_value_type = xt_simd::simd_type<value_type>
 
using bool_load_type = typename xexpression_type::bool_load_type
 
using reference = typename inner_types::reference
 
using const_reference = typename inner_types::const_reference
 
using pointer
 
using const_pointer = typename xexpression_type::const_pointer
 
using size_type = typename inner_types::size_type
 
using difference_type = typename xexpression_type::difference_type
 
using iterable_base = xiterable<self_type>
 
using inner_shape_type = typename iterable_base::inner_shape_type
 
using shape_type = typename xview_shape_type<typename xexpression_type::shape_type, S...>::type
 
using xexpression_inner_strides_type
 
using xexpression_inner_backstrides_type
 
using storage_type = typename inner_types::storage_type
 
using inner_strides_type
 
using inner_backstrides_type
 
using strides_type = get_strides_t<shape_type>
 
using backstrides_type = strides_type
 
using slice_type = std::tuple<S...>
 
using stepper = typename iterable_base::stepper
 
using const_stepper = typename iterable_base::const_stepper
 
using linear_iterator
 
using const_linear_iterator
 
using reverse_linear_iterator = std::reverse_iterator<linear_iterator>
 
using const_reverse_linear_iterator = std::reverse_iterator<const_linear_iterator>
 
using container_iterator = pointer
 
using const_container_iterator = const_pointer
 
template<class E >
using rebind_t = xview<E, S...>
 
template<class requested_type >
using simd_return_type = xt_simd::simd_return_type<value_type, requested_type>
 
template<class T , class R >
using enable_simd_interface = std::enable_if_t<has_simd_interface<T>::value && is_strided_view, R>
 
- Public Types inherited from xt::xview_semantic< xview< CT, S... > >
using base_type
 
using derived_type
 
using temporary_type
 
- Public Types inherited from xt::xsemantic_base< D >
using base_type = select_expression_base_t<D>
 
using derived_type = typename base_type::derived_type
 
using temporary_type = typename xcontainer_inner_types<D>::temporary_type
 
- Public Types inherited from xt::xaccessible< xview< CT, S... > >
using base_type
 
using derived_type
 
using reference
 
using 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

 xview (const xview &)=default
 
template<class E >
self_typeoperator= (const xexpression< E > &e)
 
template<class E >
disable_xexpression< E, self_type > & operator= (const E &e)
 
template<class... Args>
reference operator() (Args... args)
 
template<class... Args>
reference unchecked (Args... args)
 
template<class It >
reference element (It first, It last)
 
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 ST , bool Enable = is_strided_view>
std::enable_if_t<!Enable, stepper > stepper_begin (const ST &shape)
 
template<class ST , bool Enable = is_strided_view>
std::enable_if_t<!Enable, stepper > stepper_end (const ST &shape, layout_type l)
 
template<class ST , bool Enable = is_strided_view>
std::enable_if_t<!Enable, const_stepper > stepper_begin (const ST &shape) const
 
template<class ST , bool Enable = is_strided_view>
std::enable_if_t<!Enable, const_stepper > stepper_end (const ST &shape, layout_type l) const
 
template<class ST , bool Enable = is_strided_view>
std::enable_if_t< Enable, stepper > stepper_begin (const ST &shape)
 
template<class ST , bool Enable = is_strided_view>
std::enable_if_t< Enable, stepper > stepper_end (const ST &shape, layout_type l)
 
template<class ST , bool Enable = is_strided_view>
std::enable_if_t< Enable, const_stepper > stepper_begin (const ST &shape) const
 
template<class ST , bool Enable = is_strided_view>
std::enable_if_t< Enable, const_stepper > stepper_end (const ST &shape, layout_type l) const
 
template<class T = xexpression_type>
std::enable_if_t< has_data_interface< T >::value, storage_type & > storage ()
 
template<class T = xexpression_type>
std::enable_if_t< has_data_interface< T >::value, const storage_type & > storage () const
 
template<class T = xexpression_type>
std::enable_if_t< has_data_interface< T >::value &&is_strided_view, linear_iterator > linear_begin ()
 
template<class T = xexpression_type>
std::enable_if_t< has_data_interface< T >::value &&is_strided_view, linear_iterator > linear_end ()
 
template<class T = xexpression_type>
std::enable_if_t< has_data_interface< T >::value &&is_strided_view, const_linear_iterator > linear_begin () const
 
template<class T = xexpression_type>
std::enable_if_t< has_data_interface< T >::value &&is_strided_view, const_linear_iterator > linear_end () const
 
template<class T = xexpression_type>
std::enable_if_t< has_data_interface< T >::value &&is_strided_view, const_linear_iterator > linear_cbegin () const
 
template<class T = xexpression_type>
std::enable_if_t< has_data_interface< T >::value &&is_strided_view, const_linear_iterator > linear_cend () const
 
template<class T = xexpression_type>
std::enable_if_t< has_data_interface< T >::value &&is_strided_view, reverse_linear_iterator > linear_rbegin ()
 
template<class T = xexpression_type>
std::enable_if_t< has_data_interface< T >::value &&is_strided_view, reverse_linear_iterator > linear_rend ()
 
template<class T = xexpression_type>
std::enable_if_t< has_data_interface< T >::value &&is_strided_view, const_reverse_linear_iterator > linear_rbegin () const
 
template<class T = xexpression_type>
std::enable_if_t< has_data_interface< T >::value &&is_strided_view, const_reverse_linear_iterator > linear_rend () const
 
template<class T = xexpression_type>
std::enable_if_t< has_data_interface< T >::value &&is_strided_view, const_reverse_linear_iterator > linear_crbegin () const
 
template<class T = xexpression_type>
std::enable_if_t< has_data_interface< T >::value &&is_strided_view, const_reverse_linear_iterator > linear_crend () const
 
template<class T = xexpression_type>
std::enable_if_t< has_data_interface< T >::value &&is_strided_view, const inner_strides_type & > strides () const
 
template<class T = xexpression_type>
std::enable_if_t< has_data_interface< T >::value &&is_strided_view, const inner_strides_type & > backstrides () const
 
template<class T = xexpression_type>
std::enable_if_t< has_data_interface< T >::value &&is_strided_view, const_pointer > data () const
 
template<class T = xexpression_type>
std::enable_if_t< has_data_interface< T >::value &&is_strided_view, pointer > data ()
 
template<class T = xexpression_type>
std::enable_if_t< has_data_interface< T >::value &&is_strided_view, std::size_t > data_offset () const noexcept
 
template<class ST = self_type, class = std::enable_if_t<is_xscalar<std::decay_t<ST>>::value, int>>
 operator reference ()
 
template<class ST = self_type, class = std::enable_if_t<is_xscalar<std::decay_t<ST>>::value, int>>
 operator const_reference () const
 
template<class E >
rebind_t< E > build_view (E &&e) const
 
template<class align , class simd , class T = xexpression_type>
enable_simd_interface< T, voidstore_simd (size_type i, const simd &e)
 
template<class align , class requested_type = value_type, std::size_t N = xt_simd::simd_traits<requested_type>::size, class T = xexpression_type>
enable_simd_interface< T, simd_return_type< requested_type > > load_simd (size_type i) const
 
template<class T = xexpression_type>
enable_simd_interface< T, reference > data_element (size_type i)
 
template<class T = xexpression_type>
enable_simd_interface< T, const_reference > data_element (size_type i) const
 
template<class T = xexpression_type>
enable_simd_interface< T, reference > flat (size_type i)
 
template<class T = xexpression_type>
enable_simd_interface< T, const_reference > flat (size_type i) const
 
Size and shape
const inner_shape_type & shape () const noexcept
 Returns the shape of the view.
 
const slice_type & slices () const noexcept
 Returns the slices of the view.
 
layout_type layout () const noexcept
 Returns the slices of the view.
 
bool is_contiguous () const noexcept
 
Extended copy semantic
template<class E >
auto operator= (const xexpression< E > &e) -> self_type &
 The extended assignment operator.
 
template<class E >
auto operator= (const E &e) -> disable_xexpression< E, self_type > &
 
- Public Member Functions inherited from xt::xview_semantic< xview< CT, S... > >
derived_typeassign_xexpression (const xexpression< E > &e)
 
derived_typecomputed_assign (const xexpression< E > &e)
 
derived_typescalar_computed_assign (const E &e, F &&f)
 
derived_typeassign_temporary (temporary_type &&)
 Assigns the temporary tmp to *this.
 
auto assign_xexpression (const xexpression< E > &e) -> derived_type &
 
auto computed_assign (const xexpression< E > &e) -> derived_type &
 
auto scalar_computed_assign (const E &e, F &&f) -> derived_type &
 
auto operator= (const xexpression< E > &rhs) -> derived_type &
 
- Public Member Functions inherited from xt::xsemantic_base< D >
template<class E >
disable_xexpression< E, derived_type & > operator+= (const E &)
 
template<class E >
disable_xexpression< E, derived_type & > operator-= (const E &)
 
template<class E >
disable_xexpression< E, derived_type & > operator*= (const E &)
 
template<class E >
disable_xexpression< E, derived_type & > operator/= (const E &)
 
template<class E >
disable_xexpression< E, derived_type & > operator%= (const E &)
 
template<class E >
disable_xexpression< E, derived_type & > operator&= (const E &)
 
template<class E >
disable_xexpression< E, derived_type & > operator|= (const E &)
 
template<class E >
disable_xexpression< E, derived_type & > operator^= (const E &)
 
template<class E >
derived_type & operator+= (const xexpression< E > &)
 
template<class E >
derived_type & operator-= (const xexpression< E > &)
 
template<class E >
derived_type & operator*= (const xexpression< E > &)
 
template<class E >
derived_type & operator/= (const xexpression< E > &)
 
template<class E >
derived_type & operator%= (const xexpression< E > &)
 
template<class E >
derived_type & operator&= (const xexpression< E > &)
 
template<class E >
derived_type & operator|= (const xexpression< E > &)
 
template<class E >
derived_type & operator^= (const xexpression< E > &)
 
template<class E >
derived_type & assign (const xexpression< E > &)
 
template<class E >
derived_type & plus_assign (const xexpression< E > &)
 
template<class E >
derived_type & minus_assign (const xexpression< E > &)
 
template<class E >
derived_type & multiplies_assign (const xexpression< E > &)
 
template<class E >
derived_type & divides_assign (const xexpression< E > &)
 
template<class E >
derived_type & modulus_assign (const xexpression< E > &)
 
template<class E >
derived_type & bit_and_assign (const xexpression< E > &)
 
template<class E >
derived_type & bit_or_assign (const xexpression< E > &)
 
template<class E >
derived_type & bit_xor_assign (const xexpression< E > &)
 
template<class E >
auto operator+= (const E &e) -> disable_xexpression< E, derived_type & >
 Adds the scalar e to *this.
 
template<class E >
auto operator-= (const E &e) -> disable_xexpression< E, derived_type & >
 Subtracts the scalar e from *this.
 
template<class E >
auto operator*= (const E &e) -> disable_xexpression< E, derived_type & >
 Multiplies *this with the scalar e.
 
template<class E >
auto operator/= (const E &e) -> disable_xexpression< E, derived_type & >
 Divides *this by the scalar e.
 
template<class E >
auto operator%= (const E &e) -> disable_xexpression< E, derived_type & >
 Computes the remainder of *this after division by the scalar e.
 
template<class E >
auto operator&= (const E &e) -> disable_xexpression< E, derived_type & >
 Computes the bitwise and of *this and the scalar e and assigns it to *this.
 
template<class E >
auto operator|= (const E &e) -> disable_xexpression< E, derived_type & >
 Computes the bitwise or of *this and the scalar e and assigns it to *this.
 
template<class E >
auto operator^= (const E &e) -> disable_xexpression< E, derived_type & >
 Computes the bitwise xor of *this and the scalar e and assigns it to *this.
 
template<class E >
auto operator+= (const xexpression< E > &e) -> derived_type &
 Adds the xexpression e to *this.
 
template<class E >
auto operator-= (const xexpression< E > &e) -> derived_type &
 Subtracts the xexpression e from *this.
 
template<class E >
auto operator*= (const xexpression< E > &e) -> derived_type &
 Multiplies *this with the xexpression e.
 
template<class E >
auto operator/= (const xexpression< E > &e) -> derived_type &
 Divides *this by the xexpression e.
 
template<class E >
auto operator%= (const xexpression< E > &e) -> derived_type &
 Computes the remainder of *this after division by the xexpression e.
 
template<class E >
auto operator&= (const xexpression< E > &e) -> derived_type &
 Computes the bitwise and of *this and the xexpression e and assigns it to *this.
 
template<class E >
auto operator|= (const xexpression< E > &e) -> derived_type &
 Computes the bitwise or of *this and the xexpression e and assigns it to *this.
 
template<class E >
auto operator^= (const xexpression< E > &e) -> derived_type &
 Computes the bitwise xor of *this and the xexpression e and assigns it to *this.
 
template<class E >
auto assign (const xexpression< E > &e) -> derived_type &
 Assigns the xexpression e to *this.
 
template<class E >
auto plus_assign (const xexpression< E > &e) -> derived_type &
 Adds the xexpression e to *this.
 
template<class E >
auto minus_assign (const xexpression< E > &e) -> derived_type &
 Subtracts the xexpression e to *this.
 
template<class E >
auto multiplies_assign (const xexpression< E > &e) -> derived_type &
 Multiplies *this with the xexpression e.
 
template<class E >
auto divides_assign (const xexpression< E > &e) -> derived_type &
 Divides *this by the xexpression e.
 
template<class E >
auto modulus_assign (const xexpression< E > &e) -> derived_type &
 Computes the remainder of *this after division by the xexpression e.
 
template<class E >
auto bit_and_assign (const xexpression< E > &e) -> derived_type &
 Computes the bitwise and of e to *this.
 
template<class E >
auto bit_or_assign (const xexpression< E > &e) -> derived_type &
 Computes the bitwise or of e to *this.
 
template<class E >
auto bit_xor_assign (const xexpression< E > &e) -> derived_type &
 Computes the bitwise xor of e to *this.
 
template<class E >
auto operator= (const xexpression< E > &e) -> derived_type &
 
- Public Member Functions inherited from xt::xaccessible< xview< CT, S... > >
reference at (Args... args)
 
auto at (Args... args) -> reference
 Returns a reference to the element at the specified position in the expression, after dimension and bounds checking.
 
const_reference at (Args... args) const
 
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.
 
disable_integral_t< S, reference > operator[] (const S &index)
 
reference operator[] (std::initializer_list< I > index)
 
reference operator[] (size_type i)
 
auto operator[] (const S &index) -> disable_integral_t< S, reference >
 Returns a reference to the element at the specified position in the expression.
 
auto operator[] (std::initializer_list< I > index) -> reference
 
reference periodic (Args... 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).
 
const_reference periodic (Args... args) const
 
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).
 
reference front ()
 Returns a reference to the first element of the expression.
 
const_reference front () const
 Returns a constant reference to first the element of the expression.
 
reference back ()
 Returns a reference to the last element of the expression.
 
const_reference back () const
 Returns a constant reference to last the element of the expression.
 
- 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).
 

Static Public Attributes

static constexpr bool is_const = std::is_const<std::remove_reference_t<CT>>::value
 
static constexpr layout_type static_layout = inner_types::layout
 
static constexpr bool contiguous_layout = static_layout != layout_type::dynamic
 
static constexpr bool is_strided_view = detail::is_strided_view<xexpression_type, S...>::value
 
static constexpr bool is_contiguous_view = contiguous_layout
 
static constexpr bool has_trivial_strides
 
static constexpr std::size_t rank = SIZE_MAX
 

Friends

class xview_semantic< xview< CT, S... > >
 

Constructor

template<class CTA , class FSL , class... SL>
 xview (CTA &&e, FSL &&first_slice, SL &&... slices) noexcept
 Constructs a view on the specified xexpression.
 
self_typeoperator= (const xview &rhs)
 

Data

template<class T >
void fill (const T &value)
 Fills the view with the given value.
 
xexpression_type & expression () noexcept
 Returns a reference to the underlying expression of the view.
 
const xexpression_type & expression () const noexcept
 Returns a const reference to the underlying expression of the view.
 
size_type underlying_size (size_type dim) const
 
xtl::xclosure_pointer< self_type & > operator& () &
 
xtl::xclosure_pointer< const self_type & > operator& () const &
 
xtl::xclosure_pointer< self_typeoperator& () &&
 
template<class... Args>
auto operator() (Args... args) -> reference
 Returns a reference to the element at the specified position in the view.
 
template<class... Args>
auto unchecked (Args... args) -> reference
 Returns a reference to the element at the specified position in the view.
 
template<class It >
auto element (It first, It last) -> reference
 
template<class... Args>
auto operator() (Args... args) const -> const_reference
 Returns a constant reference to the element at the specified position in the view.
 
template<class... Args>
auto unchecked (Args... args) const -> const_reference
 Returns a constant reference to the element at the specified position in the view.
 
template<class It >
auto element (It first, It last) const -> const_reference
 
template<class T >
auto storage () -> std::enable_if_t< has_data_interface< T >::value, storage_type & >
 Returns the data holder of the underlying container (only if the view is on a realized container).
 
template<class T >
auto storage () const -> std::enable_if_t< has_data_interface< T >::value, const storage_type & >
 
template<class T >
auto linear_begin () -> std::enable_if_t< has_data_interface< T >::value &&is_strided_view, linear_iterator >
 
template<class T >
auto linear_end () -> std::enable_if_t< has_data_interface< T >::value &&is_strided_view, linear_iterator >
 
template<class T >
auto linear_begin () const -> std::enable_if_t< has_data_interface< T >::value &&is_strided_view, const_linear_iterator >
 
template<class T >
auto linear_end () const -> std::enable_if_t< has_data_interface< T >::value &&is_strided_view, const_linear_iterator >
 
template<class T >
auto linear_cbegin () const -> std::enable_if_t< has_data_interface< T >::value &&is_strided_view, const_linear_iterator >
 
template<class T >
auto linear_cend () const -> std::enable_if_t< has_data_interface< T >::value &&is_strided_view, const_linear_iterator >
 
template<class T >
auto linear_rbegin () -> std::enable_if_t< has_data_interface< T >::value &&is_strided_view, reverse_linear_iterator >
 
template<class T >
auto linear_rend () -> std::enable_if_t< has_data_interface< T >::value &&is_strided_view, reverse_linear_iterator >
 
template<class T >
auto linear_rbegin () const -> std::enable_if_t< has_data_interface< T >::value &&is_strided_view, const_reverse_linear_iterator >
 
template<class T >
auto linear_rend () const -> std::enable_if_t< has_data_interface< T >::value &&is_strided_view, const_reverse_linear_iterator >
 
template<class T >
auto linear_crbegin () const -> std::enable_if_t< has_data_interface< T >::value &&is_strided_view, const_reverse_linear_iterator >
 
template<class T >
auto linear_crend () const -> std::enable_if_t< has_data_interface< T >::value &&is_strided_view, const_reverse_linear_iterator >
 
template<class T >
auto strides () const -> std::enable_if_t< has_data_interface< T >::value &&is_strided_view, const inner_strides_type & >
 Return the strides for the underlying container of the view.
 
template<class T >
auto backstrides () const -> std::enable_if_t< has_data_interface< T >::value &&is_strided_view, const inner_strides_type & >
 
template<class T >
auto data () const -> std::enable_if_t< has_data_interface< T >::value &&is_strided_view, const_pointer >
 Return the pointer to the underlying buffer.
 
template<class T >
auto data () -> std::enable_if_t< has_data_interface< T >::value &&is_strided_view, pointer >
 
template<class T >
auto data_offset () const noexcept -> std::enable_if_t< has_data_interface< T >::value &&is_strided_view, std::size_t >
 Return the offset to the first element of the view in the underlying container.
 

Broadcasting

template<class ST >
bool broadcast_shape (ST &shape, bool reuse_cache=false) const
 Broadcast the shape of the view to the specified parameter.
 
template<class ST >
bool has_linear_assign (const ST &strides) const
 Checks whether the xview can be linearly assigned to an expression with the specified strides.
 
template<class It >
It data_xbegin_impl (It begin) const noexcept
 
template<class It >
It data_xend_impl (It begin, layout_type l, size_type offset) const noexcept
 
container_iterator data_xbegin () noexcept
 
const_container_iterator data_xbegin () const noexcept
 
container_iterator data_xend (layout_type l, size_type offset) noexcept
 
const_container_iterator data_xend (layout_type l, size_type offset) const noexcept
 
template<class E , class T = xexpression_type, class = std::enable_if_t<has_data_interface<T>::value && is_contiguous_view, int>>
void assign_to (xexpression< E > &e, bool force_resize) const
 
template<class E , std::size_t... I>
auto build_view_impl (E &&e, std::index_sequence< I... >) const -> rebind_t< E >
 
template<class E >
auto build_view (E &&e) const -> rebind_t< E >
 
template<class align , class simd , class T >
auto store_simd (size_type i, const simd &e) -> enable_simd_interface< T, void >
 
template<class align , class requested_type , std::size_t N, class T >
auto load_simd (size_type i) const -> enable_simd_interface< T, simd_return_type< requested_type > >
 
template<class T >
auto data_element (size_type i) -> enable_simd_interface< T, reference >
 
template<class T >
auto data_element (size_type i) const -> enable_simd_interface< T, const_reference >
 
template<class T >
auto flat (size_type i) -> enable_simd_interface< T, reference >
 
template<class T >
auto flat (size_type i) const -> enable_simd_interface< T, const_reference >
 
template<class Arg , class... Args>
auto access (Arg arg, Args... args) -> reference
 
template<class Arg , class... Args>
auto access (Arg arg, Args... args) const -> const_reference
 
template<typename std::decay_t< CT >::size_type... I, class... Args>
auto unchecked_impl (std::index_sequence< I... >, Args... args) -> reference
 
template<typename std::decay_t< CT >::size_type... I, class... Args>
auto unchecked_impl (std::index_sequence< I... >, Args... args) const -> const_reference
 
template<typename std::decay_t< CT >::size_type... I, class... Args>
auto access_impl (std::index_sequence< I... >, Args... args) -> reference
 
template<typename std::decay_t< CT >::size_type... I, class... Args>
auto access_impl (std::index_sequence< I... >, Args... args) const -> const_reference
 
template<typename std::decay_t< CT >::size_type I, class... Args>
auto index (Args... args) const -> std::enable_if_t< lesser_condition< I >::value, size_type >
 
template<typename std::decay_t< CT >::size_type I, class T >
auto sliced_access (const xslice< T > &slice) const -> size_type
 
template<typename std::decay_t< CT >::size_type I, class T , class Arg , class... Args>
auto sliced_access (const xslice< T > &slice, Arg arg, Args... args) const -> size_type
 
template<typename std::decay_t< CT >::size_type I, class T , class... Args>
auto sliced_access (const T &squeeze, Args...) const -> disable_xslice< T, size_type >
 
template<class It >
auto make_index (It first, It last) const -> base_index_type
 
template<class ST , bool Enable>
auto stepper_begin (const ST &shape) -> std::enable_if_t<!Enable, stepper >
 
template<class ST , bool Enable>
auto stepper_end (const ST &shape, layout_type l) -> std::enable_if_t<!Enable, stepper >
 
template<class ST , bool Enable>
auto stepper_begin (const ST &shape) const -> std::enable_if_t<!Enable, const_stepper >
 
template<class ST , bool Enable>
auto stepper_end (const ST &shape, layout_type l) const -> std::enable_if_t<!Enable, const_stepper >
 

Additional Inherited Members

- Protected Member Functions inherited from xt::xview_semantic< xview< CT, S... > >
 xview_semantic (const xview_semantic &)=default
 
 xview_semantic (xview_semantic &&)=default
 
xview_semanticoperator= (const xview_semantic &)=default
 
xview_semanticoperator= (xview_semantic &&)=default
 
derived_typeoperator= (const xexpression< E > &)
 
- Protected Member Functions inherited from xt::xsemantic_base< D >
 xsemantic_base (const xsemantic_base &)=default
 
xsemantic_baseoperator= (const xsemantic_base &)=default
 
 xsemantic_base (xsemantic_base &&)=default
 
xsemantic_baseoperator= (xsemantic_base &&)=default
 
template<class E >
derived_type & operator= (const xexpression< E > &)
 
- Protected Member Functions inherited from xt::xaccessible< xview< CT, S... > >
 xaccessible (const xaccessible &)=default
 
 xaccessible (xaccessible &&)=default
 
xaccessibleoperator= (const 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 CT, class... S>
class xt::xview< CT, S >

Multidimensional view with tensor semantic.

The xview class implements a multidimensional view with tensor semantic. It is used to adapt the shape of an xexpression without changing it. xview is not meant to be used directly, but only with the view helper functions.

Template Parameters
CTthe closure type of the xexpression to adapt
Sthe slices type describing the shape adaptation
See also
view, range, all, newaxis, keep, drop

Definition at line 353 of file xview.hpp.

Member Typedef Documentation

◆ accessible_base

template<class CT , class... S>
using xt::xview< CT, S >::accessible_base = xaccessible<self_type>

Definition at line 369 of file xview.hpp.

◆ backstrides_type

template<class CT , class... S>
using xt::xview< CT, S >::backstrides_type = strides_type

Definition at line 426 of file xview.hpp.

◆ bool_load_type

template<class CT , class... S>
using xt::xview< CT, S >::bool_load_type = typename xexpression_type::bool_load_type

Definition at line 376 of file xview.hpp.

◆ const_container_iterator

template<class CT , class... S>
using xt::xview< CT, S >::const_container_iterator = const_pointer

Definition at line 447 of file xview.hpp.

◆ const_linear_iterator

template<class CT , class... S>
using xt::xview< CT, S >::const_linear_iterator
Initial value:
std::conditional_t<
has_data_interface<xexpression_type>::value && is_strided_view,
typename xexpression_type::const_linear_iterator,
typename iterable_base::const_linear_iterator>

Definition at line 438 of file xview.hpp.

◆ const_pointer

template<class CT , class... S>
using xt::xview< CT, S >::const_pointer = typename xexpression_type::const_pointer

Definition at line 381 of file xview.hpp.

◆ const_reference

template<class CT , class... S>
using xt::xview< CT, S >::const_reference = typename inner_types::const_reference

Definition at line 378 of file xview.hpp.

◆ const_reverse_linear_iterator

template<class CT , class... S>
using xt::xview< CT, S >::const_reverse_linear_iterator = std::reverse_iterator<const_linear_iterator>

Definition at line 444 of file xview.hpp.

◆ const_stepper

template<class CT , class... S>
using xt::xview< CT, S >::const_stepper = typename iterable_base::const_stepper

Definition at line 432 of file xview.hpp.

◆ container_iterator

template<class CT , class... S>
using xt::xview< CT, S >::container_iterator = pointer

Definition at line 446 of file xview.hpp.

◆ difference_type

template<class CT , class... S>
using xt::xview< CT, S >::difference_type = typename xexpression_type::difference_type

Definition at line 383 of file xview.hpp.

◆ enable_simd_interface

template<class CT , class... S>
template<class T , class R >
using xt::xview< CT, S >::enable_simd_interface = std::enable_if_t<has_simd_interface<T>::value && is_strided_view, R>

Definition at line 636 of file xview.hpp.

◆ expression_tag

template<class CT , class... S>
using xt::xview< CT, S >::expression_tag = typename extension_base::expression_tag

Definition at line 371 of file xview.hpp.

◆ extension_base

template<class CT , class... S>
using xt::xview< CT, S >::extension_base = extension::xview_base_t<CT, S...>

Definition at line 370 of file xview.hpp.

◆ inner_backstrides_type

template<class CT , class... S>
using xt::xview< CT, S >::inner_backstrides_type
Initial value:
std::conditional_t<
has_trivial_strides,
typename detail::unwrap_offset_container<
xexpression_type::static_layout,
xexpression_inner_backstrides_type,
integral_count<S...>()>::type,
get_strides_t<shape_type>>

Definition at line 417 of file xview.hpp.

◆ inner_shape_type

template<class CT , class... S>
using xt::xview< CT, S >::inner_shape_type = typename iterable_base::inner_shape_type

Definition at line 392 of file xview.hpp.

◆ inner_strides_type

template<class CT , class... S>
using xt::xview< CT, S >::inner_strides_type
Initial value:
std::conditional_t<
has_trivial_strides,
typename detail::unwrap_offset_container<
xexpression_type::static_layout,
xexpression_inner_strides_type,
integral_count<S...>()>::type,
get_strides_t<shape_type>>

Definition at line 409 of file xview.hpp.

◆ inner_types

template<class CT , class... S>
using xt::xview< CT, S >::inner_types = xcontainer_inner_types<self_type>

Definition at line 364 of file xview.hpp.

◆ iterable_base

template<class CT , class... S>
using xt::xview< CT, S >::iterable_base = xiterable<self_type>

Definition at line 391 of file xview.hpp.

◆ linear_iterator

template<class CT , class... S>
using xt::xview< CT, S >::linear_iterator
Initial value:
std::conditional_t<
has_data_interface<xexpression_type>::value && is_strided_view,
std::conditional_t<is_const, typename xexpression_type::const_linear_iterator, typename xexpression_type::linear_iterator>,
typename iterable_base::linear_iterator>

Definition at line 434 of file xview.hpp.

◆ pointer

template<class CT , class... S>
using xt::xview< CT, S >::pointer
Initial value:
std::
conditional_t<is_const, typename xexpression_type::const_pointer, typename xexpression_type::pointer>

Definition at line 379 of file xview.hpp.

◆ rebind_t

template<class CT , class... S>
template<class E >
using xt::xview< CT, S >::rebind_t = xview<E, S...>

Definition at line 623 of file xview.hpp.

◆ reference

template<class CT , class... S>
using xt::xview< CT, S >::reference = typename inner_types::reference

Definition at line 377 of file xview.hpp.

◆ reverse_linear_iterator

template<class CT , class... S>
using xt::xview< CT, S >::reverse_linear_iterator = std::reverse_iterator<linear_iterator>

Definition at line 443 of file xview.hpp.

◆ self_type

template<class CT , class... S>
using xt::xview< CT, S >::self_type = xview<CT, S...>

Definition at line 363 of file xview.hpp.

◆ semantic_base

template<class CT , class... S>
using xt::xview< CT, S >::semantic_base = xview_semantic<self_type>

Definition at line 366 of file xview.hpp.

◆ shape_type

template<class CT , class... S>
using xt::xview< CT, S >::shape_type = typename xview_shape_type<typename xexpression_type::shape_type, S...>::type

Definition at line 393 of file xview.hpp.

◆ simd_return_type

template<class CT , class... S>
template<class requested_type >
using xt::xview< CT, S >::simd_return_type = xt_simd::simd_return_type<value_type, requested_type>

Definition at line 633 of file xview.hpp.

◆ simd_value_type

template<class CT , class... S>
using xt::xview< CT, S >::simd_value_type = xt_simd::simd_type<value_type>

Definition at line 375 of file xview.hpp.

◆ size_type

template<class CT , class... S>
using xt::xview< CT, S >::size_type = typename inner_types::size_type

Definition at line 382 of file xview.hpp.

◆ slice_type

template<class CT , class... S>
using xt::xview< CT, S >::slice_type = std::tuple<S...>

Definition at line 429 of file xview.hpp.

◆ stepper

template<class CT , class... S>
using xt::xview< CT, S >::stepper = typename iterable_base::stepper

Definition at line 431 of file xview.hpp.

◆ storage_type

template<class CT , class... S>
using xt::xview< CT, S >::storage_type = typename inner_types::storage_type

Definition at line 405 of file xview.hpp.

◆ strides_type

template<class CT , class... S>
using xt::xview< CT, S >::strides_type = get_strides_t<shape_type>

Definition at line 425 of file xview.hpp.

◆ temporary_type

template<class CT , class... S>
using xt::xview< CT, S >::temporary_type = typename xcontainer_inner_types<self_type>::temporary_type

Definition at line 367 of file xview.hpp.

◆ value_type

template<class CT , class... S>
using xt::xview< CT, S >::value_type = typename xexpression_type::value_type

Definition at line 374 of file xview.hpp.

◆ xexpression_inner_backstrides_type

template<class CT , class... S>
using xt::xview< CT, S >::xexpression_inner_backstrides_type
Initial value:
xtl::mpl::eval_if_t<
has_strides<xexpression_type>,
detail::expr_inner_backstrides_type<xexpression_type>,
get_strides_type<shape_type>>

Definition at line 400 of file xview.hpp.

◆ xexpression_inner_strides_type

template<class CT , class... S>
using xt::xview< CT, S >::xexpression_inner_strides_type
Initial value:
xtl::mpl::eval_if_t<
has_strides<xexpression_type>,
detail::expr_inner_strides_type<xexpression_type>,
get_strides_type<shape_type>>

Definition at line 395 of file xview.hpp.

◆ xexpression_type

template<class CT , class... S>
using xt::xview< CT, S >::xexpression_type = std::decay_t<CT>

Definition at line 365 of file xview.hpp.

Constructor & Destructor Documentation

◆ xview()

template<class CT , class... S>
template<class CTA , class FSL , class... SL>
xt::xview< CT, S >::xview ( CTA && e,
FSL && first_slice,
SL &&... slices )
explicitnoexcept

Constructs a view on the specified xexpression.

Users should not call directly this constructor but use the view function instead.

Parameters
ethe xexpression to adapt
first_slicethe first slice describing the view
slicesthe slices list describing the view
See also
view

Definition at line 881 of file xview.hpp.

Member Function Documentation

◆ access() [1/2]

template<class CT , class... S>
template<class Arg , class... Args>
auto xt::xview< CT, S >::access ( Arg arg,
Args... args ) -> reference
inline

Definition at line 1597 of file xview.hpp.

◆ access() [2/2]

template<class CT , class... S>
template<class Arg , class... Args>
auto xt::xview< CT, S >::access ( Arg arg,
Args... args ) const -> const_reference
inline

Definition at line 1614 of file xview.hpp.

◆ access_impl() [1/2]

template<class CT , class... S>
template<typename std::decay_t< CT >::size_type... I, class... Args>
auto xt::xview< CT, S >::access_impl ( std::index_sequence< I... > ,
Args... args ) -> reference
inline

Definition at line 1640 of file xview.hpp.

◆ access_impl() [2/2]

template<class CT , class... S>
template<typename std::decay_t< CT >::size_type... I, class... Args>
auto xt::xview< CT, S >::access_impl ( std::index_sequence< I... > ,
Args... args ) const -> const_reference
inline

Definition at line 1647 of file xview.hpp.

◆ assign_to()

template<class CT , class... S>
template<class E , class T , class >
void xt::xview< CT, S >::assign_to ( xexpression< E > & e,
bool force_resize ) const

Definition at line 1470 of file xview.hpp.

◆ backstrides()

template<class CT , class... S>
template<class T >
auto xt::xview< CT, S >::backstrides ( ) const -> std::enable_if_t<has_data_interface<T>::value && is_strided_view, const inner_strides_type&>
inline

Definition at line 1293 of file xview.hpp.

◆ broadcast_shape()

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

Broadcast the shape of the view to the specified parameter.

Parameters
shapethe result shape
reuse_cacheparameter for internal optimization
Returns
a boolean indicating whether the broadcasting is trivial

Definition at line 1398 of file xview.hpp.

◆ build_view()

template<class CT , class... S>
template<class E >
auto xt::xview< CT, S >::build_view ( E && e) const -> rebind_t<E>
inline

Definition at line 1486 of file xview.hpp.

◆ build_view_impl()

template<class CT , class... S>
template<class E , std::size_t... I>
auto xt::xview< CT, S >::build_view_impl ( E && e,
std::index_sequence< I... >  ) const -> rebind_t<E>
inline

Definition at line 1479 of file xview.hpp.

◆ data() [1/2]

template<class CT , class... S>
template<class T >
auto xt::xview< CT, S >::data ( ) -> std::enable_if_t<has_data_interface<T>::value && is_strided_view, pointer>
inline

Definition at line 1317 of file xview.hpp.

◆ data() [2/2]

template<class CT , class... S>
template<class T >
auto xt::xview< CT, S >::data ( ) const -> std::enable_if_t<has_data_interface<T>::value && is_strided_view, const_pointer>
inline

Return the pointer to the underlying buffer.

Definition at line 1309 of file xview.hpp.

◆ data_element() [1/2]

template<class CT , class... S>
template<class T >
auto xt::xview< CT, S >::data_element ( size_type i) -> enable_simd_interface<T, reference>
inline

Definition at line 1508 of file xview.hpp.

◆ data_element() [2/2]

template<class CT , class... S>
template<class T >
auto xt::xview< CT, S >::data_element ( size_type i) const -> enable_simd_interface<T, const_reference>
inline

Definition at line 1515 of file xview.hpp.

◆ data_offset()

template<class CT , class... S>
template<class T >
auto xt::xview< CT, S >::data_offset ( ) const -> std::enable_if_t<has_data_interface<T>::value && is_strided_view, std::size_t>
inlinenoexcept

Return the offset to the first element of the view in the underlying container.

Definition at line 1349 of file xview.hpp.

◆ data_xbegin() [1/2]

template<class CT , class... S>
auto xt::xview< CT, S >::data_xbegin ( ) const
inlinenoexcept

Definition at line 1449 of file xview.hpp.

◆ data_xbegin() [2/2]

template<class CT , class... S>
auto xt::xview< CT, S >::data_xbegin ( )
inlinenoexcept

Definition at line 1443 of file xview.hpp.

◆ data_xbegin_impl()

template<class CT , class... S>
template<class It >
It xt::xview< CT, S >::data_xbegin_impl ( It begin) const
inlinenoexcept

Definition at line 1430 of file xview.hpp.

◆ data_xend() [1/2]

template<class CT , class... S>
auto xt::xview< CT, S >::data_xend ( layout_type l,
size_type offset ) const
inlinenoexcept

Definition at line 1461 of file xview.hpp.

◆ data_xend() [2/2]

template<class CT , class... S>
auto xt::xview< CT, S >::data_xend ( layout_type l,
size_type offset )
inlinenoexcept

Definition at line 1455 of file xview.hpp.

◆ data_xend_impl()

template<class CT , class... S>
template<class It >
It xt::xview< CT, S >::data_xend_impl ( It begin,
layout_type l,
size_type offset ) const
inlinenoexcept

Definition at line 1437 of file xview.hpp.

◆ element() [1/2]

template<class CT , class... S>
template<class It >
auto xt::xview< CT, S >::element ( It first,
It last ) -> reference
inline

Definition at line 1081 of file xview.hpp.

◆ element() [2/2]

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

Definition at line 1134 of file xview.hpp.

◆ expression() [1/2]

template<class CT , class... S>
auto xt::xview< CT, S >::expression ( ) const
inlinenoexcept

Returns a const reference to the underlying expression of the view.

Definition at line 1154 of file xview.hpp.

◆ expression() [2/2]

template<class CT , class... S>
auto xt::xview< CT, S >::expression ( )
inlinenoexcept

Returns a reference to the underlying expression of the view.

Definition at line 1145 of file xview.hpp.

◆ fill()

template<class CT , class... S>
template<class T >
void xt::xview< CT, S >::fill ( const T & value)
inline

Fills the view with the given value.

Parameters
valuethe value to fill the view with.

Definition at line 1021 of file xview.hpp.

◆ flat() [1/2]

template<class CT , class... S>
template<class T >
auto xt::xview< CT, S >::flat ( size_type i) -> enable_simd_interface<T, reference>
inline

Definition at line 1522 of file xview.hpp.

◆ flat() [2/2]

template<class CT , class... S>
template<class T >
auto xt::xview< CT, S >::flat ( size_type i) const -> enable_simd_interface<T, const_reference>
inline

Definition at line 1530 of file xview.hpp.

◆ has_linear_assign()

template<class CT , class... S>
template<class ST >
bool xt::xview< CT, S >::has_linear_assign ( const ST & str) const
inline

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

Returns
a boolean indicating whether a linear assign is possible

Definition at line 1410 of file xview.hpp.

◆ index()

template<class CT , class... S>
template<typename std::decay_t< CT >::size_type I, class... Args>
auto xt::xview< CT, S >::index ( Args... args) const -> std::enable_if_t<lesser_condition<I>::value, size_type>
inline

Definition at line 1654 of file xview.hpp.

◆ is_contiguous()

template<class CT , class... S>
bool xt::xview< CT, S >::is_contiguous ( ) const
inlinenoexcept

Definition at line 1003 of file xview.hpp.

◆ layout()

template<class CT , class... S>
layout_type xt::xview< CT, S >::layout ( ) const
inlinenoexcept

Returns the slices of the view.

Definition at line 974 of file xview.hpp.

◆ linear_begin() [1/2]

template<class CT , class... S>
template<class T >
auto xt::xview< CT, S >::linear_begin ( ) -> std::enable_if_t<has_data_interface<T>::value && is_strided_view, linear_iterator>

Definition at line 1181 of file xview.hpp.

◆ linear_begin() [2/2]

template<class CT , class... S>
template<class T >
auto xt::xview< CT, S >::linear_begin ( ) const -> std::enable_if_t<has_data_interface<T>::value && is_strided_view, const_linear_iterator>

Definition at line 1197 of file xview.hpp.

◆ linear_cbegin()

template<class CT , class... S>
template<class T >
auto xt::xview< CT, S >::linear_cbegin ( ) const -> std::enable_if_t<has_data_interface<T>::value && is_strided_view, const_linear_iterator>

Definition at line 1213 of file xview.hpp.

◆ linear_cend()

template<class CT , class... S>
template<class T >
auto xt::xview< CT, S >::linear_cend ( ) const -> std::enable_if_t<has_data_interface<T>::value && is_strided_view, const_linear_iterator>

Definition at line 1221 of file xview.hpp.

◆ linear_crbegin()

template<class CT , class... S>
template<class T >
auto xt::xview< CT, S >::linear_crbegin ( ) const -> std::enable_if_t<has_data_interface<T>::value && is_strided_view, const_reverse_linear_iterator>

Definition at line 1261 of file xview.hpp.

◆ linear_crend()

template<class CT , class... S>
template<class T >
auto xt::xview< CT, S >::linear_crend ( ) const -> std::enable_if_t<has_data_interface<T>::value && is_strided_view, const_reverse_linear_iterator>

Definition at line 1269 of file xview.hpp.

◆ linear_end() [1/2]

template<class CT , class... S>
template<class T >
auto xt::xview< CT, S >::linear_end ( ) -> std::enable_if_t<has_data_interface<T>::value && is_strided_view, linear_iterator>

Definition at line 1189 of file xview.hpp.

◆ linear_end() [2/2]

template<class CT , class... S>
template<class T >
auto xt::xview< CT, S >::linear_end ( ) const -> std::enable_if_t<has_data_interface<T>::value && is_strided_view, const_linear_iterator>

Definition at line 1205 of file xview.hpp.

◆ linear_rbegin() [1/2]

template<class CT , class... S>
template<class T >
auto xt::xview< CT, S >::linear_rbegin ( ) -> std::enable_if_t<has_data_interface<T>::value && is_strided_view, reverse_linear_iterator>

Definition at line 1229 of file xview.hpp.

◆ linear_rbegin() [2/2]

template<class CT , class... S>
template<class T >
auto xt::xview< CT, S >::linear_rbegin ( ) const -> std::enable_if_t<has_data_interface<T>::value && is_strided_view, const_reverse_linear_iterator>

Definition at line 1245 of file xview.hpp.

◆ linear_rend() [1/2]

template<class CT , class... S>
template<class T >
auto xt::xview< CT, S >::linear_rend ( ) -> std::enable_if_t<has_data_interface<T>::value && is_strided_view, reverse_linear_iterator>

Definition at line 1237 of file xview.hpp.

◆ linear_rend() [2/2]

template<class CT , class... S>
template<class T >
auto xt::xview< CT, S >::linear_rend ( ) const -> std::enable_if_t<has_data_interface<T>::value && is_strided_view, const_reverse_linear_iterator>

Definition at line 1253 of file xview.hpp.

◆ load_simd()

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

Definition at line 1500 of file xview.hpp.

◆ make_index()

template<class CT , class... S>
template<class It >
auto xt::xview< CT, S >::make_index ( It first,
It last ) const -> base_index_type
inline

Definition at line 1697 of file xview.hpp.

◆ operator const_reference()

template<class CT , class... S>
template<class ST = self_type, class = std::enable_if_t<is_xscalar<std::decay_t<ST>>::value, int>>
xt::xview< CT, S >::operator const_reference ( ) const
inline

Definition at line 605 of file xview.hpp.

◆ operator reference()

template<class CT , class... S>
template<class ST = self_type, class = std::enable_if_t<is_xscalar<std::decay_t<ST>>::value, int>>
xt::xview< CT, S >::operator reference ( )
inline

Definition at line 599 of file xview.hpp.

◆ operator&() [1/3]

template<class CT , class... S>
auto xt::xview< CT, S >::operator& ( ) &
inline

Definition at line 1369 of file xview.hpp.

◆ operator&() [2/3]

template<class CT , class... S>
auto xt::xview< CT, S >::operator& ( ) &&
inline

Definition at line 1381 of file xview.hpp.

◆ operator&() [3/3]

template<class CT , class... S>
auto xt::xview< CT, S >::operator& ( ) const &
inline

Definition at line 1375 of file xview.hpp.

◆ operator()() [1/2]

template<class CT , class... S>
template<class... Args>
auto xt::xview< CT, S >::operator() ( Args... args) -> reference
inline

Returns a reference to the element at the specified position in the view.

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

Definition at line 1044 of file xview.hpp.

◆ operator()() [2/2]

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

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

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

Definition at line 1097 of file xview.hpp.

◆ operator=() [1/3]

template<class CT , class... S>
template<class E >
auto xt::xview< CT, S >::operator= ( const E & e) -> disable_xexpression<E, self_type>&
inline

Definition at line 942 of file xview.hpp.

◆ operator=() [2/3]

template<class CT , class... S>
template<class E >
auto xt::xview< CT, S >::operator= ( const xexpression< E > & e) -> self_type&
inline

The extended assignment operator.

Definition at line 933 of file xview.hpp.

◆ operator=() [3/3]

template<class CT , class... S>
auto xt::xview< CT, S >::operator= ( const xview< CT, S > & rhs)
inline

Definition at line 918 of file xview.hpp.

◆ shape()

template<class CT , class... S>
auto xt::xview< CT, S >::shape ( ) const
inlinenoexcept

Returns the shape of the view.

Definition at line 956 of file xview.hpp.

◆ sliced_access() [1/3]

template<class CT , class... S>
template<typename std::decay_t< CT >::size_type I, class T , class... Args>
auto xt::xview< CT, S >::sliced_access ( const T & squeeze,
Args...  ) const -> disable_xslice<T, size_type>
inline

Definition at line 1690 of file xview.hpp.

◆ sliced_access() [2/3]

template<class CT , class... S>
template<typename std::decay_t< CT >::size_type I, class T >
auto xt::xview< CT, S >::sliced_access ( const xslice< T > & slice) const -> size_type
inline

Definition at line 1673 of file xview.hpp.

◆ sliced_access() [3/3]

template<class CT , class... S>
template<typename std::decay_t< CT >::size_type I, class T , class Arg , class... Args>
auto xt::xview< CT, S >::sliced_access ( const xslice< T > & slice,
Arg arg,
Args... args ) const -> size_type
inline

Definition at line 1680 of file xview.hpp.

◆ slices()

template<class CT , class... S>
auto xt::xview< CT, S >::slices ( ) const
inlinenoexcept

Returns the slices of the view.

Definition at line 965 of file xview.hpp.

◆ stepper_begin() [1/2]

template<class CT , class... S>
template<class ST , bool Enable>
auto xt::xview< CT, S >::stepper_begin ( const ST & shape) -> std::enable_if_t<!Enable, stepper>
inline

Definition at line 1948 of file xview.hpp.

◆ stepper_begin() [2/2]

template<class CT , class... S>
template<class ST , bool Enable>
auto xt::xview< CT, S >::stepper_begin ( const ST & shape) const -> std::enable_if_t<!Enable, const_stepper>
inline

Definition at line 1965 of file xview.hpp.

◆ stepper_end() [1/2]

template<class CT , class... S>
template<class ST , bool Enable>
auto xt::xview< CT, S >::stepper_end ( const ST & shape,
layout_type l ) -> std::enable_if_t<!Enable, stepper>
inline

Definition at line 1956 of file xview.hpp.

◆ stepper_end() [2/2]

template<class CT , class... S>
template<class ST , bool Enable>
auto xt::xview< CT, S >::stepper_end ( const ST & shape,
layout_type l ) const -> std::enable_if_t<!Enable, const_stepper>
inline

Definition at line 1975 of file xview.hpp.

◆ storage() [1/2]

template<class CT , class... S>
template<class T >
auto xt::xview< CT, S >::storage ( ) -> std::enable_if_t<has_data_interface<T>::value, storage_type&>
inline

Returns the data holder of the underlying container (only if the view is on a realized container).

xt::eval will make sure that the underlying xexpression is on a realized container.

Definition at line 1166 of file xview.hpp.

◆ storage() [2/2]

template<class CT , class... S>
template<class T >
auto xt::xview< CT, S >::storage ( ) const -> std::enable_if_t<has_data_interface<T>::value, const storage_type&>
inline

Definition at line 1173 of file xview.hpp.

◆ store_simd()

template<class CT , class... S>
template<class align , class simd , class T >
auto xt::xview< CT, S >::store_simd ( size_type i,
const simd & e ) -> enable_simd_interface<T, void>
inline

Definition at line 1493 of file xview.hpp.

◆ strides()

template<class CT , class... S>
template<class T >
auto xt::xview< CT, S >::strides ( ) const -> std::enable_if_t<has_data_interface<T>::value && is_strided_view, const inner_strides_type&>
inline

Return the strides for the underlying container of the view.

Definition at line 1280 of file xview.hpp.

◆ unchecked() [1/2]

template<class CT , class... S>
template<class... Args>
auto xt::xview< CT, S >::unchecked ( Args... args) -> reference
inline

Returns a reference to the element at the specified position in the view.

Parameters
argsa list of indices specifying the position in the view. Indices must be unsigned integers, the number of indices must be equal to the number of dimensions of the view, 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 1074 of file xview.hpp.

◆ unchecked() [2/2]

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

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

Parameters
argsa list of indices specifying the position in the view. Indices must be unsigned integers, the number of indices must be equal to the number of dimensions of the view, 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 1127 of file xview.hpp.

◆ unchecked_impl() [1/2]

template<class CT , class... S>
template<typename std::decay_t< CT >::size_type... I, class... Args>
auto xt::xview< CT, S >::unchecked_impl ( std::index_sequence< I... > ,
Args... args ) -> reference
inline

Definition at line 1625 of file xview.hpp.

◆ unchecked_impl() [2/2]

template<class CT , class... S>
template<typename std::decay_t< CT >::size_type... I, class... Args>
auto xt::xview< CT, S >::unchecked_impl ( std::index_sequence< I... > ,
Args... args ) const -> const_reference
inline

Definition at line 1632 of file xview.hpp.

◆ underlying_size()

template<class CT , class... S>
auto xt::xview< CT, S >::underlying_size ( size_type dim) const
inline

Definition at line 1363 of file xview.hpp.

Friends And Related Symbol Documentation

◆ xview_semantic< xview< CT, S... > >

template<class CT , class... S>
friend class xview_semantic< xview< CT, S... > >
friend

Definition at line 743 of file xview.hpp.

Member Data Documentation

◆ contiguous_layout

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

Definition at line 386 of file xview.hpp.

◆ has_trivial_strides

template<class CT , class... S>
constexpr bool xt::xview< CT, S >::has_trivial_strides
staticconstexpr
Initial value:
= is_contiguous_view
&& !xtl::disjunction<detail::is_xrange<S>...>::value

Definition at line 407 of file xview.hpp.

◆ is_const

template<class CT , class... S>
constexpr bool xt::xview< CT, S >::is_const = std::is_const<std::remove_reference_t<CT>>::value
staticconstexpr

Definition at line 373 of file xview.hpp.

◆ is_contiguous_view

template<class CT , class... S>
constexpr bool xt::xview< CT, S >::is_contiguous_view = contiguous_layout
staticconstexpr

Definition at line 389 of file xview.hpp.

◆ is_strided_view

template<class CT , class... S>
constexpr bool xt::xview< CT, S >::is_strided_view = detail::is_strided_view<xexpression_type, S...>::value
staticconstexpr

Definition at line 388 of file xview.hpp.

◆ rank

template<class CT , class... S>
constexpr std::size_t xt::xview< CT, S >::rank = SIZE_MAX
staticconstexpr

Definition at line 448 of file xview.hpp.

◆ static_layout

template<class CT , class... S>
constexpr layout_type xt::xview< CT, S >::static_layout = inner_types::layout
staticconstexpr

Definition at line 385 of file xview.hpp.


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