+
    iE                     ~   ^ RI H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Ht ^ RIHtHtHt ^ RIHt ^ RIHt ^ R	It]! R
4      w  tttR tR tR tR tR t ]R 4       t!R t"R t#R t$R t%R t&R t'R t(]R 4       t)R t*R t+R t,R t-R t.R t/R t0R  t1R! t2R" t3R# t4R$ t5R% t6R& t7R' t8R( t9R) t:R* t;R	# )+    )StringIO)SsymbolsEqpiCatalan
EulerGammaFunction)Equality)	Piecewise)MatrixMatrixSymbol)OctaveCodeGencodegenmake_routine)raises)XFAILNzx,y,zc                      \        4       p \        4       pV P                  . VR RRR7       VP                  4       pVR8X  g   Q hR# )fileFheaderempty N)r   r   dump_mgetvalue)code_genoutputsources      g/var/www/html/photoedit/myenv/lib/python3.14/site-packages/sympy/utilities/tests/test_codegen_octave.pytest_empty_m_coder       s>    HZFOOBuEOB__FR<<    c                      R \         \        ,           \        ,          3p \        V RRRR7      w  pV^ ,          R8X  g   Q hV^,          pRpW#8X  g   Q hR# )testOctaveFr   test.mz7function out1 = test(x, y, z)
  out1 = z.*(x + y);
end
Nxyzr   	name_exprresultr   expecteds       r   test_m_simple_coder.      sY    !a%#Ii%uEGF!9   AYF	 
 r!   c                      R \         \        ,           \        ,          3p \        V RRRR7      w  pV^ ,          R8X  g   Q hV^,          pR\        P
                  ,           R,           pW#8X  g   Q hR# )	r#   r$   TFr   r%   z^function out1 = test(x, y, z)
  %TEST  Autogenerated by SymPy
  %   Code generated with SymPy z}
  %
  %   See http://www.sympy.org/ for more information.
  %
  %   This file is part of 'project'
  out1 = z.*(x + y);
end
N)r'   r(   r)   r   sympy__version__r*   s       r   test_m_simple_code_with_headerr2   %   sr    !a%#Ii$eDGF!9   AYF	+-2->->	?B	  r!   c                      \        \        \        \        ,           4      p R V 3p\	        VRRRR7      w  pV^,          pRpW48X  g   Q hR# )r#   r$   Fr   z)function z = test(x, y)
  z = x + y;
end
N)r   r)   r'   r(   r   exprr+   r,   r   r-   s        r   test_m_simple_code_nameoutr6   8   sN    AADIi%uEGFAYF	 
 r!   c                      R \         \        ,          3p \        V RRRR7      w  pV^,          pR\        P                  ! ^4      ,          pW#8X  g   Q hR# )r#   r$   Fr   z+function out1 = test()
  out1 = pi^%s;
end
N)r   r   r   evalfr*   s       r   test_m_numbersymbolr9   E   sS    W%Ii%uEGFAYF	 	b	H
 r!   c                      R \         \        ,          \        .3p \        V RRRRR7      w  pV^,          pRpW#8X  g   Q hR# )r#   r$   Fr   r   inlinezfunction [out1, out2] = test()
  Catalan = 0.915965594177219;  % constant
  EulerGamma = 0.5772156649015329;  % constant
  out1 = pi^Catalan;
  out2 = EulerGamma;
end
N)r   r   r	   r   r*   s       r   test_m_numbersymbol_no_inliner=   Q   sO     "g+z23Ii%!%1GFAYF	  r!   c                      \         \        ,           p \        R V \        \         \        .RR7      p\	        4       p\        4       pVP                  V.VR RRR7       VP                  4       pRpWE8X  g   Q hR# )r#   octave)argument_sequencelanguageFr   z2function out1 = test(z, x, y)
  out1 = x + y;
end
N)r'   r(   r   r)   r   r   r   r   )r5   routiner   r   r   r-   s         r   test_m_code_argument_orderrC   c   sk    q5D64Aq!9xXGHZFOOWIvve5OI__F	 
 r!   c                      \         \        ,           \        ,          p \         \        ,
          \        ,          pR W.3p\        VRRRR7      w  pV^,          pRpWE8X  g   Q hR# )r#   r$   Fr   zTfunction [out1, out2] = test(x, y, z)
  out1 = z.*(x + y);
  out2 = z.*(x - y);
