#ifndef PYTHONIC_NUMPY_UNION1D_HPP #define PYTHONIC_NUMPY_UNION1D_HPP #include "pythonic/include/numpy/union1d.hpp" #include "pythonic/utils/functor.hpp" #include "pythonic/types/ndarray.hpp" #include PYTHONIC_NS_BEGIN namespace numpy { namespace { template void _union1d(I begin, I end, O &out, utils::int_<1>) { for (; begin != end; ++begin) out.insert(*begin); } template void _union1d(I begin, I end, O &out, utils::int_) { for (; begin != end; ++begin) _union1d((*begin).begin(), (*begin).end(), out, utils::int_()); } } template types::ndarray< typename __combined::type, types::pshape> union1d(E const &e, F const &f) { std::set::type> res; _union1d(e.begin(), e.end(), res, utils::int_()); _union1d(f.begin(), f.end(), res, utils::int_()); return {res}; } } PYTHONIC_NS_END #endif