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/include/numpy/linalg/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/pythran/pythonic/include/numpy/linalg/norm.hpp
#ifndef PYTHONIC_INCLUDE_NUMPY_LINALG_NORM_HPP
#define PYTHONIC_INCLUDE_NUMPY_LINALG_NORM_HPP

#include "pythonic/include/numpy/sqrt.hpp"
#include "pythonic/include/builtins/pythran/abssqr.hpp"
#include "pythonic/include/numpy/sum.hpp"
#include "pythonic/include/numpy/asfarray.hpp"

PYTHONIC_NS_BEGIN
namespace numpy
{
  namespace linalg
  {
    template <class Array>
    auto norm(Array &&array, types::none_type ord = {},
              types::none_type axis = {})
        -> decltype(
            pythonic::numpy::functor::sqrt{}(pythonic::numpy::functor::sum{}(
                pythonic::builtins::pythran::functor::abssqr{}(
                    std::forward<Array>(array)))));

    template <class Array>
    using norm_dtype_t = typename std::conditional<
        std::is_floating_point<
            typename std::decay<Array>::type::dtype()>::value,
        typename std::decay<Array>::type::dtype(), double>::type;

    template <class Array>
    using norm_t = typename std::conditional<
        std::decay<Array>::type::value == 1, norm_dtype_t<Array>,
        types::ndarray<
            norm_dtype_t<Array>,
            types::array<long, std::decay<Array>::type::value - 1>>>::type;

    template <class Array>
    norm_t<Array> norm(Array &&array, double ord, types::none_type axis = {});

    template <class Array>
    norm_t<Array> norm(Array &&array, types::none_type ord, double axis);

    template <class Array>
    norm_t<Array> norm(Array &&array, double ord, long axis);

    template <class Array>
    norm_t<Array> norm(Array &&array, double ord, types::array<long, 1> axis);

    template <class Array>
    norm_t<Array> norm(Array &&array, double ord, types::array<long, 2> axis);
    DEFINE_FUNCTOR(pythonic::numpy::linalg, norm);
  }
}
PYTHONIC_NS_END

#endif

Youez - 2016 - github.com/yon3zu
LinuXploit