
    (ph                        S r SSKrSSKJr  SSKrSSKJrJr  SSK	J
r
Jr  SSKJrJrJr  SSK	JrJr  SSKJr  SS	KJr  SSKrSS
KJrJrJrJrJrJr  SSKJ r!J"r"  SSKr " S S5      r#g)z@
Unit tests for the differential global minimization algorithm.
    N)Pool)DifferentialEvolutionSolver_ConstraintWrapper)differential_evolutionOptimizeResult)BoundsNonlinearConstraintLinearConstraint)rosenminimize)
csr_matrix)stats)assert_equalassert_allcloseassert_almost_equalassert_string_equalassert_suppress_warnings)raiseswarnsc                      \ rS rSrS rS rS rS rS rS r	S r
S	 rS
 rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS r S r!S  r"S! r#S" r$S# r%S$ r&S% r'S& r(S' r)S( r*\+RX                  RZ                  S) 5       r.\+RX                  R_                  S*5      S+ 5       r0S, r1S- r2S. r3\+RX                  RZ                  S/ 5       r4\+RX                  R_                  S*5      \+RX                  RZ                  S0 5       5       r5S1 r6S2 r7S3 r8S4 r9\+RX                  R_                  S55      S6 5       r:\+RX                  R_                  S*5      S7 5       r;\+RX                  R_                  S*5      S8 5       r<\+RX                  R_                  S*5      S9 5       r=\+RX                  R_                  S*5      S: 5       r>\+RX                  R_                  S*5      S; 5       r?S< r@\+RX                  R                  \+RX                  R                  \CR                  " 5       S=:H  S>S?9S@ 5       5       rE\+RX                  R_                  SA5      SB 5       rF\+RX                  R_                  S*5      SC 5       rGSD rH\+RX                  RZ                  \+RX                  R_                  S*5      SE 5       5       rISF rJSG rK\+RX                  R_                  S55      SH 5       rLSIrMgJ)KTestDifferentialEvolutionSolver   c                    [         R                  " SS9U l        [         R                  " SS/SS//5      U l        SS/U l        [        U R                  S/5      U l        [        U R                  S/SS	S
