+
    /i|                        R t ^ RIHt ^ RIt^ RIt^ RIHt ^ RIH	t	H
t
 ^ RIHtHt ^ RIHtHtHt ^ RIHtHtHt ^ RIHt ^ R	IHt ^ RIt^ R
IHtHtHtHtH t  ^ RI!H"t#H$t$ ^ RI!t! ! R R4      t%R# )z@
Unit tests for the differential global minimization algorithm.
)PoolN)assert_deallocated)DifferentialEvolutionSolver_ConstraintWrapper)differential_evolutionOptimizeResult)BoundsNonlinearConstraintLinearConstraint)rosenminimize	rosen_der)	csr_array)stats)assert_equalassert_allcloseassert_almost_equalassert_string_equalassert_)raiseswarnsc                     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R tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR t R t!R t"R  t#R! t$R" t%R# t&R$ t'R% t(R& t)R' t*R( t+R) t,]-P\                  P_                  ^
4      R* 4       t0R+ t1R, t2R- t3R. t4]-P\                  P_                  ^
4      R/ 4       t5R0 t6R1 t7R2 t8R3 t9]-P\                  P_                  ^4      R4 4       t:]-P\                  P_                  ^
4      R5 4       t;]-P\                  P_                  ^
4      R6 4       t<]-P\                  P_                  ^
4      R7 4       t=]-P\                  P_                  ^
4      R8 4       t>]-P\                  P_                  ^
4      R9 4       t?R: t@]-P\                  P                  ]-P\                  P                  ]CP                  ! 4       R;8H  R<R=7      R> 4       4       tE]-P\                  P_                  ^4      R? 4       tF]-P\                  P_                  ^
4      R@ 4       tGRA tH]-P\                  P_                  ^
4      RB 4       tIRC tJRD tKRE tL]-P\                  P_                  ^4      RF 4       tMRG tNRHtOV tPRI# )JTestDifferentialEvolutionSolverc                   \         P                  ! R R7      V n        \         P                  ! RR.RR..4      V n        R	R	.V n        \        V P                  R
.4      V n        \        V P                  R.^RR7      V n	        \         P                  ! \         P                  ! RRR4      4      P                  pWP                  n        R# )raiseinvalid               @      ?)popsizemutation皙?皙?Nr   r       d   r&      )npseterr
old_seterrarraylimitsboundsr   	quadraticdummy_solverdummy_solver2
atleast_2darangeT
population)selfr6   s   & o/var/www/html/photoedit/myenv/lib/python3.14/site-packages/scipy/optimize/tests/test__differential_evolution.pysetup_method,TestDifferentialEvolutionSolver.setup_method   s    ))G4hhR!#R * +*79A
D 9:@ABBEG ]]299S#s#;<>>
(2%    c                F    \         P                  ! R/ V P                  B  R # )N )r*   r+   r,   r7   s   &r8   teardown_method/TestDifferentialEvolutionSolver.teardown_method.   s    
		$DOO$r;   c                "    V^ ,          ^,          # r&   r=   )r7   xs   &&r8   r0   )TestDifferentialEvolutionSolver.quadratic1   s    tQwr;   c                   \        \        V P                  R R7      p\        VP                  R 4       \        VP
                  P                  R4       \        \        V P                  RR7      p\        VP                  R4       \        VP
                  P                  R4       \        \        V P                  RR7      p\        VP                  R4       \        VP
                  P                  R4       \        \        V P                  RR7      p\        VP                  R4       \        VP
                  P                  R4       \        \        V P                  RR7      p\        VP                  R4       \        VP
                  P                  R4       \        \        V P                  R	R7      p\        VP                  R	4       \        VP
                  P                  R
4       \        \        V P                  RR7      p\        VP                  R4       \        VP
                  P                  R4       \        \        V P                  RR7      p\        VP                  R4       \        VP
                  P                  R4       \        \        V P                  RR7      p\        VP                  R4       \        VP
                  P                  R4       \        \        V P                  RR7      p\        VP                  R4       \        VP
                  P                  R4       \        \        V P                  RR7      p\        VP                  R4       \        VP
                  P                  R4       \        \        V P                  RR7      p\        VP                  R4       \        VP
                  P                  R4       R# )best1expstrategy_best1best1binrand1bin_rand1rand1exprand2exp_rand2best2bin_best2rand2binrandtobest1bin_randtobest1randtobest1expcurrenttobest1bin_currenttobest1currenttobest1expN)r   r   r/   r   rH   mutation_func__name__r7   solvers   & r8   test__strategy_resolves7TestDifferentialEvolutionSolver.test__strategy_resolves4   s    -U-1[[6@B 	V__j1V))22H=,U-1[[6@B 	V__j1V))22H=,U-1[[6@B 	V__j1V))22H=,U-1[[6@B 	V__j1V))22H=,U-1[[6@B 	V__j1V))22H=,U-1[[6@B 	V__j1V))22H=,U-1[[6@B 	V__j1V))22H=,U-1[[6@B 	V__j1V))22H=,U-1[[6FH 	V__&67V))22NC,U-1[[6FH 	V__&67V))22NC,U-1[[6IK 	V__&9:V))224EF,U-1[[6IK 	V__&9:V))224EFr;   c                R   \         P                  ! R .4      pV P                  P                  \         P                  ! . RO4      4      p\	        W!4       \         P                  ! R.4      pV P                  P                  \         P                  ! . RO4      4      p\	        W!4       R# )皙?      ?N               )r*   r-   r2   rI   r   rL   r7   resulttrials   &  r8   test__mutate1-TestDifferentialEvolutionSolver.test__mutate1   sp    4&!""))"((?*CD&4&!""))"((?*CD&r;   c                R   \         P                  ! R.4      pV P                  P                  \         P                  ! . RO4      4      p\	        W!4       \         P                  ! R .4      pV P                  P                  \         P                  ! . RO4      4      p\	        W!4       R# )r"   Ngrb   )r*   r-   r2   rQ   r   rO   rh   s   &  r8   test__mutate2-TestDifferentialEvolutionSolver.test__mutate2   sq     4&!""))"((?*CD&3%""))"((?*CD&r;   c                    \         P                  ! R .4      pV P                  P                  \         P                  ! . RO4      4      p\	        W!4       R# )g333333?Nrb   )r*   r-   r2   rT   r   rh   s   &  r8   test__randtobest11TestDifferentialEvolutionSolver.test__randtobest1   s9    4&!""//0IJ&r;   c                    \         P                  ! R .4      pV P                  P                  ^\         P                  ! . RO4      4      p\	        W!4       R# )r"   Nrb   )r*   r-   r2   rW   r   rh   s   &  r8   test__currenttobest14TestDifferentialEvolutionSolver.test__currenttobest1   s@    3%""22HH_%
 	&r;   c                    Rp\        V P                  V P                  VR7      p\        VP                  \        V4      4       R# )r   r!   Nr   r)   )r   r0   r/   r   ditherlist)r7   r!   r\   s   &  r8   test_can_init_with_dithering<TestDifferentialEvolutionSolver.test_can_init_with_dithering   s6    ,T^^-1[[6>@ 	V]]DN3r;   c                   \         pRp\        \        \        VV P                  VR7       Rp\        \        \        VV P                  VR7       R\
        P                  3p\        \        \        VV P                  VR7       R p\        VV P                  VR7      p\        R VP                  4       \        RVP                  4       R# )r   rw   r"   N)r   rd   r)   )
r   assert_raises
ValueErrorr   r/   r*   nanr   scalery   )r7   funcr!   r\   s   &   r8   +test_invalid_mutation_values_arent_acceptedKTestDifferentialEvolutionSolver.test_invalid_mutation_values_arent_accepted   s    j5++#+		- j5++#+		- =j5++#+		- ,T-1[[6>@ 	S&,,'T6==)r;   c                    R  p\        \        RR7      ;_uu_ 4        \        VRR.4       RRR4       R#   + '       g   i     R# ; i)c                     \         P                  ! \         P                  ! V ^,          4      \         P                  ! V 4      .4      # rc   )r*   r-   sumrC   s   &r8   r   ETestDifferentialEvolutionSolver.test_invalid_functional.<locals>.func   s*    88RVVAF^RVVAY788r;   z,func\(x, \*args\) must return a scalar valuematchNrc   )r   RuntimeErrorr   )r7   r   s   & r8   test_invalid_functional7TestDifferentialEvolutionSolver.test_invalid_functional   sH    	9 EG G #4'7);<G G G Gs	   6A	c                   \         P                  ! R .4      p\        ^V P                  P	                  V4      4       \         P                  ! ^d.R..4      V P                  n        \        ^V P                  P	                  V4      4       R# )333333?r   N)r*   r-   r   r1   _scale_parametersr.   r7   rj   s   & r8   test__scale_parameters6TestDifferentialEvolutionSolver.test__scale_parameters   sh    #R**<<UCD $&88cURDM#: R**<<UCDr;   c                   \         P                  ! ^.4      p\        RV P                  P	                  V4      4       \         P                  ! ^d.R..4      V P                  n        \        RV P                  P	                  V4      4       R# )   r   r   N)r*   r-   r   r1   _unscale_parametersr.   r   s   & r8   test__unscale_parameters8TestDifferentialEvolutionSolver.test__unscale_parameters   sh    "S$++??FG $&88cURDM#: S$++??FGr;   c                L   \         P                  ! R R7      ;_uu_ 4        \        V P                  RR.R7      pVP	                  RR.4      p\        VR4       RRR4       \        V P                  RR	.4      p\        VP                  RR.4       R#   + '       g   i     LB; i)
r   r   r         @)r/   r   Nr   r   )      ?r   )r   r   )	r*   errstater   r0   r   r   r   r   rC   )r7   r\   vress   &   r8   test_equal_bounds1TestDifferentialEvolutionSolver.test_equal_bounds   s    [[))0"J/F **C:6AAs# * %T^^j*5MNSUUS#J' *)s   9BB#	c                    \         P                  ! . RO4      pV P                  P                  V4       \	        V^,          R4       \        \         P                  ! V^ 8  V^8*  4      P                  4       4       R# )皙??N)r   r   r   g     r@gh㈵)r*   r-   r1   _ensure_constraintr   r   logical_andallr   s   & r8   test__ensure_constraint7TestDifferentialEvolutionSolver.test__ensure_constraint   sW    =>,,U3U1Xs#uz5A:6::<=r;   c                j   \        V P                  R.^RR7      pVP                  4       p\        VP                  V P                  VP
                  4      4       \        V P                  R.^RR7      pVP                  4       p\        VP                  V P                  VP
                  4      4       R# )rc   F)maxiterpolishTNr   )r   r0   solver   funrC   r7   r\   ri   s   &  r8   test_differential_evolution;TestDifferentialEvolutionSolver.test_differential_evolution   s     -NNWIq
 VZZ!9:,NNWIq
 VZZ!9:r;   c                    \        V P                  R.4      pVP                  4       p\        VP                  VP                  R^ R7       R# )rc   gV瞯<)atolrtolNr   )r   r0   r   r   rC   r   s   &  r8   test_best_solution_retrieval<TestDifferentialEvolutionSolver.test_best_solution_retrieval  s5    ,T^^gYG&((Q?r;   c                  aaa	 ^
