Ë
    çÿæiè^  ã                   ó’  — d Z ddgZddlZddlmZ ddlmZ ddl	m
Z
mZmZmZmZmZ dd	lmZ dd
lmZmZ ddlmZ ddlmZ ddlmZ ddlmZ dZ ej>                   ej@                  ejB                  «      jD                  «      Z#d„ Z$dddddddddddddde#dfd„Z%dddddddde#dddfd„Z&dedede'de(de(f
d„Z)dedede'de(de(f
d„Z*y)a  
This module implements the Sequential Least Squares Programming optimization
algorithm (SLSQP), originally developed by Dieter Kraft.
See http://www.netlib.org/toms/733

Functions
---------
.. autosummary::
   :toctree: generated/

    approx_jacobian
    fmin_slsqp

Úapprox_jacobianÚ
fmin_slsqpé    Né   )Úslsqp)Únorm)ÚOptimizeResultÚ_check_unknown_optionsÚ_prepare_scalar_functionÚ_clip_x_for_funcÚ_check_clip_xÚ_wrap_callback)Úapprox_derivative)Úold_bound_to_newÚ_arr_to_scalar)Úarray_namespace)Úarray_api_extra)Ú_call_callback_maybe_halt)ÚNDArrayzrestructuredtext enc                 óL   — t        || d||¬«      }t        j                  |«      S )a“  
    Approximate the Jacobian matrix of a callable function.

    Parameters
    ----------
    x : array_like
        The state vector at which to compute the Jacobian matrix.
    func : callable f(x,*args)
        The vector-valued function.
    epsilon : float
        The perturbation used to determine the partial derivatives.
    args : sequence
        Additional arguments passed to func.

    Returns
    -------
    An array of dimensions ``(lenf, lenx)`` where ``lenf`` is the length
    of the outputs of `func`, and ``lenx`` is the number of elements in
    `x`.

    Notes
    -----
    The approximation is done using forward differences.

    ú2-point)ÚmethodÚabs_stepÚargs)r   ÚnpÚ
