403Webshell
Server IP : 217.160.0.212  /  Your IP : 216.73.216.141
Web Server : Apache
System : Linux www 6.18.51-i1-ampere #1196 SMP Fri Sep 11 20:43:55 CEST 2026 aarch64
User : sws1073854427 ( 1073854427)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/pythran/pythonic/numpy/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/pythran/pythonic/numpy//delete_.hpp
#ifndef PYTHONIC_NUMPY_DELETE_HPP
#define PYTHONIC_NUMPY_DELETE_HPP

#include "pythonic/include/numpy/delete_.hpp"

#include "pythonic/utils/functor.hpp"
#include "pythonic/types/ndarray.hpp"

PYTHONIC_NS_BEGIN

namespace numpy
{
  template <class T, class pS>
  types::ndarray<T, types::pshape<long>>
  delete_(types::ndarray<T, pS> const &a, long index, types::none_type axis)
  {
    types::ndarray<T, types::pshape<long>> out(
        types::pshape<long>(long(a.flat_size()) - 1), builtins::None);
    long n = a.flat_size();
    index = std::min(n, index);
    std::copy(a.buffer + index + 1, a.buffer + n,
              std::copy(a.buffer, a.buffer + index, out.buffer));
    return out;
  }

  template <class T, class pS, class I>
  typename std::enable_if<!std::is_scalar<I>::value,
                          types::ndarray<T, types::pshape<long>>>::type
  delete_(types::ndarray<T, pS> const &in, I const &indices,
          types::none_type axis)
  {
    types::ndarray<T, types::pshape<long>> out(
        types::pshape<long>(long(in.flat_size()) - indices.flat_size()),
        builtins::None);
    auto out_iter = out.buffer;
    auto in_iter = in.buffer;
    for (long index : indices) {
      out_iter = std::copy(in_iter, in.buffer + index, out_iter);
      in_iter = in.buffer + index + 1;
    }
    std::copy(in_iter, in.buffer + in.flat_size(), out_iter);
    return out;
  }

  NUMPY_EXPR_TO_NDARRAY0_IMPL(delete_);
}
PYTHONIC_NS_END

#endif

Youez - 2016 - github.com/yon3zu
LinuXploit