9U l	        [         R                  " [         R                  " SSS5      5      R                  nXR                  l        g )Nraiseinvalid               @r   r   r   d   r               ?)popsizemutation皙?皙?)npseterr
old_seterrarraylimitsboundsr   	quadraticdummy_solverdummy_solver2
atleast_2darangeT
population)selfr7   s     d/var/www/html/venv/lib/python3.13/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                 D    [         R                  " S0 U R                  D6  g )N )r+   r,   r-   r8   s    r9   teardown_method/TestDifferentialEvolutionSolver.teardown_method-   s    
		$DOO$r<   c                     US   S-  $ )Nr      r>   )r8   xs     r9   r1   )TestDifferentialEvolutionSolver.quadratic0   s    tQwr<   c                 l   [        [        U R                  SS9n[        UR                  S5        [        UR
                  R                  S5        [        [        U R                  SS9n[        UR                  S5        [        UR
                  R                  S5        [        [        U R                  SS9n[        UR                  S5        [        UR
                  R                  S5        [        [        U R                  SS9n[        UR                  S5        [        UR
                  R                  S5        [        [        U R                  SS9n[        UR                  S5        [        UR
                  R                  S	5        [        [        U R                  S
S9n[        UR                  S
5        [        UR
                  R                  S5        [        [        U R                  SS9n[        UR                  S5        [        UR
                  R                  S	5        [        [        U R                  SS9n[        UR                  S5        [        UR
                  R                  S	5        [        [        U R                  SS9n[        UR                  S5        [        UR
                  R                  S5        [        [        U R                  SS9n[        UR                  S5        [        UR
                  R                  S5        [        [        U R                  SS9n[        UR                  S5        [        UR
                  R                  S5        [        [        U R                  SS9n[        UR                  S5        [        UR
                  R                  S5        g )Nbest1expstrategy_best1best1binrand1bin_rand1rand1exprand2exp_rand2best2bin_best2rand2binrandtobest1bin_randtobest1randtobest1expcurrenttobest1bin_currenttobest1currenttobest1exp)r   r   r0   r   rI   mutation_func__name__r8   solvers     r9   test__strategy_resolves7TestDifferentialEvolutionSolver.test__strategy_resolves3   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                 P   [         R                  " S/5      nU R                  R                  [         R                  " / SQ5      5      n[	        X!5        [         R                  " S/5      nU R                  R                  [         R                  " / SQ5      5      n[	        X!5        g )N皙?rC                     ?)r+   r.   r3   rJ   r   rM   r8   resulttrials      r9   test__mutate1-TestDifferentialEvolutionSolver.test__mutate1~   sp    4&!""))"((?*CD&4&!""))"((?*CD&r<   c                 P   [         R                  " S/5      nU R                  R                  [         R                  " / SQ5      5      n[	        X!5        [         R                  " S/5      nU R                  R                  [         R                  " / SQ5      5      n[	        X!5        g )Ngrb   r)   )r+   r.   r3   rR   r   rP   rh   s      r9   test__mutate2-TestDifferentialEvolutionSolver.test__mutate2   sq     4&!""))"((?*CD&3%""))"((?*CD&r<   c                     [         R                  " S/5      nU R                  R                  [         R                  " / SQ5      5      n[	        X!5        g )Ng333333?rb   )r+   r.   r3   rU   r   rh   s      r9   test__randtobest11TestDifferentialEvolutionSolver.test__randtobest1   s9    4&!""//0IJ&r<   c                     [         R                  " S/5      nU R                  R                  S[         R                  " / SQ5      5      n[	        X!5        g )Nr)   r$   rb   )r+   r.   r3   rX   r   rh   s      r9   test__currenttobest14TestDifferentialEvolutionSolver.test__currenttobest1   s@    3%""22HH_%
 	&r<   c                     Sn[        U R                  U R                  US9n[        UR                  [        U5      5        g )Nr&   r$   r(   )r   r1   r0   r   ditherlist)r8   r(   r]   s      r9   test_can_init_with_dithering<TestDifferentialEvolutionSolver.test_can_init_with_dithering   s6    ,T^^-1[[6>@ 	V]]DN3r<   c                 |   [         nSn[        [        [        UU R                  US9  Sn[        [        [        UU R                  US9  S[
        R                  4n[        [        [        UU R                  US9  Sn[        UU R                  US9n[        SUR                  5        [        S UR                  5        g )N)r&   rc   rx   r$   r)   r&   )
r   assert_raises
ValueErrorr   r0   r+   nanr   scalery   )r8   funcr(   r]   s       r9   +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                 v    S n[        [        SS9   [        USS/5        S S S 5        g ! , (       d  f       g = f)Nc                     [         R                  " [         R                  " U S-  5      [         R                  " U 5      /5      $ NrC   )r+   r.   sumrD   s    r9   r   ETestDifferentialEvolutionSolver.test_invalid_functional.<locals>.func   s*    88RVVAF^RVVAY788r<   z,func\(x, \*args\) must return a scalar valuematchrC   )r   RuntimeErrorr   )r8   r   s     r9   test_invalid_functional7TestDifferentialEvolutionSolver.test_invalid_functional   s<    	9 EG #4'7);<G G Gs   *
8c                    [         R                  " S/5      n[        SU R                  R	                  U5      5        [         R                  " S/S//5      U R                  l        [        SU R                  R	                  U5      5        g )N333333?   r"   r   )r+   r.   r   r2   _scale_parametersr/   r8   rj   s     r9   test__scale_parameters6TestDifferentialEvolutionSolver.test__scale_parameters   sh    #R**<<UCD $&88cURDM#: R**<<UCDr<   c                    [         R                  " S/5      n[        SU R                  R	                  U5      5        [         R                  " S/S//5      U R                  l        [        SU R                  R	                  U5      5        g )Nr   r   r"   r   )r+   r.   r   r2   _unscale_parametersr/   r   s     r9   test__unscale_parameters8TestDifferentialEvolutionSolver.test__unscale_parameters   sh    "S$++??FG $&88cURDM#: S$++??FGr<   c                 *   [         R                  " SS9   [        U R                  SS/S9nUR	                  SS/5      n[        US5        S S S 5        [        U R                  SS/5      n[        UR                  SS	/5        g ! , (       d  f       N?= f)
Nr   r   r   r   )      ?      @)r0   r   r&   )r   r   r   )	r+   errstater   r1   r   r   r   r   rD   )r8   r]   vress       r9   test_equal_bounds1TestDifferentialEvolutionSolver.test_equal_bounds   s~    [[)0"J/F **C:6AAs# * %T^^j*5MNSUUS#J' *)s   6B
Bc                     [         R                  " / SQ5      nU R                  R                  U5        [	        US   S5        [        [         R                  " US:  US:*  5      R                  5       5        g )N)皙??r   g     r@gh㈵rC   r   r   r$   )r+   r.   r2   _ensure_constraintr   r   logical_andallr   s     r9   test__ensure_constraint7TestDifferentialEvolutionSolver.test__ensure_constraint   sW    =>,,U3U1Xs#uz5A:6::<=r<   c                 \   [        U R                  S/SSS9nUR                  5       n[        UR                  U R                  UR
                  5      5        [        U R                  S/SSS9nUR                  5       n[        UR                  U R                  UR
                  5      5        g )Nr   r$   F)maxiterpolishT)r   r1   solver   funrD   r8   r]   ri   s      r9   test_differential_evolution;TestDifferentialEvolutionSolver.test_differential_evolution   s     -NNWIq
 VZZ!9:,NNWIq
 VZZ!9:r<   c                     [        U R                  S/5      nUR                  5       n[        UR                  UR                  5        g )Nr   )r   r1   r   r   rD   r   s      r9   test_best_solution_retrieval<TestDifferentialEvolutionSolver.test_best_solution_retrieval  s1    ,T^^gYGVXXvxx(r<   c                   ^^^	 Sm	U4S jmS Tl         [        R                  Tl        UU	4S jmSTl        S Tl        TTl        SS/n[        TUSSS9n[        S0 UDS	T0D6n[        S0 UDS
T	0D6nUR                  UR                  s=L a  SL d   e   eTR                  UR                  s=:X  a  T	:X  d   e   eUR                  S:X  d   eUR                  S:X  d   eUR                  5        H4  u  pVUS;   a  M  [        TR
                  U   U5        [        X5   U5        M6     STl        [        R                  Tl        SUS'   [        S0 UDS	T0D6nUR                  UR                  :  d   eg )N
   c                 Z   > [        U 5      nUTR                  :  a  U Tl        UTl        U$ N)r   valrD   )rD   r   r   s     r9   r   FTestDifferentialEvolutionSolver.test_intermediate_result.<locals>.func  s*    (CTXX~Jr<   c                   > T=R                   S-  sl         U Tl        U R                  R                  S:X  d   eU R                  R                  S   S:X  d   eU R                   TR                   :X  d   e[        U R                  TR                  R                  5        [        U R                  TR                  R                  5        [        U R                  [        U R                  5      5        [        [        U R                  5      5       H5  nU R                  U   n[        U R                  U   5      n[        X#5        M7     [        U R                  U R                  S   5        [        U R                  U R                  S   5        U R                  S:X  d   eU R                  SL d   e[!        U ["        5      (       d   eTR                   T:X  a  [$        eg )Nr$   rC   r   zin progressT)nitintermediate_resultr7   ndimshaper   rD   r   r   r   r   rangelenpopulation_energiesmessagesuccess
isinstancer   StopIteration)r   ir   refcallbackr   s       r9   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<   r   r   rC   ie F)r   r0   rngr   r   r   &callback function requested stop early/Maximum number of iterations has been exceeded.>   r   r   Tr   r>   )rD   r+   infr   r   r   r   dictr   r   r   itemsr   r   )
r8   r0   kwargsr   r   fieldr   r   r   r   s
          @@@r9   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                 p   SS/nSnSS jn[        [        XS9n[        UR                  U5        S n[        [        XS9nUR                  (       a   eSS jn[        [        XS9n[        UR                  U5        UR                  (       a   eSS jn[        [        UUS9nUR                  (       d   eg )	Nr   r   c                     g)NTr>   paramconvergences     r9   callback_python_trueVTestDifferentialEvolutionSolver.test_callback_terminates.<locals>.callback_python_trueW  s    r<   )r   c                     [         er   )r   )r   s    r9   callback_stopOTestDifferentialEvolutionSolver.test_callback_terminates.<locals>.callback_stop`  s    r<   c                     S/$ )Nr   r>   r   s     r9   callback_evaluates_trueYTestDifferentialEvolutionSolver.test_callback_terminates.<locals>.callback_evaluates_truef  s	    4Kr<   c                     / $ r   r>   r   s     r9   callback_evaluates_falseZTestDifferentialEvolutionSolver.test_callback_terminates.<locals>.callback_evaluates_falsen  s    Ir<   )r   )r   r   r   r   r   )r8   r0   expected_msgr   ri   r   r   r   s           r9   test_callback_terminates8TestDifferentialEvolutionSolver.test_callback_terminatesS  s    &!?	 (6
 	FNNL9	  (vN>>!!	 (vXFNNL9>>!!	 (v1IK~~~r<   c                 X    S/nSnS n[        UUUSS9n[        UR                  S5        g )Nr   )r   r   r   c                 v    [        U[        5      (       d  [        S5      eUS   US   U -  -   US   U S-  -  -   $ )Nzargs should be a tupler   r$   rC   r   )r   tupler   )rD   argss     r9   r1   LTestDifferentialEvolutionSolver.test_args_tuple_is_passed.<locals>.quadraticz  sC    dE** !9::7T!Wq[(47QU?::r<   T)r   r   gUUUUUU?)r   r   r   )r8   r0   r   r1   ri   s        r9   test_args_tuple_is_passed9TestDifferentialEvolutionSolver.test_args_tuple_is_passedu  s:    	;
 (	(.-1/35 	FJJ/r<   c                 @    [         nS/n[        [        [        UUSS9  g )Nrc   abcrH   )r   r   r   r   )r8   r   r0   s      r9   test_init_with_invalid_strategy?TestDifferentialEvolutionSolver.test_init_with_invalid_strategy  s$    j0 #(		*r<   c                     [         nS/n[        [        [        UU5        SS/n[        [        [        UU5        [        [         [	        SS/SS/5      5      n[        UR                  S5        g )Nr   r   )rc   rd   re   r   rC   )r   r   )r   r   r   r   r   r   rD   )r8   r   r0   ri   s       r9   test_bounds_checking4TestDifferentialEvolutionSolver.test_bounds_checking  sk    j0 	" 9%j0 	" (vq!fq!f/EFFHHh/r<   c                 Z   [         R                  " SSS9R                  SS5      n[        [	        USS S 24   USS S 24   5      5      n[        S USS9nSnUR                  US	5      u  pVpxn	[        [        [         R                  " [         R                  " XEXgX/5      5      5      S5        g )
Ng      (@float64)dtyperC   rf   r   r$   r'   re   )r+   r5   reshaperz   zipr   _select_samplesr   r   uniquer.   )
r8   r/   r0   r]   	candidater1r2r3r4r5s
             r9   test_select_samples3TestDifferentialEvolutionSolver.test_select_samples  s    3i088A>c&A,q!t56,T61E	#33IqA		"((I22#BCDEq	Jr<   c                     [        [        U R                  SS9nUR                  5       n[	        UR
                  S5        [	        UR                  S5        g )Nr$   )r   Fr   )r   r   r0   r   r   r   r   r   s      r9   test_maxiter_stops_solve8TestDifferentialEvolutionSolver.test_maxiter_stops_solve  sA     -UDKKKV^^U+V^^I	Kr<   c           	         [        [        U R                  SSS9nUR                  5       n[	        UR
                  S5        [	        UR                  S5        [	        UR                  S5        [        [        U R                  SSSS9nUR                  5       n[	        UR
                  S	5        [	        UR                  S5        [	        UR                  S5        [        [        U R                  SSS
SS9nUR                  5       n[	        UR
                  S
5        [	        UR                  S5        [	        UR                  S5        g )Nr$   F)maxfunr   rC   z9Maximum number of function evaluations has been exceeded.re   (   )r'   r   r  )   /   deferred)r'   r   r  updatingz8Maximum number of function evaluations has been reached.)r   r   r0   r   r   nfevr   r   r   s      r9   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                     [        U R                  S/SS9nUR                  5         [        [        R
                  " UR                  5      S5        g )Nr   r"   {Gz?)tolr   )r   r1   r   r   r+   argminr   r\   s     r9   test_quadratic.TestDifferentialEvolutionSolver.test_quadratic  s>    ,T^^.9]157 	RYYv99:A>r<   c                 2    [        U R                  S/SSS9  g )Nr   r!  r$   )r"  seed)r   r1   r?   s    r9   test_quadratic_from_diff_ev;TestDifferentialEvolutionSolver.test_quadratic_from_diff_ev  s    t~~ +}#'$%	'r<   c                     [        U R                  S/SSSS9n[        U R                  S/SSSS9n[        UR                  UR                  5        [        UR                  UR                  5        g )Nr   Fr$   r&   )r   r   r"  )r   r1   r   rD   r  )r8   ri   result2s      r9   test_rng_gives_repeatability<TestDifferentialEvolutionSolver.test_rng_gives_repeatability  sf    ')4/4,-,/	1
 ))4/4,-,/	1
 	VXXwyy)V[[',,/r<   c           
          [         R                  R                  5       n/ SQnU H  n[        U R                  S/SUSUS9  M     g )N)randomlatinhypercubesobolhaltonr   Fr&   )r   r   r"  init)r+   r/  default_rngr   r1   )r8   r   initsr3  s       r9   test_random_generator5TestDifferentialEvolutionSolver.test_random_generator  sD     ii##%?D"4>>$/=*/'*'*(,. r<   c                 X    [        [        U R                  SSS9nUR                  5         g )NrG   r$   )rI   r   r   r   r0   r   r\   s     r9   test_exp_runs-TestDifferentialEvolutionSolver.test_exp_runs  s&    ,U-1[[6@568
 	r<   c                 ,    SS/n[        [        USSS9  g )N)re   1   r$   )r'   r   )r   r   )r8   r0   s     r9   test_gh_4511_regression7TestDifferentialEvolutionSolver.test_gh_4511_regression  s    
 7# 	ufb!Dr<   c                    [        [        U R                  SS9nUR                  UR                  5        UR                  5         [        [        R                  " UR                  5      S5        [        UR                  S5        g )Nrc   r  r   rf   )r   r   r0   _calculate_population_energiesr7   _promote_lowest_energyr   r+   r#  r   _nfevr\   s     r9   "test_calculate_population_energiesBTestDifferentialEvolutionSolver.test_calculate_population_energies(  s]    ,UDKKK--f.?.?@%%'RYYv99:A> 	V\\1%r<   c                    [        [        U R                  SSS9n[        U5      u  p#[	        [
        R                  " US5      S5        [	        UR                  S5        [        [        [        U5        [        [        U R                  5      n[        U5      u  pE[        U5       H  u  pgUu  pXY:  d   eXpTUS:X  d  M    g    g )Nrc      )r'   r  r   rC   2   )r   r   r0   nextr   r+   sizerD  r   r   	enumerate)
r8   r]   rD   r   _fun_prevr   soln	x_currentfun_currents
             r9   test_iteration.TestDifferentialEvolutionSolver.test_iteration2  s     -UDKK468fRWWQ]A& 	V\\2& 	mT62 -UDKK@6l (GA%)"I***#xBw )r<   c                     [        [        U R                  SSS9nUR                  5         [	        UR
                  S:  5        g )N皙?F)r"  r   )r   r   r0   r   r   r   r\   s     r9   test_convergence0TestDifferentialEvolutionSolver.test_convergenceL  s5    ,UDKKS49;""S()r<   c                 X    [        [        U R                  S S S9nUR                  5         g )N)r   r  r9  r\   s     r9   test_maxiter_none_GH57318TestDifferentialEvolutionSolver.test_maxiter_none_GH5731R  s$    
 -UDKK48:r<   c           
         [        [        [        /[        U R                  4Q70 SS0D6  [        [        U R                  5      nUR                  5         [        UR                  S5        [        [        R                  " [        R                  " UR                  5      5      5        UR                  5         [        UR                  S5        [        [        R                  " [        R                  " UR                  5      5      5        UR                  SS9  [        UR                  S5        [        [        R                  " [        R                  " UR                  5      5      5        [        [        U R                  SS9nUR                  SS9  [        UR                  S5        [        [        R                  " [        R                  " UR                  5      5      5        [        R                  " SS	S
5      R!                  SS5      n[        [        U R                  USSSSS9n[        UR                  S5        [        [        R                  " [        R                  " UR                  5      5      5        [        UR"                  S:H  5        [        UR$                  S:H  5        [        R&                  " UR)                  U5      SS5      n[+        UR,                  S S U5        [+        [        R.                  " UR,                  S S 5      S5        [+        [        R0                  " UR,                  S S 5      S5        [        R                  " SS	S5      R!                  SS	5      n[        [        [        /[        U R                  4Q70 SU0D6  [        R2                  R5                  SSSS9n[        [        U R                  US9n[7        UR,                  S   US-  5        g )Nr3  rubbishr   r2  )
qmc_enginer1  )r3  r   rc   r   re   rC   rQ   {Gz?r$   )r3  rI   atolr   r'   )re   rC      r   r   )lowhighrK  x0)r   r   r   r   r0   init_population_randomr   rD  r   r+   r   isinfr   init_population_lhsinit_population_qmclinspacer  num_population_memberspopulation_shapeclipr   r   r7   minmaxr/  uniformr   )r8   r]   r7   unscaled_populationrd  s        r9   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--bq13FG 	BFF6#4#4Ra#891=BFF6#4#4Ra#891= [[Q+33Aq9
j1	.t{{+	.  ,	. YY3Sq9,4;;2
 	))!,b3h7r<   c                     [        [        U R                  SS/S9nUR                  (       d   e[	        [
        5         [        [        U R                  SS/S9  S S S 5        g ! , (       d  f       g = f)NrU  r*   rc   @)r   r   r0   r   r   r   )r8   r   s     r9   test_x0'TestDifferentialEvolutionSolver.test_x0  sN    $UDKKS#JG{{{ :&"5$++3*E '&&s   A##
A1c                 &    S nSS/n[        XSS9  g )Nc                 >    U S   S:  a  [         R                  $ U S   $ )Nr   r&   r$   )r+   r   r   s    r9   sometimes_infWTestDifferentialEvolutionSolver.test_infinite_objective_function.<locals>.sometimes_inf  s    tbyvvQ4Kr<   r#   F)r0   disp)r   )r8   ry  r0   s      r9    test_infinite_objective_function@TestDifferentialEvolutionSolver.test_infinite_objective_function  s    	 &!}%Hr<   c                 0   SS/n[        [        USS9n[        UR                  S:H  5        [        UR                  R
                  [        L 5        UR                  5       nUR                  (       d   e[        [        USSS9nUR                  (       d   eg )Nr    r  )r  rG   )r  rI   )
r   r   r   	_updating_mapwrapper_mapfuncmapr   r   r   )r8   r0   r]   r   s       r9   test_deferred_updating6TestDifferentialEvolutionSolver.test_deferred_updating  s    H%,UFZP  J./""++s23lln{{{ %6J
 {{{r<   c                    SS/n[        [        U5      n[        UR                  S:H  5        [        R
                  " S5      nUR                  S5       n[        [        5         [        [        XR                  S9 nUR                  5         S S S 5        S S S 5        WR                  S:X  d   e S S S 5        g ! , (       d  f       N2= f! , (       d  f       N;= f! , (       d  f       g = f)Nr    	immediatespawnrC   )workersr  )r   r   r   r  multiprocessingget_contextr   r   UserWarningr  r   )r8   r0   r]   ctxpss         r9   test_immediate_updating7TestDifferentialEvolutionSolver.test_immediate_updating  s     H%,UF;  K/0 ))'2XXa[A {#0NRSLLN O $ ;;*,,, [ ON $# [s<   C$C=B:CC:
CC
C	C
C*r   c           
         SS/n[        S5       n[        [        USUR                  SSS9 nUR                  R
                  c   eUR                  S:X  d   eUR                  5         S S S 5        S S S 5        [        [        USSSSS9 nUR                  R
                  c   eUR                  S:X  d   eUR                  5         S S S 5        g ! , (       d  f       Nm= f! , (       d  f       Nv= f! , (       d  f       g = f)Nr    rC   r  r)   rc   )r  r  r"  r'   )r  r  r'   r"  )
ThreadPoolr   r   r  r  poolr  r   )r8   r0   r  r]   s       r9   test_parallel-TestDifferentialEvolutionSolver.test_parallel  s     H%]a!<6J3PQ"
%%**666##z111LLN"
] )6J1#
%%**666##z111LLN
 
"
 "
]]
 
s.   C!<C)C!<C2
C	C!!
C/2
D c                 z    [        [        SS/5      nUR                  5         [        UR	                  5       5        g )Nr   )r   r   r   r   	convergedr\   s     r9   test_converged.TestDifferentialEvolutionSolver.test_converged  s-    ,UVV4DE  "#r<   c                 b  ^ S nS m[        U[        R                  * S5      n[        [        SS/U4S9nUR                  [        R                  " SS/5      5      n[        US5        [        T[        R                  * S5      n[        [        SS/X%4S9n/ S	Qn/ S
Qn[        Xg5       HJ  u  pUR                  [        R                  " U5      5      n[        U[        R                  " U	5      5        ML     [        UR                  [        R                  " U5      5      [        R                  " U5      5        [        R                  " [        R                  " U5       Vs/ s H  nUR                  U5      PM     sn5      n
U
R                  S:X  d   eU4S jn[        U[        R                  * S5      n[        [        SS/X%4SS9nSUl        [        R                  " [        SS9   UR                  [        R                  " U5      5        S S S 5        g s  snf ! , (       d  f       g = f)Nc                     U S   U S   -   /$ Nr   r$   r>   r   s    r9   constr_fNTestDifferentialEvolutionSolver.test_constraint_violation_fn.<locals>.constr_f      aD1Q4K= r<   c                 \    [         R                  " U S   S-  U S   -   U S   U S   -
  /5      $ Nr   rC   r$   r+   r.   r   s    r9   	constr_f2OTestDifferentialEvolutionSolver.test_constraint_violation_fn.<locals>.constr_f2  2    88QqT1Wqt^QqTAaD[9::r<   ffffff?r   constraintsr   r)   ?))333333?r$   r   )r&   r&   ))r   {Gz?r   )rt  @r   )r   r   r   )rc   r$   rc   c                 (   > T" U 5      R                   $ r   )r6   )rD   r  s    r9   	constr_f3OTestDifferentialEvolutionSolver.test_constraint_violation_fn.<locals>.constr_f3  s    Q<>>!r<   F)r  
vectorizedTz#An array returned from a Constraintr   )r	   r+   r   r   r   _constraint_violation_fnr.   r   r  r   r4   r   r  pytestr   r   )r8   r  nlcr]   cvnlc2xsvsrD   r   constraint_violationr  r  s               @r9   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   #H,&H  
H.c           	      R   S nS n[        U[        R                  * S5      n[        [        SS/U4S9nUR                  [        R                  " SS/SS//5      5      u  pV[        USS/5        [        U[        R                  " S	/S
//5      5        UR                  S:X  d   e[        U[        R                  * S5      nS GH_  n[        [        SS/X74USS9nUR                  [        R                  " SS/SS//5      5      u  pV[        USS/5        [        U[        R                  " / SQ/ SQ/5      5        UR                  [        R                  " SS/SS//5      5      u  pV[        USS/5        [        U[        R                  " / SQ/ SQ/5      5        UR                  S:X  d   eUR                  [        R                  " SS/SS//5      5      u  pV[        USS/5        [        U[        R                  " / SQ/ SQ/5      5        UR                  S:X  a  GM`   e   g )Nc                     U S   U S   -   /$ r  r>   r   s    r9   r  ZTestDifferentialEvolutionSolver.test_constraint_population_feasibilities.<locals>.constr_f)  r  r<   c                 4    U S   S-  U S   -   U S   U S   -
  /$ r  r>   r   s    r9   r  [TestDifferentialEvolutionSolver.test_constraint_population_feasibilities.<locals>.constr_f2,  s)    aD!GadNAaD1Q4K00r<   r  r   r  r&   r   Fr)   rt  )rC   r$   r  )FTr  )r  r  r  g333333?)r)   rU  r   )r   r  r   )rt  r  r   )rC   rc   rg   T)r   r   r   )
r	   r+   r   r   r   #_calculate_population_feasibilitiesr.   r   r   r   )	r8   r  r  r  r]   feasr  r  	vectorizes	            r9   (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                 .   S n[        U[        R                  * S5      n[        [        SS/U4S9n[        [        5         UR                  5       nS S S 5        U" WR                  5      S::  d   eUR                  (       d   eg ! , (       d  f       N:= f)Nc                 B    [         R                  " U S   U S   -   /5      $ r  r  r   s    r9   r  GTestDifferentialEvolutionSolver.test_constraint_solve.<locals>.constr_fW      88QqTAaD[M**r<   r  r   r  )
r	   r+   r   r   r   r   r  r   rD   r   )r8   r  r  r]   r   s        r9   test_constraint_solve5TestDifferentialEvolutionSolver.test_constraint_solveU  s}    	+ "(RVVGS9,UVV4D:=A ;,,.C   #%%%{{{	  s   B
Bc           	      f   S n[        U[        R                  * S5      n[        [        SS/U4SSSS9n[        [        5         UR                  5       nS S S 5        WR                  S:  d   eUR                  (       a   e[        [        SS/U4SS	9n[        U5        UR                  R                  5       (       a   e[        R                  " UR                  5      R                  5       (       a   eS
nUR                  S   nUR                  US/   UR                  SU/'   UR                   US/S S 24   UR                   SU/S S 24'   UR                  US/S S 24   UR                  SU/S S 24'   UR#                  5         [%        UR                  S   U5        g ! , (       d  f       GNS= f)Nc                 B    [         R                  " U S   U S   -   /5      $ r  r  r   s    r9   r  LTestDifferentialEvolutionSolver.test_impossible_constraint.<locals>.constr_fi  r  r<   r   r   r$   r"   )r  r'   r   r   r   F)r  r      )r	   r+   r   r   r   r   r  r   maxcvr   rJ  feasibler   isfiniter   r  r7   rC  r   )r8   r  r  r]   r   lr  s          r9   test_impossible_constraint:TestDifferentialEvolutionSolver.test_impossible_constraintf  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   F!!
F0c                    S n[        U[        R                  * S5      n[        [        SS/U4S9nUR
                  nU" SS[        R                  " S/5      SS[        R                  " S/5      5      (       d   eU" SS[        R                  " S/5      SS[        R                  " S/5      5      S	L d   eU" SS[        R                  " S/5      SS[        R                  " S/5      5      (       d   eU" S
S[        R                  " S/5      SS	[        R                  " S/5      5      (       d   eU" SS	[        R                  " SS/5      SS	[        R                  " SS/5      5      (       d   eU" SS	[        R                  " SS/5      SS	[        R                  " SS/5      5      (       d   eU" SS	[        R                  " SS/5      SS	[        R                  " SS/5      5      (       a   eg )Nc                     U S   U S   -   /$ r  r>   r   s    r9   r  CTestDifferentialEvolutionSolver.test_accept_trial.<locals>.constr_f  r  r<   r  r   r  r)   Tr   r   Fg#@r&   g?)r	   r+   r   r   r   _accept_trialr.   )r8   r  r  r]   fns        r9   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                   ^
 [         R                  " / SQ5      n[         R                  " S[         R                  S/5      n[         R                  " / SQ5      n[        [	        X5      U5      nUR                  U5      S:  R                  5       (       d   eUR                  / SQ5      S:H  R                  5       (       d   e[         R                  " SS5      R                  S	S
5      n/ nU H#  nUR                  UR                  U5      5        M%     [         R                  R                  UR                  UR                  5      [         R                  " U5      R                  5        [         R                  " / SQ5      n[         R                  " / SQ/ SQ/ SQ/5      m
[        [        T
[         R                  * S5      U5      nUR                  U5      S:  R                  5       (       d   eUR                  / SQ5      S:H  R                  5       (       d   e[         R                  " SS5      R                  SS5      n/ nU H#  nUR                  UR                  U5      5        M%     [         R                  R                  UR                  UR                  5      [         R                  " U5      R                  5        [        [        [        T
5      [         R                  * S5      U5      nUR                  U5      S:  R                  5       (       d   eUR                  / SQ5      S:H  R                  5       (       d   eU
4S jn[!        U[         R                  * S5      n	[        U	/ SQ5      nUR                  U5      S:  R                  5       (       d   eUR                  / SQ5      S:H  R                  5       (       d   eg )N)r   r  r   r&   F   )r$   rC   rc   r   )rg         r$      re   rc   )r$   rC   rc   rd   )re   r   r   rf   )r%   r      r   )r   rC   r   rd      r%   rd   c                 &   > TR                  U 5      $ r   )dot)rD   As    r9   r   DTestDifferentialEvolutionSolver.test_constraint_wrapper.<locals>.fun  s    558Or<   )r+   r.   r   r   r   	violationanyr   r5   r  appendtestingr   r6   r
   r   r	   )r8   lbubrd  pcr  
violationsrD   r   	nonlinearr  s             @r9   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A K "$R 1$))++++-.!388::::	 (bffWa8		+;<R 1$))++++-.!388::::r<   c                 &   S n[        USS/SS/5      n[        USS/5      n[        R                  " UR                  S   5      S:X  d   e/ SQn/ S	Qn[        XE5       H   u  pg[        UR                  U5      U5        M"     [        UR                  [        R                  " U5      R                  5      [        R                  " U5      R                  5        UR                  [        R                  " U5      R                  5      R                  S[        U5      4:X  d   eUR                  [        R                  " U5      R                  5      R                  S[        U5      4:X  d   eUR                  S:X  d   eUR                  S:X  d   eg )
Nc                 b    [         R                  " U S   S-  U S   -   U S   S-  U S   -
  /5      $ r  r  r   s    r9   cons_fQTestDifferentialEvolutionSolver.test_constraint_wrapper_violation.<locals>.cons_f  sA     88QqTQY1-qTQY1-/ 0 0r<   r   g333333rC   r&   r$   r   )rw   )r&   r  )r  r  )r)   333333)r)   r   ))r   r   )r   r)   )r  r   )gRQ?r   )r^  g=
ףp=?)r	   r   r+   rK  r0   r  r   r  r.   r6   r   r   r   
num_constrparameter_count)r8   r  r  r  r  r  rD   r   s           r9   !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                    [        5        nUR                  [        5        [        R                  " / SQ/ SQ/5      nS S S 5        [        WSS5      n[        R                  " S5      n[        X45      nUR                  U5      R                  S:X  d   e[        R                  " S5      R                  SS5      nUR                  U5      R                  S	:X  d   eg ! , (       d  f       N= f)
N)r$   r$   r$   r   )rC   rC   rC   r   r   r$   rd   )rC   r  re   )rC   re   )r   filterPendingDeprecationWarningr+   matrixr
   onesr   r  r   r5   r  )r8   supr  lcrd  cwxtrials          r9   test_matrix_linear_constraint=TestDifferentialEvolutionSolver.test_matrix_linear_constraint  s      CJJ01YY - / 0F ! fa+WWQZ' ||B%%--- 5!))!Q/||F#))V333 ! s   2C
C*r  c                 	   S n[         R                  " S5      nSUS/ SQ4'   SUSSS/4'   S	US
/ SQ4'   SUS/ SQ4'   SUSSS/4'   S	US/ SQ4'   SUS/ SQ4'   SUSS
S/4'   S	US/ SQ4'   USS 2SS 24   n[         R                  " / SQ5      n[        U[         R                  * U5      nS/S-  S/S
-  -   S/-   n[        XSSU4SSS9nSnS n[        U" U5      US!S"9  UR                  (       d   e[        UR                  US!S"9  [        UR                  US#S"9  [        [         R                  " X&R                  -  U:*  5      5        [        [         R                  " UR                  [         R                  " U5      S S 2S$4   :  5      5        [        [         R                  " UR                  [         R                  " U5      S S 2S4   :*  5      5        [        [        U5      [         R                  * U5      n[        XSS%U4SS&S9n[        U" U5      U5        UR                  (       d   e[        UR                  US'S"9  [        UR                  US#S"9  [        [         R                  " X&R                  -  U:*  5      5        [        [         R                  " UR                  [         R                  " U5      S S 2S$4   :  5      5        [        [         R                  " UR                  [         R                  " U5      S S 2S4   :*  5      5        S( n	S) n
[        US S2S S 24   [         R                  * US S 5      n[        USS2S S 24   [         R                  * USS 5      n[        U	[         R                  * USS 5      n[        U
[         R                  * USS 5      nXLX4n[        5        nUR                  [         5        [        XSS%USS&S9nS S S 5        [        UR                  US!S"9  [        UR                  US#S"9  [        [         R                  " X&R                  -  U:*  5      5        [        [         R                  " UR                  [         R                  " U5      S S 2S$4   :  5      5        [        [         R                  " UR                  [         R                  " U5      S S 2S4   :*  5      5        g ! , (       d  f       N= f)*Nc                     [         R                  " S/U 45      n [         R                  " SU SS -  5      SU SS -  U SS -  -
  [         R                  " U SS  5      -
  nU$ )Nr   re   r$   )r+   hstackr   rD   r   s     r9   f2TestDifferentialEvolutionSolver.test_L1.<locals>.f  s_    		A3(#A&&1Qq6"Qq1vXa!f_4rvvae}DCJr<   )r      )rC   rC   r$   r$   r$   )r$   rC   r      )r$   rC   r   )r   r   r$   rc   )rd   re   r   rd   )r$   rc   r   r  re   r  rf   )rf   r%   r  r%   )rC   rc   r  rH  r  rH  	   )r  r  rH  )	r   r   r   r   r   r   r   r   r   r#   r!   rK   i90  r^  rI   r   r  r'   r"  )r$   r$   r$   r$   r$   r$   r$   r$   r$   rc   rc   rc   r$   iga2U0*C?r_  g{Gzt?r   iz ra   gMb@?c                     [         R                  " S/U 45      n SU S   -  SU S   -  -   U S   -   U S   -   SU S   -  U S   -   /$ )Nr   rC   rc   r  rH  r  r+   r  r   s    r9   c13TestDifferentialEvolutionSolver.test_L1.<locals>.c1G  s\    		A3(#AadFQqtVOae+ae3qtGaeO% %r<   c                 \    [         R                  " S/U 45      n SU S   -  U S   -
  U S   -   $ )Nr   r   r  r  rH  r  r   s    r9   c23TestDifferentialEvolutionSolver.test_L1.<locals>.c2L  s5    		A3(#Aad7QqT>AbE))r<   )r+   zerosr.   r
   r   r   r   r   rD   r   r   r   r   r	   r   r  r  )r8   r
  r  bLr0   r   x_optf_optr  r  L2NN2r  r   s                   r9   test_L1'TestDifferentialEvolutionSolver.test_L1  s   	
 HHX)!^
!aW*$!Z-)!^
!aW*$!Z-)!^
!aW*$!Z-ab!"fIHH34Q+!xjl*fX5 %
A44

 8%%d3{{{u40T2qw!|$%suu 0A 6678suu 0A 6678 Z]RVVGQ7 %
aT4

 	%%({{{u40T2qw!|$%suu 0A 6678suu 0A 6678
	%
	* Qrr1uXw"16a!Qi"&&!Aa&9RVVGQqV4 bffWa!f5Rn CJJ{#(JG'C ! 	u40T2qw!|$%suu 0A 6678suu 0A 6678 ! s   9$S
Sc           	      2   S nS n[        US[        R                  5      nS/S-  nUn[        5        nUR	                  [
        5        [        XSSUS9nS S S 5        S	nS
n	[        U" U	5      U5        [        WR                  U5        [        UR                  U	SS9  UR                  (       d   e[        [        R                  " [        R                  " U" UR                  5      5      S:  5      5        [        [        R                  " UR                  [        R                  " U5      S S 2S4   :  5      5        [        [        R                  " UR                  [        R                  " U5      S S 2S4   :*  5      5        g ! , (       d  f       GN8= f)Nc                     [         R                  " S/U 45      n U S   S-
  S-  SU S   S-
  S-  -  -   U S   S-  -   SU S   S	-
  S-  -  -   SU S   S
-  -  -   SU S
   S-  -  -   U S   S-  -   SU S
   -  U S   -  -
  SU S
   -  -
  SU S   -  -
  nU$ )Nr   r$   r   rC   re   rH  rc   rd   r  rf   r%   r  r  r	  s     r9   r
  2TestDifferentialEvolutionSolver.test_L2.<locals>.fg  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                    [         R                  " S/U 45      n SSU S   S-  -  -
  SU S   S-  -  -
  U S   -
  SU S   S-  -  -
  SU S   -  -
  SS	U S   -  -
  U S   S-  -
  S
U S
   S-  -  -
  SU S   -  -   SSU S   -  -
  SU S   -  -
  SU S   S-  -  -
  U S   -
  U S   -   SU S   S-  -  U S   S-  -
  SU S   -  U S   -  -   SU S   S-  -  -
  SU S
   -  -
  SU S   -  -   /$ )Nr      rC   r$   rc   rd   re         rf   r  r%   i  r   r  r  r   s    r9   r  3TestDifferentialEvolutionSolver.test_L2.<locals>.c1n  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   r   r%   rK     rI   r   r  gy\
E@)gܤ@g$H8?g	޿g0ev@gn8)gk_@/?g0g+?h㈵>r  r$   )r	   r+   r   r   r  r  r   r   r   rD   r   r   r   r.   )
r8   r
  r  r  r0   r  r   r   r  r  s
             r9   test_L2'TestDifferentialEvolutionSolver.test_L2c  s-   		&  Arvv.Q CJJ{#(Z-1{LC !
 "1 	%%('u40{{{rxx355	*a/01suu 0A 6678suu 0A 6678 ! s   "F
Fc           	      h   S n[         R                  " S5      nSUS/ SQ4'   SUS/ SQ4'   SUS	/ S
Q4'   USS 2SS 24   n[         R                  " / SQ5      nS n[        X#[         R                  5      n[        US[         R                  5      nS/S-  nXV4n[        5        n	U	R                  [        5        [        XSUS	S9n
S S S 5        SnSn[        U" U5      USS9  [        W
R                  USS9  [        U
R                  USS9  U
R                  (       d   e[        [         R                  " X*R                  -  U:  5      5        [        [         R                  " [         R                  " U" U
R                  5      5      S:  5      5        [        [         R                  " U
R                  [         R                  " U5      S S 2S4   :  5      5        [        [         R                  " U
R                  [         R                  " U5      S S 2S4   :*  5      5        g ! , (       d  f       GNd= f)Nc                 t   [         R                  " S/U 45      n U S   S-  U S   S-  -   U S   U S   -  -   SU S   -  -
  SU S   -  -
  U S   S-
  S-  -   SU S   S	-
  S-  -  -   U S	   S-
  S-  -   SU S
   S-
  S-  -  -   S	U S   S-  -  -   SU S   S-
  S-  -  -   SU S   S-
  S-  -  -   U S   S-
  S-  -   S-   nU$ )Nr   r$   rC   r  r  rc   r   rd   re   rf   r%   r  r  r  -   r  r	  s     r9   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<   )rd   r  )r*  r=  rc   ir$   )r$   rC   r%   r  )r   r     r   rC   )r  r   r=  rC   rc   )r$   rC   r  r   )ir   ic                    [         R                  " S/U 45      n SU S   -  SU S   -  -
  SU S   S-
  S-  -  -
  S	U S
   -  -   SU S   S-
  S-  -  SU S   S-
  S-  -  -
  SU S   S-  -  -
  S	U S   -  -   S-   U S   S-  * SU S   S-
  S-  -  -
  SU S   -  U S   -  -   SU S   -  -
  SU S   -  -   SU S   S-  -  SU S   -  -
  U S   S-
  S-  -
  SU S   -  -   S-   SU S   S-
  S-  -  SU S   S-
  S-  -  -
  SU S   S-  -  -
  U S   -   S-   /$ )Nr   rc   r$   rf   rC   rH  r  r  r%   r   r   rd   x   r  re   r=  r        r   r  r   s    r9   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   r  r'   )
gWXp?`@g@gVW@!@g3Ib@grq?g` ?g$F-t%?g6N#@g7h @g]y @g<6cN8@r.  r  ư>)r+   r  r.   r
   r   r	   r   r  r  r   r   rD   r   r   r   r   r8   r
  r  r  r  r  r  r0   r  r   r   r  r  s                r9   test_L3'TestDifferentialEvolutionSolver.test_L3  s   	 HHW*!\/+!\/*!]
ab!"fIHH^$	N Q266*Arvv.Rf CJJ{#(5@!MC !
C%%d3u40T2{{{q55yA~&'rxx355	*a/01suu 0A 6678suu 0A 6678! ! s   #"H""
H1c                 P   S n[         R                  " S5      nSUSSS/4'   SUS/ S	Q4'   S
USSS/4'   USS 2SS 24   n[         R                  " / SQ5      nS n[        U[         R                  * S5      n[        US[         R                  5      nS/S/S-  -   S/S-  -   nXV4n[        5        n	U	R                  [        5        [        XSSUSSS9n
S S S 5        Sn/ SQn[        U" U5      USS9  [        W
R                  USS9  [        R                  " 5       S:X  aI  [         R                  " [         R                  5      R                   S:  a  [        U
R"                  USSS9  O[        U
R"                  US S!S9  U
R$                  (       d   e['        [         R(                  " X*R"                  -  U:*  5      5        ['        [         R(                  " [         R                  " U" U
R"                  5      5      S:  5      5        ['        [         R(                  " U
R"                  [         R                  " U5      S S 2S4   :  5      5        ['        [         R(                  " U
R"                  [         R                  " U5      S S 2S4   :*  5      5        g ! , (       d  f       GN= f)"Nc                 4    [         R                  " U S S 5      $ )Nrc   r+   r   r   s    r9   r
  2TestDifferentialEvolutionSolver.test_L4.<locals>.f  s    66!BQ%= r<   )rd   r  ){Gzd?rB  r$   rd   rf   )rB  rB  g{GzdrC   )re   r%   rd   )r^  g{Gzrc   r  re   )r$   r$   r$   c                 
   [         R                  " S/U 45      n U S   U S   -  SU S   -  -
  SU S   -  -
  S-   U S   U S	   -  S
U S   -  -
  U S   U S   -  -
  S
U S   -  -   U S   U S   -  S-
  U S   U S   -  -
  SU S   -  -   /$ )Nr   r$   rf   g!> 
@rd   r"   gSUX@rC   r%   i  re   rc   r  i i	  r  r   s    r9   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   )r"   '  )  rE  )r   rF  rK   r,  ra   r  gh|?@)got@g?@g:@gt$f@gVfyr@gh o?k@gCq@gVfx@MbP?r  Windowsgv!>gy&1l?)rtolr_  gh㈵>ga2U0*c?)r+   r  r.   r
   r   r	   r   r  r  r   r   r   platformsystemr  intpitemsizerD   r   r   r   )r8   r
  r  r  r  r  r  r0   r  r   r   r  r  s                r9   test_L4'TestDifferentialEvolutionSolver.test_L4  s   	! HHV%!aV)1!Y,"!aV)ab!"fIHHY	A Q+Arvv.=/!"33zl1nDf CJJ{#(JD'C ! 2 	%%e4U3 OO*rxx/@/I/IA/MCEE5vFC CEE5t&A{{{q55yA~&'rxx355	*a/01suu 0A 6678suu 0A 66785 ! s   0$J
J%c           	         S nS n[        U[        R                  * S5      nS/S-  nUn[        XSSUS9nS	nS
n[	        U" U5      USS9  [	        UR
                  USS9  UR                  (       d   e[        [        R                  " [        R                  " U" UR                  5      5      S:*  5      5        [        [        R                  " UR                  [        R                  " U5      S S 2S4   :  5      5        [        [        R                  " UR                  [        R                  " U5      S S 2S4   :*  5      5        g )Nc                     [         R                  " S/U 45      n [         R                  " S[         R                  -  U S   -  5      S-  [         R                  " S[         R                  -  U S   -  5      -  U S   S-  U S   U S   -   -  -  nU* $ )Nr   rC   r$   rc   )r+   r  sinpir	  s     r9   r
  2TestDifferentialEvolutionSolver.test_L5.<locals>.f  s    		A3(#A66!BEE'!A$,'*266!BEE'!A$,+??aD!GQqT!A$Y')C4Kr<   c                 ~    [         R                  " S/U 45      n U S   S-  U S   -
  S-   SU S   -
  U S   S-
  S-  -   /$ )Nr   r$   rC   rd   r  r   s    r9   r  3TestDifferentialEvolutionSolver.test_L5.<locals>.c1  sT    		A3(#AaD!GadNQ&!H!Q{*, ,r<   r   r   r   rC   rL   r,  r-  )gJIť?gU(C@g#gh㈵>r  -C6?r$   )r	   r+   r   r   r   r   r   r   r   r.   rD   	r8   r
  r  r  r0   r  r   r  r  s	            r9   test_L5'TestDifferentialEvolutionSolver.test_L5  s    		,
  RVVGQ/1$Q1<> )%%d3T2{{{rxx355	*a/01suu 0A 6678suu 0A 6678r<   c           	         S nS n[        US[        R                  5      nSS/nUn[        XSSUSS	9nS
nSn[	        U" U5      USS9  [	        UR
                  USS9  [	        UR                  USS9  UR                  (       d   e[        [        R                  " [        R                  " U" UR                  5      5      S:  5      5        [        [        R                  " UR                  [        R                  " U5      S S 2S4   :  5      5        [        [        R                  " UR                  [        R                  " U5      S S 2S4   :*  5      5        g )Nc                 f    [         R                  " S/U 45      n U S   S-
  S-  U S   S-
  S-  -   nU$ )Nr   r$   r   rc   rC   r  r  r	  s     r9   r
  2TestDifferentialEvolutionSolver.test_L6.<locals>.f  s=    		A3(#AQ47Q,!A$)a/CJr<   c                     [         R                  " S/U 45      n U S   S-
  S-  U S   S-
  S-  -   S-
  U S   S-
  S-  * U S   S-
  S-  -
  S-   /$ )Nr   r$   re   rC   r"   rf   gp=
׳T@r  r   s    r9   r  3TestDifferentialEvolutionSolver.test_L6.<locals>.c1  sl    		A3(#AqT!VaK1Q4!8a-/#5d1fq[LAaD1Hq=058: :r<   r   )   r"   r!   rL   r,  gHz>)rI   r   r  r"  )gq=
ף0,@g??g1r:  r  rG  rX  r$   )r	   r+   r   r   r   r   rD   r   r   r   r.   rY  s	            r9   test_L6'TestDifferentialEvolutionSolver.test_L6  s
   	
	:
  Arvv.X&$Q1<$H!%%d3U3u40{{{rxx355	*a/01suu 0A 6678suu 0A 6678r<   c           	         S nS n[        U/ SQ/ SQ5      nSS/S/S-  -   nUn[        XS	S
US9n/ SQnSn[        U" U5      U5        [        UR                  USS9  [        UR                  USS9  UR
                  (       d   e[        [        R                  " [        R                  " U" UR                  5      5      [        R                  " / SQ5      :  5      5        [        [        R                  " [        R                  " U" UR                  5      5      [        R                  " / SQ5      :*  5      5        [        [        R                  " UR                  [        R                  " U5      S S 2S4   :  5      5        [        [        R                  " UR                  [        R                  " U5      S S 2S4   :*  5      5        g )Nc                     [         R                  " S/U 45      n SU S   S-  -  SU S   -  U S   -  -   SU S   -  -   S	-
  nU$ )
Nr   g+dvqn@rc   rC   g"C?r$   re   gtۈB@gn@r  r	  s     r9   r
  2TestDifferentialEvolutionSolver.test_L7.<locals>.f1  s[    		A3(#AQqT1W$y1~ad'::QqT>"$-.CJr<   c                 F   [         R                  " S/U 45      n SSU S   -  U S   -  -   SU S   -  U S   -  -   S	U S
   -  U S   -  -
  SSU S   -  U S   -  -   SU S   -  U S   -  -   SU S
   S-  -  -   SSU S
   -  U S   -  -   SU S   -  U S
   -  -   SU S
   -  U S   -  -   /$ )Nr   gl#fUU@g+WPIw?rC   re   g=BD?r$   rd   gOlb?rc   gaۢ T@g+<$!6}?g h?g^5a?g/h"@gxLCs?gݗT?g^gED_?r  r   s    r9   r  3TestDifferentialEvolutionSolver.test_L7.<locals>.c17  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<   )r   Z   r  )\   n      )N   f   )!   r3  )   r3  rc   rL   r,  r-  )gq S@g] @@g˻f=@g:F@g%ShMcB@gCgbrG  r  r   r$   )
r	   r   r   rD   r   r   r   r+   r   r.   rY  s	            r9   test_L7'TestDifferentialEvolutionSolver.test_L7/  sI   		  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A 6678suu 0A 6678r<   ppc64lezfails on ppc64le)reasonc           
      l   S n[         R                  " S5      nSUSSS/4'   SUSSS/4'   USS 2SS 24   n[         R                  " SS/5      nS	 n[        X#[         R                  5      n[        U[         R                  " SS
5      [         R                  " SS5      5      nS/S-  S/S-  -   nXV4n[        5        n	U	R                  [        5        [        XSSUSS9n
S S S 5        SnSn[        U" U5      USS9  [        W
R                  S S US S SS9  [        U
R                  SS  USS  SS9  [        U
R                  USS9  U
R                  (       d   e[        [         R                   " X*R                  -  U:  5      5        [        [         R                   " [         R                  " U" U
R                  5      5      S
:  5      5        [        [         R                   " [         R                  " U" U
R                  5      5      S:*  5      5        [        [         R                   " U
R                  [         R                  " U5      S S 2S4   :  5      5        [        [         R                   " U
R                  [         R                  " U5      S S 2S4   :*  5      5        g ! , (       d  f       GN= f)Nc                     [         R                  " S/U 45      n SU S   -  SU S   S-  -  -   SU S   -  -   SU S   S-  -  -   nU$ )Nr   rc   r$   r:  rC   g^>r  r	  s     r9   r
  2TestDifferentialEvolutionSolver.test_L8.<locals>.fa  sY    		A3(#AAaD&8AaD!G++a!f4z!A$'7IICJr<   )rc   re   )r$   r   r$   rd   rc   rC   皙c           	         [         R                  " S/U 45      n S[         R                  " U S   * S-
  5      -  S[         R                  " U S   * S-
  5      -  -   S-   U S   -
  S[         R                  " U S   S-
  5      -  S[         R                  " U S   U S   -
  S-
  5      -  -   S-   U S   -
  S[         R                  " U S   S-
  5      -  S[         R                  " U S   U S   -
  S-
  5      -  -   S	-   /$ )
Nr   rF  rc   rg   rd   gfffff@r$   rC   g33333;@)r+   r  rR  r   s    r9   r  3TestDifferentialEvolutionSolver.test_L8.<locals>.c1l  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<   MbPrG  )r   i  )rx  g?rK   r,  i  )rI   r   r  r   )gEGr?@gT㥛D@g&D
n?gd,[ٿg#J{@r  gMb`?r!  r   )r+   r  r.   r
   r   r	   fullr   r  r  r   r   rD   r   r   r   r   r;  s                r9   test_L8'TestDifferentialEvolutionSolver.test_L8]  s   	
 HHV!aV)!aV)ab!"fIHHdD\"		 Q266*BGGAv$658IJQ}Q.f CJJ{# )Z-1{157C ! <%%d3bq	5!948ab	5948T2{{{qw!|$%rxx355	*f456rxx355	*e345suu 0A 6678suu 0A 6678+ ! s   =#J$$
J3re   c           	         S nS n[        US/S/5      nS/S-  nUn[        XSSUS	9n[        R                  " S5      S-  S
/nSn[	        U" U5      U5        [	        [        R
                  " UR                  5      USS9  [	        UR                  USS9  UR                  (       d   e[        [        R                  " [        R                  " U" UR                  5      5      S:  5      5        [        [        R                  " [        R                  " U" UR                  5      5      S:*  5      5        [        [        R                  " UR                  [        R                  " U5      S S 2S4   :  5      5        [        [        R                  " UR                  [        R                  " U5      S S 2S4   :*  5      5        g )Nc                 \    [         R                  " S/U 45      n U S   S-  U S   S-
  S-  -   $ )Nr   r$   rC   r  r   s    r9   r
  2TestDifferentialEvolutionSolver.test_L9.<locals>.f  s5    		A3(#AQ47ad1fq[((r<   c                 R    [         R                  " S/U 45      n U S   U S   S-  -
  /$ r  r  r   s    r9   r  3TestDifferentialEvolutionSolver.test_L9.<locals>.c1  s/    		A3(#AaD1Q47N##r<   r{  rG  r~   rC   rL   r,  r-  r&   g      ?r  r   r$   )r	   r   r+   sqrtr   absrD   r   r   r   r   r.   rY  s	            r9   test_L9'TestDifferentialEvolutionSolver.test_L9  sH   	)	$  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A 6678suu 0A 6678r<   c           	        ^ [         R                  R                  S5      n[        R                  nSnUR
                  " USUS.6nS mSS/nSS	/n[        TXbU4USUS
9nUR                  S   S:X  d   e[        UR                  USS9  [        TXbU4USUS
9nU4S jn	[        XR                  S   SX$4S	/S9n
[        UR                  S   U
R                  5        UR                  UR                  ::  d   eg )Nl   b	)re   r&   rE  )rK  random_statec                     Uu  p#[         R                  " UR                  " U/U Q76 5      R                  SS9* n[         R                  " U5      (       a  [         R
                  nU$ )Nr   axis)r+   logpmfr   isnanr   )r  r   distrD   lls        r9   r   >TestDifferentialEvolutionSolver.test_integrality.<locals>.func  sO    GD&&!a)--2-66Bxx||VVIr<   TF)r$      )r   gffffff?)r   integralityr   r   r   re   g?)rI  c                 P   > Uu  p#nT" [         R                  " X S   /5      X45      $ )Nr   r  )r  r   nr  rD   r   s        r9   func2?TestDifferentialEvolutionSolver.test_integrality.<locals>.func2  s(    JAQ!qT+T55r<   r$   )r   r0   )r+   r/  r4  r   nbinomrvsr   rD   r   r   r   )r8   r   r  shapesrD   r  r0   r   res2r  LBFGSBr   s              @r9   test_integrality0TestDifferentialEvolutionSolver.test_integrality  s    ii##M2||HHf5s;	 Um9%$T6q	1<U),.
 uuQx1}}vE2 &dF2=d*-/	6 %!T"+.q	688,xx377"""r<   c                    S n/ SQn/ SQn[        XSSS9n[        UR                  S   / SQ5        [        UR                  S   / S	Q5        [        XSUS9n[        UR                  S   / S
Q5        [        UR                  S   / SQ5        [        UR                  / SQ5        UR
                  SL d   e/ SQn[        XSUS9n[        UR                  S   / SQ5        [        UR                  S   / SQ5        [        [        R                  " UR                  S   5      / SQ5        [        [        R                  " UR                  S   5      / SQ5        / SQn[        XSUS9n[        UR                  S   / SQ5        [        UR                  S   / SQ5        / SQn[        R                  " [        SS9   [        XSUS9  S S S 5        g ! , (       d  f       g = f)Nc                     U $ r   r>   r   s    r9   r
  BTestDifferentialEvolutionSolver.test_integrality_limits.<locals>.f  s    Hr<   )TFT))rU  r   r   皙@)ffffff
@皙@F)r0   r   r  r   )rU  r   r  r$   )r   r  r  )r&   r   g      @)g      ?r        @))r  gr  )g$gffffff@)g      r         %)r8  r  r  )      r   g      $)r  r   g      @))ffffff$g333333 r  g%gr#)r  r   r  )g      !r  g      #))r  g333333$r  r  zOne of the integralityr   )r   r   r/   r   r  r   r+   roundr  r   r   )r8   r
  r  r0   r]   s        r9   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'4?A GFFs   <G
Gc           	        ^ S nS n[         R                  " [        SS9   [        XR                  SSS9  S S S 5        [        [        SS9   [        X R                  SS	9  S S S 5        [        [        S
S9   [        X R                  S[        SS9  S S S 5        S/mU4S jnSS/n[        [        USSS9n[        X4SSSS9n[        UR                  UR                  5        TS   UR                  :X  d   eUR                  UR                  :X  d   eg ! , (       d  f       N= f! , (       d  f       N= f! , (       d  f       N= f)Nc                 4    [         R                  " U S-  5      $ r   r@  r   s    r9   r1   BTestDifferentialEvolutionSolver.test_vectorized.<locals>.quadratic  s    66!Q$<r<   c                 2    [         R                  " U S-  SS9$ )NrC   r   r  r@  r   s    r9   quadratic_vecFTestDifferentialEvolutionSolver.test_vectorized.<locals>.quadratic_vec  s    66!Q$Q''r<   zThe vectorized functionr   Tr  )r  r  z#differential_evolution: the 'vector)r  z$differential_evolution: the 'workers)r  r  r  r   c                 4   > TS==   S-  ss'   [        U 5      $ r  )r   )rD   ncallss    r9   	rosen_vecBTestDifferentialEvolutionSolver.test_vectorized.<locals>.rosen_vec'  s    1INI8Or<   rW  r$   )r  r   )r  r  r   )r  r   r   r   r0   r   r  r  r   r   rD   r  r   )r8   r1   r  r  r0   res1r  r  s          @r9   test_vectorized/TestDifferentialEvolutionSolver.test_vectorized  s$   	 	( ]]</HI"9kk.2ZI J
 ;&KL"=++.24 M
 ;&LM"=++.2C,68 N
 	 7#%eVj*+-%iD/9qB 	'ayDII%%%xx488###= JI
 ML
 NMs#   DD'8D8
D$'
D58
Ec           
          S nS n[        U[        R                  * S5      n[        USS5      nS nSS/n[        [        USS	X4/S
S9n[        XVSSS	X4/S
S9n[        UR                  UR                  5        g )Nc                 B    [         R                  " U S   U S   -   /5      $ r  r  r   s    r9   r  MTestDifferentialEvolutionSolver.test_vectorized_constraints.<locals>.constr_f7  r  r<   c                 \    [         R                  " U S   S-  U S   -   U S   U S   -
  /5      $ r  r  r   s    r9   r  NTestDifferentialEvolutionSolver.test_vectorized_constraints.<locals>.constr_f2:  r  r<   r  )r   r&   r   c                 r    SU SS  U S S S-  -
  S-  -  nUSU S S -
  S-  -  n[         R                  " U5      $ )Nr"   r$   r   r   )r+   squeeze)rD   r   s     r9   r  NTestDifferentialEvolutionSolver.test_vectorized_constraints.<locals>.rosen_vec@  sM    quq"vs{*S00A!af*s""A::a= r<   rW  r  r$   F)r  r   r  r   T)r  r  r   r  r   )r	   r+   r   r   r   r   rD   )	r8   r  r  nlc1r  r  r0   r  r  s	            r9   test_vectorized_constraints;TestDifferentialEvolutionSolver.test_vectorized_constraints6  s    	+	; #8bffWc:"9j*E	! 7#%eVj*+$-24 &iD/9q37,-24
 	'r<   c           	          S n[        S S[        R                  5      n[        S [        R                  * S5      n[        USS/X#/SSS	S
9nUR                  SL d   eSUR
                  ;   d   eg )Nc                 h    [         R                  " U S   5      [         R                  " U S   5      -   $ r  )r+   cosrR  r   s    r9   r   UTestDifferentialEvolutionSolver.test_constraint_violation_error_message.<locals>.funcT  s%    66!A$<"&&1,..r<   c                 $    U S   U S   S-
  S-  -
  $ Nr$   r   rC   r>   r   s    r9   <lambda>YTestDifferentialEvolutionSolver.test_constraint_violation_error_message.<locals>.<lambda>X  s    1Q41Q46A++=r<   r   c                     U S   U S   S-  -   $ r  r>   r   s    r9   r  r  Y  s    1Q4!A$'>r<   )r   rC   r~   r   Fi3)r0   r  r   r   r   z
MAXCV = 0.)r	   r+   r   r   r   r   )r8   r   c0r  ri   s        r9   'test_constraint_violation_error_messageGTestDifferentialEvolutionSolver.test_constraint_violation_error_messageR  s{    	/ !!=q"&&I !9BFF7AF'07/A57H02/4,57 ~~&&& v~~---r<   c                   ^^^^	^
 SmSnS/T-  nTU-  m
SmSm	S/mSUUUU	U
4S jjn[        [        UUT	TSUSS	S
9	nUR                  UL d   eUR                  5         TS   S:  d   e[	        [        X#SS9nUR
                  (       d   eSS jn[        R                  " [        SS9   [	        [        UUS9  S S S 5        g ! , (       d  f       g = f)Nrd   r   )r   g      $@r*   gffffff?r   c                 p  > TS==   S-  ss'   [         R                  " X   5      nUR                  T5      n[         R                  " T5      nUR	                  U5        US S nXfU :g     S S nUS S u  pxUS   TX   X   -
  -  -   n	UR                  TS9n
U
T:  n
SX'   [         R                  " XU5      nU$ )Nr   r$   rc   rC   )rK  T)r+   copychoicer5   shufflero  where)r
  r7   r   rj   
fill_pointr  idxsr0r  bprime
crossoverscallsr(   r  recombinationtotal_popsizes              r9   custom_strategy_fnLTestDifferentialEvolutionSolver.test_strategy_fn.<locals>.custom_strategy_fnu  s    !HMHGGJ12EO4J99]+DKK<D	)*2A.D"1XFB mh^jn4'6 6F /:J#m3J%)J"HHZ7ELr<   rC   F)r'   r  r(   r   rI   r   r   r  )rI   r  c                 2    [         R                  " SS/5      $ )Nr   r   r  )r
  r7   r   s      r9   r  r    s    88S#J''r<   z	strategy*r   rH   r   )	r   r   rI   r   r   r   r  r   r   )r8   r'   r0   r  r]   r   r  r(   r  r  r  s         @@@@@r9   test_strategy_fn0TestDifferentialEvolutionSolver.test_strategy_fni  s     o-''1	 	* -''

 "4444Qx!|| %6
 {{{	( ]]<{;"+ <;;s   )C
C)r0   r2   r3   r/   r-   N)Nr[   
__module____qualname____firstlineno__r:   r@   r1   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?  rE  rR  rV  rY  rq  ru  r|  r  r  markthread_unsafer  	fail_slowr  r  r  r  r  r  r  r  r  r  r!  r/  r<  rN  rZ  rb  rq  xslowxfailrJ  machiner}  r  r  r  r  r  r  r  __static_attributes__r>   r<   r9   r   r      sm   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(8.. [[2= =r<   r   )$__doc__r  multiprocessing.dummyr   r  rJ  %scipy.optimize._differentialevolutionr   r   scipy.optimizer   r   scipy.optimize._constraintsr   r	   r
   r   r   scipy.sparser   scipyr   numpyr+   numpy.testingr   r   r   r   r   r   r  r   r   r   r   r>   r<   r9   <module>r     sR     4 G A; ; * #  L L 1 O Or<   