+
    /ig                     Z    R t ^ RIHtHt ^ RIt^ RIHtHt ^ RI	t
^ RIHt  ! R R4      tR# )z5
Unit tests for optimization routines from _root.py.
)assert_assert_equalN)raiseswarnsrootc                      a  ] tR t^t o R tR tR tR tR t]	P                  P                  R. R
O4      R 4       tRtV tR	# )TestRootc           	        R  pR pR	 F  pVR
9   d   K  VR9   d   TpMRp\        VRR.VRVR7      p\        VRR.VRVR7      pV RV! VP                  4       RV! VP                  4       2p\        VP                  V4       \        VP                  V4       \        \	        V! VP                  4      4      P                  4       \	        V! VP                  4      4      P                  4       8  V4       K  	  R# )c                 r    V w  r\         P                  ! V^,          ^,
          V^,          ^,
          .4      #    nparrayzxys   &  ]/var/www/html/photoedit/myenv/lib/python3.14/site-packages/scipy/optimize/tests/test__root.pyfunc)TestRoot.test_tol_parameter.<locals>.func   -    DA88QTAXq!tax011    c                 z    V w  r\         P                  ! ^V^,          ,          ^ .^ ^V^,          ,          ..4      # r   r   r   s   &  r   dfunc*TestRoot.test_tol_parameter.<locals>.dfunc   s5    DA88a1fa[1a1f+677r   N皙?g-C6?)jactolmethod      ?z: z vs. )hybrlmbroyden1broyden2andersondiagbroydenkrylov)linearmixingexcitingmixing)r"   r#   )r   r   r   successabsmax)selfr   r   r    r   sol1sol2msgs   &       r   test_tol_parameterTestRoot.test_tol_parameter   s    	2	80F;;'s3iSd6JDs3iSc&IDHBtDFF|nE$tvv,@CDLL#&DLL#&CTVV%))+c$tvv,.?.C.C.EE!0r   c                    R  pR F6  p\        \        P                  \        P                  ! ^4      VRV/R7       K8  	  R# )c                 &    \        V ^ ,          4      # )    )r,   r   s   &r   norm$TestRoot.test_tol_norm.<locals>.norm,   s    qt9r   tol_norm)r    optionsN)r*   r'   r)   r&   r$   r%   r(   )r   r   
zeros_likezeros)r.   r8   r    s   &  r   test_tol_normTestRoot.test_tol_norm*   s7    	!F F#T*,!r   c                0    RR lp\        VRR.RR7       R# )   c                 r    V w  r#\         P                  ! V^,          ^,
          V^,          V,
          .4      # r   r   )r   fr   r   s   &&  r   r   =TestRoot.test_minimize_scalar_coerce_args_param.<locals>.func<   r   r   r   g      ?)argsNrA   r   )r.   r   s   & r   &test_minimize_scalar_coerce_args_param/TestRoot.test_minimize_scalar_coerce_args_param:   s    	2 	TC:C(r   c                     ! R  R4      pV! 4       p\        \        4      ;_uu_ 4        \        VRR.RR7       RRR4       R#   + '       g   i     R# ; i)c                   ,   a  ] tR t^Et o R tR tRtV tR# )!TestRoot.test_f_size.<locals>.func                    ^ V n         R# )r6   Ncount)r.   s   &r   __init__*TestRoot.test_f_size.<locals>.fun.__init__F   s	    
r   c                   V ;P                   ^,          un         V P                   ^,          '       g=   V^ ,          RV^ ,          V^,          ,
          ^,          ,          ,           R,
          pV# V^ ,          RV^ ,          V^,          ,
          ^,          ,          ,           R,
          RV^,          V^ ,          ,
          ^,          ,          V^,          ,           .pV# )rA   r!   g      ?rM   )r.   r   rets   && r   __call__*TestRoot.test_f_size.<locals>.fun.__call__I   s    

a


QA$!qt'9!99C?C
 
 aD3!A$1+!);#;;cA!A$1+!!33ad:<C 
r   rM   N)__name__
__module____qualname____firstlineno__rO   rS   __static_attributes____classdictcell____classdict__s   @r   funrK   E   s     	 	r   r]   皙?g        r#   )r    N)assert_raises
ValueErrorr   )r.   r]   Fs   &  r   test_f_sizeTestRoot.test_f_sizeA   s?    	 	 E:&&S#Jt, '&&&s   AA	c           
     r  aa R  oR oVV3R lp\         P                  ! ^4      p\        SVR
RR7      pRp\        \        VR7      ;_uu_ 4        \        SVR
RSR7      pRRR4       \        \        VR7      ;_uu_ 4        \        WR
RR	R7      pRRR4       \        XP                  VP                  4       \        XP                  VP                  4       VP                  VP                  u;J d   VP                  u;J d   R	J g   Q h Q hR#   + '       g   i     L; i  + '       g   i     L; i)c                     ^V ^ ,          ,          RV ^,          ^,          ,          ,
          ^
,           RV ^ ,          ^,          ,          ^V ^,          ,          ,           ^,
          .# )r   g      ?r^    r   ignoreds   &&r   r]   #TestRoot.test_gh_10370.<locals>.fun\   sI    adFT!A$'\)B.AaD!Ga!f0Dq0HIIr   c                 J    ^RV ^,          ,          .RV ^ ,          ,          ^..# )r   r!   g?rf   rg   s   &&r   grad$TestRoot.test_gh_10370.<locals>.grad_   s%    ad
OcAaDj!_55r   c                 $   < S! W4      S! W4      3# )Nrf   )r   rh   r]   rk   s   &&r   fun_grad(TestRoot.test_gh_10370.<locals>.fun_gradb   s    q?D$444r   r(   )rE   r    z'Method krylov does not use the jacobian)match)rE   r    r   NTrF   )r   r=   r   assert_warnsRuntimeWarningr   r   r+   )	r.   rn   x0refmessageres1res2r]   rk   s	   &      @@r   test_gh_10370TestRoot.test_gh_10370X   s    	J	6	5 XXa[3h7;.88Rd8FD 9.884dKD 9 	TVVSUU#TVVSUU#||t||Bs{{BdBBBBB 9888s   DD&D#	&D6	r    c                P    R  p\        V^.VR7      pVP                  V8X  g   Q hR# )c                     V ^,
          # rF   rf   r7   s   &r   r   ,TestRoot.test_method_in_result.<locals>.funcw   s    q5Lr   )rs   r    N)r   r    )r.   r    r   ress   &&  r   test_method_in_resultTestRoot.test_method_in_resultr   s+    
	 4QC/zzV###r   rf   N)
r"   r#   r$   r%   r&   r)   r'   r*   r(   zdf-sane)rU   rV   rW   rX   r2   r>   rG   rb   rx   pytestmarkparametrizer~   rY   rZ   r[   s   @r   r	   r	      sI     :, )-.C4 [[X (= >$	>$r   r	   )__doc__numpy.testingr   r   r   r   r_   r   rq   numpyr   scipy.optimizer   r	   rf   r   r   <module>r      s'    0  A  o$ o$r   