+
    eiG  c                   s    ^ RI t ^ RIHtHtHtHtHtHtHtH	t	H
t
HtHtHtHtHtHtHtHtHtHtHtHtHtHtHtHtHtHt ^RIHt  ! R R]P>                  4      t R# )    N)ArithOpExprLanguageOpas_applyas_array
as_complexas_derefas_eqas_expr
as_factorsas_geas_gtas_leas_ltas_ne	as_numberas_numer_denomas_ref	as_string	as_symbolas_terms
as_ternaryeliminate_quotes
fromstringinsert_quotes	normalize)utilc                   sb   a  ] tR t^$t o 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# )TestSymbolicc                s   R  pR
 F  pV! VR,           4       V! VR,           V,           R,           4       V! VR,           4       V! VR,           V,           R,           4       V! VR,           4       V! RV,           R,           4       K  	  R	# )c                 s6    \        V 4      w  r\        W4      pR # N)r   r   )srZdZs1   &   E/usr/lib64/python3.14/site-packages/numpy/f2py/tests/test_symbolic.pyworkerZ2TestSymbolic.test_eliminate_quotes.<locals>.worker&   s    #A&DAq$B    z"1234" // "ABCD"z
"1234" // z"ABCD"z"1234" // 'ABCD'z'ABCD'z"1\"2'AB'34"za = z'1\'2"AB"34'N) Zmykind_ )selfr#   Zkinds   &  r"   test_eliminate_quotesZ"TestSymbolic.test_eliminate_quotes%   s}    	
 $D4,,-4,&-894../4,&-894++,6D=#445 $r$   c                s   \        R 4      p\        R4      p\        R4      p\        ^{4      p\        R4      p\        R4      p\        R4      p\        ^^4      p\        ^^4      p	\        R4      p
