+
    /i]7                     l    ^ RI t ^ RIt^RIHt ]P
                  ! ]4      P                  tR t	R t
R tR# )    N)get_arrays_tolc           	       a V'       Ed   \        V \        4      '       g   Q h\        V\        P                  4      '       d   VP                  ^8X  g   Q h\
        P                  ! S4      P                  V4      '       g   Q h\        V\        P                  4      '       d   VP                  VP                  8X  g   Q h\        V\        P                  4      '       d   VP                  VP                  8X  g   Q h\        V\        4      '       g   Q h\        V\        4      '       g   Q h\        W44      p\        P                  ! W78*  4      '       g   Q h\        P                  ! WG) 8  4      '       g   Q h\        P                  ! V4      '       d   VR8  g   Q h\        P                  ! VR4      p\        P                  ! VR4      p\        WSW4WV4      w  r\        V ) V) V3R lVVVV4      w  r\!        V	4      \!        V4      8  d   TMT
pV'       dn   \        P                  ! W<8*  4      '       g   Q h\        P                  ! W8*  4      '       g   Q h\        P"                  P%                  V4      RV,          8  g   Q hV# )ao  
Maximize approximately the absolute value of a quadratic function subject
to bound constraints in a trust region.

This function solves approximately

.. math::

    \max_{s \in \mathbb{R}^n} \quad \bigg\lvert c + g^{\mathsf{T}} s +
    \frac{1}{2} s^{\mathsf{T}} H s \bigg\rvert \quad \text{s.t.} \quad
    \left\{ \begin{array}{l}
        l \le s \le u,\\
        \lVert s \rVert \le \Delta,
    \end{array} \right.

by maximizing the objective function along the constrained Cauchy
direction.

Parameters
----------
const : float
    Constant :math:`c` as shown above.
grad : `numpy.ndarray`, shape (n,)
    Gradient :math:`g` as shown above.
curv : callable
    Curvature of :math:`H` along any vector.

        ``curv(s) -> float``

    returns :math:`s^{\mathsf{T}} H s`.
xl : `numpy.ndarray`, shape (n,)
    Lower bounds :math:`l` as shown above.
xu : `numpy.ndarray`, shape (n,)
    Upper bounds :math:`u` as shown above.
delta : float
    Trust-region radius :math:`\Delta` as shown above.
debug : bool
    Whether to make debugging tests during the execution.

Returns
-------
`numpy.ndarray`, shape (n,)
    Approximate solution :math:`s`.

Notes
-----
This function is described as the first alternative in Section 6.5 of [1]_.
It is assumed that the origin is feasible with respect to the bound
constraints and that `delta` is finite and positive.

References
----------
.. [1] T. M. Ragonneau. *Model-Based Derivative-Free Optimization Methods
   and Software*. PhD thesis, Department of Applied Mathematics, The Hong
   Kong Polytechnic University, Hong Kong, China, 2022. URL:
   https://theses.lib.polyu.edu.hk/handle/200/12294.
        c                    < S! V 4      ) # )N )xcurvs   &c/var/www/html/photoedit/myenv/lib/python3.14/site-packages/scipy/_lib/cobyqa/subsolvers/geometry.py<lambda>!cauchy_geometry.<locals>.<lambda>[   s    47(    皙?)
isinstancefloatnpndarrayndiminspect	signaturebindshapeboolr   allisfiniteminimummaximum_cauchy_geomabslinalgnorm)constgradr	   xlxudeltadebugtolstep1q_val1step2q_val2steps   &&f&&&&      r
   cauchy_geometryr-      s   t u%''''$

++		Q>>  &++D1111"bjj))bhh$**.DDD"bjj))bhh$**.DDD%''''%&&&&R$vvbi    vvbDj!!!!{{5!!eck11	B	B	B	B
 !dBEIME 		

ME K3v;.5EDvvbj!!!!vvdj!!!!yy~~d#cEk111Kr   c                v   V'       Ed   \        V \        4      '       g   Q h\        V\        P                  4      '       d   VP                  ^8X  g   Q h\
        P                  ! V4      P                  V4      '       g   Q h\        V\        P                  4      '       d4   VP                  ^8X  d#   VP                  ^ ,          VP                  8X  g   Q h\        V\        P                  4      '       d   VP                  VP                  8X  g   Q h\        V\        P                  4      '       d   VP                  VP                  8X  g   Q h\        V\        4      '       g   Q h\        V\        4      '       g   Q h\        WE4      p\        P                  ! WH8*  4      '       g   Q h\        P                  ! WX) 8  4      '       g   Q h\        P                  ! V4      '       d   VR8  g   Q h\        P                  ! VR4      p\        P                  ! VR4      p\        P                   ! V4      p	T p
