+
    /i                     ^    ^ RI t^ RIt^ RIt^ RIHtHt ^ RIHtH	t	H
t
HtHt  ! R R4      tR# )    N)assert_allcloseassert_equal)BoundsLinearConstraintNonlinearConstraintOptimizeResultminimizec                   z   a  ] tR t^t o R t]RR l4       t]R 4       tR tR t	R t
R tR tR	 tR
 tR tRtV tR# )
TestCOBYQAc                *    R R.V n         R^d/V n        R# )@Q?maxfevN)x0optionsselfs   &^/var/www/html/photoedit/myenv/lib/python3.14/site-packages/scipy/optimize/tests/test_cobyqa.pysetup_methodTestCOBYQA.setup_method   s    , #    c                l    V ^ ,          ^,          V\        V ^,          4      ^,          ,          ,           # )r   )abs)xcs   &&r   funTestCOBYQA.fun   s&    tQwS1Y\)))r   c                Z    V ^ ,          ^,          V ^,          ^,          ,           R,
          # )r   g      9@ )r   s   &r   conTestCOBYQA.con   s"    tQw1q 4''r   c           	     l    ! R  R4      p ! R R4      pRR.pV! 4       pV! 4       p\        V P                  RR4      p\        V P                  VRVVV P                  R7      p\        V P                  VRVVV P                  R7      p\
        P                  ! R4      R.p	\        VP                  V	R	R
