� ��gE���ddlmZddlmZddlmZGd�de��Ze��Zed���Zdd�Z d �d �e d fd �Z dd �Z d�Z d�Z d�Zd S)�)�contextmanager)�local�� expand_mulc��eZdZd�ZdS)�DotProdSimpStatec��d|_dS�N)�state)�selfs �h/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/sympy/matrices/utilities.py�__init__zDotProdSimpState.__init__s ���� � � �N)�__name__� __module__� __qualname__r�rr rrs#����������rrc#�~K�tj} |t_dV�|t_dS#|t_wxYwr ��_dotprodsimp_stater )�x�olds r � dotprodsimpr sI���� � "�C�'�#$�� � ����#&�� � � ��3�� �&�&�&�&s�.�<Fc�(�ddlm}|||���S)z;Wrapper for simplify.dotprodsimp to avoid circular imports.r)r)�withsimp)�sympy.simplify.simplifyr)�exprr�dpss r � _dotprodsimprs)��:�:�:�:�:�:� �3�t�h� '� '� '�'rc��|Sr r�rs r �<lambda>r"s��Q�rc��|Sr rr!s r r"r"s��!�rNc�V�|dustjdur|S|dustjdur|S|S)aSupport function for controlling intermediate simplification. Returns a simplification function according to the global setting of dotprodsimp operation. ``deffunc`` - Function to be used by default. ``offfunc`` - Function to be used if dotprodsimp has been turned off. ``onfunc`` - Function to be used if dotprodsimp has been turned on. ``dotprodsimp`` - True, False or None. Will be overridden by global _dotprodsimp_state.state if that is not None. FTr)�deffunc�offfunc�onfuncrs r �_get_intermediate_simpr(sE���e���1�7�5�@�@����d���0�6�$�>�>�� � �Nrc�&�t|dd|��S)zYSame as ``_get_intermediate_simp`` but returns bools instead of functions by default.FT)r()�defaultrs r �_get_intermediate_simp_boolr+3s�� "�'�5�$� � D� D�Drc�$�t|dd��S)zReturns True if x is zero.�is_zeroN)�getattrr!s r �_iszeror/:s�� �1�i�� &� &�&rc�(�t|��dkS)zNTests by expand_mul only, suitable for polynomials and rational functions.rrr!s r �_is_zero_after_expand_mulr1?s�� �a�=�=�A� �rc�$�ddlm}||��S)z$ Wrapper to avoid circular imports. r)�simplify)rr3)rr3s r � _simplifyr4Es"��0�0�0�0�0�0� �8�D�>�>�r)F)FN)� contextlibr� threadingr�sympy.core.functionrrrrrr(r+r/r1r4rrr �<module>r8s��%�%�%�%�%�%�������*�*�*�*�*�*������u����&�%�'�'���'�'���'�(�(�(�(� $/�;� � �������*E�E�E�E�'�'�'� ��� ����r
Memory