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

View of an xexpression using strides. More...

#include <xstrided_view.hpp>

Inheritance diagram for xt::xstrided_view< CT, S, L, FST >:
xt::xview_semantic< D > xt::xstrided_view_base< D > xt::xsemantic_base< D >

Public Types

using self_type = xstrided_view<CT, S, L, FST>
using base_type = xstrided_view_base<self_type>
using semantic_base = xview_semantic<self_type>
using extension_base = extension::xstrided_view_base_t<CT, S, L, FST>
using expression_tag = typename extension_base::expression_tag
using xexpression_type = typename base_type::xexpression_type
using value_type = typename base_type::value_type
using reference = typename base_type::reference
using const_reference = typename base_type::const_reference
using pointer = typename base_type::pointer
using const_pointer = typename base_type::const_pointer
using size_type = typename base_type::size_type
using difference_type = typename base_type::difference_type
using inner_storage_type = typename base_type::inner_storage_type
using storage_type = typename base_type::storage_type
using linear_iterator = typename storage_type::iterator
using const_linear_iterator = typename storage_type::const_iterator
using reverse_linear_iterator = std::reverse_iterator<linear_iterator>
using const_reverse_linear_iterator = std::reverse_iterator<const_linear_iterator>
using iterable_base = select_iterable_base_t<L, xexpression_type::static_layout, self_type>
using inner_shape_type = typename base_type::inner_shape_type
using inner_strides_type = typename base_type::inner_strides_type
using inner_backstrides_type = typename base_type::inner_backstrides_type
using shape_type = typename base_type::shape_type
using strides_type = typename base_type::strides_type
using backstrides_type = typename base_type::backstrides_type
using stepper = typename iterable_base::stepper
using const_stepper = typename iterable_base::const_stepper
using temporary_type = typename xcontainer_inner_types<self_type>::temporary_type
using base_index_type = xindex_type_t<shape_type>
using data_alignment = xt_simd::container_alignment_t<storage_type>
using simd_type = xt_simd::simd_type<value_type>
using simd_value_type = xt_simd::simd_type<value_type>
using bool_load_type = typename base_type::bool_load_type
template<class requested_type>
using simd_return_type = xt_simd::simd_return_type<value_type, requested_type>
using container_iterator
using const_container_iterator = typename storage_type::const_iterator
template<class E>
using rebind_t = xstrided_view<E, S, L, typename FST::template rebind_t<E>>
Public Types inherited from xt::xview_semantic< D >
using base_type = xsemantic_base<D>
using derived_type = D
using temporary_type = typename base_type::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 Member Functions

 xstrided_view (const xstrided_view &rhs)=default
const inner_backstrides_type & backstrides () const noexcept
 Returns the backstrides of the xtrided_view_base.
bool is_contiguous () const noexcept
layout_type layout () const noexcept
 Returns the layout of the xtrided_view_base.
const inner_shape_type & shape () const noexcept
 Returns the shape of the xtrided_view_base.
const inner_strides_type & strides () const noexcept
 Returns the strides of the xtrided_view_base.
reference operator() ()
const_reference operator() () const
reference operator() (Args... args)
 Returns a reference to the element at the specified position in the view.
const_reference operator() (Args... args) const
 Returns a constant reference to the element at the specified position in the view.
reference unchecked (Args... args)
 Returns a reference to the element at the specified position in the view.
const_reference unchecked (Args... args) const
 Returns a constant reference to the element at the specified position in the view.
pointer data () noexcept
 Returns a pointer to the underlying array serving as element storage.
const_pointer data () const noexcept
 Returns a constant pointer to the underlying array serving as element storage.
size_type data_offset () const noexcept
 Returns the offset to the first element in the view.
reference element (It first, It last)
 Returns a reference to the element at the specified position in the view.
const_reference element (It first, It last) const
 Returns a constant reference to the element at the specified position in the view.
xexpression_type & expression () noexcept
 Returns a reference to the underlying expression of the view.
const xexpression_type & expression () const noexcept
 Returns a constant reference to the underlying expression of the view.