end
Nr&   )expr1expr2r+   r,   r   r-   s         r   test_multiple_results_mrG   r   s[    UAIEUAIE%(Ii%uEGFAYF	  r!   c                  <   \        R 4      w  rp\        V\        \        ,           \        ,          4      p\        V \        \        ,
          \        ,          4      p\        V^\        ,          4      pRW4V.3p\        VRRRR7      w  pV^,          pRp	W8X  g   Q hR# )A,B,Cr#   r$   Fr   zVfunction [C, A, B] = test(x, y, z)
  C = z.*(x + y);
  A = z.*(x - y);
  B = 2*x;
end
Nr   r   r'   r(   r)   r   
ABCrE   rF   expr3r+   r,   r   r-   s
             r   test_results_named_unorderedrP      s    gGA!QQ	"EQQ	"EQ!E%./Ii%uEGFAYF	  r!   c            	         \        R 4      w  rp\        V\        \        ,           \        ,          4      p\        V \        \        ,
          \        ,          4      p\        V^\        ,          4      pRW4V.3p\        VRRR\        \        \        3R7      pV^ ,          ^ ,          R8X  g   Q hV^ ,          ^,          pRp	W8X  g   Q hR# )rI   r#   r$   Fr   r   r@   r%   zVfunction [C, A, B] = test(x, z, y)
  C = z.*(x + y);
  A = z.*(x - y);
  B = 2*x;
end
NrJ   rK   s
             r   test_results_named_orderedrS      s    gGA!QQ	"EQQ	"EQ!E%./IYe()1ay2F!9Q<8###AYq\F	  r!   c                     ^ RI Hp HpHp RV! \        4      V ! \
        4      ,           V! \        4      ,           ^,          P                  4       V ! V ! V ! V ! V ! V ! V ! V ! \        \
        ,           \        ,           4      4      4      4      4      4      4      4      .3p\        VRRRR7      pV^ ,          ^ ,          R8X  g   Q hV^ ,          ^,          pRpWV8X  g   Q hR# )	r   )cossintantestlongr$   Fr   z
testlong.ma5  function [out1, out2] = testlong(x, y, z)
  out1 = sin(x).^3 + 3*sin(x).^2.*cos(y) + 3*sin(x).^2.*tan(z) + 3*sin(x).*cos(y).^2 + 6*sin(x).*cos(y).*tan(z) + 3*sin(x).*tan(z).^2 + cos(y).^3 + 3*cos(y).^2.*tan(z) + 3*cos(y).*tan(z).^2 + tan(z).^3;
  out2 = cos(cos(cos(cos(cos(cos(cos(cos(x + y + z))))))));
end
N)	(sympy.functions.elementary.trigonometricrU   rV   rW   r'   r(   r)   expandr   )rU   rV   rW   r+   r,   r   r-   s          r   test_complicated_m_codegenr[      s    HHAQ#a&(1,446CCCAEAI$7 89:;<=I YeDF!9Q<<'''AYq\F	  r!   c                  >   ^ RI Hp Hp \        R4      pRV ! ^\        ,          4      \        \        V! \        4      4      V ! \        4      \        W!! ^\        ,          4      4      .3p\        VRRRR7      w  pV^ ,          R8X  g   Q hV^,          pRpWV8X  g   Q hR	# )
r   )rU   rV   afoor$   Fr   foo.mzkfunction [out1, y, out3, a] = foo(x)
  out1 = cos(2*x);
  y = sin(x);
  out3 = cos(x);
  a = sin(2*x);
end
N)rY   rU   rV   r   r'   r   r(   r   )rU   rV   r]   r+   r,   r   r-   s          r   !test_m_output_arg_mixed_unorderedr`      s    CAQqS8As1v#6ACPQRSPSH@UVWIi%uEGF!9AYF	  r!   c                      \        ^ \        R8  3\        ^,          \        ^8*  3\        ) ^,           \        ^8  3R	RR7      p RV 3p\        VRRRR7      w  pV^,          pRpW48X  g   Q hR# )
r   Fevaluatepwtestr$   r   zfunction out1 = pwtest(x)
  out1 = ((x < -1).*(0) + (~(x < -1)).*( ...
  (x <= 1).*(x.^2) + (~(x <= 1)).*( ...
  (x > 1).*(2 - x) + (~(x > 1)).*(1))));