o	V3R loRSn         \        P                  Sn        VV	3R lo^ Sn        RSn        SSn        RR.p\        SVRRR7      p\        R/ VBRS/B p\        R/ VBRS	/B pVP                  VP                  u;J d   RJ g   Q h Q hSP                  VP                  u;8X  d	   S	8X  g   Q h Q hVP                  R	8X  g   Q hVP                  R
8X  g   Q hVP                  4        F=  w  rVVR9   d   K  \        SP
                  V,          V4       \        W5,          V4       K?  	  ^ Sn        \        P                  Sn        RVR&   \        R/ VBRS/B pVP                  VP                  8  g   Q hR# )
   c                 \   < \        V 4      pVSP                  8  d   V Sn        VSn        V# N)r   valrC   )rC   r   r   s   & r8   r   FTestDifferentialEvolutionSolver.test_intermediate_result.<locals>.func  s*    (CTXX~Jr;   Nc                    < S;P                   ^,          un         V Sn        V P                  P                  ^8X  g   Q hV P                  P                  ^,          ^8X  g   Q hV P                   SP                   8X  g   Q h\        V P                  SP                  P                  4       \        V P                  SP                  P                  4       \        V P                  \        V P                  4      4       \        \        V P                  4      4       F=  pV P                  V,          p\        V P                  V,          4      p\        W#4       K?  	  \        V P                  V P                  ^ ,          4       \        V P                  V P                  ^ ,          4       V P                  R8X  g   Q hV P                  RJ g   Q h\!        V \"        4      '       g   Q hSP                   S8X  d   \$        hR# )r)   zin progressTN)nitintermediate_resultr6   ndimshaper   rC   r   r   r   r   rangelenpopulation_energiesmessagesuccess
