403Webshell
Server IP : 35.80.110.71  /  Your IP : 216.73.216.143
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/matplotlib/tri/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/matplotlib/tri/__pycache__/triangulation.cpython-312.pyc
�

G8�c�$��,�ddlZddlmZGd�d�Zy)�N)�_apic�v�eZdZdZd
d�Zd�Zed��Zd�Zd�Z	e
d��Ze
d	��Zd
�Z
ed��Zd�Zy)�
Triangulationa"
    An unstructured triangular grid consisting of npoints points and
    ntri triangles.  The triangles can either be specified by the user
    or automatically generated using a Delaunay triangulation.

    Parameters
    ----------
    x, y : (npoints,) array-like
        Coordinates of grid points.
    triangles : (ntri, 3) array-like of int, optional
        For each triangle, the indices of the three points that make
        up the triangle, ordered in an anticlockwise manner.  If not
        specified, the Delaunay triangulation is calculated.
    mask : (ntri,) array-like of bool, optional
        Which triangles are masked out.

    Attributes
    ----------
    triangles : (ntri, 3) array of int
        For each triangle, the indices of the three points that make
        up the triangle, ordered in an anticlockwise manner. If you want to
        take the *mask* into account, use `get_masked_triangles` instead.
    mask : (ntri, 3) array of bool
        Masked out triangles.
    is_delaunay : bool
        Whether the Triangulation is a calculated Delaunay
        triangulation (where *triangles* was not specified) or not.

    Notes
    -----
    For a Triangulation to be valid it must not have duplicate points,
    triangles formed from colinear points, or overlapping triangles.
    Nc�P�ddlm}tj|tj��|_tj|tj��|_|j
j|jjk7s|j
jdk7r9td|j
j�d|jj����d|_
d|_d|_d|_
|�(|j||�\|_|_d|_
�nH	tj |tj"d	�
�|_|jjdk7s|jjdd
k7r"td|jj����|jj%�t'|j
�k\r<tdt'|j
��d|jj%�����|jj)�dkr<tdt'|j
��d|jj)�����d|_d|_|j/|�y#t$r}td|���|�d}~wwxYw)Nr)�_qhull��dtype�z9x and y must be equal-length 1D arrays, but found shapes z and FT�C)r	�orderz*triangles must be a (N, 3) int array, not ��z6triangles must be a (N, 3) int array, but found shape zHtriangles are indices into the points and must be in the range 0 <= i < z but found value )�
matplotlibr�np�asarray�float64�x�y�shape�ndim�
ValueError�mask�_edges�
_neighbors�is_delaunay�delaunay�	triangles�array�int32�max�len�min�_cpp_triangulation�
_trifinder�set_mask)�selfrrrrr�es       �>/usr/lib/python3/dist-packages/matplotlib/tri/triangulation.py�__init__zTriangulation.__init__(s9��%����A�R�Z�Z�0������A�R�Z�Z�0����6�6�<�<�4�6�6�<�<�'�4�6�6�;�;�!�+;��-�-1�V�V�\�\�,<�E� $�����/�1�2�
2���	������� �����/5�o�o�a��.C�+�D�N�D�O�#�D��
:�!#���)�2�8�8�3�!O����~�~�"�"�a�'�4�>�>�+?�+?��+B�a�+G� �L��~�~�+�+�.�0�1�1��~�~�!�!�#�s�4�6�6�{�2� �&�&)�$�&�&�k�]�2C��~�~�)�)�+�,�.�/�/��~�~�!�!�#�a�'� �&�&)�$�&�&�k�]�2C��~�~�)�)�+�,�.�/�/�#'�������
�
�d���1�
:� �!M�$-�=�"2�3�89�:��
:�s�!+J�	J%�J � J%c�@�|j�j|�S)au
        Calculate plane equation coefficients for all unmasked triangles from
        the point (x, y) coordinates and specified z-array of shape (npoints).
        The returned array has shape (npoints, 3) and allows z-value at (x, y)
        position in triangle tri to be calculated using
        ``z = array[tri, 0] * x  + array[tri, 1] * y + array[tri, 2]``.
        )�get_cpp_triangulation�calculate_plane_coefficients)r&�zs  r(r,z*Triangulation.calculate_plane_coefficients[s���)�)�+�H�H��K�K�c�x�|j�#|j�j�|_|jS)aM
        Return integer array of shape (nedges, 2) containing all edges of
        non-masked triangles.

        Each row defines an edge by its start point index and end point
        index.  Each edge appears only once, i.e. for an edge between points
        *i*  and *j*, there will only be either *(i, j)* or *(j, i)*.
        )rr+�	get_edges�r&s r(�edgeszTriangulation.edgeses1���;�;���4�4�6�@�@�B�D�K��{�{�r.c	��ddlm}|j�c|j|j|j
|j|j|j|j|j�|_|jS)zc
        Return the underlying C++ Triangulation object, creating it
        if necessary.
        r)�_tri)rr4r#rrrrrrrr)r&r4s  r(r+z#Triangulation.get_cpp_triangulationsse��
	$��"�"�*�&*�&8�&8�����������	�	�4�;�;����T�%5�%5�!5�'7�D�#��&�&�&r.c�f�|j�|j|jS|jS)zL
        Return an array of triangles taking the mask into account.
        )rrr1s r(�get_masked_trianglesz"Triangulation.get_masked_triangless-���9�9� ��>�>�4�9�9�*�-�-��>�>�!r.c��t|dt�r7|^}}d|vrtjd�d|vrAtjd�n+tj	||�\}}}}}}t||||�}|||fS)a�
        Return a Triangulation object from the args and kwargs, and
        the remaining args and kwargs with the consumed values removed.

        There are two alternatives: either the first argument is a
        Triangulation object, in which case it is returned, or the args
        and kwargs are sufficient to create a new Triangulation to
        return.  In the latter case, see Triangulation.__init__ for
        the possible args and kwargs.
        rrzOPassing the keyword 'triangles' has no effect when also passing a TriangulationrzJPassing the keyword 'mask' has no effect when also passing a Triangulation)�
isinstancerr�
warn_external�_extract_triangulation_params)�args�kwargs�
triangulationrrrrs       r(�get_from_args_and_kwargsz&Triangulation.get_from_args_and_kwargs�s����d�1�g�}�-�#'� �M�D��f�$��"�"�.�/�����"�"�.�/�
�;�;�D�&�I�
0�A�q�)�T�4��)�!�Q�	�4�@�M��d�F�*�*r.c�L�|^}}}|jdd�}d}|�	|r|d}d}|�&	tj|tj��}|�#|j
dk7s|jddk7rd}|�|r|dd}|jd	d�}||||||fS#t$rd}Y�UwxYw)
NrFrTrr
r
rr)�poprrrrrr)r;r<rrr�	from_argsrs       r(r:z+Triangulation._extract_triangulation_params�s������1�t��J�J�{�D�1�	��	�����Q��I��I�� �
!��J�J�y����A�	�� �i�n�n��&9�&/�o�o�a�&8�A�&=��I�� �Y����8�D��z�z�&�$�'���!�Y��d�F�2�2���
!� �	�
!�s�%B�B#�"B#c�X�|j�ddlm}||�|_|jS)z�
        Return the default `matplotlib.tri.TriFinder` of this
        triangulation, creating it if necessary.  This allows the same
        TriFinder object to be easily shared.
        r)�TrapezoidMapTriFinder)r$�matplotlib.tri.trifinderrC)r&rCs  r(�
get_trifinderzTriangulation.get_trifinder�s'���?�?�"�F�3�D�9�D�O����r.c�x�|j�#|j�j�|_|jS)a�
        Return integer array of shape (ntri, 3) containing neighbor triangles.

        For each triangle, the indices of the three triangles that
        share the same edges, or -1 if there is no such neighboring
        triangle.  ``neighbors[i, j]`` is the triangle that is the neighbor
        to the edge from point index ``triangles[i, j]`` to point index
        ``triangles[i, (j+1)%3]``.
        )rr+�
get_neighborsr1s r(�	neighborszTriangulation.neighbors�s1���?�?�"�"�8�8�:�H�H�J�D�O����r.c��|�d|_n\tj|t��|_|jj|j
jdfk7rt
d��|j�%|jj|j�d|_	d|_
|j�|jj�yy)z�
        Set or clear the mask array.

        Parameters
        ----------
        mask : None or bool array of length ntri
        Nrrz3mask array must have same length as triangles array)
rrr�boolrrrr#r%rrr$�_initialize)r&rs  r(r%zTriangulation.set_mask�s����<��D�I��
�
�4�t�4�D�I��y�y���4�>�>�#7�#7��#:�"<�<� �"3�4�4��"�"�.��#�#�,�,�T�Y�Y�7��������?�?�&��O�O�'�'�)�'r.)NN)�__name__�
__module__�__qualname__�__doc__r)r,�propertyr2r+r6�staticmethodr>r:rErHr%�r.r(rrsx�� �B1�fL�����
'�"��+��+�6�3��3�,
�����*r.r)�numpyrrrrrRr.r(�<module>rTs����j*�j*r.

Youez - 2016 - github.com/yon3zu
LinuXploit