+
    Y°³jÚ  ã                   óº   € R t ^ RI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HtHtHtHtHtHtHtHtHtHtHtHtHtHt RR ltR	 tR
 tRR/R lt R# )zWThe adaptation of Trust Region Reflective algorithm for a linear
least-squares problem.N)Únorm)ÚqrÚsolve_triangular)Úlsmr)ÚOptimizeResult)Úgivens_elimination)ÚEPSÚstep_size_to_boundÚfind_active_constraintsÚ	in_boundsÚmake_strictly_feasibleÚbuild_quadratic_1dÚevaluate_quadraticÚminimize_quadratic_1dÚCL_scaling_vectorÚreflective_transformationÚprint_header_linearÚprint_iteration_linearÚcompute_gradÚregularized_lsq_operatorÚright_multiplied_operatorc                ó  € V'       d   VP                  4       pVP                  4       p\        W'WT,          4       \        P                  ! \        P                  ! V4      4      p\
        \        W4      ,          \        P                  ! V4      ,          p	\        P                  ! W‰8„  4      w  p
V\        P                  ! Wª4      ,          pWz,          p\        P                  ! V4      p\        W'4      W´V
,          &   V# )a^  Solve regularized least squares using information from QR-decomposition.

The initial problem is to solve the following system in a least-squares
sense::

    A x = b
    D x = 0

where D is diagonal matrix. The method is based on QR decomposition
of the form A P = Q R, where P is a column permutation matrix, Q is an
orthogonal matrix and R is an upper triangular matrix.

Parameters
----------
m, n : int
    Initial shape of A.
R : ndarray, shape (n, n)
    Upper triangular matrix from QR decomposition of A.
QTb : ndarray, shape (n,)
    First n components of Q^T b.
perm : ndarray, shape (n,)
    Array defining column permutation of A, such that ith column of
    P is perm[i]-th column of identity matrix.
diag : ndarray, shape (n,)
    Array containing diagonal elements of D.

Returns
-------
x : ndarray, shape (n,)
    Found least-squares solution.
)Úcopyr   ÚnpÚabsÚdiagr   ÚmaxÚnonzeroÚix_Úzerosr   )ÚmÚnÚRÚQTbÚpermr   Úcopy_RÚvÚ
abs_diag_RÚ	thresholdÚnnsÚxs   &&&&&&&     Ú_/home/luca/screen-checking/.venv/lib/python3.14/site-packages/scipy/optimize/_lsq/trf_linear.pyÚregularized_lsq_with_qrr,      sª   € ÷@ Ø�F‰F‹HˆØ�‰‹
€Aä�q˜T�ZÔ(ä—’œŸš ›
Ó#€JÜ”c˜!“i•¤"§&¢&¨Ó"4Õ4€IÜ�:Š:�jÑ,Ó-�D€Cà	Œ"�&Š&�Ó
Õ€AØ	�€Aä
�Š�‹€AÜ# AÓ)€Aˆ3…i�Là€Hó    c                ó’  € ^p \        W(V,          ,           Wg4      w  ršW’,
          p\        WV4      ) pVRV,          V,          8”  d   MVR,          pKR  \        W–V4      p\        P                  ! V^ 8g  4      '       dF   \        W$V,          V,          ,           Wg4      w  rš\        W–V^ R7      p	W’,
          p\        WV4      ) pW+V3# )z=Find an appropriate step size using backtracking line search.ç      à?©Úrstepgš™™™™™¹¿)r   r   r
   r   Úanyr   )ÚAÚgr*   ÚpÚthetaÚp_dot_gÚlbÚubÚalphaÚx_newÚ_ÚstepÚcost_changeÚactives   &&&&&&&&      r+   Úbacktrackingr@   E   s¹   € à€EØ