storage_type & storage () noexcept
 Returns a reference to the buffer containing the elements of the view.
const storage_type & storage () const noexcept
 Returns a constant reference to the buffer containing the elements of the view.
bool broadcast_shape (O &shape, bool reuse_cache=false) const
 Broadcast the shape of the view to the specified parameter.
bool has_linear_assign (const O &strides) const noexcept
 Checks whether the xstrided_view_base can be linearly assigned to an expression with the specified strides.
Constructor
template<class CTA, class SA>
 xstrided_view (CTA &&e, SA &&shape, strides_type &&strides, std::size_t offset, layout_type layout) noexcept
 Constructs an xstrided_view.
self_type & operator= (const self_type &)
derived_type & assign_temporary (temporary_type &&)
 Assigns the temporary tmp to *this.
template<class E>
derived_type & assign_xexpression (const xexpression< E > &e)
template<class E>
derived_type & computed_assign (const xexpression< E > &e)
template<class E, class F>
derived_type & scalar_computed_assign (const E &e, F &&f)
Public Member Functions inherited from xt::xsemantic_base< D >
template<class E>
disable_xexpression< E, derived_type & > operator+= (const E &)
 Adds the scalar e to *this.
template<class E>
disable_xexpression< E, derived_type & > operator-= (const E &)
 Subtracts the scalar e from *this.
template<class E>
disable_xexpression< E, derived_type & > operator*= (const E &)
 Multiplies *this with the scalar e.
template<class E>
disable_xexpression< E, derived_type & > operator/= (const E &)
 Divides *this by the scalar e.
template<class E>
disable_xexpression< E, derived_type & > operator%= (const E &)
 Computes the remainder of *this after division by the scalar e.
template<class E>
disable_xexpression< E, derived_type & > operator&= (const E &)
 Computes the bitwise and of *this and the scalar e and assigns it to *this.
template<class E>
disable_xexpression< E, derived_type & > operator|= (const E &)
 Computes the bitwise or of *this and the scalar e and assigns it to *this.
template<class E>
disable_xexpression< E, derived_type & > operator^= (const E &)
 Computes the bitwise xor of *this and the scalar e and assigns it to *this.
template<class E>
derived_type & operator+= (const xexpression< E > &)
 Adds the xexpression e to *this.
template<class E>
derived_type & operator-= (const xexpression< E > &)
 Subtracts the xexpression e from *this.
template<class E>
derived_type & operator*= (const xexpression< E > &)
 Multiplies *this with the xexpression e.
template<class E>
derived_type & operator/= (const xexpression< E > &)
 Divides *this by the xexpression e.
template<class E>
derived_type & operator%= (const xexpression< E > &)
 Computes the remainder of *this after division by the xexpression e.
template<class E>
derived_type & operator&= (const xexpression< E > &)
 Computes the bitwise and of *this and the xexpression e and assigns it to *this.
template<class E>
derived_type & operator|= (const xexpression< E > &)
 Computes the bitwise or of *this and the xexpression e and assigns it to *this.
template<class E>
derived_type & operator^= (const xexpression< E > &)
 Computes the bitwise xor of *this and the xexpression e and assigns it to *this.
template<class E>
derived_type & assign (const xexpression< E > &)
 Assigns the xexpression e to *this.
template<class E>
derived_type & plus_assign (const xexpression< E > &)
 Adds the xexpression e to *this.
template<class E>
derived_type & minus_assign (const xexpression< E > &)
 Subtracts the xexpression e to *this.
template<class E>
derived_type & multiplies_assign (const xexpression< E > &)
 Multiplies *this with the xexpression e.
template<class E>
derived_type & divides_assign (const xexpression< E > &)
 Divides *this by the xexpression e.
template<class E>
derived_type & modulus_assign (const xexpression< E > &)
 Computes the remainder of *this after division by the xexpression e.
template<class E>
derived_type & bit_and_assign (const xexpression< E > &)
 Computes the bitwise and of e to *this.
