aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/pythran/pythran/pythonic/numpy/ufunc_accumulate.hpp
blob: 295d45b9e3b8e352c493154afd330d3e01fe7fb0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifndef UFUNC_NAME
#error missing UFUNC_NAME
#endif

// clang-format off
#include INCLUDE_FILE(pythonic/numpy,UFUNC_NAME)
// clang-format on
#include <pythonic/numpy/partial_sum.hpp>
#include "pythonic/utils/functor.hpp"

PYTHONIC_NS_BEGIN
namespace numpy
{
  namespace UFUNC_NAME
  {
    template <class T, class dtype>
    auto accumulate(T &&a, long axis, dtype d)
        -> decltype(partial_sum<numpy::functor::UFUNC_NAME>(std::forward<T>(a),
                                                            axis, d))
    {
      return partial_sum<numpy::functor::UFUNC_NAME>(std::forward<T>(a), axis,
                                                     d);
    }
  }
}
PYTHONIC_NS_END