Ü,¨Q¸µ­]¸BÓC‰ˆØ�yˆÜ)¨!°Ó5Ð5ˆØ˜ �¨Õ/Ô/ØØ��Šä$ U°Ó3€FÜ	‡v‚vˆf˜‰k×ÒÜ,¨Q¸µÀÕ1BÕ-BÀBÓK‰ˆÜ& u°"¸AÔ>ˆØ�yˆÜ)¨!°Ó5Ð5ˆà�KÐÐr-   c
                ó   € \        W,           Wx4      '       d   V# \        WWx4      w  r«\        P                  ! V4      pWËP	                  \
        4      ;;,          R,          uu&   Wl,          pWJ,          pWZ,          pW,           p\        WíWx4      w  pp^V	,
          V,          pWù,          pV^ 8”  d>   \        WWÅVR7      w  ppp\        VVVVVR7      w  ppW\V,          ,           pWl,          pM\        P                  pWY,          pWI,          p\        WWSR7      pV) pVV,          p\        V VWx4      w  ppVV	,          p\        WVVR7      w  pp\        VV^ V4      w  ppVV,          pVV8  d
   VV8  d   V# VV8  d
   VV8  d   V# V# )zDSelect the best step according to Trust Region Reflective algorithm.)Ús0r   )Úc)r   éÿÿÿÿ)
r   r	   r   r   ÚastypeÚboolr   r   Úinfr   )r*   ÚA_hÚg_hÚc_hr5   Úp_hÚdr8   r9   r6   Úp_strideÚhitsÚr_hÚrÚ
x_on_boundÚ
r_stride_ur<   Ú
r_stride_lÚaÚbrC   Úr_strideÚr_valueÚp_valueÚag_hÚagÚag_stride_uÚ	ag_strideÚag_values   &&&&&&&&&&                   r+   Úselect_stepr^   Z   s†  € ä�•˜×ÒØˆä'¨¨bÓ5�N€HÜ
�'Š'�#‹,€CØ�‰”DÓ×˜bÕ ÓØ	�€Að …M€AØ…O€CØ•€Jô ' z°bÓ=�M€J�ð �e•)˜zÕ)€JØÕ€Jà�A„~Ü$ S¨sÀÔE‰ˆˆ1ˆaÜ1Øˆq�*˜j¨Aô/Ñˆ�'à˜(•NÕ"ˆØ�G‰ä—&‘&ˆð …L€CØ…J€AÜ  ¨3Ô9€Gàˆ4€DØ	
ˆT�€BÜ'¨¨2¨rÓ6�N€K�Ø�5Õ€KÜ˜c¨°3Ô7�D€A€qÜ/°°1°a¸ÓEÑ€IˆxØˆ)…O€Bà�Ô˜W xÔ/ØˆØ	�7Ô	˜w¨Ô1Øˆàˆ	r-   Úlsmr_maxiterc
                óN  € V P                   w  r¼\        W#V4      w  rÞ\        WÓVR R7      pVR8X  d{   \        V RRR7      w  pppVP                  pW¼8  d5   \
        P                  ! V\
        P                  ! WË,
          V34      34      p\
        P                  ! V4      p\        W¼4      pM<VR8X  d6   \
        P                  ! W¼,           4      pRpVf   R	V,          pM	VR
8X  d   RpV P                  V4      V,
          p\        V V4      pR\
        P                  ! VV4      ,          pTpRpRpRpVf   ^dpV	^8X  d   \        4        \        V4       EF!  p\        VVW44      w  ppVV,          p \        V \
        P                  R7      p!V!V8  d   ^pV	^8X  d   \!        VVVVV!4       Ve    EMÈVV,          p"V"R,          p#VR,          p$V$V,          p%\#        V V$4      p&VR8X  d6   XP                  V4      XRX% \%        W¼XV$X,          ,          VVV#RR7      ) p'MkVR8X  de   \'        V&V#4      p(VXRV% X'       d5   R	\        RV!4      ,          p)\)        \*        \        R V)V!,          4      4      p\-        V(VV
WwR7      ^ ,          ) p'V$X',          p*\
        P                  ! V*V4      p+V+^ 8”  d   Rp^\        RV!4      ,
          p,\/        VV&V%V"V*V'V$W4V,4
      p-\1        V VV-4      ) pV^ 8  d   \3        V VVV*V,V+W44      w  pp-pM\        VV-,           W4^ R7      p\        V-4      pV P                  V4      V,
          p\        V V4      pVVV,          8  d   ^pR\
        P                  ! VV4      ,          pEK$  	  Vf   ^ p\5        WÓWER7      p.\7        VVVX!V.X^,           VVR7      # )gš™™™™™¹?r0   ÚexactÚeconomicT)ÚmodeÚpivotingr   FNg{®Gáz„?Úautor/   )Úord)r%   )ÚmaxiterÚatolÚbtolg{®Gázt?)Úrtol)r*   ÚfunÚcostÚ