end
N   Tr   r'   r   pwr+   r,   r   r-   s        r   test_m_piecewise_rk      ss    	Aq2v;AqAv!Aq1uySX	YB2Ii%uEGFAYF	  r!   c                      \        ^ \        R8  3\        ^,          \        ^8*  3\        ) ^,           \        ^8  3R4      p RV 3p\        VRRRRR7      w  pV^,          pRpW48X  g   Q hR# )	r   rd   r$   Fr;   zfunction out1 = pwtest(x)
  if (x < -1)
    out1 = 0;
  elseif (x <= 1)
    out1 = x.^2;
  elseif (x > 1)
    out1 = -x + 2;
  else
    out1 = 1;
  end
end
Nre   rf   rh   ri   s        r   test_m_piecewise_no_inlinerm      sw     
Aq2v;AqAv!Aq1uy	IB2Ii%u"$GFAYF
	  r!   c                      R ^\         ,          ^\        ,          .3R\        ^,          ^\        ,          .3.p \        V RRRR7      pV^ ,          ^ ,          R8X  g   Q hV^ ,          ^,          pRpW#8X  g   Q hR# )r^   barr$   Fr   r_   zfunction [out1, out2] = foo(x, y)
  out1 = 2*x;
  out2 = 3*y;
end
function [out1, out2] = bar(y)
  out1 = y.^2;
  out2 = 4*y;
end
N)r'   r(   r   r*   s       r   test_m_multifcns_per_filerp      sy    1Q3!*%1ac{';=IYeDF!9Q<7"""AYq\F	  r!   c                  .   R ^\         ,          ^\        ,          .3R\        ^,          ^\        ,          .3.p \        V RRRR7      pV^ ,          ^ ,          R8X  g   Q hV^ ,          ^,          pR\        P                  ,           R,           pW#8X  g   Q hR	# )
r^   ro   r$   TFr   r_   zafunction [out1, out2] = foo(x, y)
  %FOO  Autogenerated by SymPy
  %   Code generated with SymPy z
  %
  %   See http://www.sympy.org/ for more information.
  %
  %   This file is part of 'project'
  out1 = 2*x;
  out2 = 3*y;
end
function [out1, out2] = bar(y)
  out1 = y.^2;
  out2 = 4*y;
end
N)r'   r(   r   r0   r1   r*   s       r   "test_m_multifcns_per_file_w_headerrr   	  s    1Q3!*%1ac{';=IYUCF!9Q<7"""AYq\F	+-2->->	?B	   r!   c                     a  R ^\         ,          ^\        ,          .3R\        ^,          ^\        ,          .3.o \        \        V 3R l4       R# )r^   ro   c                  $   < \        S R RRRR7      # )r$   ro   F)prefixr   r   )r   r+   s   r   <lambda>1test_m_filename_match_first_fcn.<locals>.<lambda>#  s    wy uE Kr!   N)r'   r(   r   
ValueErrorrv   s   @r   test_m_filename_match_first_fcnrz   !  s@    1Q3!*%1ac{';=I
: K Lr!   c                     \        \        ^\        ,          \        \        ,          ..4      p R\        \        R^^4      V 4      3p\        VRRRR7      pV^ ,          ^ ,          R8X  g   Q hV^ ,          ^,          pRpW48X  g   Q hR# )	   r#   myout1r$   Fr   r%   =function myout1 = test(x, y, z)
  myout1 = [x 2*y pi*z];
end
N)r   r'   r(   r   r)   r   r   r   )e2r+   r,   r   r-   s        r   test_m_matrix_namedr   '  s    	!QqS"Q$ 	!B,xA">CDIYeDF!9Q<8###AYq\F	 
 r!   c                      \        R ^^4      p \        \        ^\        ,          \        \
        ,          ..4      pR\        WRR7      3p\        VRRRR7      w  pV^,          pRpWE8X  g   Q hR# )r}   r#   Frb   r$   r   r~   N)r   r   r'   r(   r   r)   r   r   )r}   r   r+   r,   r   r-   s         r   test_m_matrix_named_matsymr   5  so    (Aq)F	!QqS"Q$ 	!B&u=>Ii%uEGFAYF	 
 r!   c                      \        \        \        \        ,           ^..4      p RV 3p\        VRRRR7      w  pV^,          pRpW48X  g   Q hR# )   r#   r$   Fr   z5function out1 = test(x, y)
  out1 = [x x + y 3];
end
N)r   r'   r(   r   r4   s        r   test_m_matrix_output_autonamer   C  sT    AqsA;- DIi%uEGFAYF	 
 r!   c                  P   \         \        ,           p \        ^\         ,          ^\        ,          ^\        ,          ..4      p\        \         .\        .\        ..4      p\        \         \        .\        ^..4      pRWW#33p\	        VRRRR7      w  pV^,          pRpWg8X  g   Q hR# )r|   r#   r$   Fr   zfunction [out1, out2, out3, out4] = test(x, y, z)
  out1 = x + y;
  out2 = [2*x 2*y 2*z];
  out3 = [x; y; z];
  out4 = [x y; z 16];