isinstancer   StopIteration)r   ir   refcallbackr   s   &   r8   r   JTestDifferentialEvolutionSolver.test_intermediate_result.<locals>.callback  s   LLAL+>H(&1166!;;;&1177:a???&**hll::: ,..@,00(--2C2CD ,00%8K8M8M2NO32FFGH)==a@/::1=>S& I ,..,77:<,00,@@CE '..-???&..$6661>BBBB||w&## 'r;   ie F)r   r/   rngr   r   r   &callback function requested stop early/Maximum number of iterations has been exceeded.Tr   r&   rc   r=   >   r   r   )rC   r*   infr   r   r   r   dictr   r   r   itemsr   r   )
r7   r/   kwargsr   r   fieldr   r   r   r   s
   &      @@@r8   test_intermediate_result8TestDifferentialEvolutionSolver.test_intermediate_result  sm    	 66	$8 '+$&!4F5I$AvAA$?v?w? {{ckk2U22222||sww1'11111{{FFFF{{OOOO))+JE..55e<cBS)	 & 66x$AvAAww   r;   c                   RR.pRpR	R lp\        \        WR7      p\        VP                  V4       R p\        \        WR7      pVP                  '       d   Q hR	R lp\        \        WR7      p\        VP                  V4       VP                  '       d   Q hR	R lp\        \        VVR7      pVP                  '       g   Q hR# )
r&   r   c                     R # )Tr=   paramconvergences   &&r8   callback_python_trueVTestDifferentialEvolutionSolver.test_callback_terminates.<locals>.callback_python_trueX  s    r;   )r   c                     \         hr   )r   )r   s   &r8   callback_stopOTestDifferentialEvolutionSolver.test_callback_terminates.<locals>.callback_stopa  s    r;   c                     ^
.# )r   r=   r   s   &&r8   callback_evaluates_trueYTestDifferentialEvolutionSolver.test_callback_terminates.<locals>.callback_evaluates_trueg  s	    4Kr;   c                     . # r   r=   r   s   &&r8   callback_evaluates_falseZTestDifferentialEvolutionSolver.test_callback_terminates.<locals>.callback_evaluates_falseo  s    Ir;   Nr   )r   )r   r   r   r   r   )r7   r/   expected_msgr   ri   r   r   r   s   &       r8   test_callback_terminates8TestDifferentialEvolutionSolver.test_callback_terminatesT  s    &!?	 (6
 	FNNL9	  (vN>>>!!	 (vXFNNL9>>>!!	 (v1IK~~~~r;   c                `    R.pRpR p\        VVVRR7      p\        VP                  R4       R# )r   c                     \        V\        4      '       g   \        R 4      hV^ ,          V^,          V ,          ,           V^,          V R,          ,          ,           # )zargs should be a tupler   )r   tupler   )rC   argss   &*r8   r0   LTestDifferentialEvolutionSolver.test_args_tuple_is_passed.<locals>.quadratic{  sC    dE** !9::7T!Wq[(47QU?::r;   T)r   r   Nr   )r   r   r   gUUUUUU?)r   r   r   )r7   r/   r   r0   ri   s   &    r8   test_args_tuple_is_passed9TestDifferentialEvolutionSolver.test_args_tuple_is_passedv  s:    	;
 (	(.-1/35 	FJJ/r;   c                H    \         pR.p\        \        \        VVRR7       R# )rd   abcrG   Nrd   )r   r   r   r   )r7   r   r/   s   &  r8   test_init_with_invalid_strategy?TestDifferentialEvolutionSolver.test_init_with_invalid_strategy  s$    j0 #(		*r;   c                    \         pR.p\        \        \        VV4       RR.p\        \        \        VV4       \        \         \	        ^ ^ .^^.4      4      p\        VP                  R4       R# )rd   Nr   r   )rd   re   rf   )r   r   )r   r   r   r   r   r   rC   )r7   r   r/   ri   s   &   r8   test_bounds_checking4TestDifferentialEvolutionSolver.test_bounds_checking  sk    j0 	" 9%j0 	" (vq!fq!f/EFFHHh/r;   c                h   \         P                  ! R RR7      P                  ^^4      p\        \	        VR,          VR,          4      4      p\        RV^R7      p^ pVP                  V^4      w  rVrxp	\        \        \         P                  ! \         P                  ! WEWgW.4      4      4      ^4       R# )g      (@float64)dtypeNr    )r&   NNN)r)   r  )r*   r4   reshaperz   zipr   _select_samplesr   r   uniquer-   )
r7   r.   r/   r\   	candidater1r2r3r4r5s
   &         r8   test_select_samples3TestDifferentialEvolutionSolver.test_select_samples  s    3i088A>c&,t56,T61E	#33IqA		"((I22#BCDEq	Jr;   c                    \        \        V P                  ^R7      pVP                  4       p\	        VP
                  R4       \	        VP                  R4       R# )r)   )r   Fr   N)r   r   r/   r   r   r   r   r   s   &  r8   test_maxiter_stops_solve8TestDifferentialEvolutionSolver.test_maxiter_stops_solve  sA     -UDKKKV^^U+V^^I	Kr;   c           	        \        \        V P                  ^RR7      pVP                  4       p\	        VP
                  ^4       \	        VP                  R4       \	        VP                  R4       \        \        V P                  ^R^(R7      pVP                  4       p\	        VP
                  ^)4       \	        VP                  R4       \	        VP                  R4       \        \        V P                  ^R^/RR7      pVP                  4       p\	        VP
                  ^/4       \	        VP                  R4       \	        VP                  R4       R# )	r)   F)maxfunr   z9Maximum number of function evaluations has been exceeded.)r    r   r  deferred)r    r   r  updatingz8Maximum number of function evaluations has been reached.N)r   r   r/   r   r   nfevr   r   r   s   &  r8   test_maxfun_stops_solve7TestDifferentialEvolutionSolver.test_maxfun_stops_solve  s    -UDKK49;V[[!$V^^U+V^^&	' -U-1[[564946	8
 V[["%V^^U+V^^&	' -U-1[[5649466@B V[["%V^^U+V^^%	&r;   c                    \        V P                  R.RR7      pVP                  4        \        \        P
                  ! VP                  4      ^ 4       R# )r'   {Gz?)tolNr   r'   )r   r0   r   r   r*   argminr   r[   s   & r8   test_quadratic.TestDifferentialEvolutionSolver.test_quadratic  s>    ,T^^.9]157 	RYYv99:A>r;   c                :    \        V P                  R.R^R7       R# )r'   r   )r!  seedNr"  )r   r0   r>   s   &r8   test_quadratic_from_diff_ev;TestDifferentialEvolutionSolver.test_quadratic_from_diff_ev  s    t~~ +}#'$%	'r;   c                    \        V P                  R.R^RR7      p\        V P                  R.R^RR7      p\        VP                  VP                  4       \        VP                  VP                  4       R# )r'   Fr   )r   r   r!  Nr"  )r   r0   r   rC   r  )r7   ri   result2s   &  r8   test_rng_gives_repeatability<TestDifferentialEvolutionSolver.test_rng_gives_repeatability  sf    ')4/4,-,/	1
 ))4/4,-,/	1
 	VXXwyy)V[[',,/r;   c           
         \         P                  P                  4       p. ROpV F  p\        V P                  R.RVRVR7       K!  	  R# )randomFr   )r   r   r!  initN)r/  latinhypercubesobolhaltonr"  )r*   r/  default_rngr   r0   )r7   r   initsr0  s   &   r8   test_random_generator5TestDifferentialEvolutionSolver.test_random_generator  sD     ii##%?D"4>>$/=*/'*'*(,. r;   c                `    \        \        V P                  R ^R7      pVP                  4        R# )rF   )rH   r   Nr   r   r/   r   r[   s   & r8   test_exp_runs-TestDifferentialEvolutionSolver.test_exp_runs  s&    ,U-1[[6@568
 	r;   c                4    RR.p\        \        V^1^R7       R# )rf   )r    r   N)rf   )r   r   )r7   r/   s   & r8   test_gh_4511_regression7TestDifferentialEvolutionSolver.test_gh_4511_regression  s    
 7# 	ufb!Dr;   c                   \        \        V P                  ^R7      pVP                  VP                  4       VP                  4        \        \        P                  ! VP                  4      ^ 4       \        VP                  ^4       R# )rd   r  N)r   r   r/   _calculate_population_energiesr6   _promote_lowest_energyr   r*   r#  r   _nfevr[   s   & r8   "test_calculate_population_energiesBTestDifferentialEvolutionSolver.test_calculate_population_energies)  s]    ,UDKKK--f.?.?@%%'RYYv99:A> 	V\\1%r;   c                   \        \        V P                  ^^R7      p\        V4      w  r#\	        \
        P                  ! V^ 4      ^4       \	        VP                  ^4       \        \        \        V4       \        \        V P                  4      p\        V4      w  rE\        V4       F  w  rgVw  rWY8  g   Q hYrTV^28X  g   K   R# 	  R# )rd   )r    r  N)r   r   r/   nextr   r*   sizerC  r   r   	enumerate)
r7   r\   rC   r   _fun_prevr   soln	x_currentfun_currents
   &         r8   test_iteration.TestDifferentialEvolutionSolver.test_iteration3  s     -UDKK468fRWWQ]A& 	V\\2& 	mT62 -UDKK@6l (GA%)"I***#xBw )r;   c                    \        \        V P                  R RR7      pVP                  4        \	        VP
                  R 8  4       R# )皙?F)r!  r   N)r   r   r/   r   r   r   r[   s   & r8   test_convergence0TestDifferentialEvolutionSolver.test_convergenceM  s5    ,UDKKS49;""S()r;   c                `    \        \        V P                  R R R7      pVP                  4        R # )N)r   r  r9  r[   s   & r8   test_maxiter_none_GH57318TestDifferentialEvolutionSolver.test_maxiter_none_GH5731S  s$    
 -UDKK48:r;   c           
     0   \        \        \        .\        V P                  3O5/ R R/B  \        \        V P                  4      pVP                  4        \        VP                  ^ 4       \        \        P                  ! \        P                  ! VP                  4      4      4       VP                  4        \        VP                  ^ 4       \        \        P                  ! \        P                  ! VP                  4      4      4       VP                  RR7       \        VP                  ^ 4       \        \        P                  ! \        P                  ! VP                  4      4      4       \        \        V P                  RR7      pVP                  RR7       \        VP                  ^ 4       \        \        P                  ! \        P                  ! VP                  4      4      4       \        P                  ! R^^
4      P!                  ^^4      p\        \        V P                  VRR^^R7      p\        VP                  ^ 4       \        \        P                  ! \        P                  ! VP                  4      4      4       \        VP"                  ^8H  4       \        VP$                  R8H  4       \        P&                  ! VP)                  V4      ^ ^4      p\+        VP,                  R	,          V4       \+        \        P.                  ! VP,                  R	,          4      ^ 4       \+        \        P0                  ! VP,                  R	,          4      ^4       \        P                  ! R^^4      P!                  ^^4      p\        \        \        .\        V P                  3O5/ R V/B  \        P2                  P5                  R
R^R7      p\        \        V P                  VR7      p\7        VP,                  ^ ,          VR,          4       R# )r0  rubbishr3  )
qmc_enginer2  )r0  rP   {Gz?)r0  rH   r   r   r    Nrf   Nr   r   )lowhighrH  x0Nr   )rf   rc   )r   r   r   r   r/   init_population_randomr   rC  r   r*   r   isinfr   init_population_lhsinit_population_qmclinspacer	  num_population_memberspopulation_shapeclipr   r   r6   minmaxr/  uniformr   )r7   r\   r6   unscaled_populationr`  s   &    r8   test_population_initiation:TestDifferentialEvolutionSolver.test_population_initiation\  s   
 	j1	-t{{+	-  +	-
 -UDKK@
 	%%'V\\1%rxx : :;<=""$V\\1%rxx : :;<=""h"7V\\1%rxx : :;<=,UDKKgN""g"6V\\1%rxx : :;<= [[Q+33Aq9
,UDKK2<6@26AqJ
 	V\\1%rxx : :;<=--23''612 !ggf&@&@&L&',F--b13FG 	BFF6#4#4R#891=BFF6#4#4R#891= [[Q+33Aq9
j1	.t{{+	.  ,	. YY3Sq9,4;;2
 	))!,b3h7r;   c                   \        \        V P                  R R.R7      pVP                  '       g   Q h\	        \
        4      ;_uu_ 4        \        \        V P                  R R.R7       RRR4       R#   + '       g   i     R# ; i)rR  r#   r_   @N)r   r   r/   r   r   r   )r7   r   s   & r8   test_x0'TestDifferentialEvolutionSolver.test_x0  sV    $UDKKS#JG{{{{ :&&"5$++3*E '&&&s   
A33B	c                .    R  pRR.p\        WRR7       R# )c                 P    V ^ ,          R8  d   \         P                  # V ^,          # )r&   r   )r*   r   r   s   &r8   sometimes_infWTestDifferentialEvolutionSolver.test_infinite_objective_function.<locals>.sometimes_inf  s    tbyvvQ4Kr;   F)r/   dispNr(   )r   )r7   ru  r/   s   &  r8    test_infinite_objective_function@TestDifferentialEvolutionSolver.test_infinite_objective_function  s    	 &!}%Hr;   c                B   RR.p\        \        VRR7      p\        VP                  R8H  4       \        VP                  P
                  \        J 4       VP                  4       pVP                  '       g   Q h\        \        VRRR7      pVP                  '       g   Q hR# )r   r  )r  rF   )r  rH   Nr$   )
r   r   r   	_updating_mapwrapper_mapfuncmapr   r   r   )r7   r/   r\   r   s   &   r8   test_deferred_updating6TestDifferentialEvolutionSolver.test_deferred_updating  s    H%,UFZP  J./""++s23lln{{{{ %6J
 {{{{r;   c           	     v   RR.p\        \        V4      p\        VP                  R8H  4       \	        \
        4      ;_uu_ 4        \        \        V^R7      ;_uu_ 4       pVP                  4        RRR4       RRR4       XP                  R8X  g   Q hR#   + '       g   i     L-; i  + '       g   i     L8; i)r   	immediate)workersNr  r$   )r   r   r   r{  r   UserWarningr   )r7   r/   r\   ss   &   r8   test_immediate_updating7TestDifferentialEvolutionSolver.test_immediate_updating  s    H%,UF;  K/0 ;,UFAFF! G   {{j((( GF  s$   B(B	0B(B% B((B8	c                n   RR.p\        ^4      ;_uu_ 4       p\        \        VRVP                  R^R7      ;_uu_ 4       pVP                  P
                  f   Q hVP                  R8X  g   Q hVP                  4        RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)r   r  r"   )r  r  r!  r    Nr$   )
ThreadPoolr   r   r~  r|  poolr{  r   )r7   r/   pr\   s   &   r8   test_parallel_threads5TestDifferentialEvolutionSolver.test_parallel_threads  s    H%]]a!<6J3PQ"
 "
%%**666##z111LLN"
]] "
 "
]]]s#   (B# >B	>B#B B##B4	c           	         RR.p\        \        VR^^RR7      ;_uu_ 4       pVP                  P                  f   Q hVP                  R8X  g   Q hVP                  4        RRR4       R#   + '       g   i     R# ; i)r   r  r"   )r  r  r    r!  Nr$   )r   r   r|  r  r{  r   )r7   r/   r\   s   &  r8   test_parallel_processes7TestDifferentialEvolutionSolver.test_parallel_processes  ss    H%(6J1#
 
%%**666##z111LLN
 
 
 
s   >A**A;	c                |    \        \        RR.4      pVP                  4        \        VP	                  4       4       R# )r&   Nr   )r   r   r   r   	convergedr[   s   & r8   test_converged.TestDifferentialEvolutionSolver.test_converged  s-    ,UVV4DE  "#r;   c                  a R  pR o\        V\        P                  ) R4      p\        \        RR.V3R7      pVP                  \        P                  ! RR.4      4      p\        VR4       \        S\        P                  ) R4      p\        \        RR.W%3R7      p. ROp. ROp\        Wg4       FJ  w  rVP                  \        P                  ! V4      4      p\        V\        P                  ! V	4      4       KL  	  \        VP                  \        P                  ! V4      4      \        P                  ! V4      4       \        P                  ! \        P                  ! V4       Uu. uF  pVP                  V4      NK  	  up4      p
V
P                  R8X  g   Q hV3R lp\        V\        P                  ) R4      p\        \        RR.W%3RR	7      pR
Vn        \        P                  ! \        RR7      ;_uu_ 4        VP                  \        P                  ! V4      4       RRR4       R# u upi   + '       g   i     R# ; i)c                 2    V ^ ,          V ^,          ,           .# rB   r=   r   s   &r8   constr_fNTestDifferentialEvolutionSolver.test_constraint_violation_fn.<locals>.constr_f      aD1Q4K= r;   c                     \         P                  ! V ^ ,          ^,          V ^,          ,           V ^ ,          V ^,          ,
          .4      # rB   r*   r-   r   s   &r8   	constr_f2OTestDifferentialEvolutionSolver.test_constraint_violation_fn.<locals>.constr_f2  2    88QqT1Wqt^QqTAaD[9::r;   ffffff?constraintsr   r"   ?c                 (   < S! V 4      P                   # r   )r5   )rC   r  s   &r8   	constr_f3OTestDifferentialEvolutionSolver.test_constraint_violation_fn.<locals>.constr_f3  s    Q<>>!r;   F)r  
vectorizedTz#An array returned from a Constraintr   Nr   ))333333?r)   r   )r   r   ))r   {Gz?r   )rp  @r   )r&   r&   r&   )rd   r)   rd   )r	   r*   r   r   r   _constraint_violation_fnr-   r   r
  r   r3   r   r  pytestr   r   )r7   r  nlcr\   cvnlc2xsvsrC   r   constraint_violationr  r  s   &           @r8   test_constraint_violation_fn<TestDifferentialEvolutionSolver.test_constraint_violation_fn  s   	!	; "(RVVGS9,UVV4D:=A ,,RXXsCj-ABB$"9rvvgs;,UVV4D:=F
 0;KDA00!=BBa 01  
 	++BHHRL9288B<	
  "xx24((2,)@2>Q *0)H)H)K2>)@  A#))Y666	" #9rvvgs;,UVV4D:=8=? !]]$I
 
 ++BHHRL9
 
)@
 
 
s   )H0 &H55I	c           	     f   R  pR p\        V\        P                  ) R4      p\        \        RR.V3R7      pVP                  \        P                  ! RR.RR..4      4      w  rV\        VRR.4       \        V\        P                  ! R.R..4      4       VP                  R8X  g   Q h\        V\        P                  ) R	4      pR EFd  p\        \        RR.W73VRR7      pVP                  \        P                  ! RR.RR..4      4      w  rV\        VRR.4       \        V\        P                  ! . RO. RO.4      4       VP                  \        P                  ! RR.RR..4      4      w  rV\        VRR.4       \        V\        P                  ! . RO. RO.4      4       VP                  R8X  g   Q hVP                  \        P                  ! RR.RR..4      4      w  rV\        VR
R.4       \        V\        P                  ! . RO. RO.4      4       VP                  R8X  d   EKe  Q h	  R# )c                 2    V ^ ,          V ^,          ,           .# rB   r=   r   s   &r8   r  ZTestDifferentialEvolutionSolver.test_constraint_population_feasibilities.<locals>.constr_f%  r  r;   c                 l    V ^ ,          ^,          V ^,          ,           V ^ ,          V ^,          ,
          .# rB   r=   r   s   &r8   r  [TestDifferentialEvolutionSolver.test_constraint_population_feasibilities.<locals>.constr_f2(  s)    aD!GadNAaD1Q4K00r;   r  r  r   r   Fr"   rp  r  Tr  )r  r  r  g333333?ra   Nr   )rc   r)   )FT)r"   rR  r&   )r   r  r&   )rp  r  r&   )rc   rd   )r   r   r   )
r	   r*   r   r   r   #_calculate_population_feasibilitiesr-   r   r   r   )	r7   r  r  r  r\   feasr  r  	vectorizes	   &        r8   (test_constraint_population_feasibilitiesHTestDifferentialEvolutionSolver.test_constraint_population_feasibilities$  s   	!	1 "(RVVGS9,UVV4D:=A
 ==HHsCj2r(+,.TE5>*B3%# 89xx6!!!"9rvvgs;&I08H>A[<E:DFF
 AA3*sCj124HDu~.BHHm^-L$MNAA3*r2h/02HDu~.BHHm]-K$LM88v%%%AA4,R124HDe}-BHHnm-L$MN88v%%%+ 'r;   c                N   R  p\        V\        P                  ) R4      p\        \        RR.V3R7      p\        \        4      ;_uu_ 4        VP                  4       pRRR4       V! XP                  4      R8:  g   Q hVP                  '       g   Q hR#   + '       g   i     L?; i)c                 Z    \         P                  ! V ^ ,          V ^,          ,           .4      # rB   r  r   s   &r8   r  GTestDifferentialEvolutionSolver.test_constraint_solve.<locals>.constr_fR      88QqTAaD[M**r;   r  r  Nr   )
r	   r*   r   r   r   r   r  r   rC   r   )r7   r  r  r\   r   s   &    r8   test_constraint_solve5TestDifferentialEvolutionSolver.test_constraint_solveQ  s    	+ "(RVVGS9,UVV4D:=A ;,,.C   #%%%{{{{	  s   BB$	c           	        R  p\        V\        P                  ) R4      p\        \        RR.V3^^^dR7      p\        \        4      ;_uu_ 4        VP                  4       pRRR4       XP                  ^ 8  g   Q hVP                  '       d   Q h\        \        RR.V3RR7      p\        V4       VP                  P                  4       '       d   Q h\        P                  ! VP                  4      P                  4       '       d   Q h^pVP                  ^ ,          pVP                  V^ .,          VP                  ^ V.&   VP                   V^ .R3,          VP                   ^ V.R3&   VP                  V^ .R3,          VP                  ^ V.R3&   VP#                  4        \%        VP                  ^ ,          V4       R#   + '       g   i     ELi; i)c                 Z    \         P                  ! V ^ ,          V ^,          ,           .4      # rB   r  r   s   &r8   r  LTestDifferentialEvolutionSolver.test_impossible_constraint.<locals>.constr_fc  r  r;   )r  r    r   r   NF)r  r   r  r   r   )r	   r*   r   r   r   r   r  r   maxcvr   rG  feasibler   isfiniter   r  r6   rB  r   )r7   r  r  r\   r   lr  s   &      r8   test_impossible_constraint:TestDifferentialEvolutionSolver.test_impossible_constrainta  s   	+ "(RVVGR8,FF##SV
 ;,,.C   yy1}};;;
 -FF##GV??&&((((;;v99:>>@@@@ ((+-3-G-GA-O""Aq6*'-'8'8!Q'C1a&!)$''A	2 	##QFAI. 	%%'V003R83  s   G  G	c                    R  p\        V\        P                  ) R4      p\        \        RR.V3R7      pVP
                  pV! RR\        P                  ! R.4      RR\        P                  ! R.4      4      '       g   Q hV! RR\        P                  ! R.4      RR\        P                  ! R.4      4      RJ g   Q hV! RR\        P                  ! R.4      RR\        P                  ! R.4      4      '       g   Q hV! RR\        P                  ! R.4      RR\        P                  ! R.4      4      '       g   Q hV! RR\        P                  ! R	R	.4      RR\        P                  ! RR.4      4      '       g   Q hV! RR\        P                  ! R	R	.4      RR\        P                  ! RR	.4      4      '       g   Q hV! RR\        P                  ! R	R	.4      RR\        P                  ! RR
.4      4      '       d   Q hR# )c                 2    V ^ ,          V ^,          ,           .# rB   r=   r   s   &r8   r  CTestDifferentialEvolutionSolver.test_accept_trial.<locals>.constr_f  r  r;   r  r  r"   Tr   r   Fg#@r   g?Nr   )r	   r*   r   r   r   _accept_trialr-   )r7   r  r  r\   fns   &    r8   test_accept_trial1TestDifferentialEvolutionSolver.test_accept_trial  s   	!!(RVVGS9,UVV4D:=A!!#tRXXrd^S$"GGGG3bhhuosD"((C5/JeSTS#tRXXrd^S$"GGGG #tRXXrd^S%2$HHHH 3rxxc
3rxxS	24 4 	5 43rxxc
3rxxT
35 5 	6 5sE288S#J#7E288S#J#79 9 	: : 9r;   c                  a
 \         P                  ! . RO4      p\         P                  ! R\         P                  ^F.4      p\         P                  ! . RO4      p\        \	        W4      V4      pVP                  V4      ^ 8  P                  4       '       g   Q hVP                  . RO4      ^ 8H  P                  4       '       g   Q h\         P                  ! ^^4      P                  ^^4      p. pV F#  pVP                  VP                  V4      4       K%  	  \         P                  P                  VP                  VP                  4      \         P                  ! V4      P                  4       \         P                  ! . RO4      p\         P                  ! . RO. RO. R	O.4      o
\        \        S
\         P                  ) ^ 4      V4      pVP                  V4      ^ 8  P                  4       '       g   Q hVP                  . R
O4      ^ 8H  P                  4       '       g   Q h\         P                  ! ^^4      P                  ^^4      p. pV F#  pVP                  VP                  V4      4       K%  	  \         P                  P                  VP                  VP                  4      \         P                  ! V4      P                  4       \        \        \        S
4      \         P                  ) ^ 4      V4      pVP                  V4      ^ 8  P                  4       '       g   Q hVP                  . R
O4      ^ 8H  P                  4       '       g   Q hV
3R lp\!        V\         P                  ) ^ 4      p	\        V	. R
O4      pVP                  V4      ^ 8  P                  4       '       g   Q hVP                  . R
O4      ^ 8H  P                  4       '       g   Q hR# )r&   r   c                 &   < SP                  V 4      # r   )dot)rC   As   &r8   r   DTestDifferentialEvolutionSolver.test_constraint_wrapper.<locals>.fun  s    558Or;   N)r&      r   )r)   rc   rd   )ra         )r)   rc   rd   re   )rf   r&   r&   rg   )   r&      r&   )r   rc   r   re   )r*   r-   r   r   r   	violationanyr   r4   r	  appendtestingr   r5   r
   r   r	   )r7   lbubr`  pcr  