template<class E>
derived_type & bit_or_assign (const xexpression< E > &)
 Computes the bitwise or of e to *this.
template<class E>
derived_type & bit_xor_assign (const xexpression< E > &)
 Computes the bitwise xor of e to *this.

Static Public Attributes

static constexpr bool provides_simd_interface
static constexpr bool is_const
static constexpr bool contiguous_layout
static constexpr layout_type static_layout

Friends

template<class C>
class xstepper
class xview_semantic< self_type >
class xaccessible< self_type >
class xconst_accessible< self_type >
template<class D>
class xaxis_iterator
template<class D>
class xaxis_slice_iterator

Extended copy semantic

template<class E>
self_type & operator= (const xexpression< E > &e)
 The extended assignment operator.
template<class E>
disable_xexpression< E, self_type > & operator= (const E &e)

Data

template<class T>
void fill (const T &value)
 Fills the view with the given value.
linear_iterator linear_begin ()
linear_iterator linear_end ()
const_linear_iterator linear_begin () const
const_linear_iterator linear_end () const
const_linear_iterator linear_cbegin () const
const_linear_iterator linear_cend () const
reverse_linear_iterator linear_rbegin ()
reverse_linear_iterator linear_rend ()
const_reverse_linear_iterator linear_rbegin () const
const_reverse_linear_iterator linear_rend () const
const_reverse_linear_iterator linear_crbegin () const
const_reverse_linear_iterator linear_crend () const
template<class ST, class STEP = stepper>
disable_indexed_stepper_t< STEP > stepper_begin (const ST &shape)
template<class ST, class STEP = stepper>
disable_indexed_stepper_t< STEP > stepper_end (const ST &shape, layout_type l)
template<class ST, class STEP = stepper>
enable_indexed_stepper_t< STEP > stepper_begin (const ST &shape)
template<class ST, class STEP = stepper>
enable_indexed_stepper_t< STEP > stepper_end (const ST &shape, layout_type l)
template<class ST, class STEP = const_stepper>
disable_indexed_stepper_t< STEP > stepper_begin (const ST &shape) const
template<class ST, class STEP = const_stepper>
disable_indexed_stepper_t< STEP > stepper_end (const ST &shape, layout_type l) const
template<class ST, class STEP = const_stepper>
enable_indexed_stepper_t< STEP > stepper_begin (const ST &shape) const
template<class ST, class STEP = const_stepper>
enable_indexed_stepper_t< STEP > stepper_end (const ST &shape, layout_type l) const
template<class align, class simd>
requires provides_simd_interface
void store_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>
requires provides_simd_interface
simd_return_type< requested_type > load_simd (size_type i) const
reference data_element (size_type i)
const_reference data_element (size_type i) const
reference flat (size_type i)
const_reference flat (size_type i) const
template<class E>
rebind_t< E > build_view (E &&e) const

Additional Inherited Members

Protected Member Functions inherited from xt::xview_semantic< D >
 xview_semantic (const xview_semantic &)=default
xview_semantic & operator= (const xview_semantic &)=default
 xview_semantic (xview_semantic &&)=default
xview_semantic & operator= (xview_semantic &&)=default
template<class E>
derived_type & operator= (const xexpression< E > &)
Protected Member Functions inherited from xt::xsemantic_base< D >
 xsemantic_base (const xsemantic_base &)=default
xsemantic_base & operator= (const xsemantic_base &)=default
 xsemantic_base (xsemantic_base &&)=default
xsemantic_base & operator= (xsemantic_base &&)=default
template<class E>
derived_type & operator= (const xexpression< E > &)

Detailed Description

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
class xt::xstrided_view< CT, S, L, FST >

View of an xexpression using strides.

The xstrided_view class implements a view utilizing an initial offset and strides.

Template Parameters
CTthe closure type of the xexpression type underlying this view
Lthe layout of the strided view
Sthe strides type of the strided view
FSTthe flat storage type used for the strided view
See also
strided_view, transpose

Definition at line 128 of file xstrided_view.hpp.

