xtensor
Loading...
Searching...
No Matches
xt::xtensor_view< EC, N, L, Tag > Class Template Reference

Dense multidimensional container adaptor with view semantics and fixed dimension. More...

#include <xtensor.hpp>

Inheritance diagram for xt::xtensor_view< EC, N, L, Tag >:
xt::xstrided_container< xtensor_view< EC, N, L, Tag > > xt::xview_semantic< xtensor_view< EC, N, L, Tag > > xt::xcontainer< xtensor_view< EC, N, L, Tag > > xt::xsemantic_base< xtensor_view< EC, N, L, Tag > > xt::xcontiguous_iterable< xtensor_view< EC, N, L, Tag > > xt::xaccessible< xtensor_view< EC, N, L, Tag > > xt::xiterable< xtensor_view< EC, N, L, Tag > >

Public Types

using container_closure_type = EC
using self_type = xtensor_view<EC, N, L, Tag>
using base_type = xstrided_container<self_type>
using semantic_base = xview_semantic<self_type>
using extension_base = extension::xtensor_adaptor_base_t<EC, N, L, Tag>
using storage_type = typename base_type::storage_type
using allocator_type = typename base_type::allocator_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 temporary_type = typename semantic_base::temporary_type
using expression_tag = Tag
Public Types inherited from xt::xstrided_container< xtensor_view< EC, N, L, Tag > >
using base_type
using storage_type
using value_type
using reference
using const_reference
using pointer
using const_pointer
using size_type
using shape_type
using strides_type
using inner_shape_type
using inner_strides_type
using inner_backstrides_type
Public Types inherited from xt::xcontainer< xtensor_view< EC, N, L, Tag > >
using derived_type
using inner_types
using storage_type
using allocator_type
using value_type
using reference
using const_reference
using pointer
using const_pointer
using size_type
using difference_type
using simd_value_type
using bool_load_type
using shape_type
using strides_type
using backstrides_type
using inner_shape_type
using inner_strides_type
using inner_backstrides_type
using iterable_base
using stepper
using const_stepper
using accessible_base
using data_alignment
using simd_type
using linear_iterator
using const_linear_iterator
using reverse_linear_iterator
using const_reverse_linear_iterator
using simd_return_type
using container_iterator
using const_container_iterator
Public Types inherited from xt::xcontiguous_iterable< xtensor_view< EC, N, L, Tag > >
using derived_type
using inner_types
using iterable_base
using stepper
using const_stepper
using layout_iterator
using const_layout_iterator
using reverse_layout_iterator
using const_reverse_layout_iterator
using broadcast_iterator
using const_broadcast_iterator
using reverse_broadcast_iterator
using const_reverse_broadcast_iterator
using linear_traits
using linear_iterator
using const_linear_iterator
using reverse_linear_iterator
using const_reverse_linear_iterator
using select_iterator_impl
using select_iterator
using select_const_iterator
using select_reverse_iterator
using select_const_reverse_iterator
using iterator
using const_iterator
using reverse_iterator
using const_reverse_iterator
Public Types inherited from xt::xview_semantic< xtensor_view< EC, N, L, Tag > >
using base_type
using derived_type
using temporary_type
Public Types inherited from xt::xsemantic_base< xtensor_view< EC, N, L, Tag > >
using base_type
using derived_type
using temporary_type

Public Member Functions

 xtensor_view (const xtensor_view &)=default
 xtensor_view (xtensor_view &&)=default
Constructors
 xtensor_view (storage_type &&storage)
 Constructs an xtensor_view of the given stl-like container.
 xtensor_view (const storage_type &storage)
 Constructs an xtensor_view of the given stl-like container.
template<class D>
 xtensor_view (D &&storage, const shape_type &shape, layout_type l=L)
 Constructs an xtensor_view of the given stl-like container, with the specified shape and layout_type.
template<class D>
 xtensor_view (D &&storage, const shape_type &shape, const strides_type &strides)
 Constructs an xtensor_view of the given stl-like container, with the specified shape and strides.
xtensor_viewoperator= (const xtensor_view &)
xtensor_viewoperator= (xtensor_view &&)
void resize (S &&shape, bool force=false)
 Resizes the container.
auto & reshape (S &&shape, layout_type layout=base_type::static_layout) &
 Reshapes the container and keeps old elements.
layout_type layout () const noexcept
 Return the layout_type of the container.
bool is_contiguous () const noexcept
Public Member Functions inherited from xt::xcontainer< xtensor_view< EC, N, L, Tag > >
reference at (Args... args)
 Returns a 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)
 Returns a reference to the element at the specified position in the expression.
reference operator[] (std::initializer_list< I > index)
reference operator[] (size_type i)
reference back ()
 Returns a reference to the last element of the expression.