\        P"                  P%                  V^ R7      pV\        P&                  ) 8  VP(                  \*        ) V,          8  ,          pV\        P&                  ) 8  VP(                  \*        V,          8  ,          pV\        P&                  8  VP(                  \*        V,          8  ,          pV\        P&                  8  VP(                  \*        ) V,          8  ,          p\        P,                  ! \        P.                  ! WLP                  4      V,          VP(                  V,          ,          4      p\        P0                  ! V^\        P&                  ) R7      p\        P.                  ! \        P2                  ! V4      VP                  ^,          4      p\        P,                  ! \        P.                  ! WMP                  4      V,          VP(                  V,          ,          4      p\        P0                  ! V^\        P&                  R7      p\        P.                  ! \        P2                  ! V4      VP                  ^,          4      p\        P,                  ! \        P.                  ! W_P                  4      V,          VP(                  V,          ,          4      p\        P0                  ! V^\        P&                  ) R7      p\        P.                  ! \        P2                  ! V4      VP                  ^,          4      p\        P,                  ! \        P.                  ! W^P                  4      V,          VP(                  V,          ,          4      p\        P0                  ! V^\        P&                  R7      p\        P.                  ! \        P2                  ! V4      VP                  ^,          4      p\5        VP                  ^,          4       EF$  pVV,          \*        V,          8  d   \1        WkV,          ,          R4      pMK9  \1        \7        VV,          VV,          4      R4      p\7        \1        VV,          VV,          4      R4      pWRV3,          ,          pV! VRV3,          4      pVR8  d   V\*        ) V,          8  g   VR8:  d)   V\*        ) V,          8  d   \1        V) V,          R4      pM\        P&                  pVR8  d   V\*        V,          8  g   VR8:  d(   V\*        V,          8  d   \7        V) V,          R4      pM\        P&                  ) p\7        VV4      p\1        V) V4      pV VV,          ,           RVR,          ,          V,          ,           pV VV,          ,           RVR,          ,          V,          ,           pVV8  dJ   V VV,          ,           RVR,          ,          V,          ,           p \9        V 4      \9        V4      8  d   TpT pVV8  dJ   V VV,          ,           RVR,          ,          V,          ,           p!\9        V!4      \9        V4      8  d   TpT!p\9        V4      \9        V4      8  dF   \9        V4      \9        V
4      8  d-   \        P:                  ! VVRV3,          ,          WE4      p	Tp
EK  \9        V4      \9        V4      8  g   EK  \9        V4      \9        V
4      8  g   EK  \        P:                  ! VVRV3,          ,          WE4      p	Tp
EK'  	  V'       dn   \        P                  ! WI8*  4      '       g   Q h\        P                  ! W8*  4      '       g   Q h\        P"                  P%                  V	4      RV,          8  g   Q hV	# )a  
Maximize approximately the absolute value of a quadratic function subject
to bound constraints in a trust region.

This function solves approximately

.. math::

    \max_{s \in \mathbb{R}^n} \quad \bigg\lvert c + g^{\mathsf{T}} s +
    \frac{1}{2} s^{\mathsf{T}} H s \bigg\rvert \quad \text{s.t.} \quad
    \left\{ \begin{array}{l}
        l \le s \le u,\\
        \lVert s \rVert \le \Delta,
    \end{array} \right.

by maximizing the objective function along given straight lines.

Parameters
----------
const : float
    Constant :math:`c` as shown above.
grad : `numpy.ndarray`, shape (n,)
    Gradient :math:`g` as shown above.
curv : callable
    Curvature of :math:`H` along any vector.

        ``curv(s) -> float``

    returns :math:`s^{\mathsf{T}} H s`.
xpt : `numpy.ndarray`, shape (n, npt)
    Points defining the straight lines. The straight lines considered are
    the ones passing through the origin and the points in `xpt`.
xl : `numpy.ndarray`, shape (n,)
    Lower bounds :math:`l` as shown above.
xu : `numpy.ndarray`, shape (n,)
    Upper bounds :math:`u` as shown above.
delta : float
    Trust-region radius :math:`\Delta` as shown above.
debug : bool
    Whether to make debugging tests during the execution.

Returns
-------
`numpy.ndarray`, shape (n,)
    Approximate solution :math:`s`.

Notes
-----
This function is described as the second alternative in Section 6.5 of
[1]_. It is assumed that the origin is feasible with respect to the bound
constraints and that `delta` is finite and positive.

References
----------
.. [1] T. M. Ragonneau. *Model-Based Derivative-Free Optimization Methods
   and Software*. PhD thesis, Department of Applied Mathematics, The Hong
   Kong Polytechnic University, Hong Kong, China, 2022. URL:
   https://theses.lib.polyu.edu.hk/handle/200/12294.
r   )axis)r/   initial:NNN      ?       @r   )r   r   r   r   r   r   r   r   r   sizer   r   r   r   r   r   
zeros_liker   r    infTTINY
atleast_2dbroadcast_tomax
atleast_1drangeminr   clip)"r!   r"   r	   xptr#   r$   r%   r&   r'   r,   q_vals_normi_xl_posi_xl_negi_xu_posi_xu_negalpha_xl_posalpha_xl_negalpha_xu_negalpha_xu_poskalpha_tralpha_bd_posalpha_bd_neg	grad_step	curv_stepalpha_quad_posalpha_quad_neg	alpha_pos	alpha_neg	q_val_pos	q_val_negq_val_quad_posq_val_quad_negs"   &&&&&&&&                          r
   spider_geometryrX   j   s   x u%''''$

++		Q>>  &++D1111sBJJ''A		!		)	
* "bjj))bhh$**.DDD"bjj))bhh$**.DDD%''''%&&&&R$vvbi    vvbDj!!!!{{5!!eck11	B	B	B	B ==DEYY^^Ca^(F bffW$!34HbffW!23HRVVr	 12HRVV
 23H ==
