| Server IP : 217.160.0.135 / Your IP : 216.73.217.85 Web Server : Apache System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64 User : sws1074145052 ( 1074145052) PHP Version : 8.3.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /usr/lib/python3/dist-packages/scipy/spatial/__pycache__/ |
Upload File : |
�
d�c�� � �t � d dl ZddlmZmZ g d�Zdd�Zdd�Z G d� d � � Z G d
� de� � Z dd
�Z
dS )� N� )�cKDTree�cKDTreeNode)�minkowski_distance_p�minkowski_distance�distance_matrix� Rectangle�KDTree� c �> � t j | � � } t j |� � }t j t j | j |j � � d� � }| � |� � } |� |� � }|t j k r+t j t j || z
� � d�� � S |dk r+t j t j || z
� � d�� � S t j t j || z
� � |z d�� � S )aH Compute the pth power of the L**p distance between two arrays.
For efficiency, this function computes the L**p distance but does
not extract the pth root. If `p` is 1 or infinity, this is equal to
the actual L**p distance.
The last dimensions of `x` and `y` must be the same length. Any
other dimensions must be compatible for broadcasting.
Parameters
----------
x : (..., K) array_like
Input array.
y : (..., K) array_like
Input array.
p : float, 1 <= p <= infinity
Which Minkowski p-norm to use.
Returns
-------
dist : ndarray
pth power of the distance between the input arrays.
Examples
--------
>>> from scipy.spatial import minkowski_distance_p
>>> minkowski_distance_p([[0, 0], [0, 0]], [[1, 1], [0, 1]])
array([2, 1])
�float64���)�axisr ) �np�asarray�
promote_types�dtype�astype�inf�amax�abs�sum)�x�y�p�common_datatypes �7/usr/lib/python3/dist-packages/scipy/spatial/_kdtree.pyr r s� � �>