#ifndef PYTHONIC_INCLUDE_NUMPY_DIAG_HPP #define PYTHONIC_INCLUDE_NUMPY_DIAG_HPP #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/ndarray.hpp" #include "pythonic/include/utils/numpy_conversion.hpp" #include "pythonic/include/numpy/asarray.hpp" PYTHONIC_NS_BEGIN namespace numpy { template typename std::enable_if::value == 2, types::ndarray>>::type diag(types::ndarray const &a, long k = 0); template typename std::enable_if::value == 1, types::ndarray>>::type diag(types::ndarray const &a, long k = 0); template auto diag(types::list const &a, long k = 0) -> decltype(diag(asarray(a), k)); NUMPY_EXPR_TO_NDARRAY0_DECL(diag); DEFINE_FUNCTOR(pythonic::numpy, diag); } PYTHONIC_NS_END #endif