Member Typedef Documentation

◆ backstrides_type

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
using xt::xstrided_view< CT, S, L, FST >::backstrides_type = typename base_type::backstrides_type

Definition at line 166 of file xstrided_view.hpp.

◆ base_index_type

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
using xt::xstrided_view< CT, S, L, FST >::base_index_type = xindex_type_t<shape_type>

Definition at line 175 of file xstrided_view.hpp.

◆ base_type

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
using xt::xstrided_view< CT, S, L, FST >::base_type = xstrided_view_base<self_type>

Definition at line 137 of file xstrided_view.hpp.

◆ bool_load_type

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
using xt::xstrided_view< CT, S, L, FST >::bool_load_type = typename base_type::bool_load_type

Definition at line 180 of file xstrided_view.hpp.

◆ const_container_iterator

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
using xt::xstrided_view< CT, S, L, FST >::const_container_iterator = typename storage_type::const_iterator

Definition at line 275 of file xstrided_view.hpp.

◆ const_linear_iterator

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
using xt::xstrided_view< CT, S, L, FST >::const_linear_iterator = typename storage_type::const_iterator

Definition at line 156 of file xstrided_view.hpp.

◆ const_pointer

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
using xt::xstrided_view< CT, S, L, FST >::const_pointer = typename base_type::const_pointer

Definition at line 149 of file xstrided_view.hpp.

◆ const_reference

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
using xt::xstrided_view< CT, S, L, FST >::const_reference = typename base_type::const_reference

Definition at line 147 of file xstrided_view.hpp.

◆ const_reverse_linear_iterator

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
using xt::xstrided_view< CT, S, L, FST >::const_reverse_linear_iterator = std::reverse_iterator<const_linear_iterator>

Definition at line 158 of file xstrided_view.hpp.

◆ const_stepper

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
using xt::xstrided_view< CT, S, L, FST >::const_stepper = typename iterable_base::const_stepper

Definition at line 169 of file xstrided_view.hpp.

◆ container_iterator

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
using xt::xstrided_view< CT, S, L, FST >::container_iterator
Initial value:
std::
conditional_t<is_const, typename storage_type::const_iterator, typename storage_type::iterator>

Definition at line 273 of file xstrided_view.hpp.

◆ data_alignment

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
using xt::xstrided_view< CT, S, L, FST >::data_alignment = xt_simd::container_alignment_t<storage_type>

Definition at line 177 of file xstrided_view.hpp.

◆ difference_type

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
using xt::xstrided_view< CT, S, L, FST >::difference_type = typename base_type::difference_type

Definition at line 151 of file xstrided_view.hpp.

◆ expression_tag

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
using xt::xstrided_view< CT, S, L, FST >::expression_tag = typename extension_base::expression_tag

Definition at line 140 of file xstrided_view.hpp.

◆ extension_base

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
using xt::xstrided_view< CT, S, L, FST >::extension_base = extension::xstrided_view_base_t<CT, S, L, FST>

Definition at line 139 of file xstrided_view.hpp.

◆ inner_backstrides_type

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
using xt::xstrided_view< CT, S, L, FST >::inner_backstrides_type = typename base_type::inner_backstrides_type

Definition at line 163 of file xstrided_view.hpp.

◆ inner_shape_type

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
using xt::xstrided_view< CT, S, L, FST >::inner_shape_type = typename base_type::inner_shape_type

Definition at line 161 of file xstrided_view.hpp.

◆ inner_storage_type

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
using xt::xstrided_view< CT, S, L, FST >::inner_storage_type = typename base_type::inner_storage_type

Definition at line 153 of file xstrided_view.hpp.

◆ inner_strides_type

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
using xt::xstrided_view< CT, S, L, FST >::inner_strides_type = typename base_type::inner_strides_type

Definition at line 162 of file xstrided_view.hpp.

◆ iterable_base

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
using xt::xstrided_view< CT, S, L, FST >::iterable_base = select_iterable_base_t<L, xexpression_type::static_layout, self_type>