violationsrC   r   	nonlinearr  s   &         @r8   test_constraint_wrapper7TestDifferentialEvolutionSolver.test_constraint_wrapper  s   XXk"XXsBFFB'(XXi r3R 1$))++++^,1668888 YYq"%%a+
Abll1o. 


""2<<#5rxx
7K7M7MNXXl#HHlL,?@ 0RVVGQ ?DR 1$))++++-.!388:::: YYq"%%a+
Abll1o. 


""2<<#5rxx
7K7M7MN 01w J "$R 1$))++++-.!388::::	 (bffWa8		+;<R 1$))++++-.!388::::r;   c                :   R  p\        VRR.^^.4      p\        VR^.4      p\        P                  ! VP                  ^ ,          4      ^8X  g   Q h. ROp. ROp\        WE4       F   w  rg\        VP                  V4      V4       K"  	  \        VP                  \        P                  ! V4      P                  4      \        P                  ! V4      P                  4       VP                  \        P                  ! V4      P                  4      P                  ^\        V4      38X  g   Q hVP                  \        P                  ! V4      P                  4      P                  ^\        V4      38X  g   Q hVP                  ^8X  g   Q hVP                  ^8X  g   Q hR# )c                     \         P                  ! V ^ ,          ^,          V ^,          ,           V ^ ,          ^,          V ^,          ,
          .4      # rB   r  r   s   &r8   cons_fQTestDifferentialEvolutionSolver.test_constraint_wrapper_violation.<locals>.cons_f  sA     88QqTQY1-qTQY1-/ 0 0r;   r   Nr   g333333)rx   )r   r  )r  r  )r"   333333)r"   r   ))r&   r&   )r&   r"   )r  r&   )gRQ?r&   )r[  g=
ףp=?)r	   r   r*   rH  r/   r
  r   r  r-   r5   r   r   r   
