+
    ,i!                         ^ RI HtHtHt ^RIHt ^RIHtHt ^RI	H
t
 ^ RIHt ^RIHt ^RIHt ^RIHt ^ R	It^ R
IHt  ! R R]4      tR tR tRR ltR	# )    )NonlinearConstraintLinearConstraintBounds)process_nl_constraints)#combine_multiple_linear_constraintsseparate_LC_into_eq_and_ineq)process_bounds)Enum)_project)get_arrays_tol)cobylaN)Iterablec                   &    ] tR t^t^t^
t^t^tRtR# )ConstraintType N)	__name__
__module____qualname____firstlineno__LINEAR_OBJECTNONLINEAR_OBJECTLINEAR_DICTNONLINEAR_DICT__static_attributes__r       =/usr/lib/python3/dist-packages/scipy/_lib/pyprima/__init__.pyr   r      s    MKNr   r   c                 6   \        V \        4      '       d&   R V 9   d   RV 9   d   RV 9   d   \        P                  # \        V \        4      '       d&   RV 9   d   RV 9   d   RV 9   d   \        P                  # \        V R 4      '       d5   \        V R4      '       d#   \        V R4      '       d   \        P                  # \        V R4      '       d5   \        V R4      '       d#   \        V R4      '       d   \        P                  # \        R\        V 4       R24      h)AlbubfunzConstraint type z not recognized)

isinstancedictr   r   r   hasattrr   r   
ValueErrortype)
constraints   &r   get_constraint_typer(      s    *d##
):ASZ^blZl)))	J	%	%5J+>TZEW^bfp^p,,,	S	!	!gj$&?&?GJX\D]D]+++	U	#	#
D(A(AgjZ^F_F_...+D,<+=_MNNr   c           	          V '       g   R# \        V \        4      '       g   V .p . p. pV  F  p\        V4      pV\        P                  J d   VP                  V4       K5  V\        P                  J d   VP                  V4       K\  V\        P                  8X  d4   VP                  \        VR,          VR,          VR,          4      4       K  V\        P                  8X  d4   VP                  \        VR,          VR,          VR,          4      4       K  \        R4      h	  \        V4      ^ 8  d   \        V4      pMR p\        V4      ^8  d   \        V4      pWe3# \        V4      ^8X  d   V^ ,          pWe3# R pWe3# )Nr   r   r    r!   zConstraint type not recognized)NN)r"   r   r(   r   r   appendr   r   r   r   r   r%   lenr   r   )constraintslinear_constraintsnonlinear_constraintsr'   constraint_typenonlinear_constraint_functionlinear_constraints   &      r   process_constraintsr2   %   sw    k8,,"m !
-j9n:::%%j1 ? ??!((4 : ::%%&6z#
SWHXZdeiZj&kl = ==!(()<Z=NPZ[_P`blmqbr)st=>> "  !A%(>?T(U%(,% "?@RS ;; 
	 A	%.q1 ;; !;;r   c                   a aaaaaaa \        V4      w  poVf   RR/MTpVP                  RR4      p	Vfe   Se   V	'       g   \        R4       RpMVe   V	'       g   \        R4       RpMVe   V	'       g   \        R4       RpM~V	'       g   \        R	4       R
pMhVP                  4       pVR9  d   \	        RV R24      hVR8w  d   Se   \	        R4      hVR9  d   Ve   \	        R4      hVR9  d   Ve   \	        R4      h \        V4      o\        VS4      w  r\        W4      pW8*  \        P                  ! W,
          4      V8  ,          o\        S4      '       dq   RVS,          VS,          ,           ,          o\        P                  ! SVS,          VS,          4      oVS( ,          pVS( ,          pVS( ,          pS oVVVVV3R lpVo Sf   \        WVRVRR /4      pVP                  pVe   \!        V4      w  ppppMRw  ppppSe
   VV V3R lpMVV 3R lpV! V4      w  ppRV9   d   VR RV9   d   VR,          VR&   VR \#        V\        V4      VVVVVVV3	RVRVRV/VB p\        S4      '       d3   \        P$                  ! S4      pSVS&   VP                  VS( &   VVn        V#   \         d)    \        P                  ! T.4      pS oTT3R lp
T
o ^o ELi ; i) NquietTz/Nonlinear constraints detected, applying COBYLAr   zJLinear constraints detected without nonlinear constraints, applying LINCOAlincoazHBounds without linear or nonlinear constraints detected, applying BOBYQAbobyqaz2No bounds or constraints detected, applying NEWUOAnewuoazFMethod must be one of NEWUOA, UOBYQA, BOBYQA, COBYLA, or LINCOA, not ''zLNonlinear constraints were provided for an algorithm that cannot handle themzILinear constraints were provided for an algorithm that cannot handle themz=Bounds were provided for an algorithm that cannot handle themc                 &   < S! V ^ ,          .SO5!  # r   r   )xargsoriginal_scalar_funs   &r   
scalar_funminimize.<locals>.scalar_funw   s    &qt3d33r   g      ?c                 X   < \         P                  ! S4      pSVS&   WS( &   S! V.SO5!  # Nnpzeros)r;   newx
_fixed_idx_fixed_valuesr<   lenx0original_funs   & r   	fixed_funminimize.<locals>.fixed_fun   s4    88E?D,D !*,t,,r   linear	nonlinearc                 .   < S! V .SO5!  pS! V 4      pW3# rA   r   )r;   fnlconstrr<   r!   r0   s   &  r   calcfcminimize.<locals>.calcfc   s"    AA4Q7H;r   c                 J   < S! V .SO5!  p\         P                  ! ^ 4      pW3# r:   rB   )r;   rO   constrr<   r!   s   &  r   rQ   rR      s%    AAXXa[F9r   maxfevmaxfunf0	nlconstr0callback)r7   uobyqar6   r   r5   )r   r5   )r   r6   r5   )NNNN)r2   getprintlowerr%   r+   	TypeErrorrC   arrayr	   r   absanyclipr   r;   r   r   rD   )r!   x0r<   methodboundsr,   rY   optionsr1   r4   r>   r   r    tolrJ   resultA_eqb_eqA_ineqb_ineqrQ   rW   rX   rE   rF   rG   rH   r0   rI   r=   s   f&f&&&&&                @@@@@@r   minimizerm   O   s;   7J;7W44!(wogGKK&E~(4% QRF*% lmF% jkF% TUF KKeflemmnoppX"?"Kkll--2C2Ohii77F<N\]]
B FE*FB 
 C	66"'?S 	"  :zNR
^+
 zNzN

 ___	- 	-
  %,""x1BKQU&VWXX$%ABS%T"dFF%;"dFF$0	 	
	
 2JMB	'G7#H-HI


    F  :xx(Z"HHj[MA  XXrd^!	4s   J5 5/K('K()r   NNr   NN)scipy.optimizer   r   r   common._nonlinear_constraintsr   common._linear_constraintsr   r   common._boundsr	   enumr
   common._projectr   common.linalgr   cobyla.cobylar   numpyrC   collections.abcr   r   r(   r2   rm   r   r   r   <module>rx      sH    H H A +  % ) !  $T 
O'<TEr   