atleast_2d)ÚxÚfuncÚepsilonr   Újacs        úm/Volumes/fast/ai/experiments/voice-extract-mac/.venv/lib/python3.12/site-packages/scipy/optimize/_slsqp_py.pyr   r   $   s*   € ô6 ˜D !¨IÀØ!%ô'€Cô �=‰=˜ÓÐó    © éd   g�íµ ÷Æ°>c                 ó.  ‡
— |�|}t        |d«      }||||dk7  ||dœ}d}|t        ˆ
fd„|D «       «      z  }|t        ˆ
fd„|D «       «      z  }|r|d||‰
dœfz  }|r|d	||	‰
dœfz  }t        | |‰
f|||d
œ|¤Ž}|r|d   |d   |d   |d   |d   fS |d   S )aC  
    Minimize a function using Sequential Least Squares Programming

    Python interface function for the SLSQP Optimization subroutine
    originally implemented by Dieter Kraft.

    Parameters
    ----------
    func : callable f(x,*args)
        Objective function.  Must return a scalar.
    x0 : 1-D ndarray of float
        Initial guess for the independent variable(s).
    eqcons : list, optional
        A list of functions of length n such that
        eqcons[j](x,*args) == 0.0 in a successfully optimized
        problem.
    f_eqcons : callable f(x,*args), optional
        Returns a 1-D array in which each element must equal 0.0 in a
        successfully optimized problem. If f_eqcons is specified,
        eqcons is ignored.
    ieqcons : list, optional
        A list of functions of length n such that
        ieqcons[j](x,*args) >= 0.0 in a successfully optimized
        problem.
    f_ieqcons : callable f(x,*args), optional
        Returns a 1-D ndarray in which each element must be greater or
        equal to 0.0 in a successfully optimized problem. If
        f_ieqcons is specified, ieqcons is ignored.
    bounds : list, optional
        A list of tuples specifying the lower and upper bound
        for each independent variable [(xl0, xu0),(xl1, xu1),...]
        Infinite values will be interpreted as large floating values.
    fprime : callable ``f(x,*args)``, optional
        A function that evaluates the partial derivatives of func.
    fprime_eqcons : callable ``f(x,*args)``, optional
        A function of the form ``f(x, *args)`` that returns the m by n
        array of equality constraint normals. If not provided,
        the normals will be approximated. The array returned by
        fprime_eqcons should be sized as ( len(eqcons), len(x0) ).
    fprime_ieqcons : callable ``f(x,*args)``, optional
        A function of the form ``f(x, *args)`` that returns the m by n
        array of inequality constraint normals. If not provided,
        the normals will be approximated. The array returned by
        fprime_ieqcons should be sized as ( len(ieqcons), len(x0) ).
    args : sequence, optional
        Additional arguments passed to func and fprime.
    iter : int, optional
        The maximum number of iterations.
    acc : float, optional
        Requested accuracy.
    iprint : int, optional
        The verbosity of fmin_slsqp :

        * iprint <= 0 : Silent operation
        * iprint == 1 : Print summary upon completion (default)
        * iprint >= 2 : Print status of each iterate and summary
    disp : int, optional
        Overrides the iprint interface (preferred).
    full_output : bool, optional
        If False, return only the minimizer of func (default).
        Otherwise, output final objective function and summary
        information.
    epsilon : float, optional
        The step size for finite-difference derivative estimates.
    callback : callable, optional
        Called after each iteration, as ``callback(x)``, where ``x`` is the
        current parameter vector.

    Returns
    -------
    out : ndarray of float
        The final minimizer of func.
    fx : ndarray of float, if full_output is true
        The final value of the objective function.
    its : int, if full_output is true
        The number of iterations.
    imode : int, if full_output is true
        The exit mode from the optimizer (see below).
    smode : string, if full_output is true
        Message describing the exit mode from the optimizer.

    See also
    --------
    minimize: Interface to minimization algorithms for multivariate
        functions. See the 'SLSQP' `method` in particular.

    Notes
    -----
    Exit modes are defined as follows:

    - ``-1`` : Gradient evaluation required (g & a)
    - ``0`` : Optimization terminated successfully
    - ``1`` : Function evaluation required (f & c)
    - ``2`` : More equality constraints than independent variables
    - ``3`` : More than 3*n iterations in LSQ subproblem
    - ``4`` : Inequality constraints incompatible
    - ``5`` : Singular matrix E in LSQ subproblem
    - ``6`` : Singular matrix C in LSQ subproblem
    - ``7`` : Rank-deficient equality constraint subproblem HFTI
    - ``8`` : Positive directional derivative for linesearch
    - ``9`` : Iteration limit reached

    Examples
    --------
    Examples are given :ref:`in the tutorial <tutorial-sqlsp>`.

    r   r   )ÚmaxiterÚftolÚiprintÚdispÚepsÚcallbackr"   c              3   ó*   •K  — | ]
  }d |‰dœ–— Œ y­w)Úeq©ÚtypeÚfunr   Nr"   ©Ú.0Úcr   s     €r    Ú	<genexpr>zfmin_slsqp.<locals>.<genexpr>Ç   s   øè ø€ ÐIÁ&¸Q˜4¨°4Õ8Á&ùó   ƒc              3   ó*   •K  — | ]
  }d |‰dœ–— Œ y­w)Úineqr-   Nr"   r0   s     €r    r3   zfmin_slsqp.<locals>.<genexpr>È   s   øè ø€ ÐLÁG¸q˜6¨!°TÕ:ÁGùr4   r,   )r.   r/   r   r   r6   )r   ÚboundsÚconstraintsr   r/   ÚnitÚstatusÚmessage)r   ÚtupleÚ_minimize_slsqp)r   Úx0ÚeqconsÚf_eqconsÚieqconsÚ	f_ieqconsr7   ÚfprimeÚfprime_eqconsÚfprime_ieqconsr   ÚiterÚaccr'   r(   Úfull_outputr   r*   ÚoptsÚconsÚress             `          r    r   r   F   s  ø€ ð` ÐØˆô ˜h¨Ó0€HàØØØ˜a‘KØØ ñ"€Dð €Dð 	ŒEÓIÁ&ÓIÓIÑI€DØŒEÓLÁGÓLÓLÑL€Dñ Ø˜$ x¸Øñ ð #ñ 	#ˆáØ˜&¨¸>Øñ ð #ñ 	#ˆô ˜$  Dð 4¨f¸VØ&*ñ4Ø.2ñ4€CáØ�3‰x˜˜U™ S¨¡Z°°X±ÀÀIÁÐNÐNà�3‰xˆr!   Fc                 ó˜  ‡‡‡5‡6— t        |«       |}|