reference front ()
 Returns a reference to the first element of the expression.
reference periodic (Args... args)
 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).
size_type size () const noexcept
 Returns the number of element in the container.
constexpr size_type dimension () const noexcept
 Returns the number of dimensions of the container.
constexpr const inner_shape_type & shape () const noexcept
 Returns the shape of the container.
constexpr const inner_strides_type & strides () const noexcept
 Returns the strides of the container.
constexpr const inner_backstrides_type & backstrides () const noexcept
 Returns the backstrides of the container.
void fill (const T &value)
 Fills the container with the given value.
reference operator() (Args... args)
 Returns a reference to the element at the specified position in the container.
reference unchecked (Args... args)
 Returns a reference to the element at the specified position in the container.
reference element (It first, It last)
 Returns a reference to the element at the specified position in the container.
storage_type & storage () noexcept
 Returns a reference to the buffer containing the elements of the container.
pointer data () noexcept
 Returns a pointer to the underlying array serving as element storage.
const size_type data_offset () const noexcept
 Returns the offset to the first element in the container.
bool broadcast_shape (S &shape, bool reuse_cache=false) const
 Broadcast the shape of the container to the specified parameter.
bool has_linear_assign (const S &strides) const noexcept
 Checks whether the xcontainer can be linearly assigned to an expression with the specified strides.
stepper stepper_begin (const S &shape) noexcept
stepper stepper_end (const S &shape, layout_type l) noexcept
reference data_element (size_type i)
reference flat (size_type i)
 Returns a reference to the element at the specified position in the container storage (as if it was one dimensional).
void store_simd (size_type i, const simd &e)
container_simd_return_type_t< storage_type, value_type, requested_type > load_simd (size_type i) const
linear_iterator linear_begin () noexcept
linear_iterator linear_end () noexcept
const_linear_iterator linear_cbegin () const noexcept
const_linear_iterator linear_cend () const noexcept
reverse_linear_iterator linear_rbegin () noexcept
reverse_linear_iterator linear_rend () noexcept
const_reverse_linear_iterator linear_crbegin () const noexcept
const_reverse_linear_iterator linear_crend () const noexcept
Public Member Functions inherited from xt::xcontiguous_iterable< xtensor_view< EC, N, L, Tag > >
select_iterator< L > begin () noexcept
 Returns an iterator to the first element of the expression.
select_iterator< L > end () noexcept
 Returns an iterator to the element following the last element of the expression.
select_const_iterator< L > cbegin () const noexcept
 Returns a constant iterator to the first element of the expression.
select_const_iterator< L > cend () const noexcept
 Returns a constant iterator to the element following the last element of the expression.
select_reverse_iterator< L > rbegin () noexcept
 Returns an iterator to the first element of the reversed expression.
select_reverse_iterator< L > rend () noexcept
 Returns an iterator to the element following the last element of the reversed expression.
select_const_reverse_iterator< L > crbegin () const noexcept
 Returns a constant iterator to the first element of the reversed expression.
select_const_reverse_iterator< L > crend () const noexcept
 Returns a constant iterator to the element following the last element of the reversed expression.
Public Member Functions inherited from xt::xview_semantic< xtensor_view< EC, N, L, Tag > >
derived_type & assign_temporary (temporary_type &&)
 Assigns the temporary tmp to *this.
derived_type & assign_xexpression (const xexpression< E > &e)
derived_type & computed_assign (const xexpression< E > &e)
derived_type & scalar_computed_assign (const E &e, F &&f)
Public Member Functions inherited from xt::xsemantic_base< xtensor_view< EC, N, L, Tag > >
disable_xexpression< E, derived_type & > operator+= (const E &)
 Adds the scalar e to *this.
disable_xexpression< E, derived_type & > operator-= (const E &)
 Subtracts the scalar e from *this.
disable_xexpression< E, derived_type & > operator*= (const E &)
 Multiplies *this with the scalar e.
disable_xexpression< E, derived_type & > operator/= (const E &)
 Divides *this by the scalar e.
disable_xexpression< E, derived_type & > operator%= (const E &)
 Computes the remainder of *this after division by the scalar e.
disable_xexpression< E, derived_type & > operator&= (const E &)
 Computes the bitwise and of *this and the scalar e and assigns it to *this.
disable_xexpression< E, derived_type & > operator|= (const E &)
 Computes the bitwise or of *this and the scalar e and assigns it to *this.
disable_xexpression< E, derived_type & > operator^= (const E &)
 Computes the bitwise xor of *this and the scalar e and assigns it to *this.
derived_type & assign (const xexpression< E > &)
 Assigns the xexpression e to *this.
derived_type & plus_assign (const xexpression< E > &)
 Adds the xexpression e to *this.