Definition at line 160 of file xstrided_view.hpp.

◆ linear_iterator

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
using xt::xstrided_view< CT, S, L, FST >::linear_iterator = typename storage_type::iterator

Definition at line 155 of file xstrided_view.hpp.

◆ pointer

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
using xt::xstrided_view< CT, S, L, FST >::pointer = typename base_type::pointer

Definition at line 148 of file xstrided_view.hpp.

◆ rebind_t

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
template<class E>
using xt::xstrided_view< CT, S, L, FST >::rebind_t = xstrided_view<E, S, L, typename FST::template rebind_t<E>>

Definition at line 278 of file xstrided_view.hpp.

◆ reference

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
using xt::xstrided_view< CT, S, L, FST >::reference = typename base_type::reference

Definition at line 146 of file xstrided_view.hpp.

◆ reverse_linear_iterator

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
using xt::xstrided_view< CT, S, L, FST >::reverse_linear_iterator = std::reverse_iterator<linear_iterator>

Definition at line 157 of file xstrided_view.hpp.

◆ self_type

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
using xt::xstrided_view< CT, S, L, FST >::self_type = xstrided_view<CT, S, L, FST>

Definition at line 136 of file xstrided_view.hpp.

◆ semantic_base

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
using xt::xstrided_view< CT, S, L, FST >::semantic_base = xview_semantic<self_type>

Definition at line 138 of file xstrided_view.hpp.

◆ shape_type

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
using xt::xstrided_view< CT, S, L, FST >::shape_type = typename base_type::shape_type

Definition at line 164 of file xstrided_view.hpp.

◆ simd_return_type

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
template<class requested_type>
using xt::xstrided_view< CT, S, L, FST >::simd_return_type = xt_simd::simd_return_type<value_type, requested_type>

Definition at line 257 of file xstrided_view.hpp.

◆ simd_type

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
using xt::xstrided_view< CT, S, L, FST >::simd_type = xt_simd::simd_type<value_type>

Definition at line 178 of file xstrided_view.hpp.

◆ simd_value_type

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
using xt::xstrided_view< CT, S, L, FST >::simd_value_type = xt_simd::simd_type<value_type>

Definition at line 179 of file xstrided_view.hpp.

◆ size_type

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
using xt::xstrided_view< CT, S, L, FST >::size_type = typename base_type::size_type

Definition at line 150 of file xstrided_view.hpp.

◆ stepper

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
using xt::xstrided_view< CT, S, L, FST >::stepper = typename iterable_base::stepper

Definition at line 168 of file xstrided_view.hpp.

◆ storage_type

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
using xt::xstrided_view< CT, S, L, FST >::storage_type = typename base_type::storage_type

Definition at line 154 of file xstrided_view.hpp.

◆ strides_type

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
using xt::xstrided_view< CT, S, L, FST >::strides_type = typename base_type::strides_type

Definition at line 165 of file xstrided_view.hpp.

◆ temporary_type

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
using xt::xstrided_view< CT, S, L, FST >::temporary_type = typename xcontainer_inner_types<self_type>::temporary_type

Definition at line 174 of file xstrided_view.hpp.

◆ value_type

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
using xt::xstrided_view< CT, S, L, FST >::value_type = typename base_type::value_type

Definition at line 145 of file xstrided_view.hpp.

◆ xexpression_type

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
using xt::xstrided_view< CT, S, L, FST >::xexpression_type = typename base_type::xexpression_type

Definition at line 142 of file xstrided_view.hpp.

Constructor & Destructor Documentation

◆ xstrided_view()

template<class CT, class S, layout_type L, class FST>
template<class CTA, class SA>
xt::xstrided_view< CT, S, L, FST >::xstrided_view ( CTA && e,
SA && shape,
strides_type && strides,
std::size_t offset,
layout_type layout )
inlinenoexcept

Constructs an xstrided_view.

Parameters
ethe underlying xexpression for this view
shapethe shape of the view
stridesthe strides of the view
offsetthe offset of the first element in the underlying container
layoutthe layout of the view