end
N)r'   r(   r   r)   r   )e1r   e3e4r+   r,   r   r-   s           r   test_m_matrix_output_autoname_2r   P  s    
a%B	!A#qsAaC!	"B	!qcA3	 B	!Q!R!	"B"")*Ii%uEGFAYF	  r!   c            	      b   \        R 4      w  r\        R^^4      p\        V\        \        ,           \
        ,          4      p\        V\        ^^\        ..4      4      p\        V ^\        ,          4      pRW4V.3p\        VRRR\        \
        \        3R7      w  pV^,          pRp	W8X  g   Q hR# )zB,CrL   r#   r$   FrR   zSfunction [C, A, B] = test(x, z, y)
  C = z.*(x + y);
  A = [1 2 x];
  B = 2*x;
end
N)r   r   r   r'   r(   r)   r   r   )
rM   rN   rL   rE   rF   rO   r+   r,   r   r-   s
             r   #test_m_results_matrix_named_orderedr   c  s    5>DAS!QAQQ	"EQAq	{+,EQ!E%./Ii%u()1ay2GFAYF	  r!   c                  $   \        R ^^4      p \        R^^4      p\        R^^4      p\        R^^4      pR\        WR
,          4      \        W R,          4      \        W0R,          4      .3p\        VRRRR7      w  pV^,          pRpWg8X  g   Q hR	# )rL   rM   rN   Dr#   r$   Fr   zNfunction [B, C, D] = test(A)
  B = A(1, :);
  C = A(2, :);
  D = A(:, 3);
end
Nr   NNNrg   r   )r   r|   r   r   r   )rL   rM   rN   r   r+   r,   r   r-   s           r   test_m_matrixsymbol_slicer   w  s    S!QAS!QAS!QAS!QA(1g."1g."1g.0 1I i%uEGFAYF	  r!   c                      \        R ^^4      p \        R^^4      p\        R^^4      pR\        WR	,          4      \        W R
,          4      .3p\        VRRRR7      w  pV^,          pRpWV8X  g   Q hR# )rL   rM   rN   r#   r$   Fr   zDfunction [B, C] = test(A)
  B = A(1:2, 1:2);
  C = A(1:2, 2:3);
end
N)r   r|   Nr   )r   :rg   r   Nr   rL   rM   rN   r+   r,   r   r-   s          r   test_m_matrixsymbol_slice2r         S!QAS!QAS!QA(1k2"1k24 5Ii%uEGFAYF	  r!   c                      \        R ^^4      p \        R^^4      p\        R^^4      pR\        WR	,          4      \        W R
,          4      .3p\        VRRRR7      w  pV^,          pRpWV8X  g   Q hR# )rL   rM   rN   r#   r$   Fr   zRfunction [B, C] = test(A)
  B = A(7:end, 2:3:end);
  C = A(1:2:end, 1:3:end);
end
N):   NN:rg   Nr   ):NNr|   :NNr   r   r   s          r   test_m_matrixsymbol_slice3r     r   r!   c                      \        R ^^4      p \        R^^4      pR\        WR,          4      V R	,          V R
,          V R,          .3p\        VRRRR7      w  pV^,          pRpWE8X  g   Q hR# )rL   rM   r#   r$   Fr   zrfunction [B, out2, out3, out4] = test(A)
  B = A(1, :);
  out2 = A(2, :);
  out3 = A(:, 1);
  out4 = A(:, 2);
end
Nr   r   )r   r   )r   rg   r   )rL   rM   r+   r,   r   r-   s         r   "test_m_matrixsymbol_slice_autonamer     sy    S!QAS!QA(1f-qvqvqvFGIi%uEGFAYF	  r!   c            	      |   ^ RI Hp Hp ^ RIHp V! RRR7      w  r4V ! R4      pV ! R4      pV ! R4      pV! R	V4      pV! R
V4      p	\        R\        Wx,          WXV	3,          Wi,          ,          4      3RRRR7      w  p
V
^,          pRpWRRV: RV	: R2/,          8X  g   WRRV: RV	: R2/,          8X  g   Q hR# R# )r   IndexedBaseIdxr   zn mTintegerrL   r'   r(   ijmat_vec_multr$   Fr   zfunction y = mat_vec_mult(A, m, n, x)
  for i = 1:m
    y(i) = 0;
  end
  for i = 1:m
    for j = 1:n
      y(i) = %(rhs)s + y(i);
    end
  end