derived_type & minus_assign (const xexpression< E > &)
 Subtracts the xexpression e to *this.
derived_type & multiplies_assign (const xexpression< E > &)
 Multiplies *this with the xexpression e.
derived_type & divides_assign (const xexpression< E > &)
 Divides *this by the xexpression e.
derived_type & modulus_assign (const xexpression< E > &)
 Computes the remainder of *this after division by the xexpression e.
derived_type & bit_and_assign (const xexpression< E > &)
 Computes the bitwise and of e to *this.
derived_type & bit_or_assign (const xexpression< E > &)
 Computes the bitwise or of e to *this.
derived_type & bit_xor_assign (const xexpression< E > &)
 Computes the bitwise xor of e to *this.

Friends

class xcontainer< xtensor_view< EC, N, L, Tag > >
class xview_semantic< xtensor_view< EC, N, L, Tag > >

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)

Additional Inherited Members

Static Public Attributes inherited from xt::xcontainer< xtensor_view< EC, N, L, Tag > >
static constexpr layout_type static_layout
static constexpr bool contiguous_layout
Static Public Attributes inherited from xt::xcontiguous_iterable< xtensor_view< EC, N, L, Tag > >
static constexpr layout_type static_layout
Protected Member Functions inherited from xt::xstrided_container< xtensor_view< EC, N, L, Tag > >
xstrided_container & operator= (const xstrided_container &)=default
inner_shape_type & shape_impl () noexcept
inner_strides_type & strides_impl () noexcept
inner_backstrides_type & backstrides_impl () noexcept
void reshape_impl (S &&shape, std::true_type, layout_type layout=base_type::static_layout)
layout_typemutable_layout () noexcept
Protected Member Functions inherited from xt::xcontainer< xtensor_view< EC, N, L, Tag > >
xcontainer & operator= (const xcontainer &)=default
container_iterator data_xbegin () noexcept
container_iterator data_xend (layout_type l, size_type offset) noexcept
derived_type & derived_cast () &noexcept
Protected Member Functions inherited from xt::xview_semantic< xtensor_view< EC, N, L, Tag > >
xview_semantic & operator= (const xview_semantic &)=default
Protected Member Functions inherited from xt::xsemantic_base< xtensor_view< EC, N, L, Tag > >
xsemantic_base & operator= (const xsemantic_base &)=default

Detailed Description

template<class EC, std::size_t N, layout_type L, class Tag>
class xt::xtensor_view< EC, N, L, Tag >

Dense multidimensional container adaptor with view semantics and fixed dimension.

The xtensor_view class implements a dense multidimensional container adaptor with viewsemantics and fixed dimension. It is used to provide a multidimensional container semantic and a view semantic to stl-like containers.

Template Parameters
ECThe closure for the container type to adapt.
NThe dimension of the view.
LThe layout_type of the view.
TagThe expression tag.
See also
xstrided_container, xcontainer

Definition at line 326 of file xtensor.hpp.

Member Typedef Documentation

◆ allocator_type

template<class EC, std::size_t N, layout_type L, class Tag>
using xt::xtensor_view< EC, N, L, Tag >::allocator_type = typename base_type::allocator_type

Definition at line 339 of file xtensor.hpp.

◆ backstrides_type

template<class EC, std::size_t N, layout_type L, class Tag>
using xt::xtensor_view< EC, N, L, Tag >::backstrides_type = typename base_type::backstrides_type

Definition at line 342 of file xtensor.hpp.

◆ base_type

template<class EC, std::size_t N, layout_type L, class Tag>
using xt::xtensor_view< EC, N, L, Tag >::base_type = xstrided_container<self_type>

Definition at line 335 of file xtensor.hpp.

◆ container_closure_type

template<class EC, std::size_t N, layout_type L, class Tag>
using xt::xtensor_view< EC, N, L, Tag >::container_closure_type = EC

Definition at line 332 of file xtensor.hpp.

◆ expression_tag

template<class EC, std::size_t N, layout_type L, class Tag>
using xt::xtensor_view< EC, N, L, Tag >::expression_tag = Tag

Definition at line 344 of file xtensor.hpp.

◆ extension_base

template<class EC, std::size_t N, layout_type L, class Tag>
using xt::xtensor_view< EC, N, L, Tag >::extension_base = extension::xtensor_adaptor_base_t<EC, N, L, Tag>

Definition at line 337 of file xtensor.hpp.

◆ self_type

template<class EC, std::size_t N, layout_type L, class Tag>
using xt::xtensor_view< EC, N, L, Tag >::self_type = xtensor_view<EC, N, L, Tag>

Definition at line 334 of file xtensor.hpp.

◆ semantic_base