7       VP                  '       g   Q VP                  4       hVP                  R8  g   Q V4       hVP                  ^d8:  g   Q V4       hVP                  V P                  V	4      R,           8  g   Q V4       hVP                  VP                  8X  g   Q R4       h\        VP                  VP                  4       VP                  '       g   Q VP                  4       hVP                  VP                  8X  g   Q hVP                  VP                  8X  g   Q hVP                  VP                  8X  g   Q hVP                  VP                  8X  g   Q hVP                  VP                  8X  g   Q R4       hR# )c                   ,   a  ] tR t^t o R tR tRtV tR# )1TestCOBYQA.test_minimize_simple.<locals>.Callbackc                H    \         P                  ! 4       V n        ^ V n        R# r   N	threadingLocklockn_callsr   s   &r   __init__:TestCOBYQA.test_minimize_simple.<locals>.Callback.__init__       %NN,	 r   c                    \        V\        P                  4      '       g   Q hV P                  ;_uu_ 4        V ;P                  ^,          un        RRR4       R#   + '       g   i     R# ; i   N)
isinstancenpndarrayr*   r+   )r   r   s   &&r   __call__:TestCOBYQA.test_minimize_simple.<locals>.Callback.__call__#   s<    !!RZZ0000YYYLLA%L YYYs   AA,	r*   r+   N__name__
__module____qualname____firstlineno__r,   r5   __static_attributes____classdictcell____classdict__s   @r   Callbackr$           !& &r   rA   c                   ,   a  ] tR t^(t o R tR tRtV tR# ):TestCOBYQA.test_minimize_simple.<locals>.CallbackNewSyntaxc                H    \         P                  ! 4       V n        ^ V n        R# r&   r'   r   s   &r   r,   CTestCOBYQA.test_minimize_simple.<locals>.CallbackNewSyntax.__init__)   r.   r   c                    \        V\        4      '       g   Q hV P                  ;_uu_ 4        V ;P                  ^,          un        RRR4       R#   + '       g   i     R# ; ir0   )r2   r   r*   r+   )r   intermediate_results   &&r   r5   CTestCOBYQA.test_minimize_simple.<locals>.CallbackNewSyntax.__call__-   s9    !"5~FFFFYYYLLA%L YYYs   AA"	r7   Nr8   r?   s   @r   CallbackNewSyntaxrD   (   rB   r   rJ   r   r           cobyqa)methodconstraintscallbackr   -C6?atol:0yE>MbP?z<Callback is not called exactly once for every function eval.N888@UUUUUU?)r   r    r	   r   r   r3   sqrtr   r   successmessagemaxcvnfevr+   r   nit)
r   rA   rJ   r   rO   callback_new_syntaxrN   solsol_newsolutions
   &         r   test_minimize_simpleTestCOBYQA.test_minimize_simple   s   	& 	&	& 	& D\:/1 *$((C=HH#LL
 HH#(LL
 GG,-y9xd3{{{'CKK'{yy4$$xx3##ww(+d227C72xx8+++ 	KJ	K+SUUGII&//ww'++%%%yyGMM)))xx7<<'''ww'++%%%||2::: 	KJ	K:r   c           	       a a VV 3R  lp\        RR.RR.4      o\        S P                  RR4      p\        VS P                  RSVS P
                  R7      p\        P                  ! R4      R.p\        VP                  VRR	7       VP                  '       g   Q VP                  4       hVP                  R
8  g   Q V4       h\        P                  ! SP                  VP                  8*  4      '       d4   \        P                  ! VP                  SP                  8*  4      '       g   Q V4       hVP                   ^d8:  g   Q V4       hVP"                  S P#                  V4      R,           8  g   Q V4       h\        RR.RR.4      o\        VS P                  RSVS P
                  R7      pVP                  '       d   Q VP                  4       hVP                  R8  g   Q V4       h\        P                  ! SP                  VP                  8*  4      '       d4   \        P                  ! VP                  SP                  8*  4      '       g   Q V4       hVP                   ^d8:  g   Q V4       hR# )c                    < \         P                  ! SP                  V 8*  4      '       d*   \         P                  ! V SP                  8*  4      '       g   Q hSP	                  V 4      # N)r3   alllbubr   )r   boundsr   s   &r   fun_check_bounds9TestCOBYQA.test_minimize_bounds.<locals>.fun_check_boundsZ   sD    66&))q.))bffQ&))^.D.DDD88A;r         @333333?      @ffffff?rK   rL   rM   ri   rN   r   rP   rQ   rS   rT   g      @g?gffffff?NrU   rV   )r   r   r    r	   r   r   r3   rW   r   r   rX   rY   rZ   rf   rg   rh   r[   r   )r   rj   rN   r^   r`   ri   s   f    @r   test_minimize_boundsTestCOBYQA.test_minimize_boundsY   s   	
 c
S#J/)$((C=GG#LL
 GG,-y9xd3{{{'CKK'{yy4$$vvfii355())bffSUUfii5G.H.HM#MHxx3##ww(+d227C72 c
S$K0GG#LL
 ;;;++yy4$$vvfii355())bffSUUfii5G.H.HM#MHxx3##r   c                B   \        R R .R R 4      p\        V P                  V P                  RVV P                  R7      p^\
        P                  ! ^4      ,
          ^,          \
        P                  ! ^4      ^,
          ^,          .p\        VP                  VRR7       VP                  '       g   Q VP                  4       hVP                  R8  g   Q V4       hVP                  ^d8:  g   Q V4       hVP                  V P                  V4      R,           8  g   Q V4       hR# )      ?rL   rM   rN   r   rP   rQ   rS   rT   N)r   r	   r   r   r   r3   rW   r   r   rX   rY   rZ   r[   r   rN   r^   r`   s   &   r    test_minimize_linear_constraints+TestCOBYQA.test_minimize_linear_constraints   s    &Sz3<HHGG#LL
 ^q(2771:>Q*>?xd3{{{'CKK'{yy4$$xx3##ww(+d227C72r   c           	        \        V P                  R R 4      p\        V P                  V P                  R	RVV P
                  R7      p\        P                  ! R
4      R.p\        VP                  VRR7       VP                  '       g   Q VP                  4       hVP                  R8  g   Q V4       hVP                  ^d8:  g   Q V4       hVP                  V P                  VR4      R,           8  g   Q V4       hR# )rK          @rL   )argsrM   rN   r   rP   rQ   rS   rT   N)rz   g988@gUUUUUU?)r   r    r	   r   r   r   r3   rW   r   r   rX   rY   rZ   r[   rv   s   &   r   test_minimize_argsTestCOBYQA.test_minimize_args   s    )$((C=HHGG#LL
 GG-.	:xd3{{{'CKK'{yy4$$xx3##ww(C0477<<7r   c                ^  a  V 3R  lp\        RR.RR.4      p\        S P                  RR4      p\        S P                  S P
                  RVVS P                  R7      pR F  p\        VS P
                  V3RVVS P                  R7      p\        VP                  VP                  4       VP                  '       g   Q VP                  4       hVP                  VP                  8X  g   Q hVP                  VP                  8X  g   Q hVP                  VP                  8X  g   Q hVP                  VP                  8X  d   K  Q h	  \        P                  ! \         4      ;_uu_ 4        \        V 3R	 lS P
                  RVVS P                  R7       R
R
R
4       R
#   + '       g   i     R
# ; i)c                    < \         P                  ! SP                  V 4      4      p\         P                  ! VRV,          4      # )r1   )r1   )r3   arrayr   reshape)r   dimfr   s   && r   	fun_array1TestCOBYQA.test_minimize_array.<locals>.fun_array   s.    !%A::a,,r   rl   rm   rn   ro   rK   rL   rp   )r{   rM   ri   rN   r   c                 p   < \         P                  ! SP                  V 4      SP                  V 4      .4      # re   )r3   r   r   )r   r   s   &r   <lambda>0TestCOBYQA.test_minimize_array.<locals>.<lambda>   s#    "((DHHQK!#=>r   N)r   r1      )r   r   r    r	   r   r   r   r   r   rX   rY   rZ   r[   r\   pytestraises	TypeError)r   r   ri   rN   r^   r   	sol_arrays   f      r   test_minimize_arrayTestCOBYQA.test_minimize_array   sX   	-
 c
S#J/)$((C=HHGG#LL
 C V'I 	,$$$7i&7&77$77imm+++99	///88y~~---77imm+++ $ ]]9%%>' &%%%s   '*FF,	c                    \        V P                  R R 4      pR^/p\        V P                  V P                  RVVR7      pVP
                  '       d   Q VP                  4       hVP                  ^8:  g   Q V4       hR# )rK   r   rL   ru   N)r   r    r	   r   r   rX   rY   r[   r   rN   r   r^   s   &   r   test_minimize_maxfevTestCOBYQA.test_minimize_maxfev   sl    )$((C=Q-HHGG#
 ;;;++xx1}!c!}r   c                    \        V P                  R R 4      pR^/p\        V P                  V P                  RVVR7      pVP
                  '       d   Q VP                  4       hVP                  ^8:  g   Q V4       hR# )rK   maxiterrL   ru   N)r   r    r	   r   r   rX   rY   r\   r   s   &   r   test_minimize_maxiter TestCOBYQA.test_minimize_maxiter   sl    )$((C=a.HHGG#
 ;;;++ww!| S |r   c                   \        V P                  R R 4      p\        V P                  V P                  RVV P
                  R7      p\        V P
                  4      pVP                  VR&   \        V P                  V P                  RVVR7      pVP                  '       g   Q VP                  4       hVP                  R8  g   Q V4       hVP                  VP                  8:  g   Q V4       hVP                  VP                  8:  g   Q V4       hR# )rK   rL   ru   f_targetrS   N)r   r    r	   r   r   r   dictrX   rY   rZ   r[   )r   rN   sol_refr   r^   s   &    r   test_minimize_f_target!TestCOBYQA.test_minimize_f_target   s    )$((C=HHGG#LL
 t||$%kk
HHGG#
 {{{'CKK'{yy4$$xx7<<',,'ww'++%*s*%r   )r   r   N)rt   )r9   r:   r;   r<   r   staticmethodr   r    ra   rq   rw   r|   r   r   r   r   r=   r>   r?   s   @r   r   r      sc     ' * * ( (:Kx%$N8 ="*X"!+ +r   r   )numpyr3   r   r(   numpy.testingr   r   scipy.optimizer   r   r   r   r	   r   r   r   r   <module>r      s'       7 m+ m+r   