+
    /i)                     J    R t ^RIHt ^RIHtHtHtHtHtH	t	 ^ RI
tR tR tR# )a  
This module contains subroutines concerning the geometry-improving of the interpolation set.

Translated from Zaikun Zhang's modern-Fortran reference implementation in PRIMA.

Dedicated to late Professor M. J. D. Powell FRS (1936--2015).

Python translation by Nickolai Belakovski.
)	DEBUGGING)isinvmatprodinprodnormprimasum	primapow2Nc                j   Rp\         P                  ! V^ 4      p\        '       Ed   V^8  g   Q h\         P                  ! V4      V8X  d&   \        \         P                  ! V4      4      '       g   Q hW#8  d   V^ 8  g   Q h\         P                  ! V^ 4      V8X  d$   \         P                  ! V^4      V^,           8X  g   Q h\         P                  ! V4      P                  4       '       g   Q h\        \         P
                  ! \        VRRV13,          4      ^ R7      ^ 8  4      '       g   Q h\         P                  ! V^ 4      V8X  d   \         P                  ! V^4      V8X  g   Q h\         P                  ! V4      P                  4       '       g   Q h\        VRRV13,          WV4      '       g   Q h\         P                  ! \         P                  ! V^4      4      pV '       d`   \        \        VRRV13,          \         P                  ! W^34      P                  ,
          4      ^ R7      VRV% \        W,          4      W&   M(\        \        VRRV13,          4      ^ R7      VRV% ^ W&   \         P                  ! ^V\        \         P                  ! W2^
,          4      4      ,          4      p	\        WQ4      p
V	\        \         P                  ! . V
O^\        V
4      ,
          N4      4      ,          pV '       g   RW&   RV\         P                   ! V4      &   Rp\#        V^ 8  4      '       d   \         P$                  ! V4      pV '       d   Vf   \         P$                  ! V4      p\        '       dA   Ve   ^ Tu;8:  d   V^,           8  g   Q h Q hW8:  g   V '       g   Q hV^ 8  g   V '       d   Q hV# )a  
This function finds (the index) of a current interpolation point to be replaced with
the trust-region trial point. See (19)-(22) of the COBYLA paper.
N.B.:
1. If XIMPROVED == True, then JDROP > 0 so that D is included into XPT. Otherwise,
   it is a bug.
2. COBYLA never sets JDROP = NUM_VARS
TODO: Check whether it improves the performance if JDROP = NUM_VARS is allowed when
XIMPROVED is True. Note that UPDATEXFC should be revised accordingly.
g?NNNN)axis)npsizer   allisfinitemaxabsr   zerosr   r   tileTmaximumr   arrayisnananyargmax)	ximprovedddeltarhosimsimiitolnum_varsdistsqweightsimidscorejdrops   &&&&&&       `/var/www/html/photoedit/myenv/lib/python3.14/site-packages/scipy/_lib/pyprima/cobyla/geometry.py
setdrop_trr)      s    D wwsAH y1}}wwqzX%#bkk!n*=*===|a''wwsA(*rwwsA(Q,/NNN{{3##%%%%266#c!YhY,/0q9A=>>>>wwtQ8+a0@H0LLL{{4 $$&&&&SIXI&3333~ XXbggc1o&F$Ys1ixi</@2771YZmC\C^C^/^%_fghy#AC=$Ys1ixi</@%AJyZZ6IbjjBh.G$HHIF DES"?E"?1x+>"?@AAE   E"((5/E 519~~		% em		&! y}e!:hl!:;;!:;; I--z** L    c	           
        Ve   \         P                  ! V^ 4      M^ p	\         P                  ! V^ 4      p
\         P                  ! V^ 4      p\        '       Ed	   Yu;8  d	   ^ 8  g   Q h Q hV^8  g   Q hV^ 8  g   Q hV^ 8  g   Q h\         P                  ! V^ 4      V8X  d   \         P                  ! V^4      V8X  g   Q h\         P                  ! V4      P	                  4       '       g   Q h\         P                  ! V4      V^,           8X  dA   \        \         P                  ! V4      \         P                  ! V4      ,          4      '       d   Q h\         P                  ! V^ 4      V
8X  d$   \         P                  ! V^4      V^,           8X  g   Q h\         P
                  ! \         P                  ! V4      \         P                  ! V4      ,          4      '       d   Q h\         P                  ! V4      V^,           8X  dK   \        V^ \         P                  ! V4      ,          \         P                  ! V4      ,          8  4      '       d   Q h^ T u;8:  d	   V8  g   Q h Q hWR3,          pWl\        V4      ,          ,          p\        VRV W{,          ,
          V4      p\         P                  ! W34      pVe   VP                  MTVRRV	13&   \        W9R1RV13,          \         P                  ! W9R1V3,          V^34      P                  ,
          V4      P                  VRV	R13&   \         P                  ! \         P                  ! ^ VRV3,          \        W4      ,           4      4      p\         P                  ! \         P                  ! ^ VRV3,          \        W4      ,
          4      4      p\        W4      ) VV,          ,           \        W4      WO,          ,           8  d
   VR,          p\        '       d   \         P                  ! V4      V8X  d&   \	        \         P                  ! V4      4      '       g   Q hRV,          \         P                   P                  V4      u;8  d   RV,          8:  g   Q h Q hV# )z
This function calculates a geometry step so that the geometry of the interpolation set is improved
when SIM[: JDROP_GEO] is replaced with SIM[:, NUM_VARS] + D. See (15)--(17) of the COBYLA paper.
Nr
   g?g?r   )r   r   r   r   r   r   r   isposinfr   r   r   r   r   r   appendr   linalg)r'   amatbvecconmatcpencvaldelbarfvalr    m_lconnum_constraintsr"   r   gAcvpdcvnds   &&&&&&&&&        r(   geostepr<      sb    "&!1RWWT1qFggfa(OwwtQH y-A-----1}}zzaxxwwtQ8+a0@H0LLL{{4 $$&&&&wwt}1,S$"++VZJ[9[5\5\\\wwvq!_49KxZ[|9[[[66"((6*R[[-@@AAAAwwt}1,SBHHTN@RUWU`U`aeUf@f9f5g5gggE$H$$$$$ 	AXAd1g+A 	Yh$.0$7A
(,-A".DFFDAa&jMVGYhY$67''&():";h]KMMNPTVVWVW ajM 66"))Avak2WQ]BCDD66"))Avak2WQ]BCDDq}td{"VA\DK%??	R ywwqzX%#bkk!n*=*=== V|biinnQ/?3<?????Hr*   )__doc__common.constsr   common.linalgr   r   r   r   r   r   numpyr   r)   r<    r*   r(   <module>rB      s$    & M M Pj=r*   