
    JTh,                         S SK Jr  S SKrS SKJr  S SKJr  S SKJr  S SK	J
r
  S SKJr  S SKJrJr   " S S	\
\S
9r\R                   r " S S\
\S
9rg)    N)Expr)
_sympifyit)
AtomicExpr)Number)global_parameters)S	Singletonc                   l  ^  \ rS rSrSrSrSrSrSrSr	Sr
SrSrSrS rS rS	 r \" S
\5      S 5       r\r\" S
\5      S 5       r\" S
\5      S 5       r\" S
\5      S 5       r\r\" S
\5      S 5       rS rS rS rS rU 4S jrS rS r S r!S r"S r#S r$\" S
\5      S 5       r%\%r&S r'S r(Sr)U =r*$ )IntInfinity   aL  Positive integer infinite quantity.

Integer infinity is a value in an extended integers which
is greater than all other integers.  We distinguish it from
sympy's existing notion of infinity in that it reports that
it is_integer.

Infinity is a singleton, and can be accessed by ``S.IntInfinity``,
or can be imported as ``int_oo``.
TF      Y@ c                 .    [         R                  " U 5      $ Nr   __new__clss    R/var/www/auris/envauris/lib/python3.13/site-packages/torch/utils/_sympy/numbers.pyr   IntInfinity.__new__)       !!#&&    c                     g)Nint_oor   selfprinters     r   	_sympystrIntInfinity._sympystr,   s    r   c                     X:X  a  U$ g r   r   r   oldnews      r   
_eval_subsIntInfinity._eval_subs/       ;J r   otherc                 :   [        U[        5      (       aq  [        R                  (       a\  U[        R
                  [        R                  4;   a  U$ U[        R                  [        R                  4;   a  [        R                  $ U $ [        R                  " X5      $ r   )

isinstancer   r   evaluater   InfinityNegativeInfinityNegativeIntInfinityNaN__add__r   r'   s     r   r/   IntInfinity.__add__<   sh    eV$$):)C)CQ%7%788..66uuK~~d**r   c                 z   [        U[        5      (       a  [        R                  (       a|  U[        R
                  L a  [        R                  $ U[        R                  L a  [        R
                  $ U[        R                  [        R                  4;   a  [        R                  $ U $ [        R                  " X5      $ r   )
r)   r   r   r*   r   r+   r,   r   r.   __sub__r0   s     r   r3   IntInfinity.__sub__H   sz    eV$$):)C)C

")))***zz!..uuK~~d**r   c                 &    U * R                  U5      $ r   r/   r0   s     r   __rsub__IntInfinity.__rsub__T       u%%r   c                 0   [        U[        5      (       al  [        R                  (       aW  UR                  (       d  U[
        R                  L a  [
        R                  $ UR                  (       a  U $ [
        R                  $ [        R                  " X5      $ r   )
r)   r   r   r*   is_zeror   r.   is_extended_positiver-   __mul__r0   s     r   r=   IntInfinity.__mul__X   s[    eV$$):)C)C}}uu))(((~~d**r   c                    [        U[        5      (       a  [        R                  (       a  U[        R
                  [        R                  [        R                  [        R                  [        R                  4;   a  [        R                  $ UR                  (       a  [        R
                  $ [        R                  $ [        R                  " X5      $ r   r)   r   r   r*   r   r+   r   r,   r-   r.   is_extended_nonnegative__truediv__r0   s     r   rB   IntInfinity.__truediv__d   s    eV$$):)C)C

""%%  uu,,zz!%%%!!$..r   c                 "    [         R                  $ r   r   r   r   s    r   __abs__IntInfinity.__abs__t       }}r   c                 "    [         R                  $ r   r   r-   rF   s    r   __neg__IntInfinity.__neg__w   s    $$$r   c                 \   UR                   (       a  [        R                  $ UR                  (       a  [        R                  $ U[        R
                  L a  [        R
                  $ U[        R                  L a  [        R
                  $ UR                  SL a  UR                  (       a  SSK	J
n  U" U5      nUR                  (       a  [        R                  $ UR                  (       a  [        R                  $ UR                  (       a  [        R
                  $ XR                  5       -  $ g g )NFr   )re)r<   r   r   is_extended_negativeZeror.   ComplexInfinityis_extended_real	is_number$sympy.functions.elementary.complexesrO   is_positiveis_negativer;   evalf)r   exptrO   	expt_reals       r   _eval_powerIntInfinity._eval_powerz   s    $$== $$66M155=55L1$$$55L  E)dnn?4I$$((($$vv  uu::<'' /=)r   c                 "    [         R                  $ r   )mlibfinfr   precs     r   _as_mpf_valIntInfinity._as_mpf_val   s    yyr   c                     > [         TU ]  5       $ r   super__hash__r   	__class__s    r   rg   IntInfinity.__hash__       w!!r   c                 &    U[         R                  L $ r   rE   r0   s     r   __eq__IntInfinity.__eq__   s    %%r   c                 &    U[         R                  L$ r   rE   r0   s     r   __ne__IntInfinity.__ne__   s    AMM))r   c                     U[         R                  L a  [        R                  $ U[         R                  L a  [        R                  $ [        R
                  $ r   r   r+   sympyfalser   truer0   s     r   __gt__IntInfinity.__gt__   s8    AJJ;;amm#;;::r   c                     U[         R                  L a  [        R                  $ U[         R                  L a  [        R
                  $ [        R
                  $ r   rs   r0   s     r   __ge__IntInfinity.__ge__   s8    AJJ;;amm#::::r   c                     U[         R                  L a  [        R                  $ U[         R                  L a  [        R
                  $ [        R
                  $ r   r   r+   rt   rv   r   ru   r0   s     r   __lt__IntInfinity.__lt__   s8    AJJ::amm#;;;;r   c                     U[         R                  L a  [        R                  $ U[         R                  L a  [        R                  $ [        R
                  $ r   r}   r0   s     r   __le__IntInfinity.__le__   s8    AJJ::amm#::;;r   c                 X    [        U[        5      (       d  [        $ [        R                  $ r   r)   r   NotImplementedr   r.   r0   s     r   __mod__IntInfinity.__mod__       %&&!!uur   c                     U $ r   r   rF   s    r   floorIntInfinity.floor       r   c                     U $ r   r   rF   s    r   ceilingIntInfinity.ceiling   r   r   )+__name__
__module____qualname____firstlineno____doc__
is_integeris_commutativerT   rS   is_comparabler<   is_prime_op_priority	__slots__r   r   r$   r   r   r/   __radd__r3   r7   r=   __rmul__rB   rG   rL   r[   rb   rg   rm   rp   rw   rz   r~   r   r   __rmod__r   r   __static_attributes____classcell__ri   s   @r   r   r      sH   	 JNIMH LI'
 (+ )+ H(	+ )	+ (& )& (+ )+ H(/ )/%(,"&* ( )
 H r   r   )	metaclassc                   r  ^  \ rS rSrSrSrSrSrSrSr	Sr
SrSrSrS rS rS	 r \" S
\5      S 5       r\r\" S
\5      S 5       r\" S
\5      S 5       r\" S
\5      S 5       r\r\" S
\5      S 5       rS rS rS rS rU 4S jrS rS r S r!S r"S r#S r$\" S
\5      S 5       r%\%r&S r'S r(S r)Sr*U =r+$ )r-      zNegative integer infinite quantity.

NegativeInfinity is a singleton, and can be accessed
by ``S.NegativeInfinity``.

See Also
========

IntInfinity
r   TFr   c                 .    [         R                  " U 5      $ r   r   r   s    r   r   NegativeIntInfinity.__new__   r   r   c                     X:X  a  U$ g r   r   r!   s      r   r$   NegativeIntInfinity._eval_subs   r&   r   c                     g)Nz-int_oor   r   s     r   r   NegativeIntInfinity._sympystr   s    r   r'   c                 4   [        U[        5      (       an  [        R                  (       aY  U[        R
                  L a  [        R
                  $ U[        R                  [        R                  4;   a  [        R                  $ U $ [        R                  " X5      $ r   )	r)   r   r   r*   r   r+   r   r.   r/   r0   s     r   r/   NegativeIntInfinity.__add__   s`    eV$$):)C)C

"zz!..uuK~~d**r   c                 4   [        U[        5      (       an  [        R                  (       aY  U[        R
                  L a  [        R                  $ U[        R                  [        R                  4;   a  [        R                  $ U $ [        R                  " X5      $ r   )
r)   r   r   r*   r   r,   r+   r-   r.   r3   r0   s     r   r3   NegativeIntInfinity.__sub__  sd    eV$$):)C)C***zz!..66uuK~~d**r   c                 &    U * R                  U5      $ r   r6   r0   s     r   r7   NegativeIntInfinity.__rsub__  r9   r   c                 0   [        U[        5      (       al  [        R                  (       aW  UR                  (       d  U[
        R                  L a  [
        R                  $ UR                  (       a  U $ [
        R                  $ [        R                  " X5      $ r   )
r)   r   r   r*   r;   r   r.   r<   r   r=   r0   s     r   r=   NegativeIntInfinity.__mul__  sY    eV$$):)C)C}}uu))== ~~d**r   c                    [        U[        5      (       a  [        R                  (       a  U[        R
                  [        R                  [        R                  [        R                  [        R                  4;   a  [        R                  $ UR                  (       a  U $ [        R
                  $ [        R                  " X5      $ r   r@   r0   s     r   rB   NegativeIntInfinity.__truediv__  s    eV$$):)C)C

""%%  uu,,::!!$..r   c                 "    [         R                  $ r   rE   rF   s    r   rG   NegativeIntInfinity.__abs__/  rI   r   c                 "    [         R                  $ r   rE   rF   s    r   rL   NegativeIntInfinity.__neg__2  rI   r   c                    UR                   (       GaJ  U[        R                  [        R                  [        R                  [        R
                  [        R                  4;   a  [        R                  $ [        U[        R                  5      (       aB  UR                  (       a1  UR                  (       a  [        R                  $ [        R
                  $ [        R
                  U-  n[        R                  U-  nUS:X  a  UR                  (       a  U$ U[        R                  L a2  UR                  (       a!  UR                  (       d  [        R                  $ X2-  $ g )Nr   )rT   r   r.   r+   r,   r   r-   r)   rt   Integerr<   is_oddNegativeOne	is_finiterR   r;   )r   rY   inf_parts_parts       r   r[   NegativeIntInfinity._eval_power5  s    >>>

""%%  uu$..43L3L;;000==(}}d*H]]D(F1}!1!1A---$$((($$5 r   c                 "    [         R                  $ r   )r^   fninfr`   s     r   rb   NegativeIntInfinity._as_mpf_valR  s    zzr   c                     > [         TU ]  5       $ r   re   rh   s    r   rg   NegativeIntInfinity.__hash__U  rk   r   c                 &    U[         R                  L $ r   rK   r0   s     r   rm   NegativeIntInfinity.__eq__X  s    ----r   c                 &    U[         R                  L$ r   rK   r0   s     r   rp   NegativeIntInfinity.__ne__[  s    A1111r   c                     U[         R                  L a  [        R                  $ U[         R                  L a  [        R
                  $ [        R
                  $ r   r   r,   rt   rv   r-   ru   r0   s     r   rw   NegativeIntInfinity.__gt__^  s<    A&&&::a+++;;;;r   c                     U[         R                  L a  [        R                  $ U[         R                  L a  [        R                  $ [        R
                  $ r   r   r0   s     r   rz   NegativeIntInfinity.__ge__f  s<    A&&&::a+++::;;r   c                     U[         R                  L a  [        R                  $ U[         R                  L a  [        R                  $ [        R
                  $ r   r   r,   rt   ru   r-   rv   r0   s     r   r~   NegativeIntInfinity.__lt__n  s<    A&&&;;a+++;;::r   c                     U[         R                  L a  [        R                  $ U[         R                  L a  [        R
                  $ [        R
                  $ r   r   r0   s     r   r   NegativeIntInfinity.__le__v  s<    A&&&;;a+++::::r   c                 X    [        U[        5      (       d  [        $ [        R                  $ r   r   r0   s     r   r   NegativeIntInfinity.__mod__~  r   r   c                     U $ r   r   rF   s    r   r   NegativeIntInfinity.floor  r   r   c                     U $ r   r   rF   s    r   r   NegativeIntInfinity.ceiling  r   r   c                 F    [         R                  S[         R                  S0$ )N   )r   r   r   rF   s    r   as_powers_dict"NegativeIntInfinity.as_powers_dict  s    q!--33r   ),r   r   r   r   r   r   r   rS   r   r   rP   rT   r   r   r   r$   r   r   r   r/   r   r3   r7   r=   r   rB   rG   rL   r[   rb   rg   rm   rp   rw   rz   r~   r   r   r   r   r   r   r   r   r   s   @r   r-   r-      sK   	 LJNMIHI' (+ )+ H(+ )+ (& )& (+ )+ H(/ )/%:".2 ( )
 H4 4r   r-   )mpmath.libmplibmpr^   rt   r   sympy.core.decoratorsr   sympy.core.exprr   sympy.core.numbersr   sympy.core.parametersr   sympy.core.singletonr   r	   r   r   r-   r   r   r   <module>r      sI       , & % 3 -|&I |~ 
4&I 4r   