num_constrparameter_count)r7   r  r  r  r  r  rC   r   s   &       r8   !test_constraint_wrapper_violationATestDifferentialEvolutionSolver.test_constraint_wrapper_violation  s2   	0 "&2w-!Q@c1X.wwryy|$)))HCKDABLLOQ/   	RXXb\^^4	(vvbhhrlnn%++3r7|;;;||BHHRLNN+11aR\AAA}}!!!!!Q&&&r;   c                   \         P                  ! 4       ;_uu_ 4        \         P                  ! R \        4       \        P
                  ! . RO. RO.4      pRRR4       \        X^ ^4      p\        P                  ! ^4      p\        W#4      pVP                  V4      P                  R8X  g   Q h\        P                  ! ^4      P                  ^^4      pVP                  V4      P                  R8X  g   Q hR#   + '       g   i     L; i)ignoreN)r)   r)   r)   r   )rc   rc   rc   r   r   )rc   rf   )warningscatch_warningssimplefilterPendingDeprecationWarningr*   matrixr
   onesr   r  r   r4   r	  )r7   r  lcr`  cwxtrials   &     r8   test_matrix_linear_constraint=TestDifferentialEvolutionSolver.test_matrix_linear_constraint  s     $$&&!!(,EFYY - / 0F ' fa+WWQZ' ||B%%--- 5!))!Q/||F#))V333 '&s   8C88D	c                
   R  p\         P                  ! R4      pRV^. RO3&   RV^^^
.3&   RV^. RO3&   RV^. RO3&   RV^^^.3&   RV^. RO3&   RV^. RO3&   RV^^^.3&   RV^	. RO3&   VR,          p\         P                  ! . RO4      p\        V\         P                  ) V4      pR.^	,          R .^,          ,           R.,           p\        WRRV3^RR7      pR!pR"p\        V! V4      VRR7       VP                  '       g   Q h\        VP                  VRR7       \        VP                  VRR7       \        \         P                  ! W&P                  ,          V8*  4      4       \        \         P                  ! VP                  \         P                  ! V4      R#,          8  4      4       \        \         P                  ! VP                  \         P                  ! V4      R$,          8*  4      4       \        \        V4      \         P                  ) V4      p\        WRRV3^R	R7      p\        V! V4      V4       VP                  '       g   Q h\        VP                  VR
R7       \        VP                  VRR7       \        \         P                  ! W&P                  ,          V8*  4      4       \        \         P                  ! VP                  \         P                  ! V4      R#,          8  4      4       \        \         P                  ! VP                  \         P                  ! V4      R$,          8*  4      4       R p	R p
\        VR%,          \         P                  ) VR,          4      p\        VR&,          \         P                  ) VR,          4      p\        V	\         P                  ) VR,          4      p\        V
\         P                  ) VR,          4      pWLW3p\        P                  ! 4       ;_uu_ 4        \        P                   ! R\"        4       \        WRRV^R	R7      pRRR4       \        VP                  VRR7       \        VP                  VRR7       \        \         P                  ! W&P                  ,          V8*  4      4       \        \         P                  ! VP                  \         P                  ! V4      R#,          8  4      4       \        \         P                  ! VP                  \         P                  ! V4      R$,          8*  4      4       R#   + '       g   i     EL; i)'c                 
   \         P                  ! ^ .V 34      p \         P                  ! ^V R,          ,          4      ^V R,          ,          V R,          ,          ,
          \         P                  ! V R,          4      ,
          pV# )r&   :r)   rf   N:rf   NN)r*   hstackr   rC   r   s   & r8   f2TestDifferentialEvolutionSolver.test_L1.<locals>.f  sW    		A3(#A&&1S6"QqvXaf_4rvvae}DCJr;   rJ   i90  r[  rH   r   r  r    r!  ga2U0*C?r   g{Gzt?iz r`   gMb@?c                     \         P                  ! ^ .V 34      p ^V ^,          ,          ^V ^,          ,          ,           V ^,          ,           V ^,          ,           RV ^,          ,          V ^,          ,           .# )r&   r*   r  r   s   &r8   c13TestDifferentialEvolutionSolver.test_L1.<locals>.c1A  s\    		A3(#AadFQqtVOae+ae3qtGaeO% %r;   c                     \         P                  ! ^ .V 34      p RV ^,          ,          V ^	,          ,
          V ^,          ,           # )r&   r   r	  r   s   &r8   c23TestDifferentialEvolutionSolver.test_L1.<locals>.c2F  s5    		A3(#Aad7QqT>AbE))r;   r\  rf   rg   N:rg   r  N:r  	   Nr  N)r      )rc   rc   r)   r)   )r)   rc   r      )r  r)   )r   r   r)   )re   rf   r   )r)   rd   r   r  )rg   r  r  )rc   rd   r     )r  r  r  r)   NNr  )	r   r&   r&   r   r&   r&   r   r&   r&   r(   r%   )r)   r)   r)   r)   r)   r)   r)   r)   r)   rd   rd   rd   r)   ir  r&   r  r)   )r\  r  )r  r  )r*   zerosr-   r
   r   r   r   r   rC   r   r   r   r   r	   r  r  r  r  )r7   r  r  bLr/   r   x_optf_optr
  r  L2NN2r  s   &              r8   test_L1'TestDifferentialEvolutionSolver.test_L1  s   	
 HHX)!^