Š5|	sd}t        |«      }t        j                  |j	                  |«      d|¬«      }|j
                  }|j                  |j                  d«      r|j                  }|j                  |j                  ||«      d«      }|�t        |«      dk(  r"t        j                   t        j                  fŠ6nt        |«      Š6t        j                  |‰6d   ‰6d   «      }t        |t         «      r|f}dddœ}t#        |«      D ]�  \  }}	 |d	   j%                  «       }|dvrt'        d
|d	   › d�«      ‚d|vrt'        d|› d�«      ‚|j/                  d«      }|€ˆ5ˆˆˆ6fd„} ||d   «      }||xx   |d   ||j/                  dd«      dœfz  cc<   Œ� ddddddddddd d!œ}t1        t3        t        |d"   D �cg c]$  }t        j4                   |d   |g|d   ¢­Ž «      ‘Œ& c}«      «      }t1        t3        t        |d#   D �cg c]$  }t        j4                   |d   |g|d   ¢­Ž «      ‘Œ& c}«      «      }||z   }t        |«      }|�t        |«      dk(  rvt        j6                  |t8        ¬$«      } t        j6                  |t8        ¬$«      }!| j;                  t        j<                  «       |!j;                  t        j<                  «       �n=t        j>                  |D �"�#cg c]  \  }"}#tA        |"«      tA        |#«      f‘Œ c}#}"t8        «      }$|$jB                  d   |k7  rtE        d%«      ‚t        jF                  d&¬'«      5  |$dd…df   |$dd…df   kD  }%ddd«       %jI                  «       r%t'        d(d)jK                  d*„ |%D «       «      › d+�«      ‚|$dd…df   jM                  «       |$dd…df   jM                  «       }!} t        jN                  |$«       }&t        j<                  | |&dd…df   <   t        j<                  |!|&dd…df   <   tQ        | |‰||
‰‰6|¬,«      }'tS        |'jT                  ‰6«      }(tS        |'jV                  ‰6«      })i d-|“d.d/“d0d/“d1d/“d2d/“d3d/“d4d/“d5d/“d6d/“d7d/“d8d9|z  “d:d“d;d“d<d“d=d“d>tY        |«      “d?d“||d|d@œ¥}*|dAk\  rt[        dBdC›dDdEdC›dDdFdG›dDdHdG›�«       t        j\                  t_        |dA|z  z   dAz   d«      gt        j`                  ¬$«      }+||dz   z  dAz  dI|z  |z  z   |dJ|z  z   dKz   |z  z
  dL|z  z   dM|z  |z  z   dN|z  z   ||z  z   dOz   },|dk(  r|,dA|z  |dz   z  z  },t        j\                  t_        |,d«      t        j
                  ¬$«      }- |(|«      }. |)|«      }/t        j\                  t_        d|dA|z  z   dAz   «      gt        j
                  ¬$«      }0t        j\                  t_        d|«      |gt        j
                  dP¬Q«      }1t        j\                  t_        d|«      gt        j
                  ¬$«      }2tc        |1||||«       te        |2||||«       d}3	 tg        |*|.|/|1|2||0| |!|-|+«       |*dR   dk(  r |'jU                  |«      }.te        |2||||«       |*dR   dk(  r |'jW                  |«      }/tc        |1||||«       |*d=   |3kD  rd|�-ti        t        jL                  |«      |.¬S«      }4tk        ||4«      rnM|dAk\  r0t[        |*d=   dT›dD|'jl                  dT›dD|.dU›dDto        |/«      dU›�«       tq        |*dR   «      dk7  rn|*d=   }3Œé|dk\  rbt[        ||*dR      dV|*dR   › dW�z   «       t[        dX|.«       t[        dY|*d=   «       t[        dZ|'jl                  «       t[        d[|'jr                  «       ti        ||.|/|*d=   |'jl                  |'jr                  |*dR   ||*dR      |*dR   dk(  |0d| ¬\«
      S # t(        $ r}t)        d|› d�«      |‚d}~wt*        $ r}t+        d«      |‚d}~wt,        $ r}t+        d«      |‚d}~ww xY wc c}w c c}w c c}#}"w # 1 sw Y   �ŒÔxY w)]aØ  
    Minimize a scalar function of one or more variables using Sequential
    Least Squares Programming (SLSQP).

    Parameters
    ----------
    ftol : float
        Precision target for the value of f in the stopping criterion. This value
        controls the final accuracy for checking various optimality conditions;
        gradient of the lagrangian and absolute sum of the constraint violations
        should be lower than ``ftol``. Similarly, computed step size and the
        objective function changes are checked against this value. Default is 1e-6.
    eps : float
        Step size used for numerical approximation of the Jacobian.
    disp : bool
        Set to True to print convergence messages. If False,
        `verbosity` is ignored and set to 0.
    maxiter : int, optional
        Maximum number of iterations. Default value is 100.
    finite_diff_rel_step : None or array_like, optional
        If ``jac in ['2-point', '3-point', 'cs']`` the relative step size to
        use for numerical approximation of `jac`. The absolute step
        size is computed as ``h = rel_step * sign(x) * max(1, abs(x))``,
        possibly adjusted to fit into the bounds. For ``method='3-point'``
        the sign of `h` is ignored. If None (default) then step is selected
        automatically.
    workers : int, map-like callable, optional
        A map-like callable, such as `multiprocessing.Pool.map` for evaluating
        any numerical differentiation in parallel.
        This evaluation is carried out as ``workers(fun, iterable)``.

        .. versionadded:: 1.16.0

    Returns
    -------
    res : OptimizeResult
        The optimization result represented as an `OptimizeResult` object.
        In this dict-like object the following fields are of particular importance:
        ``x`` the solution array, ``success`` a Boolean flag indicating if the
        optimizer exited successfully, ``message`` which describes the reason for
        termination, and ``multipliers`` which contains the Karush-Kuhn-Tucker
        (KKT) multipliers for the QP approximation used in solving the original
        nonlinear problem. See ``Notes`` below. See also `OptimizeResult` for a
        description of other attributes.

    Notes
    -----
    The KKT multipliers are returned in the ``OptimizeResult.multipliers``
    attribute as a NumPy array. Denoting the dimension of the equality constraints
    with ``meq``, and of inequality constraints with ``mineq``, then the returned
    array slice ``m[:meq]`` contains the multipliers for the equality constraints,
    and the remaining ``m[meq:meq + mineq]`` contains the multipliers for the
    inequality constraints. The multipliers corresponding to bound inequalities
    are not returned. See [1]_ pp. 321 or [2]_ for an explanation of how to interpret
    these multipliers. The internal QP problem is solved using the methods given
    in [3]_ Chapter 25.

    Note that if new-style `NonlinearConstraint` or `LinearConstraint` were
    used, then ``minimize`` converts them first to old-style constraint dicts.
    It is possible for a single new-style constraint to simultaneously contain
    both inequality and equality constraints. This means that if there is mixing
    within a single constraint, then the returned list of multipliers will have
    a different length than the original new-style constraints.

    References
    ----------
    .. [1] Nocedal, J., and S J Wright, 2006, "Numerical Optimization", Springer,
       New York.
    .. [2] Kraft, D., "A software package for sequential quadratic programming",
       1988, Tech. Rep. DFVLR-FB 88-28, DLR German Aerospace Center, Germany.
    .. [3] Lawson, C. L., and R. J. Hanson, 1995, "Solving Least Squares Problems",
       SIAM, Philadelphia, PA.

    r   r   )ÚndimÚxpzreal floatingéÿÿÿÿNr"   )r,   r6   r.   zUnknown constraint type 'z'.zConstraint z has no type defined.z/Constraints must be defined using a dictionary.z#Constraint's type must be a string.r/   z has no function defined.r   c                 ó   •‡ — ˆˆˆ ˆˆfd„}|S )Nc                 óh   •— t        | ‰«      } ‰dv rt        ‰| ‰|‰‰¬«      S t        ‰| d‰|‰¬«      S )N)r   z3-pointÚcs)r   r   Úrel_stepr7   r   )r   r   r   r7   )r   r   )r   r   r   Úfinite_diff_rel_stepr/   r   Ú
new_boundss     €€€€€r    Úcjacz3_minimize_slsqp.<locals>.cjac_factory.<locals>.cjaca  sT   ø€ Ü% a¨Ó4�AàÐ:Ñ:Ü0°°aÀÈ$Ø:NØ8Bô Dð Dô  1°°aÀ	Ø:AÈØ8Bô Dð Dr!   r"   )r/   rV   r   rT   r   rU   s   ` €€€€r    Úcjac_factoryz%_minimize_slsqp.<locals>.cjac_factory`  s   ù€ ÷
Dð 
Dð �r!   r   )r/   r   r   z$Gradient evaluation required (g & a)z$Optimization terminated successfullyz$Function evaluation required (f & c)z4More equality constraints than independent variablesz*More than 3*n iterations in LSQ subproblemz#Inequality constraints incompatiblez#Singular matrix E in LSQ subproblemz#Singular matrix C in LSQ subproblemz2Rank-deficient equality constraint subproblem HFTIz.Positive directional derivative for linesearchzIteration limit reached)rO   r   r   é   é   é   é   é   é   é   é	   r,   r6   )ÚdtypezDSLSQP Error: the length of bounds is not compatible with that of x0.Úignore)ÚinvalidzSLSQP Error: lb > ub in bounds z, c              3   ó2   K  — | ]  }t        |«      –— Œ y ­w)N)Ústr)r1   Úbs     r    r3   z"_minimize_slsqp.<locals>.<genexpr>ž  s   è ø€ Ð)A¹&°Q¬#¨a¯&¹&ùs   ‚Ú.)r   r   r   rT   r7   ÚworkersrG   Úalphag        Úf0ÚgsÚh1Úh2Úh3Úh4ÚtÚt0Útolg      $@ÚexactÚinconsistentÚresetrF   ÚitermaxÚline)ÚmÚmeqÚmodeÚnrX   ÚNITz>5Ú ÚFCÚOBJFUNz>16ÚGNORMrY   r[   r]   r_   r^   é#   é   ÚF)r`   Úorderry   )r   r/   Ú5dz16.6Ez    (Exit mode Ú)z#            Current function value:z            Iterations:z!            Function evaluations:z!            Gradient evaluations:)
r   r/   r   r9   ÚnfevÚnjevr:   r;   ÚsuccessÚmultipliers):r	   r   ÚxpxÚ
atleast_ndÚasarrayÚfloat64Úisdtyper`   ÚreshapeÚastypeÚlenr   Úinfr   ÚclipÚ
isinstanceÚdictÚ	enumerateÚlowerÚ
ValueErrorÚKeyErrorÚ	TypeErrorÚAttributeErrorÚgetÚsumÚmapÚ
atleast_1dÚemptyÚfloatÚfillÚnanÚarrayr   ÚshapeÚ
IndexErrorÚerrstateÚanyÚjoinÚcopyÚisfiniter
   r   r/   ÚgradÚintÚprintÚzerosÚmaxÚint32Ú_eval_con_normalsÚ_eval_constraintr   r   r   r†   ÚlanormÚabsÚngev)7r   r>   r   r   r7   r8   r%   r&   r'   r(   r)   r*   rT   rg   Úunknown_optionsrG   rN   r`   r   rJ   ÚicÚconÚctypeÚerV   rW   Ú
