xtensor
Loading...
Searching...
No Matches
xt::xfixed_adaptor< EC, S, L, SH, Tag > Class Template Reference

Dense multidimensional container adaptor with tensor semantic and fixed dimension. More...

#include <xfixed.hpp>

Inheritance diagram for xt::xfixed_adaptor< EC, S, L, SH, Tag >:
xt::xcontainer< xfixed_adaptor< EC, S, L, SH, Tag > > xt::xcontainer_semantic< xfixed_adaptor< EC, S, L, SH, Tag > > xt::xcontiguous_iterable< xfixed_adaptor< EC, S, L, SH, Tag > > xt::xaccessible< xfixed_adaptor< EC, S, L, SH, Tag > > xt::xsemantic_base< xfixed_adaptor< EC, S, L, SH, Tag > > xt::xiterable< xfixed_adaptor< EC, S, L, SH, Tag > >

Public Types

using container_closure_type = EC
using self_type = xfixed_adaptor<EC, S, L, SH, Tag>
using base_type = xcontainer<self_type>
using semantic_base = xcontainer_semantic<self_type>
using storage_type = typename base_type::storage_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 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 temporary_type = typename semantic_base::temporary_type
using expression_tag = Tag
Public Types inherited from xt::xcontainer< xfixed_adaptor< EC, S, L, SH, 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< xfixed_adaptor< EC, S, L, SH, 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::xcontainer_semantic< xfixed_adaptor< EC, S, L, SH, Tag > >
using base_type
using derived_type
using temporary_type
Public Types inherited from xt::xsemantic_base< xfixed_adaptor< EC, S, L, SH, Tag > >
using base_type
using derived_type
using temporary_type

Public Member Functions

 xfixed_adaptor (const xfixed_adaptor &)=default
 xfixed_adaptor (xfixed_adaptor &&)=default
template<class E>
xfixed_adaptoroperator= (const xexpression< E > &e)
Constructors
 xfixed_adaptor (storage_type &&data)
 Constructs an xfixed_adaptor of the given stl-like container.
 xfixed_adaptor (const storage_type &data)
 Constructs an xfixed_adaptor of the given stl-like container.
template<class D>
 xfixed_adaptor (D &&data)
 Constructs an xfixed_adaptor of the given stl-like container, with the specified shape and layout_type.
xfixed_adaptoroperator= (const xfixed_adaptor &)
xfixed_adaptoroperator= (xfixed_adaptor &&)
xfixed_adaptoroperator= (temporary_type &&)
Public Member Functions inherited from xt::xcontainer< xfixed_adaptor< EC, S, L, SH, 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< xfixed_adaptor< EC, S, L, SH, 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::xcontainer_semantic< xfixed_adaptor< EC, S, L, SH, 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< xfixed_adaptor< EC, S, L, SH, 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.

Static Public Attributes

static constexpr std::size_t N = S::size()
Static Public Attributes inherited from xt::xcontainer< xfixed_adaptor< EC, S, L, SH, Tag > >
static constexpr layout_type static_layout
static constexpr bool contiguous_layout
Static Public Attributes inherited from xt::xcontiguous_iterable< xfixed_adaptor< EC, S, L, SH, Tag > >
static constexpr layout_type static_layout

Friends

class xcontainer< xfixed_adaptor< EC, S, L, SH, Tag > >

Extended copy semantic

template<class ST = std::array<std::size_t, N>>
void resize (ST &&shape, bool force=false) const
 Note that the xfixed_adaptor cannot be resized.
template<class ST = shape_type>
void resize (ST &&shape, layout_type l) const
 Note that the xfixed_adaptor cannot be resized.
template<class ST = shape_type>
void resize (ST &&shape, const strides_type &strides) const
 Note that the xfixed_adaptor cannot be resized.
template<class ST = std::array<std::size_t, N>>
const auto & reshape (ST &&shape, layout_type layout=L) const
 Note that the xfixed_container cannot be reshaped to a shape different from S.
template<class ST>
bool broadcast_shape (ST &s, bool reuse_cache=false) const
constexpr layout_type layout () const noexcept
bool is_contiguous () const noexcept
template<class E>
auto operator= (const xexpression< E > &e) -> self_type &
 The extended assignment operator.

Additional Inherited Members

Protected Member Functions inherited from xt::xcontainer< xfixed_adaptor< EC, S, L, SH, 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::xcontainer_semantic< xfixed_adaptor< EC, S, L, SH, Tag > >
xcontainer_semantic & operator= (const xcontainer_semantic &)=default
Protected Member Functions inherited from xt::xsemantic_base< xfixed_adaptor< EC, S, L, SH, Tag > >
xsemantic_base & operator= (const xsemantic_base &)=default