Definition at line 368 of file xstrided_view.hpp.

Member Function Documentation

◆ broadcast_shape()

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
bool xt::xstrided_view_base< self_type >::broadcast_shape ( O & shape,
bool reuse_cache = false ) const

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

◆ build_view()

template<class CT, class S, layout_type L, class FST>
template<class E>
auto xt::xstrided_view< CT, S, L, FST >::build_view ( E && e) const -> rebind_t< E >
inline

Definition at line 692 of file xstrided_view.hpp.

◆ data() [1/2]

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
const_pointer xt::xstrided_view_base< self_type >::data ( ) const
noexcept

Returns a constant pointer to the underlying array serving as element storage.

The first element of the view is at data() + data_offset().

◆ data() [2/2]

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
pointer xt::xstrided_view_base< self_type >::data ( )
noexcept

Returns a pointer to the underlying array serving as element storage.

The first element of the view is at data() + data_offset().

◆ data_element() [1/2]

template<class CT, class S, layout_type L, class FST>
auto xt::xstrided_view< CT, S, L, FST >::data_element ( size_type i)
inline

Definition at line 462 of file xstrided_view.hpp.

◆ data_element() [2/2]

template<class CT, class S, layout_type L, class FST>
auto xt::xstrided_view< CT, S, L, FST >::data_element ( size_type i) const
inline

Definition at line 468 of file xstrided_view.hpp.

◆ element() [1/2]

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
reference xt::xstrided_view_base< self_type >::element ( It first,
It last )

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

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 the number of dimensions of the view..

◆ element() [2/2]

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
const_reference xt::xstrided_view_base< self_type >::element ( It first,
It last ) const

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

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 the number of dimensions of the view..

◆ fill()

template<class CT, class S, layout_type L, class FST>
template<class T>
void xt::xstrided_view< CT, S, L, FST >::fill ( const T & value)
inline

Fills the view with the given value.

Parameters
valuethe value to fill the view with.

Definition at line 447 of file xstrided_view.hpp.

◆ flat() [1/2]

template<class CT, class S, layout_type L, class FST>
auto xt::xstrided_view< CT, S, L, FST >::flat ( size_type i)
inline

Definition at line 474 of file xstrided_view.hpp.

◆ flat() [2/2]

template<class CT, class S, layout_type L, class FST>
auto xt::xstrided_view< CT, S, L, FST >::flat ( size_type i) const
inline

Definition at line 480 of file xstrided_view.hpp.

◆ has_linear_assign()

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
bool xt::xstrided_view_base< self_type >::has_linear_assign ( const O & strides) const
noexcept

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

Returns
a boolean indicating whether a linear assign is possible

◆ linear_begin() [1/2]

template<class CT, class S, layout_type L, class FST>
auto xt::xstrided_view< CT, S, L, FST >::linear_begin ( )
inline

Definition at line 486 of file xstrided_view.hpp.

◆ linear_begin() [2/2]

template<class CT, class S, layout_type L, class FST>
auto xt::xstrided_view< CT, S, L, FST >::linear_begin ( ) const
inline

Definition at line 498 of file xstrided_view.hpp.

◆ linear_cbegin()

template<class CT, class S, layout_type L, class FST>
auto xt::xstrided_view< CT, S, L, FST >::linear_cbegin ( ) const
inline

Definition at line 510 of file xstrided_view.hpp.

◆ linear_cend()

template<class CT, class S, layout_type L, class FST>
auto xt::xstrided_view< CT, S, L, FST >::linear_cend ( ) const
inline

Definition at line 516 of file xstrided_view.hpp.

◆ linear_crbegin()

template<class CT, class S, layout_type L, class FST>
auto xt::xstrided_view< CT, S, L, FST >::linear_crbegin ( ) const
inline

Definition at line 546 of file xstrided_view.hpp.

◆ linear_crend()

template<class CT, class S, layout_type L, class FST>
auto xt::xstrided_view< CT, S, L, FST >::linear_crend ( ) const
inline