template<class EC, std::size_t N, layout_type L, class Tag>
using xt::xtensor_view< EC, N, L, Tag >::semantic_base = xview_semantic<self_type>

Definition at line 336 of file xtensor.hpp.

◆ shape_type

template<class EC, std::size_t N, layout_type L, class Tag>
using xt::xtensor_view< EC, N, L, Tag >::shape_type = typename base_type::shape_type

Definition at line 340 of file xtensor.hpp.

◆ storage_type

template<class EC, std::size_t N, layout_type L, class Tag>
using xt::xtensor_view< EC, N, L, Tag >::storage_type = typename base_type::storage_type

Definition at line 338 of file xtensor.hpp.

◆ strides_type

template<class EC, std::size_t N, layout_type L, class Tag>
using xt::xtensor_view< EC, N, L, Tag >::strides_type = typename base_type::strides_type

Definition at line 341 of file xtensor.hpp.

◆ temporary_type

template<class EC, std::size_t N, layout_type L, class Tag>
using xt::xtensor_view< EC, N, L, Tag >::temporary_type = typename semantic_base::temporary_type

Definition at line 343 of file xtensor.hpp.

Constructor & Destructor Documentation

◆ xtensor_view() [1/4]

template<class EC, std::size_t N, layout_type L, class Tag>
xt::xtensor_view< EC, N, L, Tag >::xtensor_view ( storage_type && storage)
inline

Constructs an xtensor_view of the given stl-like container.

Parameters
storagethe container to adapt

Definition at line 741 of file xtensor.hpp.

◆ xtensor_view() [2/4]

template<class EC, std::size_t N, layout_type L, class Tag>
xt::xtensor_view< EC, N, L, Tag >::xtensor_view ( const storage_type & storage)
inline

Constructs an xtensor_view of the given stl-like container.

Parameters
storagethe container to adapt

Definition at line 752 of file xtensor.hpp.

◆ xtensor_view() [3/4]

template<class EC, std::size_t N, layout_type L, class Tag>
template<class D>
xt::xtensor_view< EC, N, L, Tag >::xtensor_view ( D && storage,
const shape_type & shape,
layout_type l = L )
inline

Constructs an xtensor_view of the given stl-like container, with the specified shape and layout_type.

Parameters
storagethe container to adapt
shapethe shape of the xtensor_view
lthe layout_type of the xtensor_view

Definition at line 767 of file xtensor.hpp.

◆ xtensor_view() [4/4]

template<class EC, std::size_t N, layout_type L, class Tag>
template<class D>
xt::xtensor_view< EC, N, L, Tag >::xtensor_view ( D && storage,
const shape_type & shape,
const strides_type & strides )
inline

Constructs an xtensor_view of the given stl-like container, with the specified shape and strides.

Parameters
storagethe container to adapt
shapethe shape of the xtensor_view
stridesthe strides of the xtensor_view

Definition at line 783 of file xtensor.hpp.

Member Function Documentation

◆ operator=() [1/4]

template<class EC, std::size_t N, layout_type L, class Tag>
template<class E>
auto xt::xtensor_view< EC, N, L, Tag >::operator= ( const E & e)
inline

Definition at line 826 of file xtensor.hpp.

◆ operator=() [2/4]

template<class EC, std::size_t N, layout_type L, class Tag>
template<class E>
auto xt::xtensor_view< EC, N, L, Tag >::operator= ( const xexpression< E > & e) -> self_type &
inline

The extended assignment operator.

Definition at line 817 of file xtensor.hpp.

◆ operator=() [3/4]

template<class EC, std::size_t N, layout_type L, class Tag>
auto xt::xtensor_view< EC, N, L, Tag >::operator= ( const xtensor_view< EC, N, L, Tag > & rhs)
inline

Definition at line 793 of file xtensor.hpp.

◆ operator=() [4/4]

template<class EC, std::size_t N, layout_type L, class Tag>
auto xt::xtensor_view< EC, N, L, Tag >::operator= ( xtensor_view< EC, N, L, Tag > && rhs)
inline

Definition at line 801 of file xtensor.hpp.

◆ xcontainer< xtensor_view< EC, N, L, Tag > >

template<class EC, std::size_t N, layout_type L, class Tag>
friend class xcontainer< xtensor_view< EC, N, L, Tag > >
friend

Definition at line 376 of file xtensor.hpp.

◆ xview_semantic< xtensor_view< EC, N, L, Tag > >

template<class EC, std::size_t N, layout_type L, class Tag>
friend class xview_semantic< xtensor_view< EC, N, L, Tag > >
friend

Definition at line 376 of file xtensor.hpp.


The documentation for this class was generated from the following file:
  • /home/runner/work/xtensor/xtensor/include/xtensor/containers/xtensor.hpp