xtensor
|
Expression with repeated values along an axis. More...
#include <xrepeat.hpp>
Public Member Functions | |
template<class CTA > | |
xrepeat (CTA &&e, R &&repeats, size_type axis) | |
Constructs an xrepeat expression repeating the element of the specified xexpression. | |
template<class... Args> | |
const_reference | operator() (Args... args) const |
template<class... Args> | |
const_reference | unchecked (Args... args) const |
template<class It > | |
const_reference | element (It first, It last) const |
size_type | size () const noexcept |
Returns the size of the expression. | |
size_type | shape (size_type index) const |
Returns the i-th dimension of the expression. | |
Size and shape | |
const shape_type & | shape () const noexcept |
Returns the shape of the expression. | |
layout_type | layout () const noexcept |
Returns the layout_type of the expression. | |
bool | is_contiguous () const noexcept |
Data | |
const xexpression_type & | expression () const noexcept |
Returns a constant reference to the underlying expression of the broadcast expression. | |
template<class... Args> | |
auto | operator() (Args... args) const -> const_reference |
Returns a constant reference to the element at the specified position in the expression. | |
template<class... Args> | |
auto | unchecked (Args... args) const -> const_reference |
Returns a constant reference to the element at the specified position in the expression. | |
template<class It > | |
auto | element (It first, It last) const -> const_reference |
Returns a constant reference to the element at the specified position in the view. | |
Public Member Functions inherited from xt::xconst_iterable< xrepeat< CT, R > > | |
const_layout_iterator< L > | begin () const noexcept |
const_broadcast_iterator< S, L > | begin (const S &shape) const noexcept |
const_layout_iterator< L > | end () const noexcept |
const_broadcast_iterator< S, L > | end (const S &shape) const noexcept |
const_layout_iterator< L > | cbegin () const noexcept |
const_broadcast_iterator< S, L > | cbegin (const S &shape) const noexcept |
const_layout_iterator< L > | cend () const noexcept |
const_broadcast_iterator< S, L > | cend (const S &shape) const noexcept |
const_reverse_layout_iterator< L > | rbegin () const noexcept |
const_reverse_broadcast_iterator< S, L > | rbegin (const S &shape) const noexcept |
const_reverse_layout_iterator< L > | rend () const noexcept |
const_reverse_broadcast_iterator< S, L > | rend (const S &shape) const noexcept |
const_reverse_layout_iterator< L > | crbegin () const noexcept |
const_reverse_broadcast_iterator< S, L > | crbegin (const S &shape) const noexcept |
const_reverse_layout_iterator< L > | crend () const noexcept |
const_reverse_broadcast_iterator< S, L > | crend (const S &shape) const noexcept |
auto | begin () const noexcept -> const_layout_iterator< L > |
Returns a constant iterator to the first element of the expression. | |
auto | end () const noexcept -> const_layout_iterator< L > |
Returns a constant iterator to the element following the last element of the expression. | |
auto | cbegin () const noexcept -> const_layout_iterator< L > |
Returns a constant iterator to the first element of the expression. | |
auto | cend () const noexcept -> const_layout_iterator< L > |
Returns a constant iterator to the element following the last element of the expression. | |
auto | begin (const S &shape) const noexcept -> const_broadcast_iterator< S, L > |
Returns a constant iterator to the first element of the expression. | |
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. | |
auto | cbegin (const S &shape) const noexcept -> const_broadcast_iterator< S, L > |
Returns a constant iterator to the first element of the expression. | |
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. | |
auto | rbegin () const noexcept -> const_reverse_layout_iterator< L > |
Returns a constant iterator to the first element of the reversed expression. | |
auto | rend () const noexcept -> const_reverse_layout_iterator< L > |
Returns a constant iterator to the element following the last element of the reversed expression. | |
auto | crbegin () const noexcept -> const_reverse_layout_iterator< L > |
Returns a constant iterator to the first element of the reversed expression. | |
auto | crend () const noexcept -> const_reverse_layout_iterator< L > |
Returns a constant iterator to the element following the last element of the reversed expression. | |
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. | |
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. | |
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. | |
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. | |
auto | get_cbegin (bool end_index) const noexcept -> const_layout_iterator< L > |
auto | get_cbegin (const S &shape, bool end_index) const noexcept -> const_broadcast_iterator< S, L > |
auto | get_cend (bool end_index) const noexcept -> const_layout_iterator< L > |
auto | get_cend (const S &shape, bool end_index) const noexcept -> const_broadcast_iterator< S, L > |
auto | get_stepper_begin (const S &shape) const noexcept -> const_stepper |
auto | get_stepper_end (const S &shape, layout_type l) const noexcept -> const_stepper |
Public Member Functions inherited from xt::xconst_accessible< xrepeat< CT, R > > | |
size_type | size () const noexcept |
Returns the size of the expression. | |
size_type | dimension () const noexcept |
Returns the number of dimensions of the expression. | |
size_type | shape (size_type index) const |
Returns the i-th dimension of the expression. | |
const_reference | at (Args... args) const |
auto | at (Args... args) const -> const_reference |
Returns a constant reference to the element at the specified position in the expression, after dimension and bounds checking. | |
disable_integral_t< S, const_reference > | operator[] (const S &index) const |
const_reference | operator[] (std::initializer_list< I > index) const |
const_reference | operator[] (size_type i) const |
auto | operator[] (const S &index) const -> disable_integral_t< S, const_reference > |
Returns a constant reference to the element at the specified position in the expression. | |
auto | operator[] (std::initializer_list< I > index) const -> const_reference |
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). | |
bool | in_bounds (Args... args) const |
Returns true only if the the specified position is a valid entry in the expression. | |
const_reference | front () const |
Returns a constant reference to first the element of the expression. | |
const_reference | back () const |
Returns a constant reference to last the element of the expression. | |
Public Member Functions inherited from xt::xexpression< D > | |
derived_type & | derived_cast () &noexcept |
Returns a reference to the actual derived type of the xexpression. | |
const derived_type & | derived_cast () const &noexcept |
Returns a constant reference to the actual derived type of the xexpression. | |
derived_type | derived_cast () &&noexcept |
Returns a constant reference to the actual derived type of the xexpression. | |
Static Public Attributes | |
static constexpr layout_type | static_layout = xexpression_type::static_layout |
static constexpr bool | contiguous_layout = false |
Broadcasting | |
template<class S > | |
bool | broadcast_shape (S &shape, bool reuse_cache=false) const |
Broadcast the shape of the function to the specified parameter. | |
template<class S > | |
bool | has_linear_assign (const S &strides) const noexcept |
Checks whether the xbroadcast can be linearly assigned to an expression with the specified strides. | |
const_stepper | stepper_begin () const |
const_stepper | stepper_begin (const shape_type &s) const |
const_stepper | stepper_end (layout_type l) const |
const_stepper | stepper_end (const shape_type &s, layout_type l) const |
template<class Arg , class... Args> | |
auto | access (Arg arg, Args... args) const -> const_reference |
template<std::size_t I, class Arg , class... Args> | |
auto | access_impl (stepper &&s, Arg arg, Args... args) const -> const_reference |
template<std::size_t I> | |
auto | access_impl (stepper &&s) const -> const_reference |
Expression with repeated values along an axis.
The xrepeat class implements the repetition of the elements of an xexpression along a given axis. xrepeat is not meant to be used directly, but only with the repeat helper functions.
Definition at line 96 of file xrepeat.hpp.
using xt::xrepeat< CT, R >::accessible_base = xconst_accessible<self_type> |
Definition at line 105 of file xrepeat.hpp.
using xt::xrepeat< CT, R >::bool_load_type = typename xexpression_type::bool_load_type |
Definition at line 122 of file xrepeat.hpp.
using xt::xrepeat< CT, R >::const_pointer = typename xexpression_type::const_pointer |
Definition at line 124 of file xrepeat.hpp.
using xt::xrepeat< CT, R >::const_reference = typename container_type::const_reference |
Definition at line 115 of file xrepeat.hpp.
using xt::xrepeat< CT, R >::const_stepper = typename iterable_type::const_stepper |
Definition at line 129 of file xrepeat.hpp.
using xt::xrepeat< CT, R >::container_type = xcontainer_inner_types<xrepeat<CT, R>> |
Definition at line 113 of file xrepeat.hpp.
using xt::xrepeat< CT, R >::difference_type = typename xexpression_type::difference_type |
Definition at line 125 of file xrepeat.hpp.
using xt::xrepeat< CT, R >::expression_tag = typename extension_base::expression_tag |
Definition at line 107 of file xrepeat.hpp.
Definition at line 106 of file xrepeat.hpp.
Definition at line 127 of file xrepeat.hpp.
using xt::xrepeat< CT, R >::pointer = typename xexpression_type::pointer |
Definition at line 123 of file xrepeat.hpp.
using xt::xrepeat< CT, R >::reference = typename container_type::reference |
Definition at line 114 of file xrepeat.hpp.
using xt::xrepeat< CT, R >::repeats_type = xtl::const_closure_type_t<R> |
Definition at line 111 of file xrepeat.hpp.
Definition at line 103 of file xrepeat.hpp.
using xt::xrepeat< CT, R >::shape_type = typename xexpression_type::shape_type |
Definition at line 110 of file xrepeat.hpp.
using xt::xrepeat< CT, R >::size_type = typename container_type::size_type |
Definition at line 116 of file xrepeat.hpp.
Definition at line 128 of file xrepeat.hpp.
using xt::xrepeat< CT, R >::temporary_type = typename container_type::temporary_type |
Definition at line 117 of file xrepeat.hpp.
using xt::xrepeat< CT, R >::value_type = typename xexpression_type::value_type |
Definition at line 109 of file xrepeat.hpp.
Definition at line 104 of file xrepeat.hpp.
|
explicit |
Constructs an xrepeat expression repeating the element of the specified xexpression.
e | the input expression |
repeats | The number of repetitions for each elements |
axis | The axis along which to repeat the value |
Definition at line 259 of file xrepeat.hpp.
|
inline |
Definition at line 417 of file xrepeat.hpp.
|
inline |
Definition at line 463 of file xrepeat.hpp.
|
inline |
Definition at line 455 of file xrepeat.hpp.
Broadcast the shape of the function to the specified parameter.
shape | the result shape |
reuse_cache | parameter for internal optimization |
Definition at line 390 of file xrepeat.hpp.
Returns a constant reference to the element at the specified position in the view.
first | iterator starting the sequence of indices |
last | iterator 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.. |
Definition at line 353 of file xrepeat.hpp.
Returns a constant reference to the underlying expression of the broadcast expression.
Definition at line 371 of file xrepeat.hpp.
Checks whether the xbroadcast can be linearly assigned to an expression with the specified strides.
Definition at line 402 of file xrepeat.hpp.
Definition at line 294 of file xrepeat.hpp.
Returns the layout_type of the expression.
Definition at line 288 of file xrepeat.hpp.
|
inline |
Returns a constant reference to the element at the specified position in the expression.
args | a list of indices specifying the position in the function. Indices must be unsigned integers, the number of indices should be equal or greater than the number of dimensions of the expression. |
Definition at line 313 of file xrepeat.hpp.
Returns the shape of the expression.
Definition at line 279 of file xrepeat.hpp.
|
inline |
Returns the i-th dimension of the expression.
Definition at line 41 of file xaccessible.hpp.
Returns the size of the expression.
Definition at line 39 of file xaccessible.hpp.
Definition at line 428 of file xrepeat.hpp.
|
inline |
Definition at line 434 of file xrepeat.hpp.
|
inline |
Definition at line 446 of file xrepeat.hpp.
|
inline |
Definition at line 440 of file xrepeat.hpp.
|
inline |
Returns a constant reference to the element at the specified position in the expression.
args | a list of indices specifying the position in the expression. Indices must be unsigned integers, the number of indices must be equal to the number of dimensions of the expression, else the behavior is undefined. |
Definition at line 339 of file xrepeat.hpp.
Definition at line 120 of file xrepeat.hpp.
|
staticconstexpr |
Definition at line 119 of file xrepeat.hpp.