#ifndef PYTHONIC_NUMPY_CLIP_HPP #define PYTHONIC_NUMPY_CLIP_HPP #include "pythonic/include/numpy/clip.hpp" #include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" PYTHONIC_NS_BEGIN namespace numpy { namespace wrapper { template typename __combined::type clip(T const &v, Mi a_min, Ma a_max) { if (v < a_min) return a_min; else if (v > a_max) return a_max; else return v; } template typename __combined::type clip(T const &v, Mi a_min) { if (v < a_min) return a_min; else return v; } } #define NUMPY_NARY_FUNC_NAME clip #define NUMPY_NARY_FUNC_SYM wrapper::clip #include "pythonic/types/numpy_nary_expr.hpp" } PYTHONIC_NS_END #endif