optimalityÚactive_maskÚnitÚstatusÚinitial_costrD   )Úshaper   r   r   ÚTr   Úvstackr   ÚminÚdotr   r   Úranger   r   rG   r   r   r,   r   r   r   r   r^   r   r@   r
   r   )/r3   rU   Úx_lsqr8   r9   ÚtolÚ
lsq_solverÚlsmr_tolÚmax_iterÚverboser_   r    r!   r*   r<   ÚQTr"   r$   ÚQTrÚkÚr_augÚauto_lsmr_tolrP   r4   rl   rq   Útermination_statusÚ	step_normr>   Ú	iterationr&   ÚdvÚg_scaledÚg_normÚdiag_hÚdiag_root_hrL   rI   rH   rK   Úlsmr_opÚetar5   r7   r6   r=   rn   s/   &&&&&&&&&&$                                    r+   Ú
trf_linearr�   Ž   s”  € à�7‰7�D€AÜ$ U°Ó3�D€AÜ˜q b°Ô4€Aà�WÔÜ˜ °dÔ;‰ˆˆAˆtØ�T‰TˆàŒ5Ü—	’	˜1œbŸhšh¨­¨q zÓ2Ð3Ó4ˆAä�hŠh�q‹kˆÜ�‹I‰Ø	�vÔ	Ü—’˜�“ˆØˆØÒØ˜c•z‰HØ˜ÔØ ˆMà	�‰ˆa‹�1�€AÜ�Q˜Ó€AØ”—’˜˜1“Õ€DØ€LàÐØ€IØ€KàÒØˆà�!„|ÜÔä˜8—_ˆ	Ü! ! Q¨Ó/‰ˆˆ2Ø�q•5ˆÜ�h¤B§F¡FÔ+ˆØ�CŒ<Ø!"Ðà�aŒ<Ü" 9¨d°KØ#,¨fô6ð Ò)Úà�R•ˆØ •mˆØ��HˆØ�!�eˆä'¨¨1Ó-ˆØ˜Ô Ø—f‘f˜Q“iˆC��ˆGÜ*¨1°°Q°tµWµ¸cÀ4Ø+6¸uôFð F‰Cà˜6Ô!Ü.¨s°KÓ@ˆGØˆE�"�1ˆIßØœS  fÓ-Õ-�Üœs¤C¨¨S°6­\Ó$:Ó;�Ü˜ °Ø%ô6Ø67õ9ð 9ˆCð ��Gˆä—&’&˜˜A“,ˆØ�QŒ;Ø!#Ðà”C˜˜vÓ&Õ&ˆÜ˜1˜c 3¨°°3¸¸2À5ÓIˆÜ)¨!¨Q°Ó5Ð5ˆð
 ˜Œ?Ü#/Ø�1�a˜˜E 7¨Bó$4Ñ ˆAˆt‘[ô ' q¨4¥x°¸qÔAˆAä˜“Jˆ	Ø�E‰E�!‹H�q�LˆÜ˜˜AÓˆà˜˜t�Ô#Ø!"Ðà”R—V’V˜A˜q“\Õ!‹ñw %ðz Ò!ØÐä)¨!°Ô>€KäØ
�˜¨&¸kØ˜�MÐ"4Ø!ô#ð #r-   )T)!Ú__doc__Únumpyr   Únumpy.linalgr   Úscipy.linalgr   r   Úscipy.sparse.linalgr   Úscipy.optimizer   r   Úcommonr   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r,   r@   r^   r�   © r-   r+   Ú<module>r–      sU   ðñã Ý ß -Ý $Ý )å 2÷9÷ 9÷ 9÷ 9ñ 9ô0òf ò*1ðhk#Ø26ök#r-   