+
    .åûjÝ  ã                   ó~   € R t ^ RIHtHtHtHtHtHtH	t
 ^ RIHt ^ RIHt ^ RIHt ^ RIHt ] ! R R]4      4       tR# )	z2Implementation of :class:`GMPYIntegerRing` class. )ÚGMPYIntegerÚSymPyIntegerÚ	factorialÚ
gmpy_gcdexÚgmpy_gcdÚgmpy_lcmÚsqrt)Ú
int_valued)ÚIntegerRing)ÚCoercionFailed)Úpublicc                   óÂ   a € ] tR t^t o Rt]t]! ^ 4      t]! ^4      t]	! ]4      t
RtR tR tR tR tR tR tR	 tR
 tR tR tR tR tR tR tR tR tR tRtV tR# )ÚGMPYIntegerRingz§Integer ring based on GMPY's ``mpz`` type.

This will be the implementation of :ref:`ZZ` if ``gmpy`` or ``gmpy2`` is
installed. Elements will be of type ``gmpy.mpz``.
ÚZZ_gmpyc                ó   € R# )z$Allow instantiation of this domain. N© )Úselfs   &Ú_C:\Ai_Coding\apps\studio\ComfyUI\.venv\Lib\site-packages\sympy\polys\domains\gmpyintegerring.pyÚ__init__ÚGMPYIntegerRing.__init__   s   ‚ ó    c                ó*   € \        \        V4      4      # )z!Convert ``a`` to a SymPy object. )r   Úint©r   Úas   &&r   Úto_sympyÚGMPYIntegerRing.to_sympy   s   € äœC ›FÓ#Ð#r   c                ó¾   € VP                   '       d   \        VP                  4      # \        V4      '       d   \        \	        V4      4      # \        RV,          4      h)z&Convert SymPy's Integer to ``dtype``. zexpected an integer, got %s)Ú
is_Integerr   Úpr	   r   r   r   s   &&r   Ú
from_sympyÚGMPYIntegerRing.from_sympy#   sC   € à�<�<ˆ<Ü˜qŸs™sÓ#Ð#Ü˜�]Š]Üœs 1›vÓ&Ð&ä Ð!>ÀÕ!BÓCÐCr   c                ó$   € VP                  V4      # )z3Convert ``ModularInteger(int)`` to GMPY's ``mpz``. ©Úto_int©ÚK1r   ÚK0s   &&&r   Úfrom_FF_pythonÚGMPYIntegerRing.from_FF_python,   ó   € à�y‰y˜‹|Ðr   c                ó   € \        V4      # )z,Convert Python's ``int`` to GMPY's ``mpz``. )r   r%   s   &&&r   Úfrom_ZZ_pythonÚGMPYIntegerRing.from_ZZ_python0   s   € ä˜1‹~Ðr   c                óR   € VP                   ^8X  d   \        VP                  4      # R# ©z1Convert Python's ``Fraction`` to GMPY's ``mpz``. N©Údenominatorr   Ú	numeratorr%   s   &&&r   Úfrom_QQÚGMPYIntegerRing.from_QQ4   ó"   € à�=‰=˜AÔÜ˜qŸ{™{Ó+Ð+ñ r   c                óR   € VP                   ^8X  d   \        VP                  4      # R# r/   r0   r%   s   &&&r   Úfrom_QQ_pythonÚGMPYIntegerRing.from_QQ_python9   r5   r   c                ó$   € VP                  V4      # )z3Convert ``ModularInteger(mpz)`` to GMPY's ``mpz``. r#   r%   s   &&&r   Úfrom_FF_gmpyÚGMPYIntegerRing.from_FF_gmpy>   r*   r   c                ó   € V# )z*Convert GMPY's ``mpz`` to GMPY's ``mpz``. r   r%   s   &&&r   Úfrom_ZZ_gmpyÚGMPYIntegerRing.from_ZZ_gmpyB   s   € àˆr   c                ó@   € VP                   ^8X  d   VP                  # R# )z(Convert GMPY ``mpq`` to GMPY's ``mpz``. N)r1   r2   r%   s   &&&r   Úfrom_QQ_gmpyÚGMPYIntegerRing.from_QQ_gmpyF   s   € à�=‰=˜AÔØ—;‘;Ðñ r   c                óP   € VP                  V4      w  r4V^8X  d   \        V4      # R# )z,Convert mpmath's ``mpf`` to GMPY's ``mpz``. N)Úto_rationalr   )r&   r   r'   r   Úqs   &&&  r   Úfrom_RealFieldÚGMPYIntegerRing.from_RealFieldK   s(   € à�~‰~˜aÓ ‰ˆà�Œ6Ü˜q“>Ð!ñ r   c                ó@   € VP                   ^ 8X  d   VP                  # R# )é    N)ÚyÚxr%   s   &&&r   Úfrom_GaussianIntegerRingÚ(GMPYIntegerRing.from_GaussianIntegerRingR   s   € Ø�3‰3�!Œ8Ø—3‘3ˆJñ r   c                ó&   € \        W4      w  r4pWEV3# )z)Compute extended GCD of ``a`` and ``b``. )r   )r   r   ÚbÚhÚsÚts   &&&   r   ÚgcdexÚGMPYIntegerRing.gcdexV   s   € ä˜QÓ"‰ˆˆaØ�Qˆwˆr   c                ó   € \        W4      # )z Compute GCD of ``a`` and ``b``. )r   ©r   r   rN   s   &&&r   ÚgcdÚGMPYIntegerRing.gcd[   ó   € ä˜‹~Ðr   c                ó   € \        W4      # )z Compute LCM of ``a`` and ``b``. )r   rU   s   &&&r   ÚlcmÚGMPYIntegerRing.lcm_   rX   r   c                ó   € \        V4      # )zCompute square root of ``a``. )Ú	gmpy_sqrtr   s   &&r   r   ÚGMPYIntegerRing.sqrtc   s   € ä˜‹|Ðr   c                ó   € \        V4      # )zCompute factorial of ``a``. )Úgmpy_factorialr   s   &&r   r   ÚGMPYIntegerRing.factorialg   s   € ä˜aÓ Ð r   r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   ÚdtypeÚzeroÚoneÚtypeÚtpÚaliasr   r   r    r(   r,   r3   r7   r:   r=   r@   rE   rK   rR   rV   rZ   r   r   Ú__static_attributes__Ú__classdictcell__)Ú__classdict__s   @r   r   r      sŒ   ø‡ € ñð €EÙ�‹8€DÙ
�‹(€CÙ	ˆc‹€BØ€Eò3ò$òDòòò,ò
,ò
òòò
"òòò
òò÷!ð !r   r   N)rf   Úsympy.polys.domains.groundtypesr   r   r   r`   r   r   r   r   r]   Úsympy.core.numbersr	   Úsympy.polys.domains.integerringr
   Úsympy.polys.polyerrorsr   Úsympy.utilitiesr   r   r   r   r   Ú<module>ru      sA   ðÙ 8÷÷ ñ õ
 *Ý 7Ý 1Ý "àôZ!�kó Z!ó òZ!r   