Definition at line 552 of file xstrided_view.hpp.

◆ linear_end() [1/2]

template<class CT, class S, layout_type L, class FST>
auto xt::xstrided_view< CT, S, L, FST >::linear_end ( )
inline

Definition at line 492 of file xstrided_view.hpp.

◆ linear_end() [2/2]

template<class CT, class S, layout_type L, class FST>
auto xt::xstrided_view< CT, S, L, FST >::linear_end ( ) const
inline

Definition at line 504 of file xstrided_view.hpp.

◆ linear_rbegin() [1/2]

template<class CT, class S, layout_type L, class FST>
auto xt::xstrided_view< CT, S, L, FST >::linear_rbegin ( )
inline

Definition at line 522 of file xstrided_view.hpp.

◆ linear_rbegin() [2/2]

template<class CT, class S, layout_type L, class FST>
auto xt::xstrided_view< CT, S, L, FST >::linear_rbegin ( ) const
inline

Definition at line 534 of file xstrided_view.hpp.

◆ linear_rend() [1/2]

template<class CT, class S, layout_type L, class FST>
auto xt::xstrided_view< CT, S, L, FST >::linear_rend ( )
inline

Definition at line 528 of file xstrided_view.hpp.

◆ linear_rend() [2/2]

template<class CT, class S, layout_type L, class FST>
auto xt::xstrided_view< CT, S, L, FST >::linear_rend ( ) const
inline

Definition at line 540 of file xstrided_view.hpp.

◆ load_simd()

template<class CT, class S, layout_type L, class FST>
requires provides_simd_interface
template<class alignment, class requested_type, std::size_t N>
requires provides_simd_interface
auto xt::xstrided_view< CT, S, L, FST >::load_simd ( size_type i) const -> simd_return_type< requested_type >
inline

Definition at line 683 of file xstrided_view.hpp.

◆ operator()() [1/2]

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
reference xt::xstrided_view_base< self_type >::operator() ( Args... args)

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.

◆ operator()() [2/2]

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
const_reference xt::xstrided_view_base< self_type >::operator() ( Args... args) const

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.

◆ operator=() [1/3]

template<class CT, class S, layout_type L, class FST>
template<class E>
auto xt::xstrided_view< CT, S, L, FST >::operator= ( const E & e)
inline

Definition at line 406 of file xstrided_view.hpp.

◆ operator=() [2/3]

template<class CT, class S, layout_type L, class FST>
auto xt::xstrided_view< CT, S, L, FST >::operator= ( const self_type & rhs)
inline

Definition at line 382 of file xstrided_view.hpp.

◆ operator=() [3/3]

template<class CT, class S, layout_type L, class FST>
template<class E>
auto xt::xstrided_view< CT, S, L, FST >::operator= ( const xexpression< E > & e) -> self_type &
inline

The extended assignment operator.

Definition at line 397 of file xstrided_view.hpp.

◆ stepper_begin() [1/4]

template<class CT, class S, layout_type L, class FST>
template<class ST, class STEP>
auto xt::xstrided_view< CT, S, L, FST >::stepper_begin ( const ST & shape)
inline

Definition at line 580 of file xstrided_view.hpp.

◆ stepper_begin() [2/4]

template<class CT, class S, layout_type L, class FST>
template<class ST, class STEP>
auto xt::xstrided_view< CT, S, L, FST >::stepper_begin ( const ST & shape) -> disable_indexed_stepper_t< STEP >
inline

Definition at line 563 of file xstrided_view.hpp.

◆ stepper_begin() [3/4]

template<class CT, class S, layout_type L, class FST>
template<class ST, class STEP>
auto xt::xstrided_view< CT, S, L, FST >::stepper_begin ( const ST & shape) const
inline

Definition at line 615 of file xstrided_view.hpp.

◆ stepper_begin() [4/4]

template<class CT, class S, layout_type L, class FST>
template<class ST, class STEP>
auto xt::xstrided_view< CT, S, L, FST >::stepper_begin ( const ST & shape) const
inline

