#ifndef PYTHONIC_NUMPY_ARRAY_HPP #define PYTHONIC_NUMPY_ARRAY_HPP #include "pythonic/include/numpy/array.hpp" #include "pythonic/utils/functor.hpp" #include "pythonic/utils/nested_container.hpp" #include "pythonic/types/ndarray.hpp" PYTHONIC_NS_BEGIN namespace numpy { template typename std::enable_if< types::has_size::type>::value, types::ndarray::type::value>>>::type array(T &&iterable, dtype d) { return {std::forward(iterable)}; } template typename std::enable_if< !types::has_size::type>::value && !types::is_dtype::type>::value, types::ndarray::type::value>>>::type array(T &&iterable, dtype d) { types::list::type::value_type> tmp{iterable.begin(), iterable.end()}; return {tmp}; } template typename std::enable_if< !types::has_size::type>::value && types::is_dtype::type>::value, typename dtype::type>::type array(T &&non_iterable, dtype d) { return non_iterable; } template types::ndarray>> array(std::tuple<>, dtype) { return {types::pshape>{}, types::none_type{}}; } template types::ndarray array(types::ndarray const &arr) { return arr.copy(); } template types::ndarray::shape_t> array(types::array_base const &a, dtype) { return {a}; } template types::ndarray::shape_t> array(types::array_base &&a, dtype) { return {std::move(a)}; } } PYTHONIC_NS_END #endif