NN+H5hGL 66,Q@L??2==#>		!ML==
NN+H5hGL 66,Q?L??2==#>		!ML==
NN+H5hGL 66,Q@L??2==#>		!ML==
NN+H5hGL 66,Q?L??2==#>		!ML399Q< !9te|#5!9,c2H 3|AQ@#F3|AQ@#F q!t9$	QTO	TEI--CTEI-- )i!7=NVVND9,,CD9,, )i!7=N ffWN ,/		<0	I	))C)S.,@9,LL 	 I	))C)S.,@9,LL 	 I% 9,-++i78 
 >"S^3*	*	I% 9,-++i78 
 >"S^3*	*	y>S^+IU0K779s1a4y0"9DE^c)n,Y#e*1L779s1a4y0"9DEU !X vvbj!!!!vvdj!!!!yy~~d#cEk111Kr   c                   VR8  VR8  ,          pVR8  VR8  ,          p\         P                  ! V4      p	W7,          W&   WH,          W&   \         P                  P                  V	4      V8  Ed   Wx,          p
 \         P                  P                  W,          4      p\         P                  ! VR,          W( ,          W( ,          ,          ,
          4      pV\
        \        V4      ,          8  d   \        W,          R4      pMMWV
,          ,          W&   WV8  ,          pWV8  ,          p\         P                  ! V4      '       g   \         P                  ! V4      '       g   M'W7,          W&   WH,          W&   WV,          ( ,          p
EK  W,          pVR8  Ed   \         P                  P                  V	4      pV\
        V,          8  d   \        W_,          R4      pMRpV! V	4      pV\
        ) V,          8  d   \        V) V,          R4      pM\         P                  pV\         P                  ) 8  V	\
        V,          8  ,          pV\         P                  8  V	\
        V,          8  ,          p\         P                  ! VV,          V	V,          ,          \         P                  R7      p\         P                  ! VV,          V	V,          ,          \         P                  R7      p\        VV4      p\        VVV4      p\         P                  ! VV	,          W44      pV VV,          ,           RVR,          ,          V,          ,           pM\         P                  ! V4      pT pV'       dp   \         P                  ! VV8*  4      '       g   Q h\         P                  ! VV8*  4      '       g   Q h\         P                  P                  V4      RV,          8  g   Q hVV3# )zE
Same as `bound_constrained_cauchy_step` without the absolute value.
r   r2   )r0   r1   r   )r   r4   r   r    sqrtr7   r   r:   anyr5   r=   r>   r   )r!   r"   r	   r#   r$   r%   r&   fixed_xlfixed_xucauchy_stepworkingg_normdelta_reducedmurN   rA   rK   rO   
alpha_quadi_xli_xualpha_xlalpha_xualpha_bdalphar,   r@   s   &&&&&&&                    r
   r   r   8  s   
 STCZ(HSTCZ(H --%KLKLK	yy~~k"U*%YY^^DM2FGGs
[2[5JJJM s=111/5#%W#5K  "23H"23H66(##BFF8,<,<$&LK!$&LK!X"5 66G "IC,D5L 5>3/H H %	uy((iZ)3S9JJ bffWtby!89RVVdRi 7866"T([%66G66"T([%66Gx* Hj(3wwu{*B3	))C%*,<y,HH }}T"vvbDj!!!!vvdbj!!!!yy~~d#cEk111;r   )r   numpyr   utilsr   finfor   tinyr7   r-   rX   r   r   r   r
   <module>rn      s7      " 
xx\~K\Kr   