Definition at line 597 of file xstrided_view.hpp.

◆ stepper_end() [1/4]

template<class CT, class S, layout_type L, class FST>
template<class ST, class STEP>
auto xt::xstrided_view< CT, S, L, FST >::stepper_end ( const ST & shape,
layout_type l )
inline

Definition at line 588 of file xstrided_view.hpp.

◆ stepper_end() [2/4]

template<class CT, class S, layout_type L, class FST>
template<class ST, class STEP>
auto xt::xstrided_view< CT, S, L, FST >::stepper_end ( const ST & shape,
layout_type l ) -> disable_indexed_stepper_t< STEP >
inline

Definition at line 571 of file xstrided_view.hpp.

◆ stepper_end() [3/4]

template<class CT, class S, layout_type L, class FST>
template<class ST, class STEP>
auto xt::xstrided_view< CT, S, L, FST >::stepper_end ( const ST & shape,
layout_type l ) const
inline

Definition at line 624 of file xstrided_view.hpp.

◆ stepper_end() [4/4]

template<class CT, class S, layout_type L, class FST>
template<class ST, class STEP>
auto xt::xstrided_view< CT, S, L, FST >::stepper_end ( const ST & shape,
layout_type l ) const
inline

Definition at line 606 of file xstrided_view.hpp.

◆ store_simd()

template<class CT, class S, layout_type L, class FST>
requires provides_simd_interface
template<class alignment, class simd>
requires provides_simd_interface
void xt::xstrided_view< CT, S, L, FST >::store_simd ( size_type i,
const simd & e )
inline

Definition at line 674 of file xstrided_view.hpp.

◆ unchecked() [1/2]

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
reference xt::xstrided_view_base< self_type >::unchecked ( Args... args)

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.uncheked(0, 1);
xarray_container< uvector< T, A >, L, xt::svector< typename uvector< T, A >::size_type, 4, SA, true > > xarray
Alias template on xarray_container with default parameters for data container type and shape / stride...

◆ unchecked() [2/2]

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
const_reference xt::xstrided_view_base< self_type >::unchecked ( Args... args) const

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.uncheked(0, 1);

◆ xaccessible< self_type >

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
friend class xaccessible< self_type >
friend

Definition at line 301 of file xstrided_view.hpp.

◆ xaxis_iterator

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
template<class D>
friend class xaxis_iterator
friend

Definition at line 306 of file xstrided_view.hpp.

◆ xaxis_slice_iterator

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
template<class D>
friend class xaxis_slice_iterator
friend

Definition at line 308 of file xstrided_view.hpp.

◆ xconst_accessible< self_type >

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
friend class xconst_accessible< self_type >
friend

Definition at line 301 of file xstrided_view.hpp.

◆ xstepper

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
template<class C>
friend class xstepper
friend

Definition at line 301 of file xstrided_view.hpp.

◆ xview_semantic< self_type >

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
friend class xview_semantic< self_type >
friend

Definition at line 301 of file xstrided_view.hpp.

Member Data Documentation

◆ contiguous_layout

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
bool xt::xstrided_view_base< self_type >::contiguous_layout
staticconstexpr

Definition at line 133 of file xstrided_view_base.hpp.

◆ is_const

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
bool xt::xstrided_view_base< self_type >::is_const
staticconstexpr

Definition at line 104 of file xstrided_view_base.hpp.

◆ provides_simd_interface

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
bool xt::xstrided_view< CT, S, L, FST >::provides_simd_interface
staticconstexpr

◆ static_layout

template<class CT, class S, layout_type L = layout_type::dynamic, class FST = detail::flat_storage_getter<CT, ::xt::layout_type::row_major >>
layout_type xt::xstrided_view_base< self_type >::static_layout
staticconstexpr

Definition at line 132 of file xstrided_view_base.hpp.


The documentation for this class was generated from the following files:
  • /home/runner/work/xtensor/xtensor/include/xtensor/io/xmime.hpp
  • /home/runner/work/xtensor/xtensor/include/xtensor/views/xstrided_view.hpp