Detailed Description

template<class EC, class S, layout_type L, bool SH, class Tag>
class xt::xfixed_adaptor< EC, S, L, SH, Tag >

Dense multidimensional container adaptor with tensor semantic and fixed dimension.

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

Template Parameters
ECThe closure for the container type to adapt.
SThe xshape template parameter for the fixed shape of the adaptor
LThe layout_type of the adaptor.
SHWether the adaptor can be used as a shared expression.
TagThe expression tag.

Definition at line 425 of file xfixed.hpp.

Member Typedef Documentation

◆ backstrides_type

template<class EC, class S, layout_type L, bool SH, class Tag>
using xt::xfixed_adaptor< EC, S, L, SH, Tag >::backstrides_type = typename base_type::backstrides_type

Definition at line 438 of file xfixed.hpp.

◆ base_type

template<class EC, class S, layout_type L, bool SH, class Tag>
using xt::xfixed_adaptor< EC, S, L, SH, Tag >::base_type = xcontainer<self_type>

Definition at line 433 of file xfixed.hpp.

◆ container_closure_type

template<class EC, class S, layout_type L, bool SH, class Tag>
using xt::xfixed_adaptor< EC, S, L, SH, Tag >::container_closure_type = EC

Definition at line 430 of file xfixed.hpp.

◆ expression_tag

template<class EC, class S, layout_type L, bool SH, class Tag>
using xt::xfixed_adaptor< EC, S, L, SH, Tag >::expression_tag = Tag

Definition at line 443 of file xfixed.hpp.

◆ inner_backstrides_type

template<class EC, class S, layout_type L, bool SH, class Tag>
using xt::xfixed_adaptor< EC, S, L, SH, Tag >::inner_backstrides_type = typename base_type::inner_backstrides_type

Definition at line 441 of file xfixed.hpp.

◆ inner_shape_type

template<class EC, class S, layout_type L, bool SH, class Tag>
using xt::xfixed_adaptor< EC, S, L, SH, Tag >::inner_shape_type = typename base_type::inner_shape_type

Definition at line 439 of file xfixed.hpp.

◆ inner_strides_type

template<class EC, class S, layout_type L, bool SH, class Tag>
using xt::xfixed_adaptor< EC, S, L, SH, Tag >::inner_strides_type = typename base_type::inner_strides_type

Definition at line 440 of file xfixed.hpp.

◆ self_type

template<class EC, class S, layout_type L, bool SH, class Tag>
using xt::xfixed_adaptor< EC, S, L, SH, Tag >::self_type = xfixed_adaptor<EC, S, L, SH, Tag>

Definition at line 432 of file xfixed.hpp.

◆ semantic_base

template<class EC, class S, layout_type L, bool SH, class Tag>
using xt::xfixed_adaptor< EC, S, L, SH, Tag >::semantic_base = xcontainer_semantic<self_type>

Definition at line 434 of file xfixed.hpp.

◆ shape_type

template<class EC, class S, layout_type L, bool SH, class Tag>
using xt::xfixed_adaptor< EC, S, L, SH, Tag >::shape_type = typename base_type::shape_type

Definition at line 436 of file xfixed.hpp.

◆ storage_type

template<class EC, class S, layout_type L, bool SH, class Tag>
using xt::xfixed_adaptor< EC, S, L, SH, Tag >::storage_type = typename base_type::storage_type

Definition at line 435 of file xfixed.hpp.

◆ strides_type

template<class EC, class S, layout_type L, bool SH, class Tag>
using xt::xfixed_adaptor< EC, S, L, SH, Tag >::strides_type = typename base_type::strides_type

Definition at line 437 of file xfixed.hpp.

◆ temporary_type

template<class EC, class S, layout_type L, bool SH, class Tag>
using xt::xfixed_adaptor< EC, S, L, SH, Tag >::temporary_type = typename semantic_base::temporary_type

Definition at line 442 of file xfixed.hpp.

Constructor & Destructor Documentation

◆ xfixed_adaptor() [1/3]

template<class EC, class S, layout_type L, bool SH, class Tag>
xt::xfixed_adaptor< EC, S, L, SH, Tag >::xfixed_adaptor ( storage_type && data)
inline

Constructs an xfixed_adaptor of the given stl-like container.

Parameters
datathe container to adapt

Definition at line 770 of file xfixed.hpp.

◆ xfixed_adaptor() [2/3]

template<class EC, class S, layout_type L, bool SH, class Tag>
xt::xfixed_adaptor< EC, S, L, SH, Tag >::xfixed_adaptor ( const storage_type & data)
inline

Constructs an xfixed_adaptor of the given stl-like container.

Parameters
datathe container to adapt

