????
Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/guppy/etc/__pycache__/ |
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/guppy/etc/__pycache__/RE_Rect.cpython-311.pyc |
� ��V}�>� � � d Z ddlmZmZmZ G d� de� � Z G d� de� � Z G d� dee� � Zd � Z d � Z G d� d� � Z G d � dee� � Z G d� dee� � Z d� Zg dgfd�Zdgfd�Zd� Zd� ZdS )a� Support functions for RE simplification. This module is intended for use by the RE module. It is in a separate module to keep RE itself cleaner since the algorithm, 'rectangle selection', is a quite separate part that depends on some tricky heuristics. The primary entry function is chooserects(lines, gauges) It chooses 'the best' rectangles from lines to base simplification on. A weight on atoms is given by gauges. pr() gives some example usages of chooserects. � )� immbitset� mutbitset�immbitrangec �2 � e Zd ZdZd� Zd� Zd� Zd d�Zd� ZdS ) �Rect)�width�lines�gainmemo�lnos� all_lines�common_partc �^ � || _ || _ |rt |� � dk rJ �i | _ d S )N� )r r �lenr )�selfr r s �d/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib64/python3.11/site-packages/guppy/etc/RE_Rect.py�__init__z Rect.__init__ s4 � ��� ��� ��.�c�%�j�j�A�o�o�o�.��� � � � c � �� || _ t �fd�| j D � � � � | _ | � � � | _ d S )Nc �: �� g | ]}�t |� � ��S � ��id)�.0�line�lnobyids �r � <listcomp>zRect.init2.<locals>.<listcomp> s$ �� �H�H�H�T�w�r�$�x�x�0�H�H�Hr )r r r r �get_common_partr )r r r s ` r �init2z Rect.init2 sJ �� �"����H�H�H�H�T�Z�H�H�H�I�I�� ��/�/�1�1����r c �� � � � j }|| z }||k r|� _ � fd�|D � � � _ t |� � dk r!t � j d � � � _ d S d S )Nc �* �� g | ]}�j | ��S r )r )r �lnor s �r r z$Rect.reducelines.<locals>.<listcomp>+ s �� �>�>�>�#�$�.��-�>�>�>r r r )r r r r )r r �olnoss ` r �reducelineszRect.reducelines# sq �� � � ����u�}���5�=�=��D�I�>�>�>�>��>�>�>�D�J��t�9�9��>�>��T�Z��]�+�+�D�J�J�J� �>r r c �f � g }| j | z D ]"}|� | j | � � �#|S �N)r �appendr )r � pickednosr �is r � get_lineszRect.get_lines/ s@ � �����y�[�(� ,� ,�A��L�L����*�+�+�+�+��r c �V � d| j | j t | j � � | j fz S )Nz0< dir = %d width = %d lnos = %s lines = %s >)�dirr �listr r �r s r �__repr__z Rect.__repr__5 s, � �F��H�d�j�$�t�y�/�/�4�:�J?� ?� ?r N�r ) �__name__� __module__�__qualname__� __slots__r r r$ r* r/ r r r r r si � � � � � �P�I�� � �2� 2� 2� ,� ,� ,�� � � �?� ?� ?� ?� ?r r c �$ � e Zd ZdZdZd� Zdd�ZdS )�LeftRectr r c �6 � | j d d | j � S �Nr )r r r. s r r zLeftRect.get_common_part>