+
    LV-j%  ã                   óN   € R t ^ RIt^ RIt^RIHtHt . tRR lt	 ! R R]4      t
R# )z"Dog-leg trust-region optimization.N)Ú_minimize_trust_regionÚBaseQuadraticSubproblemc                óˆ   € Vf   \        R4      h\        V4      '       g   \        R4      h\        W3RVRVRVR\        /VB # )aä  
Minimization of scalar function of one or more variables using
the dog-leg trust-region algorithm.

Options
-------
initial_trust_radius : float
    Initial trust-region radius.
max_trust_radius : float
    Maximum value of the trust-region radius. No steps that are longer
    than this value will be proposed.
eta : float
    Trust region related acceptance stringency for proposed steps.
gtol : float
    Gradient norm must be less than `gtol` before successful
    termination.

z,Jacobian is required for dogleg minimizationz+Hessian is required for dogleg minimizationÚargsÚjacÚhessÚ
subproblem)Ú
ValueErrorÚcallabler   ÚDoglegSubproblem)ÚfunÚx0r   r   r   Útrust_region_optionss   &&&&&,Ús/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/scipy/optimize/_trustregion_dogleg.pyÚ_minimize_doglegr   	   s^   € ð( ‚{ÜÐGÓHÐHÜ�D�>Š>ÜÐFÓGÐGÜ! #ñ :°ð :¸#ð :ÀDð :Ü-=ð:à$8ñ:ð :ó    c                   ó6   a € ] tR t^&t o RtR tR tR tRtV t	R# )r   z0Quadratic subproblem solved by the dogleg methodc                óì   € V P                   f\   V P                  pV P                  V4      p\        P                  ! W4      \        P                  ! W4      ,          ) V,          V n         V P                   # )zF
The Cauchy point is minimal along the direction of steepest descent.
)Ú_cauchy_pointr   ÚhesspÚnpÚdot)ÚselfÚgÚBgs   &  r   Úcauchy_pointÚDoglegSubproblem.cauchy_point)   sW   € ð ×ÑÒ%Ø—‘ˆAØ—‘˜A“ˆBÜ#%§6¢6¨!£<´"·&²&¸³-Õ#?Ð!@À1Õ!DˆDÔØ×!Ñ!Ð!r   c                óî   € V P                   f]   V P                  pV P                  p\        P                  P                  V4      p\        P                  P                  W14      ) V n         V P                   # )zC
The Newton point is a global minimum of the approximate function.
)Ú_newton_pointr   r   ÚscipyÚlinalgÚ
cho_factorÚ	cho_solve)r   r   ÚBÚcho_infos   &   r   Únewton_pointÚDoglegSubproblem.newton_point3   s\   € ð ×ÑÒ%Ø—‘ˆAØ—	‘	ˆAÜ—|‘|×.Ñ.¨qÓ1ˆHÜ"'§,¡,×"8Ñ"8¸Ó"EÐ!EˆDÔØ×!Ñ!Ð!r   c                óp  € V P                  4       p\        P                  P                  V4      V8  d   RpW#3# V P	                  4       p\        P                  P                  V4      pWQ8¼  d   WAV,          ,          pRpWc3# V P                  WBV,
          V4      w  rxWHW$,
          ,          ,           pRpWc3# )aÔ  
Minimize a function using the dog-leg trust-region algorithm.

This algorithm requires function values and first and second derivatives.
It also performs a costly Hessian decomposition for most iterations,
and the Hessian is required to be positive definite.

Parameters
----------
trust_radius : float
    We are allowed to wander only this far away from the origin.

Returns
-------
p : ndarray
    The proposed step.
hits_boundary : bool
    True if the proposed step is on the boundary of the trust region.

Notes
-----
The Hessian is required to be positive definite.

References
----------
.. [1] Jorge Nocedal and Stephen Wright,
       Numerical Optimization, second edition,
       Springer-Verlag, 2006, page 73.
FT)r%   r   r    Únormr   Úget_boundaries_intersections)	r   Útrust_radiusÚp_bestÚhits_boundaryÚp_uÚp_u_normÚ
p_boundaryÚ_Útbs	   &&       r   ÚsolveÚDoglegSubproblem.solve>   sº   € ðD ×"Ñ"Ó$ˆÜ�<‰<×Ñ˜VÓ$ |Ô3Ø!ˆMØÐ(Ð(ð ×ÑÓ!ˆô —<‘<×$Ñ$ SÓ)ˆØÔ#Ø¨xÕ 7Õ8ˆJØ ˆMØÐ,Ð,ð ×1Ñ1°#Àµ|Ø2>ó@‰ˆà ¥Õ.Õ.ˆ
ØˆØÐ(Ð(r   )r   r   N)
Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r%   r2   Ú__static_attributes__Ú__classdictcell__)Ú__classdict__s   @r   r   r   &   s   ø‡ € Ù:ò"ò	"÷<)ð <)r   r   )© NN)r8   Únumpyr   Úscipy.linalgr   Ú_trustregionr   r   Ú__all__r   r   r<   r   r   Ú<module>rA      s*   ðÙ (Û Û ß Kà
€ô:ô:T)Ð.ö T)r   