\        R4      p\	        WE34      p\	        V34      p\        V4      p\        V4      p\        V4      p\        V4      p\        WV4      p\        WV4      p\        W4      p\        W4      pR# )	xyz  g(@gF@z'123'"ABC"N)
r   r   r   r   r   r   r   r   r	   r   )r'   r)   r*   r+   nmZfnZfmcZc2r   Zs2aZbtZuvZwZefs   &                   r"   test_sanityZTestSymbolic.test_sanity3   s    cNcNcN cNcN t_t_ q!1 gw aVaUO QKQK qMqM qQqQ !K!Kr$   c                s   \        R 4      p\        R4      p\        R4      p\        ^{4      p\        R4      p\        WE34      p\        WE4      p\	        \
        P                  V^\	        \
        P                  V^V^/4      ^/4      p\	        \
        P                  V^\	        \
        P                  V^V^/4      ^/4      pR# )r)   r*   r+   r,   N)r   r   r   r   r   r   ZFACTORSZTERMS)	r'   r)   r*   r+   r.   r/   r1   r0   r3   s	   &        r"   test_tostring_fortranZ"TestSymbolic.test_tostring_fortran   s    cNcNcNcNcNaVq0 aDAq!Q<$@!DEaDaAq\$BAFGr$   c                s~    \         P                  p\        R 4      p\        R4      p\        R4      p\        ^{4      pR# r)   r*   r+   N)r   ZCr   r   )r'   Zlanguager)   r*   r+   r.   s   &     r"   test_tostring_cZTestSymbolic.test_tostring_c   s/    ::cNcNcNcNr$   c                s    \        R 4      p\        R4      p\        R4      p\        R4      p\        R4      p\        RR4      pR# )r)   r*   r+   r-   "123"g      ?g       @N)r   r   r   )r'   r)   r*   r+   r   r2   r0   s   &      r"   test_operationsZTestSymbolic.test_operations   sB    cNcNcNb gg sC r$   c                s`    \        R 4      p\        R4      p\        R4      p\        W34      pR# r7   )r   r   )r'   r)   r*   r+   r1   s   &    r"   test_substituteZTestSymbolic.test_substitute  s)    cNcNcNaVr$   c                s    \        R 4      p\        R4      p\        R4      p\        R4      p\        R4      p\        R4      p\        W34      pR# )r)   r*   r+   r4   r-   r9   N)r   r   r   )r'   r)   r*   r+   r4   r   r2   r1   s   &       r"   test_fromstringZTestSymbolic.test_fromstring'  sF    cNcNcNcNggaVr$   c                s  aa	a
 \        R 4      o
\        R4      p\        R4      p\        R4      pV3V
3R llp\        4       o\        4       o	VV	3R lpS
V! VS
V,
          4      ,           P                  V4       R p\        4       o	S
V! VS
V,
          4      ,           P                  VS	4       R p\        4       o	S
V! VS
V,
          4      ,           P                  VS	4       R# )	r)   r*   r+   r4   c                 s   < V S8X  d   V# R # r   r&   )r   r    r)   s   &&r"   replace_visitZ1TestSymbolic.test_traverse.<locals>.replace_visit  s    Av r$   c                 s8  < V P                   \        P                  J dA   V P                  ^ ,          pSP	                  V4       VS9   d   SP                  V4       R# R# V P                   \        P                  J d   V S9  d   SP	                  V 4       R# R# R# )r    N)opr   APPLYZdataaddZremoveSYMBOL)r   Zoperfunction_symbolssymbolss   & r"   collect_symbolsZ3TestSymbolic.test_traverse.<locals>.collect_symbols  sr    ttrxxvvay $$T*7?NN4( #"q0@'@A (A"r$   c                 sh    V P                   \        P                  J d   VP                  V 4       R # R # r   )r>   r   rA   r@   ZexprrC      &&r"   collect_symbols2Z4TestSymbolic.test_traverse.<locals>.collect_symbols2  s#    ww"))#D! $r$   c                 s    V P                   \        P                  J d   V # V P                   \        P                  J d   VP	                  V 4       R # R # r   )r>   r   r?   rA   r@   rE   rF   r"   collect_symbols3Z4TestSymbolic.test_traverse.<locals>.collect_symbols3  s8    ww"(("ww"))#D! $r$   N)r   ZsetZtraverse)r'   r*   r+   r4   r=   rD   rG   rH   rB   rC   r)   s   &       @@@r"   test_traverseZTestSymbolic.test_traverse  s    cNcNcNcN  ! 	$ 5%	 
Qq!a%[""?3
	" %	
Qq!a%[""#3W=	" %	
Qq!a%[""#3W=r$   c                s   a \        R 4      o\        R4      p\        R4      p\        P                  ! \        V3R l4       R# )r)   r*   r+   c                  s4   < S S ,          P                  S 4      # r   )Zlinear_solve)r)   s   r"   Z<lambda>Z0TestSymbolic.test_linear_solve.<locals>.<lambda>  s    QU,@,@,Cr$   N)r   pytestZraisesZRuntimeError)r'   r*   r+   r)   s   &  @r"   test_linear_solveZTestSymbolic.test_linear_solve  s/    cNcNcN 	l$CDr$   c                H    \        R 4      p\        R4      p\        ^{4      pR# r)   r*   Nr   r   r'   r)   r*   r.   r!   r"   test_as_numer_denomZ TestSymbolic.test_as_numer_denom      cNcNcNr$   c                rL   rM   rN   rO   r!   r"   test_polynomial_atomsZ"TestSymbolic.test_polynomial_atoms  rQ   r$   r&   N)Z__name__Z
__module__Z__qualname__Z__firstlineno__r(   r5   r6   r8   r:   r;   r<   rI   rK   rP   rR   Z__static_attributes__Z__classdictcell__)Z__classdict__s   @r"   r   r   $   sN     6O#b/.bC@>-@E$\P|<|E(L6 6r$   r   )!rJ   Znumpy.f2py.symbolicr   r   r   r   r   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r%   r   ZF2PyTestr   r&   r$   r"   <module>rS      sG           < K64== K6r$   