xtensor
|
Broadcasted xexpression to a specified shape. More...
#include <xbroadcast.hpp>
Public Member Functions | |
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 |
template<class S > | |
const_stepper | stepper_begin (const S &shape) const noexcept |
template<class S > | |
const_stepper | stepper_end (const S &shape, layout_type l) const noexcept |
template<class E > | |
rebind_t< E > | build_broadcast (E &&e) 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. | |
Constructor | |
template<class CTA , class S > | |
xbroadcast (CTA &&e, const S &s) | |
Constructs an xbroadcast expression broadcasting the specified xexpression to the given shape. | |
template<class CTA > | |
xbroadcast (CTA &&e, shape_type &&s) | |
Constructs an xbroadcast expression broadcasting the specified xexpression to the given shape. | |
Size and shape | |
const inner_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, It last) const -> const_reference |
Returns a constant reference to the element at the specified position in the expression. | |
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. | |
template<class E , class XCT = CT, class = std::enable_if_t<xt::is_xscalar<XCT>::value>> | |
void | assign_to (xexpression< E > &e) const |
template<class S > | |
auto | stepper_begin (const S &shape) const noexcept -> const_stepper |
template<class S > | |
auto | stepper_end (const S &shape, layout_type l) const noexcept -> const_stepper |
template<class E > | |
auto | build_broadcast (E &&e) const -> rebind_t< E > |
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. | |
Public Member Functions inherited from xt::xconst_iterable< xbroadcast< CT, X > > | |
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< xbroadcast< CT, X > > | |
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. | |
Static Public Attributes | |
static constexpr layout_type | static_layout = layout_type::dynamic |
static constexpr bool | contiguous_layout = false |
Broadcasted xexpression to a specified shape.
The xbroadcast class implements the broadcasting of an xexpression to a specified shape. xbroadcast is not meant to be used directly, but only with the broadcast helper functions.
CT | the closure type of the xexpression to broadcast |
X | the type of the specified shape. |
Definition at line 158 of file xbroadcast.hpp.
using xt::xbroadcast< CT, X >::accessible_base = xconst_accessible<self_type> |
Definition at line 167 of file xbroadcast.hpp.
using xt::xbroadcast< CT, X >::bool_load_type = typename xexpression_type::bool_load_type |
Definition at line 187 of file xbroadcast.hpp.
using xt::xbroadcast< CT, X >::const_pointer = typename xexpression_type::const_pointer |
Definition at line 176 of file xbroadcast.hpp.
using xt::xbroadcast< CT, X >::const_reference = typename inner_types::const_reference |
Definition at line 174 of file xbroadcast.hpp.
using xt::xbroadcast< CT, X >::const_stepper = typename iterable_base::const_stepper |
Definition at line 185 of file xbroadcast.hpp.
using xt::xbroadcast< CT, X >::difference_type = typename xexpression_type::difference_type |
Definition at line 178 of file xbroadcast.hpp.
using xt::xbroadcast< CT, X >::expression_tag = typename extension_base::expression_tag |
Definition at line 169 of file xbroadcast.hpp.
Definition at line 168 of file xbroadcast.hpp.
using xt::xbroadcast< CT, X >::inner_shape_type = typename iterable_base::inner_shape_type |
Definition at line 181 of file xbroadcast.hpp.
using xt::xbroadcast< CT, X >::inner_types = xcontainer_inner_types<self_type> |
Definition at line 171 of file xbroadcast.hpp.
using xt::xbroadcast< CT, X >::iterable_base = xconst_iterable<self_type> |
Definition at line 180 of file xbroadcast.hpp.
using xt::xbroadcast< CT, X >::pointer = typename xexpression_type::const_pointer |
Definition at line 175 of file xbroadcast.hpp.
using xt::xbroadcast< CT, X >::rebind_t = xbroadcast<E, X> |
Definition at line 230 of file xbroadcast.hpp.
using xt::xbroadcast< CT, X >::reference = typename inner_types::reference |
Definition at line 173 of file xbroadcast.hpp.
Definition at line 165 of file xbroadcast.hpp.
Definition at line 182 of file xbroadcast.hpp.
using xt::xbroadcast< CT, X >::size_type = typename inner_types::size_type |
Definition at line 177 of file xbroadcast.hpp.
using xt::xbroadcast< CT, X >::stepper = typename iterable_base::stepper |
Definition at line 184 of file xbroadcast.hpp.
using xt::xbroadcast< CT, X >::value_type = typename xexpression_type::value_type |
Definition at line 172 of file xbroadcast.hpp.
Definition at line 166 of file xbroadcast.hpp.
Constructs an xbroadcast expression broadcasting the specified xexpression to the given shape.
e | the expression to broadcast |
s | the shape to apply |
Definition at line 288 of file xbroadcast.hpp.
|
inline |
Constructs an xbroadcast expression broadcasting the specified xexpression to the given shape.
e | the expression to broadcast |
s | the shape to apply |
Definition at line 309 of file xbroadcast.hpp.
|
inline |
Definition at line 467 of file xbroadcast.hpp.
Broadcast the shape of the function to the specified parameter.
shape | the result shape |
reuse_cache | parameter for internal optimization |
Definition at line 428 of file xbroadcast.hpp.
|
inline |
Definition at line 476 of file xbroadcast.hpp.
Returns a constant reference to the element at the specified position in the expression.
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 number of dimensions of the function. |
Definition at line 400 of file xbroadcast.hpp.
Returns a constant reference to the underlying expression of the broadcast expression.
Definition at line 409 of file xbroadcast.hpp.
Checks whether the xbroadcast can be linearly assigned to an expression with the specified strides.
Definition at line 440 of file xbroadcast.hpp.
Definition at line 341 of file xbroadcast.hpp.
|
inlinenoexcept |
Returns the layout_type of the expression.
Definition at line 335 of file xbroadcast.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 360 of file xbroadcast.hpp.
Returns the shape of the expression.
Definition at line 326 of file xbroadcast.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.
|
inlinenoexcept |
Definition at line 451 of file xbroadcast.hpp.
|
inlinenoexcept |
Definition at line 459 of file xbroadcast.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 386 of file xbroadcast.hpp.
Definition at line 190 of file xbroadcast.hpp.
|
staticconstexpr |
Definition at line 189 of file xbroadcast.hpp.