end
rhszA(z, z).*x(j)zx(j).*A()Nsympy.tensorr   r   sympy.core.symbolr   r   r   )r   r   r   nmrL   r'   r(   r   r   r,   r   r-   s                r   test_m_loopsr     s    
 .)5$'DACACACACACA~r!$Q$'=>"%1GFAYF		  %a)C!DDD%a)C!DDDF ED Er!   c                  R   ^ RI Hp Hp ^ RIHp V! RRR7      w  r4rVV ! R4      pV ! R4      pV ! R4      p	V! R	V4      p
V! R
V4      pV! RV4      pV! RV4      p\        R\        W,          WW3,          WzWV3,          ,          4      3RRRR7      w  pV^,          pRpVV8X  g   Q hR# )r   r   r   zn m o pTr   rL   rM   r(   r   r   kltensorthingr$   Fr   zfunction y = tensorthing(A, B, m, n, o, p)
  for i = 1:m
    y(i) = 0;
  end
  for i = 1:m
    for j = 1:n
      for k = 1:o
        for l = 1:p
          y(i) = A(i, j, k, l).*B(j, k, l) + y(i);
        end
      end
    end
  end
end
Nr   )r   r   r   r   r   oprL   rM   r(   r   r   r   r   r,   r   r-   s                    r   )test_m_tensor_loops_multiple_contractionsr     s    -)D1JA!CACACACACACACA}bqAz!qQJ-/G&HIuE;GFAYF	   Xr!   c                      \        \        \        ^,          4      p RV 3p\        VRRRR7      w  pV^,          pRpW48X  g   Q hR# )r|   mysqrr$   Fr   z&function x = mysqr(x)
  x = x.^2;
end
N)r   r'   r   r4   s        r   test_m_InOutArgumentr      sN    Aq!tD$Ii%uEGFAYF	 
 r!   c                  T   \        \        \        ^,          \        ,           4      p RV 3p\        VRRR\        \        3R7      w  pV^,          pRpW48X  g   Q h\        \        \        ^,          \        ,           4      p RV 3p\        VRRRR7      w  pV^,          pRpW48X  g   Q hR# )r|   r#   r$   FrR   z,function x = test(x, y)
  x = x.^2 + y;
end
r   N)r   r'   r(   r   r4   s        r   test_m_InOutArgument_orderr     s    Aq!tax DIi%!aU<GFAYF	 
 Aq!tax DIi%uEGFAYF	 
 r!   c                      \        R 4      p RV ! \        4      P                  \        4      \        P                  .3p\        VRRRR7      w  pV^,          pRpW48X  g   Q hR# )fr#   r$   Fr   zfunction [out1, out2] = test(x)
  % unsupported: Derivative(f(x), x)
  % unsupported: zoo
  out1 = Derivative(f(x), x);
  out2 = zoo;
end
N)r
   r'   diffr   ComplexInfinityr   )r   r+   r,   r   r-   s        r   test_m_not_supportedr   '  s_    A!A$))A,(9(9:;Ii%uEGFAYF	  r!   c            	          \        R 4      w  rr#\        RW,          3RRRV3R7      pV^ ,          ^,          pRpWV8X  g   Q h\        RW,          V,           3RRRW3W#3R7      pV^ ,          ^,          pRpWV8X  g   Q hR# )	zx y z tr   r$   F)r   r   global_varsz3function out1 = f(x)
  global y
  out1 = x.*y;
end
)r   r   r@   r   z<function out1 = f(x, y)
  global t z
  out1 = x.*y + z;
end
N)r   r   )r'   r(   r)   tr,   r   r-   s          r   test_global_vars_octaver   7  s    #JA!c13Z%u"#'FAYq\F	  c13q5\8E()vA6CFAYq\F	  r!   )<ior   
sympy.corer   r   r   r   r   r	   r
   sympy.core.relationalr   $sympy.functions.elementary.piecewiser   sympy.matricesr   r   sympy.utilities.codegenr   r   r   sympy.testing.pytestr   r   r0   r'   r(   r)   r    r.   r2   r6   r9   r=   rC   rG   rP   rS   r[   r`   rk   rm   rp   rr   rz   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r   <module>r      s     H H H * : / H H ' &  '
1a
&
	  " &((&  .$0L
&(("""F@D
4 r!   