#ifndef PYTHONIC_NUMPY_ARANGE_HPP #define PYTHONIC_NUMPY_ARANGE_HPP #include "pythonic/include/numpy/arange.hpp" #include "pythonic/operator_/pos.hpp" #include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" PYTHONIC_NS_BEGIN namespace numpy { template types::numpy_expr> arange(T begin, U end, S step, dtype d) { using R = typename dtype::type; long size; if (std::is_integral::value) size = std::max(R(0), R((end - begin + step - 1) / step)); else size = std::max(R(0), R(std::ceil((end - begin) / step))); return {details::arange_index{(R)begin, (R)step, size}}; } template types::numpy_expr::type>> arange(T end) { return arange>(T(0), end); } } PYTHONIC_NS_END #endif