xrepeat

Defined in xtensor/xrepeat.hpp

template<class CT, class R>
class xrepeat : public xt::xiterable<xrepeat<CT, R>>, public xt::xaccessible<xrepeat<CT, R>>

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.

See

repeat

Public Functions

template<class CTA>
xrepeat(CTA &&e, R &&repeats, size_type axis)

Constructs an xrepeat expression repeating the element of the specified xexpression.

Parameters
  • e: the input expression

  • repeats: The number of repetitions for each elements

  • axis: The axis along which to repeat the value

auto shape() const

Returns the shape of the expression.

template<class ...Args>
auto operator()(Args... args) const

Returns a constant reference to the element at the specified position in the expression.

Parameters
  • 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.

template<class It>
auto element(It first, It last) const

Returns a constant reference to the element at the specified position in the view.

Parameters
  • 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..