#ifndef PYTHONIC_UTILS_ARRAY_HELPER_HPP #define PYTHONIC_UTILS_ARRAY_HELPER_HPP #include "pythonic/include/utils/array_helper.hpp" #include "pythonic/types/tuple.hpp" PYTHONIC_NS_BEGIN /* recursively return the value at the position given by `indices' in the * `self' "array like". It may be a sub array instead of real value. * indices[0] is the coordinate for the first dimension && indices[M-1] is * for the last one. */ template template auto nget::operator()(A &&self, types::array const &indices) -> decltype(nget()(std::forward(self)[0], indices)) { return nget()(std::forward(self)[indices[M - L - 1]], indices); } template template auto nget::fast(A &&self, types::array const &indices) -> decltype(nget().fast(std::forward(self).fast(0), indices)) { return nget().fast(std::forward(self).fast(indices[M - L - 1]), indices); } template auto nget<0>::operator()(A &&self, types::array const &indices) -> decltype(std::forward(self)[indices[M - 1]]) { return std::forward(self)[indices[M - 1]]; } template auto nget<0>::fast(A &&self, types::array const &indices) -> decltype(std::forward(self).fast(indices[M - 1])) { return std::forward(self).fast(indices[M - 1]); } PYTHONIC_NS_END #endif