xtensor
|
Dense multidimensional container adaptor with tensor semantic and fixed dimension. More...
#include <xfixed.hpp>
Public Member Functions | |
xfixed_adaptor (const xfixed_adaptor &)=default | |
xfixed_adaptor (xfixed_adaptor &&)=default | |
template<class E > | |
xfixed_adaptor & | operator= (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_adaptor & | operator= (const xfixed_adaptor &) |
xfixed_adaptor & | operator= (xfixed_adaptor &&) |
xfixed_adaptor & | operator= (temporary_type &&) |
Public Member Functions inherited from xt::xcontainer< xfixed_adaptor< EC, S, L, SH, Tag > > | |
reference | operator() (Args... args) |
const_reference | operator() (Args... args) const |
reference | unchecked (Args... args) |
const_reference | unchecked (Args... args) const |
reference | element (It first, It last) |
const_reference | element (It first, It last) const |
stepper | stepper_begin (const S &shape) noexcept |
const_stepper | stepper_begin (const S &shape) const noexcept |
stepper | stepper_end (const S &shape, layout_type l) noexcept |
const_stepper | stepper_end (const S &shape, layout_type l) const noexcept |
container_simd_return_type_t< storage_type, value_type, requested_type > | load_simd (size_type i) const |
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. | |
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. | |
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 | 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). | |
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. | |
auto | operator() (Args... args) -> reference |
Returns a reference to the element at the specified position in the container. | |
auto | operator() (Args... args) const -> const_reference |
Returns a constant reference to the element at the specified position in the container. | |
auto | unchecked (Args... args) -> reference |
Returns a reference to the element at the specified position in the container. | |
auto | unchecked (Args... args) const -> const_reference |
Returns a constant reference to the element at the specified position in the container. | |
auto | element (It first, It last) -> reference |
Returns a reference to the element at the specified position in the container. | |
auto | element (It first, It last) const -> const_reference |
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. | |
const storage_type & | storage () const noexcept |
Returns a constant 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_pointer | data () const noexcept |
Returns a constant 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. | |
auto | stepper_begin (const S &shape) noexcept -> stepper |
auto | stepper_begin (const S &shape) const noexcept -> const_stepper |
auto | stepper_end (const S &shape, layout_type l) noexcept -> stepper |
auto | stepper_end (const S &shape, layout_type l) const noexcept -> const_stepper |
reference | data_element (size_type i) |
const_reference | data_element (size_type i) const |
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). | |
const_reference | flat (size_type i) const |
Returns a constant 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) |
auto | load_simd (size_type i) const -> container_simd_return_type_t< storage_type, value_type, requested_type > |
linear_iterator | linear_begin () noexcept |
const_linear_iterator | linear_begin () const noexcept |
linear_iterator | linear_end () noexcept |
const_linear_iterator | linear_end () const noexcept |
const_linear_iterator | linear_cbegin () const noexcept |
const_linear_iterator | linear_cend () const noexcept |
reverse_linear_iterator | linear_rbegin () noexcept |
const_reverse_linear_iterator | linear_rbegin () const noexcept |
reverse_linear_iterator | linear_rend () noexcept |
const_reverse_linear_iterator | linear_rend () const noexcept |
const_reverse_linear_iterator | linear_crbegin () const noexcept |
const_reverse_linear_iterator | linear_crend () const noexcept |
Public Member Functions inherited from xt::xcontiguous_iterable< D > | |
template<layout_type L = ::xt::layout_type::row_major> | |
select_iterator< L > | begin () noexcept |
template<layout_type L = ::xt::layout_type::row_major> | |
select_iterator< L > | end () noexcept |
template<layout_type L = ::xt::layout_type::row_major> | |
select_const_iterator< L > | begin () const noexcept |
template<layout_type L = ::xt::layout_type::row_major> | |
select_const_iterator< L > | end () const noexcept |
template<layout_type L = ::xt::layout_type::row_major> | |
select_const_iterator< L > | cbegin () const noexcept |
template<layout_type L = ::xt::layout_type::row_major> | |
select_const_iterator< L > | cend () const noexcept |
template<layout_type L = ::xt::layout_type::row_major> | |
select_reverse_iterator< L > | rbegin () noexcept |
template<layout_type L = ::xt::layout_type::row_major> | |
select_reverse_iterator< L > | rend () noexcept |
template<layout_type L = ::xt::layout_type::row_major> | |
select_const_reverse_iterator< L > | rbegin () const noexcept |
template<layout_type L = ::xt::layout_type::row_major> | |
select_const_reverse_iterator< L > | rend () const noexcept |
template<layout_type L = ::xt::layout_type::row_major> | |
select_const_reverse_iterator< L > | crbegin () const noexcept |
template<layout_type L = ::xt::layout_type::row_major> | |
select_const_reverse_iterator< L > | crend () const noexcept |
template<layout_type L = ::xt::layout_type::row_major, class S > | |
broadcast_iterator< S, L > | begin (const S &shape) noexcept |
template<layout_type L = ::xt::layout_type::row_major, class S > | |
broadcast_iterator< S, L > | end (const S &shape) noexcept |
template<layout_type L = ::xt::layout_type::row_major, class S > | |
const_broadcast_iterator< S, L > | begin (const S &shape) const noexcept |
template<layout_type L = ::xt::layout_type::row_major, class S > | |
const_broadcast_iterator< S, L > | end (const S &shape) const noexcept |
template<layout_type L = ::xt::layout_type::row_major, class S > | |
const_broadcast_iterator< S, L > | cbegin (const S &shape) const noexcept |
template<layout_type L = ::xt::layout_type::row_major, class S > | |
const_broadcast_iterator< S, L > | cend (const S &shape) const noexcept |
template<layout_type L = ::xt::layout_type::row_major, class S > | |
reverse_broadcast_iterator< S, L > | rbegin (const S &shape) noexcept |
template<layout_type L = ::xt::layout_type::row_major, class S > | |
reverse_broadcast_iterator< S, L > | rend (const S &shape) noexcept |
template<layout_type L = ::xt::layout_type::row_major, class S > | |
const_reverse_broadcast_iterator< S, L > | rbegin (const S &shape) const noexcept |
template<layout_type L = ::xt::layout_type::row_major, class S > | |
const_reverse_broadcast_iterator< S, L > | rend (const S &shape) const noexcept |
template<layout_type L = ::xt::layout_type::row_major, class S > | |
const_reverse_broadcast_iterator< S, L > | crbegin (const S &shape) const noexcept |
template<layout_type L = ::xt::layout_type::row_major, class S > | |
const_reverse_broadcast_iterator< S, L > | crend (const S &shape) const noexcept |
template<layout_type L> | |
auto | begin () noexcept -> select_iterator< L > |
Returns an iterator to the first element of the expression. | |
template<layout_type L> | |
auto | end () noexcept -> select_iterator< L > |
Returns an iterator to the element following the last element of the expression. | |
template<layout_type L> | |
auto | begin () const noexcept -> select_const_iterator< L > |
Returns a constant iterator to the first element of the expression. | |
template<layout_type L> | |
auto | end () const noexcept -> select_const_iterator< L > |
Returns a constant iterator to the element following the last element of the expression. | |
template<layout_type L> | |
auto | cbegin () const noexcept -> select_const_iterator< L > |
Returns a constant iterator to the first element of the expression. | |
template<layout_type L> | |
auto | cend () const noexcept -> select_const_iterator< L > |
Returns a constant iterator to the element following the last element of the expression. | |
template<layout_type L> | |
auto | rbegin () noexcept -> select_reverse_iterator< L > |
Returns an iterator to the first element of the reversed expression. | |
template<layout_type L> | |
auto | rend () noexcept -> select_reverse_iterator< L > |
Returns an iterator to the element following the last element of the reversed expression. | |
template<layout_type L> | |
auto | rbegin () const noexcept -> select_const_reverse_iterator< L > |
Returns a constant iterator to the first element of the reversed expression. | |
template<layout_type L> | |
auto | rend () const noexcept -> select_const_reverse_iterator< L > |
Returns a constant iterator to the element following the last element of the reversed expression. | |
template<layout_type L> | |
auto | crbegin () const noexcept -> select_const_reverse_iterator< L > |
Returns a constant iterator to the first element of the reversed expression. | |
template<layout_type L> | |
auto | crend () const noexcept -> select_const_reverse_iterator< L > |
Returns a constant iterator to the element following the last element of the reversed expression. | |
template<layout_type L, class S > | |
auto | begin (const S &shape) noexcept -> broadcast_iterator< S, L > |
Returns an iterator to the first element of the expression. | |
template<layout_type L, class S > | |
auto | end (const S &shape) noexcept -> broadcast_iterator< S, L > |
Returns an iterator to the element following the last element of the expression. | |
template<layout_type L, class S > | |
auto | begin (const S &shape) const noexcept -> const_broadcast_iterator< S, L > |
Returns a constant iterator to the first element of the expression. | |
template<layout_type L, class S > | |
auto | end (const S &shape) const noexcept -> const_broadcast_iterator< S, L > |
Returns a constant iterator to the element following the last element of the expression. | |
template<layout_type L, class S > | |
auto | cbegin (const S &shape) const noexcept -> const_broadcast_iterator< S, L > |
Returns a constant iterator to the first element of the expression. | |
template<layout_type L, class S > | |
auto | cend (const S &shape) const noexcept -> const_broadcast_iterator< S, L > |
Returns a constant iterator to the element following the last element of the expression. | |
template<layout_type L, class S > | |
auto | rbegin (const S &shape) noexcept -> reverse_broadcast_iterator< S, L > |
Returns an iterator to the first element of the reversed expression. | |
template<layout_type L, class S > | |
auto | rend (const S &shape) noexcept -> reverse_broadcast_iterator< S, L > |
Returns an iterator to the element following the last element of the reversed expression. | |
template<layout_type L, class S > | |
auto | rbegin (const S &shape) const noexcept -> const_reverse_broadcast_iterator< S, L > |
Returns a constant iterator to the first element of the reversed expression. | |
template<layout_type L, class S > | |
auto | rend (const S &shape) const noexcept -> const_reverse_broadcast_iterator< S, L > |
Returns a constant iterator to the element following the last element of the reversed expression. | |
template<layout_type L, class S > | |
auto | crbegin (const S &shape) const noexcept -> const_reverse_broadcast_iterator< S, L > |
Returns a constant iterator to the first element of the reversed expression. | |
template<layout_type L, class S > | |
auto | crend (const S &shape) const noexcept -> const_reverse_broadcast_iterator< S, L > |
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_xexpression (const xexpression< E > &e) |
derived_type & | computed_assign (const xexpression< E > &e) |
derived_type & | scalar_computed_assign (const E &e, F &&f) |
derived_type & | assign_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 > &e) -> 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 & |
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< D > | |
static constexpr layout_type | static_layout = inner_types::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. | |
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.
EC | The closure for the container type to adapt. |
S | The xshape template parameter for the fixed shape of the adaptor |
L | The layout_type of the adaptor. |
SH | Wether the adaptor can be used as a shared expression. |
Tag | The expression tag. |
Definition at line 446 of file xfixed.hpp.
using xt::xfixed_adaptor< EC, S, L, SH, Tag >::backstrides_type = typename base_type::backstrides_type |
Definition at line 459 of file xfixed.hpp.
using xt::xfixed_adaptor< EC, S, L, SH, Tag >::base_type = xcontainer<self_type> |
Definition at line 454 of file xfixed.hpp.
Definition at line 451 of file xfixed.hpp.
Definition at line 464 of file xfixed.hpp.
using xt::xfixed_adaptor< EC, S, L, SH, Tag >::inner_backstrides_type = typename base_type::inner_backstrides_type |
Definition at line 462 of file xfixed.hpp.
using xt::xfixed_adaptor< EC, S, L, SH, Tag >::inner_shape_type = typename base_type::inner_shape_type |
Definition at line 460 of file xfixed.hpp.
using xt::xfixed_adaptor< EC, S, L, SH, Tag >::inner_strides_type = typename base_type::inner_strides_type |
Definition at line 461 of file xfixed.hpp.
Definition at line 453 of file xfixed.hpp.
using xt::xfixed_adaptor< EC, S, L, SH, Tag >::semantic_base = xcontainer_semantic<self_type> |
Definition at line 455 of file xfixed.hpp.
Definition at line 457 of file xfixed.hpp.
Definition at line 456 of file xfixed.hpp.
Definition at line 458 of file xfixed.hpp.
using xt::xfixed_adaptor< EC, S, L, SH, Tag >::temporary_type = typename semantic_base::temporary_type |
Definition at line 463 of file xfixed.hpp.
Constructs an xfixed_adaptor of the given stl-like container.
data | the container to adapt |
Definition at line 806 of file xfixed.hpp.
Constructs an xfixed_adaptor of the given stl-like container.
data | the container to adapt |
Definition at line 817 of file xfixed.hpp.
Constructs an xfixed_adaptor of the given stl-like container, with the specified shape and layout_type.
data | the container to adapt |
Definition at line 830 of file xfixed.hpp.
|
inline |
Definition at line 938 of file xfixed.hpp.
Definition at line 962 of file xfixed.hpp.
|
constexprnoexcept |
Definition at line 956 of file xfixed.hpp.
|
inline |
The extended assignment operator.
Definition at line 871 of file xfixed.hpp.
|
inline |
Definition at line 839 of file xfixed.hpp.
Definition at line 855 of file xfixed.hpp.
|
inline |
Definition at line 847 of file xfixed.hpp.
|
inline |
Note that the xfixed_container cannot be reshaped to a shape different from S
.
Definition at line 926 of file xfixed.hpp.
|
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 884 of file xfixed.hpp.
|
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 911 of file xfixed.hpp.
|
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 896 of file xfixed.hpp.
|
friend |
Definition at line 516 of file xfixed.hpp.
Definition at line 466 of file xfixed.hpp.