xsort

Defined in xtensor/xsort.hpp

template <class E>
auto xt::sort(const xexpression<E> &e)
template <class E>
auto xt::sort(const xexpression<E> &e, placeholders::xtuph)
template <class E>
auto xt::sort(const xexpression<E> &e, std::size_t axis)

Sort xexpression (optionally along axis) The sort is performed using the std::sort functions.

A copy of the xexpression is created and returned.

Return
sorted array (copy)
Parameters
  • e: xexpression to sort
  • axis: axis along which sort is performed

template <class E>
auto xt::argmin(const xexpression<E> &e)
template <class E>
auto xt::argmin(const xexpression<E> &e, std::size_t axis)

Find position of minimal value in xexpression.

Return
returns xarray with positions of minimal value
Parameters
  • e: input xexpression
  • axis: select axis (or none)

template <class E>
auto xt::argmax(const xexpression<E> &e)
template <class E>
auto xt::argmax(const xexpression<E> &e, std::size_t axis)

Find position of maximal value in xexpression.

Return
returns xarray with positions of maximal value
Parameters
  • e: input xexpression
  • axis: select axis (or none)

template <class E>
auto xt::unique(const xexpression<E> &e)

Find unique elements of a xexpression.

This returns a flattened xtensor with sorted, unique elements from the original expression.

Parameters
  • e: input xexpression (will be flattened)