Definition at line 781 of file xfixed.hpp.

◆ xfixed_adaptor() [3/3]

template<class EC, class S, layout_type L, bool SH, class Tag>
template<class D>
xt::xfixed_adaptor< EC, S, L, SH, Tag >::xfixed_adaptor ( D && data)
inline

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

Parameters
datathe container to adapt

Definition at line 794 of file xfixed.hpp.

Member Function Documentation

◆ broadcast_shape()

template<class ET, class S, layout_type L, bool SH, class Tag>
template<class ST>
bool xt::xfixed_adaptor< ET, S, L, SH, Tag >::broadcast_shape ( ST & s,
bool reuse_cache = false ) const
inline

Definition at line 902 of file xfixed.hpp.

◆ is_contiguous()

template<class EC, class S, layout_type L, bool SH, class Tag>
bool xt::xfixed_adaptor< EC, S, L, SH, Tag >::is_contiguous ( ) const
inlinenoexcept

Definition at line 926 of file xfixed.hpp.

◆ layout()

template<class EC, class S, layout_type L, bool SH, class Tag>
layout_type xt::xfixed_adaptor< EC, S, L, SH, Tag >::layout ( ) const
constexprnoexcept

Definition at line 920 of file xfixed.hpp.

◆ operator=() [1/4]

template<class EC, class S, layout_type L, bool SH, class Tag>
template<class E>
auto xt::xfixed_adaptor< EC, S, L, SH, Tag >::operator= ( const xexpression< E > & e) -> self_type &
inline

The extended assignment operator.

Definition at line 835 of file xfixed.hpp.

◆ operator=() [2/4]

template<class EC, class S, layout_type L, bool SH, class Tag>
auto xt::xfixed_adaptor< EC, S, L, SH, Tag >::operator= ( const xfixed_adaptor< EC, S, L, SH, Tag > & rhs)
inline

Definition at line 803 of file xfixed.hpp.

◆ operator=() [3/4]

template<class EC, class S, layout_type L, bool SH, class Tag>
auto xt::xfixed_adaptor< EC, S, L, SH, Tag >::operator= ( temporary_type && rhs)
inline

Definition at line 819 of file xfixed.hpp.

◆ operator=() [4/4]

template<class EC, class S, layout_type L, bool SH, class Tag>
auto xt::xfixed_adaptor< EC, S, L, SH, Tag >::operator= ( xfixed_adaptor< EC, S, L, SH, Tag > && rhs)
inline

Definition at line 811 of file xfixed.hpp.

◆ reshape()

template<class ET, class S, layout_type L, bool SH, class Tag>
template<class ST>
const auto & xt::xfixed_adaptor< ET, S, L, SH, Tag >::reshape ( ST && shape,
layout_type layout = L ) const
inline

Note that the xfixed_container cannot be reshaped to a shape different from S.

Definition at line 890 of file xfixed.hpp.

◆ resize() [1/3]

template<class ET, class S, layout_type L, bool SH, class Tag>
template<class ST>
void xt::xfixed_adaptor< ET, S, L, SH, Tag >::resize ( ST && shape,
bool force = false ) const
inline

Note that the xfixed_adaptor cannot be resized.

Attempting to resize with a different size throws an assert in debug mode.

Definition at line 848 of file xfixed.hpp.

◆ resize() [2/3]

template<class ET, class S, layout_type L, bool SH, class Tag>
template<class ST>
void xt::xfixed_adaptor< ET, S, L, SH, Tag >::resize ( ST && shape,
const strides_type & strides ) const
inline

Note that the xfixed_adaptor cannot be resized.

Attempting to resize with a different size throws an assert in debug mode.

Definition at line 875 of file xfixed.hpp.

◆ resize() [3/3]

template<class ET, class S, layout_type L, bool SH, class Tag>
template<class ST>
void xt::xfixed_adaptor< ET, S, L, SH, Tag >::resize ( ST && shape,
layout_type l ) const
inline

Note that the xfixed_adaptor cannot be resized.

Attempting to resize with a different size throws an assert in debug mode.

Definition at line 860 of file xfixed.hpp.

◆ xcontainer< xfixed_adaptor< EC, S, L, SH, Tag > >

template<class EC, class S, layout_type L, bool SH, class Tag>
friend class xcontainer< xfixed_adaptor< EC, S, L, SH, Tag > >
friend

Definition at line 495 of file xfixed.hpp.

Member Data Documentation

◆ N

template<class EC, class S, layout_type L, bool SH, class Tag>
std::size_t xt::xfixed_adaptor< EC, S, L, SH, Tag >::N = S::size()
staticconstexpr

Definition at line 445 of file xfixed.hpp.


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