exit_modesr2   rx   Úmieqrw   rz   ÚxlÚxuÚloÚupÚbndsÚbnderrÚinfbndÚsfÚwrapped_funÚwrapped_gradÚ
state_dictÚindicesÚbuffer_sizeÚbufferÚfxÚgÚmultÚCÚdÚ	iter_prevÚintermediate_resultr   rU   s7      `        `                                        @@r    r=   r=   Û   s0	  û€ ô^ ˜?Ô+Ø
€CØ€GáØˆô 
˜Ó	€BÜ	�‰˜Ÿ
™
 2›¨Q°2Ô	6€BØ�J‰J€EØ	‡z�z�"—(‘(˜OÔ,Ø—‘ˆØ
�
‰
�2—9‘9˜R Ó'¨Ó,€Að €~œ˜V›¨Ò)Ü—v‘v�gœrŸv™vÐ&‰
ä% fÓ-ˆ
ô 	�‰��:˜a‘= *¨Q¡-Ó0€Aô �+œtÔ$Ø"�oˆà˜bÑ!€DÜ˜[Ö)‰ˆˆCð	NØ˜‘K×%Ñ%Ó'ˆEð ˜NÑ*Ü Ð#<¸SÀ¹[¸MÈÐ!LÓMÐMð ˜ÑÜ˜{¨2¨$Ð.GÐHÓIÐIð �w‰w�u‹~ˆØˆ<÷ñ    E¡
Ó+ˆDð 	ˆU‹  E¡
Ø $Ø!$§¡¨°Ó!4ñ6ð 9ñ 	9ŒðS *ðZ =Ø<Ø<ØLØBØ;Ø;Ø;ØJØFØ/ñ
1€Jô Œc”#Ø˜D’zó#Ù!�!ô Ÿ™ h a¨¡h¨qÐ&=°1°V±9Ò&=Õ>Ø!ñ#ó $ó %€CäŒs”3Ø˜Všó&Ù$�1ô Ÿ™ x q¨¡x°Ð'>°A°f±IÒ'>Õ?Ø$ñ&ó 'ó (€Dð 	ˆd‰
€AäˆA‹€Að €~œ˜V›¨Ò)Ü�X‰X�aœuÔ%ˆÜ�X‰X�aœuÔ%ˆØ
�‰”—‘ŒØ
�‰”—‘Žä�x‰xÙ&,ô.Ù&,™(˜2˜rô )¨Ó,¬n¸RÓ.@ÒAØ&,ò.Ü/4ó6ˆà�:‰:�a‰=˜AÒÜð ;ó <ð <ô �[‰[ Ö*Øš!˜Q˜$‘Z $¢q¨! t¡*Ñ,ˆF÷ +ð �:‰:Œ<ÜÐ>Ø $§	¡	Ñ)A¹&Ó)AÓ AÐBÀ!ðEó Fð Fà’a˜�d‘—‘Ó" Dª¨A¨¡J§O¡OÓ$5ˆBˆô —+‘+˜dÓ#Ð#ˆÜŸ6™6ˆˆ6’!�Q�$‰<ÑÜŸ6™6ˆˆ6’!�Q�$‰<Ñô 
" $¨¨s¸ÀsØ7KØ)3¸Wô
F€Bô
 # 2§6¡6¨:Ó6€KÜ# B§G¡G¨ZÓ8€Lð.Øˆsðà�ðð 	ˆcðð 	ˆcð	ð
 	ˆcðð 	ˆcðð 	ˆcðð 	ˆcðð 	ˆSðð 	ˆcðð 	ˆt�C‰xðð 	�ðð 	˜ðð 	�ðð 	�ðð  	”3�w“<ð!ð" 	�ð#ð$ ØØØò+€Jð2 �‚{Ü��r�
