xaccumulatorΒΆ

Defined in xtensor/xaccumulator.hpp

template <class F, class E, class EVS = evaluation_strategy::immediate, typename std::enable_if_t<!std::is_integral< EVS >::value, int > = 0>
auto xt::accumulate(F &&f, E &&e, EVS evaluation_strategy = EVS())

Accumulate and flatten array NOTE This function is not lazy!

Return
returns xarray<T> filled with accumulated values
Parameters
  • f: functor to use for accumulation
  • e: xexpression to be accumulated
  • evaluation_strategy: evaluation strategy of the accumulation

template <class F, class E, class EVS = evaluation_strategy::immediate>
auto xt::accumulate(F &&f, E &&e, std::ptrdiff_t axis, EVS evaluation_strategy = EVS())

Accumulate over axis NOTE This function is not lazy!

Return
returns xarray<T> filled with accumulated values
Parameters
  • f: Functor to use for accumulation
  • e: xexpression to accumulate
  • axis: Axis to perform accumulation over
  • evaluation_strategy: evaluation strategy of the accumulation