!aW*$!Z-)!^
!aW*$!Z-)!^
!aW*$!Z-fIHH34Q+!xjl*fX5 %
A44

 8%%d3{{{{u40T2qw!|$%suu 0 6678suu 0 6678 Yq\BFF7A6 %
aT4

 	%%({{{{u40T2qw!|$%suu 0 6678suu 0 6678
	%
	* QuXw"6ai"&&!C&9RVVGQsV4 bffWaf5Rn$$&&!!(K8(JG'C ' 	u40T2qw!|$%suu 0 6678suu 0 6678 '&&s   -T,,T=	c           
        R  pR p\        V^ \        P                  4      pR
.^,          pTp\        P                  ! 4       ;_uu_ 4        \        P
                  ! R\        4       \        WRRVR7      pRRR4       RpRp\        V! V4      V4       \        XP                  V4       \        VP                  VRR	7       VP                  '       g   Q h\        \        P                  ! \        P                  ! V! VP                  4      4      ^ 8  4      4       \        \        P                  ! VP                  \        P                  ! V4      R,          8  4      4       \        \        P                  ! VP                  \        P                  ! V4      R,          8*  4      4       R#   + '       g   i     EL?; i)c                 P   \         P                  ! ^ .V 34      p V ^,          ^
,
          ^,          ^V ^,          ^,
          ^,          ,          ,           V ^,          ^,          ,           ^V ^,          ^,
          ^,          ,          ,           ^
V ^,          ^,          ,          ,           ^V ^,          ^,          ,          ,           V ^,          ^,          ,           ^V ^,          ,          V ^,          ,          ,
          ^
V ^,          ,          ,
          ^V ^,          ,          ,
          pV# rB   r	  r  s   & r8   r  2TestDifferentialEvolutionSolver.test_L2.<locals>.fa  s    		A3(#AaDGa<!QqT"WqL.01Q47:Q!R!|^KadAg: !!A$'	*,-aD!G467!fQqTkBDFqtGLQqT6C Jr;   c                    \         P                  ! ^ .V 34      p ^^V ^,          ^,          ,          ,
          ^V ^,          ^,          ,          ,
          V ^,          ,
          ^V ^,          ^,          ,          ,
          ^V ^,          ,          ,
          ^^V ^,          ,          ,
          V ^,          ^,          ,
          ^V ^,          ^,          ,          ,
          ^V ^,          ,          ,           R^V ^,          ,          ,
          ^V ^,          ,          ,
          ^
V ^,          ^,          ,          ,
          V ^,          ,
          V ^,          ,           RV ^,          ^,          ,          V ^,          ^,          ,
          ^V ^,          ,          V ^,          ,          ,           ^V ^,          ^,          ,          ,
          ^V ^,          ,          ,
          ^V ^,          ,          ,           .# )r&   i  r	  r   s   &r8   r
  3TestDifferentialEvolutionSolver.test_L2.<locals>.c1h  sF   		A3(#A!AaD!G)Oa!ai/!A$61Q47BQqtVK"QqT'MAaD!G+a!ai7!AaD&@!AaD&L1QqT6)BqtQwJ61=!DqtQwJ1q(1QqT6!A$;61Q47BadF!W%& &r;   r  rJ     rH   r   r  Ngy\
E@h㈵>r  r   )gܤ@g$H8?g	޿g0ev@gn8)gk_@/?g0g+?r  r  )r	   r*   r   r  r  r  r  r   r   r   rC   r   r   r   r-   )	r7   r  r
  r  r/   r  r   r  r  s	   &        r8   test_L2'TestDifferentialEvolutionSolver.test_L2]  s5   		&  Arvv.Q$$&&!!(K8(Z-1{LC '
 "1 	%%('u40{{{{rxx355	*a/01suu 0 6678suu 0 6678 '&&s   +F,,F=	c           
        R  p\         P                  ! R
4      pRV^. RO3&   RV^. RO3&   RV^. RO3&   VR,          p\         P                  ! . RO4      pR p\        W#\         P                  4      p\        V^ \         P                  4      pR.^
,          pWV3p\        P                  ! 4       ;_uu_ 4        \        P                  ! R\        4       \        WRV^R7      p	RRR4       Rp
Rp\        V! V
4      VRR7       \        X	P                  V
R	R7       \        V	P                  VRR7       V	P                  '       g   Q h\        \         P                   ! W)P                  ,          V8  4      4       \        \         P                   ! \         P                  ! V! V	P                  4      4      ^ 8  4      4       \        \         P                   ! V	P                  \         P                  ! V4      R,          8  4      4       \        \         P                   ! V	P                  \         P                  ! V4      R,          8*  4      4       R#   + '       g   i     ELu; i)c                    \         P                  ! ^ .V 34      p V ^,          ^,          V ^,          ^,          ,           V ^,          V ^,          ,          ,           ^V ^,          ,          ,
          ^V ^,          ,          ,
          V ^,          ^
,
          ^,          ,           ^V ^,          ^,
          ^,          ,          ,           V ^,          ^,
          ^,          ,           ^V ^,          ^,
          ^,          ,          ,           ^V ^,          ^,          ,          ,           ^V ^,          ^,
          ^,          ,          ,           ^V ^	,          ^
,
          ^,          ,          ,           V ^
,          ^,
          ^,          ,           ^-,           pV# rB   r	  r  s   & r8   r  2TestDifferentialEvolutionSolver.test_L3.<locals>.f  s   		A3(#AQ47QqT1W$qtAaDy02ad7:R!WDaDGa< "#QqT!VaK-034Q46A+>@A1Q46A+NQqT1W9 !A$r'A~.011Q47Q,? bEAI>" %''C
 Jr;   c                    \         P                  ! ^ .V 34      p ^V ^,          ,          ^V ^,          ,          ,
          ^V ^	,          ^,
          ^,          ,          ,
          ^V ^
,          ,          ,           RV ^,          ^,
          ^,          ,          ^V ^,          ^,
          ^,          ,          ,
          ^V ^,          ^,          ,          ,
          ^V ^,          ,          ,           ^x,           V ^,          ^,          ) ^V ^,          ^,
          ^,          ,          ,
          ^V ^,          ,          V ^,          ,          ,           ^V ^,          ,          ,
          ^V ^,          ,          ,           RV ^,          ^,          ,          ^V ^,          ,          ,
          V ^,          ^,
          ^,          ,
          ^V ^,          ,          ,           ^(,           RV ^,          ^,
          ^,          ,          ^V ^,          ^,
          ^,          ,          ,
          ^V ^,          ^,          ,          ,
          V ^,          ,           ^,           .# )r&   r   r=        r	  r   s   &r8   r
  3TestDifferentialEvolutionSolver.test_L3.<locals>.c1  s~   		A3(#AadFQqtVOb!A$q&1n4q2w>!Q{NQ!Q{]2QqtQwY>1Q4G#MqT1WHq!A$q&1},q1vad{:R!WDq1vMqtQwJ1Q4'1Q46A+5!A$>C!A$q&1$q!A$q&1}4q1qy@1Q4G"L	N Nr;   r  r(  )r   r  r    Ng<6cN8@r*  r  ư>)re   r  )r&  r=  rd   i)r)   rc   r  r  )r   r     r   )r  r   r=  rc   )r)   rc   r  r   r  )ir&   ir   )
gWXp?`@g@gVW@!@g3Ib@grq?g` ?g$F-t%?g6N#@g7h @g]y @r  r  )r*   r  r-   r
   r   r	   r  r  r  r  r   r   rC   r   r   r   r   r7   r  r  r  r
  r  r  r/   r  r   r  r  s   &           r8   test_L3'TestDifferentialEvolutionSolver.test_L3  s   	 HHW*!\/+!\/*!]
fIHH^$	N Q266*Arvv.Rf$$&&!!(K8(5@!MC '
C%%d3u40T2{{{{q55yA~&'rxx355	*a/01suu 0 6678suu 0 6678! '&&s   8+II 	c                   R  p\         P                  ! R4      pRV^^^.3&   RV^. RO3&   RV^^^.3&   VR,          p\         P                  ! . RO4      pR p\        V\         P                  ) ^4      p\        V^ \         P                  4      pR.R.^,          ,           R.^,          ,           pWV3p\        P                  ! 4       ;_uu_ 4        \        P                  ! R\        4       \        WRRV^RR7      p	RRR4       Rp
. ROp\        V! V4      V
R	R
7       \        X	P                  V
R	R
7       \        P                  ! 4       R8X  dN   \         P                  ! \         P                   4      P"                  ^8  d   \        V	P$                  VRRR7       M\        V	P$                  VRRR7       V	P&                  '       g   Q h\)        \         P*                  ! W)P$                  ,          V8*  4      4       \)        \         P*                  ! \         P                  ! V! V	P$                  4      4      ^ 8  4      4       \)        \         P*                  ! V	P$                  \         P                  ! V4      R,          8  4      4       \)        \         P*                  ! V	P$                  \         P                  ! V4      R,          8*  4      4       R#   + '       g   i     EL; i)c                 <    \         P                  ! V R ,          4      # ):Nrd   Nr*   r   r   s   &r8   r  2TestDifferentialEvolutionSolver.test_L4.<locals>.f  s    66!B%= r;   c                    \         P                  ! ^ .V 34      p V ^,          V ^,          ,          RV ^,          ,          ,
          ^dV ^,          ,          ,
          R,           V ^,          V ^,          ,          RV ^,          ,          ,
          V ^,          V ^,          ,          ,
          RV ^,          ,          ,           V ^,          V ^,          ,          R,
          V ^,          V ^,          ,          ,
          RV ^,          ,          ,           .# )r&   g!> 
@gSUX@i  i i	  r	  r   s   &r8   r
  3TestDifferentialEvolutionSolver.test_L4.<locals>.c1  s    		A3(#AaD1I	!A$.QqT9IEaD1IQqT	)AaD1I5QqT	AaD1I'!A$qt)3d1Q4i?A Ar;   r  rJ   r(  r`   r  Ngh|?@MbP?r  Windowsgv!>gy&1l?)r   r   gh㈵>ga2U0*c?)re   r  ){Gzd?r@  )r@  r@  g{Gzd)rf   r  re   )r[  g{Gzr  )r)   r)   r)   )r'   '  )  rA  )r   rB  )got@g?@g:@gt$f@gVfyr@gh o?k@gCq@gVfx@r  r  )r*   r  r-   r
   r   r	   r  r  r  r  r   r   r   platformsystemr  intpitemsizerC   r   r   r   )r7   r  r  r  r
  r  r  r/   r  r   r  r  s   &           r8   test_L4'TestDifferentialEvolutionSolver.test_L4  s   	! HHV%!aV)1!Y,"!aV)fIHHY	A Q+Arvv.=/!"33zl1nDf$$&&!!(K8(JD'C ' 2 	%%e4U3 OO*rxx/@/I/IA/MCEE5vFC CEE5t&A{{{{q55yA~&'rxx355	*a/01suu 0 6678suu 0 66785 '&&s   -KK%	c           	        R  pR p\        V\        P                  ) ^ 4      pR	.^,          pTp\        WRRVR7      pR
pRp\	        V! V4      VRR7       \	        VP
                  VRR7       VP                  '       g   Q h\        \        P                  ! \        P                  ! V! VP                  4      4      ^ 8*  4      4       \        \        P                  ! VP                  \        P                  ! V4      R,          8  4      4       \        \        P                  ! VP                  \        P                  ! V4      R,          8*  4      4       R# )c                    \         P                  ! ^ .V 34      p \         P                  ! ^\         P                  ,          V ^,          ,          4      ^,          \         P                  ! ^\         P                  ,          V ^,          ,          4      ,          V ^,          ^,          V ^,          V ^,          ,           ,          ,          pV) # rB   )r*   r  sinpir  s   & r8   r  2TestDifferentialEvolutionSolver.test_L5.<locals>.f  s    		A3(#A66!BEE'!A$,'*266!BEE'!A$,+??aD!GQqT!A$Y')C4Kr;   c                     \         P                  ! ^ .V 34      p V ^,          ^,          V ^,          ,
          ^,           ^V ^,          ,
          V ^,          ^,
          ^,          ,           .# rB   r	  r   s   &r8   r
  3TestDifferentialEvolutionSolver.test_L5.<locals>.c1  sT    		A3(#AaD!GadNQ&!H!Q{*, ,r;   rK   r(  r)  gh㈵>r  -C6?Nr&   r   )gJIť?gU(C@g#r  r  )r	   r*   r   r   r   r   r   r   r   r-   rC   	r7   r  r
  r  r/   r  r   r  r  s	   &        r8   test_L5'TestDifferentialEvolutionSolver.test_L5  s    		,
  RVVGQ/1$Q1<> )%%d3T2{{{{rxx355	*a/01suu 0 6678suu 0 6678r;   c           	        R  pR p\        V^ \        P                  4      pRR.pTp\        WRRVRR7      pRpRp\	        V! V4      VRR7       \	        VP
                  VRR7       \	        VP                  VR	R7       VP                  '       g   Q h\        \        P                  ! \        P                  ! V! VP                  4      4      ^ 8  4      4       \        \        P                  ! VP                  \        P                  ! V4      R,          8  4      4       \        \        P                  ! VP                  \        P                  ! V4      R,          8*  4      4       R
# )c                     \         P                  ! ^ .V 34      p V ^,          ^
,
          ^,          V ^,          ^,
          ^,          ,           pV# rB   r	  r  s   & r8   r  2TestDifferentialEvolutionSolver.test_L6.<locals>.f  s=    		A3(#AQ47Q,!A$)a/CJr;   c                    \         P                  ! ^ .V 34      p V ^,          ^,
          ^,          V ^,          ^,
          ^,          ,           ^d,
          V ^,          ^,
          ^,          ) V ^,          ^,
          ^,          ,
          R,           .# )r&   gp=
׳T@r	  r   s   &r8   r
  3TestDifferentialEvolutionSolver.test_L6.<locals>.c1  sl    		A3(#AqT!VaK1Q4!8a-/#5d1fq[LAaD1Hq=058: :r;   rK   r(  gHz>)rH   r   r  r!  r3  r  r>  rP  N)   r'   r%   )gq=
ף0,@g??g1r  r  )r	   r*   r   r   r   r   rC   r   r   r   r-   rR  s	   &        r8   test_L6'TestDifferentialEvolutionSolver.test_L6  s   	
	:
  Arvv.X&$Q1<$H!%%d3U3u40{{{{rxx355	*a/01suu 0 6678suu 0 6678r;   c           	        R  pR p\        V. RO. R	O4      pR
R.R.^,          ,           pTp\        WRRVR7      p. ROpRp\        V! V4      V4       \        VP                  VRR7       \        VP                  VRR7       VP
                  '       g   Q h\        \        P                  ! \        P                  ! V! VP                  4      4      \        P                  ! . RO4      8  4      4       \        \        P                  ! \        P                  ! V! VP                  4      4      \        P                  ! . R	O4      8*  4      4       \        \        P                  ! VP                  \        P                  ! V4      R,          8  4      4       \        \        P                  ! VP                  \        P                  ! V4      R,          8*  4      4       R# )c                     \         P                  ! ^ .V 34      p RV ^,          ^,          ,          RV ^,          ,          V ^,          ,          ,           RV ^,          ,          ,           R,
          pV# )r&   g+dvqn@g"C?gtۈB@gn@r	  r  s   & r8   r  2TestDifferentialEvolutionSolver.test_L7.<locals>.f+  s[    		A3(#AQqT1W$y1~ad'::QqT>"$-.CJr;   c                    \         P                  ! ^ .V 34      p RRV ^,          ,          V ^,          ,          ,           RV ^,          ,          V ^,          ,          ,           RV ^,          ,          V ^,          ,          ,
          RRV ^,          ,          V ^,          ,          ,           RV ^,          ,          V ^,          ,          ,           RV ^,          ^,          ,          ,           R	R
V ^,          ,          V ^,          ,          ,           RV ^,          ,          V ^,          ,          ,           RV ^,          ,          V ^,          ,          ,           .# )r&   gl#fUU@g+WPIw?g=BD?gOlb?gaۢ T@g+<$!6}?g h?g^5a?g/h"@gxLCs?gݗT?g^gED_?r	  r   s   &r8   r
  3TestDifferentialEvolutionSolver.test_L7.<locals>.c11  s    		A3(#A	!A$qt 33i!nQqT6IIadN1Q4'( y1~ad22Yqt^AaD5HHadAg%& y1~ad22Yqt^AaD5HHadN1Q4'(	 	r;   rK   r(  r)  r>  r  N)r&   Z   r  )\   n      )N   f   )!   -   )   ri  )gq S@g] @@g˻f=@g:F@g%ShMcB@gCgbr  r  )
r	   r   r   rC   r   r   r   r*   r   r-   rR  s	   &        r8   test_L7'TestDifferentialEvolutionSolver.test_L7)  sC   		  K?X&(A5$Q1<>
 %%(u40T2{{{{rxx355	*bhh{.CCDErxx355	*bhh}.EEFGsuu 0 6678suu 0 6678r;   ppc64lezfails on ppc64le)reasonc                    R  p\         P                  ! R4      pRV^^^.3&   RV^^^.3&   VR,          p\         P                  ! RR.4      pR p\        W#\         P                  4      p\        V\         P                  ! ^R4      \         P                  ! ^R4      4      pR.^,          R.^,          ,           pWV3p\        P                  ! 4       ;_uu_ 4        \        P                  ! R\        4       \        WRRVRR7      p	RRR4       Rp
R	p\        V! V
4      VRR
7       \        X	P                  R,          V
R,          RR
7       \        V	P                  R,          V
R,          RR
7       \        V	P                  VRR
7       V	P                  '       g   Q h\!        \         P"                  ! W)P                  ,          V8  4      4       \!        \         P"                  ! \         P                  ! V! V	P                  4      4      R8  4      4       \!        \         P"                  ! \         P                  ! V! V	P                  4      4      R8*  4      4       \!        \         P"                  ! V	P                  \         P                  ! V4      R,          8  4      4       \!        \         P"                  ! V	P                  \         P                  ! V4      R,          8*  4      4       R#   + '       g   i     EL; i)c                     \         P                  ! ^ .V 34      p ^V ^,          ,          RV ^,          ^,          ,          ,           ^V ^,          ,          ,           RV ^,          ^,          ,          ,           pV# )r&   r3  g^>r	  r  s   & r8   r  2TestDifferentialEvolutionSolver.test_L8.<locals>.f[  sY    		A3(#AAaD&8AaD!G++a!f4z!A$'7IICJr;   c           	         \         P                  ! ^ .V 34      p R\         P                  ! V ^,          ) R,
          4      ,          R\         P                  ! V ^,          ) R,
          4      ,          ,           R,           V ^,          ,
          R\         P                  ! V ^,          R,
          4      ,          R\         P                  ! V ^,          V ^,          ,
          R,
          4      ,          ,           R,           V ^,          ,
          R\         P                  ! V ^,          R,
          4      ,          R\         P                  ! V ^,          V ^,          ,
          R,
          4      ,          ,           R,           .# )r&   rB  ra   gfffff@g33333;@)r*   r  rK  r   s   &r8   r
  3TestDifferentialEvolutionSolver.test_L8.<locals>.c1f  s    		A3(#A1d
++d2661Q4%*3E.EEaD!!T	**T"&&1ad42H-HHaD!!T	**T"&&1ad42H-HH r;   r>  r  rJ   r(  i  )rH   r   r  r   Ng#J{@r  Nrc   NgMb`?:rc   NNr   )rd   rf   )r)   r   r  皙MbP)r&   i  )ru  g?)gEGr?@gT㥛D@g&D
n?gd,[ٿr  r  )r*   r  r-   r
   r   r	   fullr  r  r  r  r   r   rC   r   r   r   r   r5  s   &           r8   test_L8'TestDifferentialEvolutionSolver.test_L8W  s   	
 HHV!aV)!aV)fIHHdD\"		 Q266*BGGAv$658IJQ}Q.f$$&&!!(K8 )Z-1{157C ' <%%d3b	5948b	5948T2{{{{qw!|$%rxx355	*f456rxx355	*e345suu 0 6678suu 0 6678+ '&&s   ,K,,K=	c           	        R  pR p\        VR
.R.4      pR.^,          pTp\        WRRVR7      p\        P                  ! ^4      ^,          R.pRp\	        V! V4      V4       \	        \        P
                  ! VP                  4      VRR7       \	        VP                  VRR7       VP                  '       g   Q h\        \        P                  ! \        P                  ! V! VP                  4      4      R
8  4      4       \        \        P                  ! \        P                  ! V! VP                  4      4      R8*  4      4       \        \        P                  ! VP                  \        P                  ! V4      R,          8  4      4       \        \        P                  ! VP                  \        P                  ! V4      R,          8*  4      4       R	# )c                     \         P                  ! ^ .V 34      p V ^,          ^,          V ^,          ^,
          ^,          ,           # rB   r	  r   s   &r8   r  2TestDifferentialEvolutionSolver.test_L9.<locals>.f  s5    		A3(#AQ47ad1fq[((r;   c                 r    \         P                  ! ^ .V 34      p V ^,          V ^,          ^,          ,
          .# rB   r	  r   s   &r8   r
  3TestDifferentialEvolutionSolver.test_L9.<locals>.c1  s/    		A3(#AaD1Q47N##r;   r>  rK   r(  r)  r   g      ?r  Nrv  r~   r  r  )r	   r   r*   sqrtr   absrC   r   r   r   r   r-   rR  s	   &        r8   test_L9'TestDifferentialEvolutionSolver.test_L9  sB   	)	$  UGeW51$Q1<> As#%%(suuu48T2{{{{rxx355	*f456rxx355	*e345suu 0 6678suu 0 6678r;   c           	     ,  a \         P                  P                  R 4      p\        P                  pRpVP
                  ! VRRRV/ pR oRR.pRR.p\        SWbV3VRVR7      pVP                  ^ ,          ^8X  g   Q h\        VP                  VRR	7       \        SWbV3VRVR7      pV3R
 lp	\        WP                  ^,          ^W$3R.R7      p
\        VP                  ^,          V
P                  4       VP                  VP                  8:  g   Q hR# )l   b	rH  rA  random_statec                     Vw  r#\         P                  ! VP                  ! V.V O5!  4      P                  RR7      ) p\         P                  ! V4      '       d   \         P
                  pV# )r)   axisr   )r*   logpmfr   isnanr   )r  r   distrC   lls   &*   r8   r   >TestDifferentialEvolutionSolver.test_integrality.<locals>.func  sO    GD&&!a)--2-66Bxx||VVIr;   TF)r   integralityr   r   g?)r   c                 X   < Vw  r#pS! \         P                  ! W ^ ,          .4      W44      # rB   r  )r  r   nr  rC   r   s   &*   r8   func2?TestDifferentialEvolutionSolver.test_integrality.<locals>.func2  s(    JAQ!qT+T55r;   )r   r/   N)rf   r   )r)      )r&   gffffff?)r*   r/  r4  r   nbinomrvsr   rC   r   r   r   )r7   r   r  shapesrC   r  r/   r   res2r  LBFGSBr   s   &          @r8   test_integrality0TestDifferentialEvolutionSolver.test_integrality  s    ii##M2||HHf;5;s;	 Um9%$T6q	1<U),.
 uuQx1}}vE2 &dF2=d*-/	6 %!T"+.q	688,xx377"""r;   c           	     R   R  p. ROp. ROp\        WRRR7      p\        VP                  ^ ,          . RO4       \        VP                  ^,          . R	O4       \        WRVR7      p\        VP                  ^ ,          . R
O4       \        VP                  ^,          . RO4       \        VP                  . RO4       VP
                  RJ g   Q h. ROp\        WRVR7      p\        VP                  ^ ,          . RO4       \        VP                  ^,          . RO4       \        \        P                  ! VP                  ^ ,          4      . RO4       \        \        P                  ! VP                  ^,          4      . RO4       . ROp\        WRVR7      p\        VP                  ^ ,          . RO4       \        VP                  ^,          . RO4       . ROp\        P                  ! \        RR7      ;_uu_ 4        \        WRVR7       RRR4       R#   + '       g   i     R# ; i)c                     V # r   r=   r   s   &r8   r  BTestDifferentialEvolutionSolver.test_integrality_limits.<locals>.f  s    Hr;   F)r/   r   r  zOne of the integralityr   N)TFT))rR  r   r   皙@)ffffff
@皙@)rR  r   r  )r   r  r  )r   r   g      @)g      ?r        @))r  gr  )g$gffffff@)g      r         %)r1  r  r  )      r   g      $)r  r   g      @))ffffff$g333333 r  g%gr#)r  r   r  )g      !r  g      #))r  g333333$r  r  )r   r   r.   r   r  r   r*   roundr  r   r   )r7   r  r  r/   r\   s   &    r8   test_integrality_limits7TestDifferentialEvolutionSolver.test_integrality_limits  s   	 *5 -Qe9>@a(/:a(/: -Qe9DFa(/:a(/:V'')<=}}%%%9,Qe9DFa(*<=a(*:; 	q!124FGq!124DE>,Qe9DFa(*=>a(*;<?]]:-EFF'4?A GFFFs   <HH&	c           
       a R  pR p\         P                  ! \        RR7      ;_uu_ 4        \        WP                  RRR7       RRR4       \        \        RR7      ;_uu_ 4        \        W P                  RR	7       RRR4       \        \        R
R7      ;_uu_ 4        \        W P                  R\        RR7       RRR4       ^ .oV3R lpRR.p\        \        VR^R7      p\        W4RR^R7      p\        VP                  VP                  4       S^ ,          VP                  8X  g   Q hVP                  VP                  8X  g   Q hR#   + '       g   i     EL; i  + '       g   i     L; i  + '       g   i     L; i)c                 <    \         P                  ! V ^,          4      # r   r:  r   s   &r8   r0   BTestDifferentialEvolutionSolver.test_vectorized.<locals>.quadratic  s    66!Q$<r;   c                 @    \         P                  ! V ^,          ^ R7      # )rc   r  r:  r   s   &r8   quadratic_vecFTestDifferentialEvolutionSolver.test_vectorized.<locals>.quadratic_vec  s    66!Q$Q''r;   zThe vectorized functionr   Tr  )r  r  Nz#differential_evolution: the 'vector)r  z$differential_evolution: the 'workers)r  r  r  c                 D   < S^ ;;,          ^,          uu&   \        V 4      # rB   )r   )rC   ncallss   &r8   	rosen_vecBTestDifferentialEvolutionSolver.test_vectorized.<locals>.rosen_vec   s    1INI8Or;   )r  r   )r  r  r   rQ  )r  r   r   r   r/   r   r  r~  r   r   rC   r  r   )r7   r0   r  r  r/   res1r  r  s   &      @r8   test_vectorized/TestDifferentialEvolutionSolver.test_vectorized  s0   	 	( ]]</HII"9kk.2ZI J
 ;&KLL"=++.24 M
 ;&LMM"=++.2C,68 N
 	 7#%eVj*+-%iD/9qB 	'ayDII%%%xx488###= JII
 ML
 NMs#   E&E!E4E	!E1	4F	c           
        R  pR p\        V\        P                  ) R4      p\        VR
R4      pR pRR.p\        \        VR^W4.RR7      p\        WVRR^W4.RR7      p\        VP                  VP                  4       R	# )c                 Z    \         P                  ! V ^ ,          V ^,          ,           .4      # rB   r  r   s   &r8   r  MTestDifferentialEvolutionSolver.test_vectorized_constraints.<locals>.constr_f0  r  r;   c                     \         P                  ! V ^ ,          ^,          V ^,          ,           V ^ ,          V ^,          ,
          .4      # rB   r  r   s   &r8   r  NTestDifferentialEvolutionSolver.test_vectorized_constraints.<locals>.constr_f23  r  r;   r  c                     ^dV R,          V RR R,          ,
          R,          ,          pV^V RR ,
          R,          ,          p\         P                  ! V4      # )r'   r  Nr   r   )r*   squeeze)rC   r   s   & r8   r  NTestDifferentialEvolutionSolver.test_vectorized_constraints.<locals>.rosen_vec9  sK    quq"vs{*S00A!af*s""A::a= r;   r  F)r  r   r  r   T)r  r  r   r  r   N)r   r   r   rQ  )r	   r*   r   r   r   r   rC   )	r7   r  r  nlc1r  r  r/   r  r  s	   &        r8   test_vectorized_constraints;TestDifferentialEvolutionSolver.test_vectorized_constraints/  s    	+	; #8bffWc:"9j*E	! 7#%eVj*+$-24 &iD/9q37,-24
 	'r;   c           	     >  aa \        V P                  4      oV3R  loRSn        \        \        V P                  S^^ R7      p\        \        V P                  R^^ R7      pVP
                  f   Q h\        VP                  \        P                  ! S4      RR7       VP                  SP                  P                  8X  g   Q hVP                  VP                  8w  g   Q hV3R lp\        \        RR7      ;_uu_ 4        \        \        V P                  V^R	7       RRR4       R
 o\        P                  P                  R4      p\        \        V P                  RV^R7      p\        \        VP                  V P                  RR7      p\        P                  P                  R4      p\        \        V P                  SV^R7      p\        VP                  VP                  4       \        VP                  VP                  4       R#   + '       g   i     L; i)c                 N   < \        W3R \        RR/VB Sn        SP                  # )jacmethodztrust-constr)r   r   r   )r   rC   kwdspfs   &&,r8   r  @TestDifferentialEvolutionSolver.test_polish_function.<locals>.pfO  s'    cS)SNSdSBF66Mr;   N)r   r   r   Tr3  r  c                    < R V9   g   Q h\        VR ,          \        4      '       g   Q hRV9   g   Q h\        P                  ! S4      # )r/   r  )r   r   r*   r  )r   rC   r  r  s   &&,r8   dummy_pfFTestDifferentialEvolutionSolver.test_polish_function.<locals>.dummy_pf`  sD    t###d8nf5555 D(((771:r;   z(The result from a user defined polishingr   )r   r   c                     \        W3R R/VB # )r  L-BFGS-B)r   )r   rC   r  s   &&,r8   r  r  t  s    D?J?$??r;   l   -g F)r   r   r   r  )r/   r  )r   r/   r   r   r   r  r   rC   r*   r  r   r   r   r/  r4  r   )r7   r   r   r  r   r  r  r  s   &     @@r8   test_polish_function4TestDifferentialEvolutionSolver.test_polish_functionK  s   	 $UDKKASTU$UDKKaUVW
 ww"""rwwqz5ww"&&**$$$ww#''!!!	 <
 
 #		
	@ ii##L1$4;;u#q
 uceeDKK
Kii##L1%4;;rsA

 	tvv&*;
 
s    HH	c           	         R  p\        R ^ \        P                  4      p\        R \        P                  ) ^ 4      p\        VRR	.W#.^
RRR7      pVP                  RJ g   Q hRVP
                  9   g   Q hR# )
c                     \         P                  ! V ^ ,          4      \         P                  ! V ^,          4      ,           # rB   )r*   cosrK  r   s   &r8   r   UTestDifferentialEvolutionSolver.test_constraint_violation_error_message.<locals>.func  s%    66!A$<"&&1,..r;   c                 L    V ^,          V ^ ,          ^,
          ^,          ,
          # r)   r=   r   s   &r8   <lambda>YTestDifferentialEvolutionSolver.test_constraint_violation_error_message.<locals>.<lambda>  s    1Q41Q46A++=r;   c                 >    V ^,          V ^ ,          ^,          ,           # r  r=   r   s   &r8   r  r    s    1Q4!A$'>r;   Fi3)r/   r  r   r   r   z
MAXCV = 0.N)r   rc   r~   )r	   r*   r   r   r   r   )r7   r   c0r
  ri   s   &    r8   'test_constraint_violation_error_messageGTestDifferentialEvolutionSolver.test_constraint_violation_error_message  s{    	/ !!=q"&&I !9BFF7AF'07/A57H02/4,57 ~~&&& v~~---r;   c                  aaaa	a
 ^o^
pR.S,          pSV,          o
RoRo	^ .oRVVVV	V
3R llp\        \        VVS	S^V^
RR7	      pVP                  VJ g   Q hVP                  4        S^ ,          ^ 8  g   Q h\	        \        W#RR7      pVP
                  '       g   Q hRR	 lp\        P                  ! \        R
R7      ;_uu_ 4        \	        \        VVR7       RRR4       R#   + '       g   i     R# ; i)re   r#   gffffff?Nc                   < S^ ;;,          ^,          uu&   \         P                  ! W,          4      pVP                  S4      p\         P                  ! S4      pVP	                  V4       VR^ pWfV 8g  ,          R,          pVR,          w  rxV^ ,          SW,          W,          ,
          ,          ,           p	VP                  SR7      p
V
S8  p
RW&   \         P                  ! WV4      pV# )r&   Nrt  )rH  T)r*   copychoicer4   shufflerk  where)r  r6   r   rj   
fill_pointr  idxsr0r  bprime
crossoverscallsr!   r  recombinationtotal_popsizes   &&&        r8   custom_strategy_fnLTestDifferentialEvolutionSolver.test_strategy_fn.<locals>.custom_strategy_fn  s    !HMHGGJ12EO4J99]+DKK<D	)*2.D"XFB mh^jn4'6 6F /:J#m3J%)J"HHZ7ELr;   F)r    r  r!   r   rH   r   r   r  )rH   r  c                 2    \         P                  ! R R.4      # )r   r   r  )r  r6   r   s   &&&r8   r  r    s    88S#J''r;   z	strategy*r   rG   )r&   g      $@r   )	r   r   rH   r   r   r   r  r   r   )r7   r    r/   r  r\   r   r  r!   r  r  r  s   &     @@@@@r8   test_strategy_fn0TestDifferentialEvolutionSolver.test_strategy_fn  s     o-''1	 	* -''

 "4444Qx!|| %6
 {{{{	( ]]<{;;"+ <;;;s   	C&&C7	c                    \        \        \        R.^,          4      ;_uu_ 4         RRR4       R#   + '       g   i     R# ; i)r&   NrQ  )r   r   r   r>   s   &r8   test_reference_cycles5TestDifferentialEvolutionSolver.test_reference_cycles  s+     ;UWIaKPP QPPPs	   2A	)r/   r1   r2   r.   r,   N)QrZ   
__module____qualname____firstlineno__r9   r?   r0   r]   rk   rn   rq   rt   r{   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r$  r(  r,  r6  r:  r>  rD  rO  rS  rV  rm  rq  rx  r  r  r  r  mark	fail_slowr  r  r  r  r  r  r  r  r  r  r   r+  r6  rG  rS  r[  rk  xslowxfailrC  machinerx  r  r  r  r  r  r  r  r  r  __static_attributes____classdictcell__)__classdict__s   @r8   r   r      s1    3&%IGV'
'''4*<=EH
(>;@G!R D0 *0$JK.&`?'0.E &4*D8LFI)	 [[2 $
7:r+&Z  [[2%9 %9N:4*;X'84& [[2\9 \9| [[2%9 %9N [[209 09d [[229 29h [[29 9< [[29 98,9\ [[[[x'')Y60  2192 19f [[19 9< [[2*# *#X+AZ [[2&$ &$P(88+t.. [[2= =~ r;   r   )&__doc__multiprocessing.dummyr   r  rC  r  scipy._lib._gcutilsr   %scipy.optimize._differentialevolutionr   r   scipy.optimizer   r   scipy.optimize._constraintsr   r	   r
   r   r   r   scipy.sparser   scipyr   numpyr*   numpy.testingr   r   r   r   r   r  r   r   r   r   r=   r;   r8   <module>r     sV    5   2G A; ; 5 5 "  9 9 1 E Er;   