˜!˜D ˜9 A h¨s ^°1°W¸S°MÐBÔCô �h‰hœ˜A  !¡™G a™K¨Ó+Ð,´B·H±HÔ=€Gð 	
ˆ1ˆQ‰3‰�‰
�Q�q‘S˜‘UÑ˜a ! A¡#™g¨™k¨3Ñ.Ñ.°°1±Ñ4°q¸±s¸1±uÑ<¸rÀ!¹tÑCÀcÈ#ÁgÑMÐPRÑRð ð
 ˆq‚yØ�q˜‘s˜A ™E‘{Ñ"ˆÜ�X‰X”c˜+ qÓ)´·±Ô<€Fñ
 
�Q‹€BÙ�Q‹€Aô �8‰8”S˜˜A  !¡™G a™KÓ(Ð)´·±Ô<€Dô 	�‰”#�a˜“)˜Q�¤r§z¡z¸Ô=€AÜ
�‰”#�a˜“)�¤B§J¡JÔ/€AÜ�a˜˜D ! SÔ)Ü�Q˜˜4  CÔ(à€Ià
äˆj˜"˜a  A q¨$°°B¸ÀÔHà�fÑ Ò"Ø—‘˜“ˆBÜ˜Q  4¨¨CÔ0à�fÑ Ò#Ø—‘˜“
ˆAÜ˜a  D¨!¨SÔ1à�fÑ 	Ò)àÐ#Ü&4Ü—g‘g˜a“jØô'Ð#ô -¨XÐ7JÔKØð ˜Š{Ü˜ FÑ+¨BÐ/¨q°·±¸°¸AØ˜E˜
 !¤F¨1£I¨eÐ#4ð6ô 7ô ˆz˜&Ñ!Ó" aÒ'Øà˜vÑ&ˆ	ð? ðD �‚{ÜØ�z &Ñ)Ñ*¨¸zÈ&Ñ?QÐ>RÐRSÐ-TÑTô	
ô 	Ð3°RÔ8ÜÐ'¨°FÑ);Ô<ÜÐ1°2·7±7Ô;ÜÐ1°2·7±7Ô;äØ
�˜ 
¨6Ñ 2¸¿¹ÀrÇwÁwØ˜&Ñ!¨:°jÀÑ6HÑ+IØ˜FÑ# qÑ(°t¸B¸Q°xôð øôM ò 	KÜ˜[¨¨Ð,AÐBÓCÈÐJûÜò 	2Üð *ó +Ø01ð2ûäò 	JÜÐAÓBÈÐIûð	Jüòd#ùò&ùó.÷ +Ñ*úsN   Ä$_Ç)`/È)`4Ë9 `9
Í`?ß	`,ß'_7ß7`,à`à`,à`'à'`,à?a	rÐ   r   rJ   rw   rx   c                 ó�  — |dk(  ry |dkD  r[d}|d   D ]Q  }t        j                   |d   |g|d   ¢­Ž «      j                  «       }|| ||t        |«      z    |t        |«      z  }ŒS ||kD  r[|}|d   D ]Q  }t        j                   |d   |g|d   ¢­Ž «      j                  «       }|| ||t        |«      z    |t        |«      z  }ŒS y )Nr   r,   r/   r   r6   )r   rŸ   Úravelr‘   )rÐ   r   rJ   rw   rx   Úrowr¹   Útemps           r    r³   r³   9  sã   € ØˆA‚vØð ˆQ‚wØˆØ˜”:ˆCÜ—=‘=   U¡¨AÐ!<°°F±Ò!<Ó=×CÑCÓEˆDØ%)ˆAˆc�#œ˜D›	‘/Ð"Ø”3�t“9Ñ‰Cð ð
 	ˆ3‚wØˆØ˜”<ˆCÜ—=‘=   U¡¨AÐ!<°°F±Ò!<Ó=×CÑCÓEˆDØ%)ˆAˆc�#œ˜D›	‘/Ð"Ø”3�t“9Ñ‰Cð  ð
 r!   rÏ   c                 ó�  — |dk(  ry |dkD  r[d}|d   D ]Q  }t        j                   |d   |g|d   ¢­Ž «      }|| |||j                  d   z   …d d …f<   ||j                  d   z  }ŒS ||kD  r[|}|d   D ]Q  }t        j                   |d   |g|d   ¢­Ž «      }|| |||j                  d   z   …d d …f<   ||j                  d   z  }ŒS y )Nr   r,   r   r   r6   )r   r   r¥   )rÏ   r   rJ   rw   rx   rÕ   r¹   rÖ   s           r    r²   r²   R  sñ   € ØˆA‚vØà
ˆQ‚wØˆØ˜”:ˆCÜ—=‘=   U¡¨AÐ!<°°F±Ò!<Ó=ˆDØ,0ˆAˆc�#˜Ÿ
™
 1™Ñ%Ð%¢qÐ(Ñ)Ø�4—:‘:˜a‘=Ñ ‰Cð ð
 	ˆ3‚wØˆØ˜”<ˆCÜ—=‘=   U¡¨AÐ!<°°F±Ò!<Ó=ˆDØ,0ˆAˆc�#˜Ÿ
™
 1™Ñ%Ð%¢qÐ(Ñ)Ø�4—:‘:˜a‘=Ñ ‰Cð  ð
 r!   )+Ú__doc__Ú__all__Únumpyr   Ú	_slsqplibr   Úscipy.linalgr   r´   Ú	_optimizer   r	   r
   r   r   r   Ú_numdiffr   Ú_constraintsr   r   Úscipy._lib._array_apir   Ú
scipy._libr   rŠ   Úscipy._lib._utilr   Únumpy.typingr   Ú__docformat__ÚsqrtÚfinfor�   r)   Ú_epsilonr   r   r=   r•   r­   r³   r²   r"   r!   r    Ú<module>rè      s  ðñð ˜lÐ
+€ã Ý Ý '÷7÷ 7õ (ß :Ý 1Ý -Ý 6Ý  à%€àˆ2�7‰7�8�2—8‘8˜BŸJ™JÓ'×+Ñ+Ó,€òðD !#¨T¸2ÈØ °TØ"¨°#¸6Ø˜d°¸8Øó	Rðj $&¨4¸Ø "Ø f°Q¸UØ ¨4ÀdØ ó	[ð|
˜ð  Gð °4ð ¸Cð Àcó ð2˜ð  Wð °Dð ¸Sð Àsô r!   