+
    LV-j[\  ã                   óð   € R t Rt. ROt^ RIt^RIHtHt ^RIH	t	 ^RI
HtHtHtHt ^RIHt ^R	IHtHtHtHtHtHtHtHt ^R
IHtHtHtHt  ! R R]4      tR t R t! ! R R]]4      t" ! R R]	]4      t#R# )zSparse DIAgonal formatzrestructuredtext enÚ	dia_arrayÚ
dia_matrixN)Ú_prune_arrayÚcopy_if_needed)Úspmatrix)ÚissparseÚ_formatsÚ_spbaseÚsparray)Ú_data_matrix)ÚisdenseÚisscalarlikeÚisshapeÚupcast_charÚgetdtypeÚget_sum_dtypeÚvalidateaxisÚcheck_shape)Ú
dia_matmatÚ
dia_matvecÚdia_matvecsÚ	dia_tocsrc                   ó˜  a a€ ] tR t^t oRtRRR/R lltR tR tRR lt]	P                  P                  ]n
        RR lt]	P                  P                  ]n
        RR	 lt]	P                  P                  ]n
        RR
 ltV 3R ltR tV 3R ltR tR tV 3R ltRR ltRR lt]	P*                  P                  ]n
        RR lt]	P,                  P                  ]n
        RR lt]	P.                  P                  ]n
        RR lt]	P0                  P                  ]n
        RR ltR t]	P4                  P                  ]n
        RtVtV ;t# ) Ú	_dia_baseÚdiaNÚmaxprintc               óv	  € \         P                  ! WVR 7       \        V4      '       dê   VP                  R8X  dW   V'       d   VP	                  4       pVP
                  V n        VP                  V n        \        VP                  4      V n	        EMœVP                  V P                  8X  d   V'       d   VP	                  4       pMVP                  4       pVP
                  V n        VP                  V n        \        VP                  4      V n	        EM\        V\        4      '       EdP   \        V4      '       d€   \        V4      V n	        \        P                  ! R\!        V\"        R7      4      V n        V P%                  \'        V P                  4      R7      p\        P                  ! ^ VR7      V n        EMs Vw  r‰Vf   \)        R4      hV'       g   \*        p\        P,                  ! \        P.                  ! V^ ,          W4R7      4      V n        \        P.                  ! V^,          V P%                  \'        V4      R7      VR7      p	\        P0                  ! V	4      V n        \        V4      V n	        M´ \        P4                  ! V4      p\        T \6        4      '       d+   TP8                  ^8w  d   \)        RTP8                   R24      hT P;                  YTR7      P                  4       pTP
                  T n        TP                  T n        \        TP                  4      T n	        Ve.   \!        V4      pV P
                  P=                  VRR7      V n        V P                  P8                  ^8w  d   \)        R4      hV P
                  P8                  ^8w  d   \)        R4      hV P
                  P                  ^ ,          \?        V P                  4      8w  dA   \)        RV P
                  P                  ^ ,           R\?        V P                  4       R24      h\?        \        P@                  ! V P                  4      4      \?        V P                  4      8w  d   \)        R4      hR#   \2         d   p
Rp\)        T4      T
hRp
?
ii ; i  \2         d    p
\)        R	T P                   R
24      T
hRp
?
ii ; i))r   r   )Údefault©Úmaxval©ÚdtypeNzexpected a shape argument)r!   Úcopyz+unrecognized form for dia_array constructorzunrecognized form for z_matrix constructorzDIA arrays don't support zD input. Use 2D)r!   ÚshapeF©r"   zoffsets array must have rank 1zdata array must have rank 2znumber of diagonals (z() does not match the number of offsets (Ú)z&offset array contains duplicate values)é    r&   )!r   Ú__init__r   Úformatr"   ÚdataÚoffsetsr   r#   Ú_shapeÚtodiaÚ
isinstanceÚtupler   ÚnpÚzerosr   ÚfloatÚ_get_index_dtypeÚmaxÚ
ValueErrorr   Ú
atleast_2dÚarrayÚ
atleast_1dÚ	ExceptionÚasarrayr
   ÚndimÚ_coo_containerÚastypeÚlenÚunique)ÚselfÚarg1r#   r!   r"   r   ÚAÚ	idx_dtyper)   r*   ÚeÚmessageÚnewdtypes   &&&&&$       Úb/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/scipy/sparse/_dia.pyr'   Ú_dia_base.__init__   sƒ  € Ü×Ò˜d°8Õ<ä�D�>Š>Ø�{‰{˜eÔ#ßØŸ9™9›;�DØ ŸI™I�”	Ø#Ÿ|™|�”Ü)¨$¯*©*Ó5�–à—;‘; $§+¡+Ô-·$ØŸ	™	›‘AàŸ
™
›�AØŸF™F�”	Ø Ÿy™y�”Ü)¨!¯'©'Ó2�–Ü˜œe×$Ó$Ü�t�}Š}ô *¨$Ó/�”ÜŸHšH U¬H°UÄEÔ,JÓK�”	Ø ×1Ñ1¼¸T¿Z¹Z»Ð1ÓI�	Ü!Ÿxšx¨°9Ô=�–ð5à$(‘M�Dð
 ’}Ü(Ð)DÓEÐEßÜ-˜Ü "§¢¬b¯hªh°t¸AµwÀeÔ.WÓ X�D”IÜ Ÿhšh t¨A¥wØ-1×-BÑ-BÌ#ÈeË*Ð-BÓ-UØ,0ô2�Gô $&§=¢=°Ó#9�D”LÜ"-¨eÓ"4�D•KðMÜ—z’z $Ó'�ô ˜$¤×(Ò(¨T¯Y©Y¸!¬^Ü Ð#<¸T¿Y¹Y¸KÀÐ!WÓXÐXØ×#Ñ# D¸UÐ#ÓC×IÑIÓKˆAØŸ™ˆDŒIØŸ9™9ˆDŒLÜ% a§g¡gÓ.ˆDŒKàÒÜ “ˆHØŸ	™	×(Ñ(¨¸Ð(Ó>ˆDŒIð �<‰<×Ñ Ô!ÜÐ=Ó>Ð>à�9‰9�>‰>˜QÔÜÐ:Ó;Ð;à�9‰9�?‰?˜1Õ¤ T§\¡\Ó!2Ô2ÜØ'¨¯	©	¯©¸Õ(:Ð';ð <Ü" 4§<¡<Ó0Ð1°ð4óð ô Œr�yŠy˜Ÿ™Ó&Ó'¬3¨t¯|©|Ó+<Ô<ÜÐEÓFÐFñ =øôY !ô 5ØK�GÜ$ WÓ-°1Ð4ûð5ûô$ ô MÜ Ð!9Ø$(§K¡K =Ð0Cð"Eó FØKLðMûðMús0   Æ;Q- É:R Ñ-RÑ8RÒRÒR8ÒR3Ò3R8c                ó  € \         V P                  ,          w  r\        V \        4      '       d   R MRpV P                  P
                  ^ ,          pRV RV RV P                   RV P                   RV RV P
                   R2# )	r6   ÚmatrixÚ<z sparse z of dtype 'z'
	with z stored elements (z diagonals) and shape Ú>)r   r(   r-   r
   r)   r#   r!   Únnz)r?   Ú_ÚfmtÚ
sparse_clsÚds   &    rF   Ú__repr__Ú_dia_base.__repr__d   s}   € Ü˜$Ÿ+™+Õ&‰ˆÜ *¨4´× 9Ò 9‘W¸xˆ
Ø�I‰I�O‰O˜AÕˆà�ˆu�H˜Z˜L¨°D·J±J°<ð @Ø—h‘h�ZÐ1°!°Ð4JÈ4Ï:É:È,ÐVWðYð	
ó    c                óì   € V P                   w  r\        P                  ! V P                  P                   ^,          4      pW0P                  R,          ,
          pV^ 8¬  pWTV8  ,          pWSV8  ,          pV# )zvReturns a mask of the same shape as self.data, where
mask[i,j] is True when data[i,j] corresponds to a stored element.©ºNNNN)r#   r/   Úaranger)   r*   )r?   Únum_rowsÚnum_colsÚoffset_indsÚrowÚmasks   &     rF   Ú
_data_maskÚ_dia_base._data_maskm   sc   € ð "ŸZ™ZÑˆÜ—i’i §	¡	§¡°Õ 2Ó3ˆØŸL™L¨Õ0Õ0ˆØ�q‘ˆØ�x‘Õ ˆØ˜xÑ'Õ(ˆØˆrS   c                óŽ   € Ve   \        R4      hV P                  4       p\        P                  ! V P                  V,          4      # )Nz<count_nonzero over an axis is not implemented for DIA format)ÚNotImplementedErrorr]   r/   Úcount_nonzeror)   )r?   Úaxisr\   s   && rF   ra   Ú_dia_base.count_nonzerox   s?   € ØÒÜ%ØNóð ð �‰Ó ˆÜ×Ò §	¡	¨$¥Ó0Ð0rS   c           	     ó|  € Ve   \        R4      hV P                  w  r#\        V P                  P                  ^,          V4      p\	        \
        P                  ! \
        P                  ! W P                  ,           V4      \
        P                  ! V P                  ^ 4      ,
          ^ 4      P                  4       4      # )Nz6_getnnz over an axis is not implemented for DIA format)
r`   r#   Úminr)   Úintr/   ÚmaximumÚminimumr*   Úsum)r?   rb   ÚMÚNÚLs   &&   rF   Ú_getnnzÚ_dia_base._getnnz‚   s‹   € ØÒÜ%ð '7ó 8ð 8à�z‰z‰ˆÜ�—	‘	—‘ Õ" AÓ&ˆÜ”2—:’:œbŸjšj¨¯\©\Õ)9¸1Ó=Ü Ÿjšj¨¯©°qÓ9õ:àó!ç!$¡£ó(ð 	(rS   c           
     óZ  € \        V4      p\        V P                  4      pV P                  w  rVR pVR8X  d˜   V P	                  4       pV P
                  V,          P                  ^ R7      p	V	P                  ^ ,          V8X  d   T	p
M6\        P                  ! WiP                  R7      p
WšR V	P                  ^ ,          % V P                  W¤R7      pMË\        P                  ! V^3VR7      p\        P                  ! WdR7      p\        WV\        V P                  4      V P
                  P                  ^,          V P                  V P
                  WË4       V P                  V4      pVf   VP                  W#R7      # V P                  VP                  VR7      4      pVP                  RW#R7      # )N)rb   r    )r!   Úout)rb   r!   rp   ©r&   © )r   r   r!   r#   r]   r)   ri   r/   r0   Ú_ascontainerÚonesr   r=   r*   )r?   rb   r!   rp   Ú	res_dtyperX   rY   Úretr\   ÚxÚresÚrow_sumsÚones   &&&&         rF   ri   Ú_dia_base.sumŽ   sT  € Ü˜DÓ!ˆä! $§*¡*Ó-ˆ	Ø!ŸZ™ZÑˆØˆà�4Œ<Ø—?‘?Ó$ˆDØ—‘˜TÕ!×&Ñ&¨AÐ&Ó.ˆAØ�w‰w�q�z˜XÔ%Ø‘ä—h’h˜x¯w©wÔ7�Ø#$�K�Q—W‘W˜Q•ZÐ Ø×#Ñ# CÐ#Ó9‰Cô —x’x ¨1 °YÔ?ˆHÜ—'’'˜(Ô4ˆCÜ�x¬3¨t¯|©|Ó+<Ø—y‘y—‘ qÕ)¨4¯<©<¸¿¹ÀCôSð ×(Ñ(¨Ó2ˆHàŠ|Ø—|‘|¨%�|Ó9Ð9à×#Ñ# H§L¡L°d LÓ$;Ó<ˆCà�w‰w˜B eˆwÓ5Ð5rS   c                óN  € \        V\        4      '       g   VP                  V 4      # \        P                  ! V P
                  VP
                  4      '       dV   T P                  V'       d"   V P                  VP                  ,
          4      # V P                  VP                  ,           4      # \        P                  ! V P
                  VP
                  4      p\        P                  ! W0P
                  4      p\        P                  ! W1P
                  4      pV P                  P                  ^,          pVP                  P                  ^,          pWg8X  dŒ   \        V4      \        V P
                  4      8X  di   V P                  \        V4      ,          pV'       d#   W…R3;;,          VP                  ,          uu&   EMÇW…R3;;,          VP                  ,          uu&   EM¥Wg8X  dˆ   \        V4      \        VP
                  4      8X  de   V'       d   VP                  \        V4      ,          ) pMVP                  \        V4      ,          pW„R3;;,          V P                  ,          uu&   EM\        V P                  ^ ,          VR,          ,           V P                  ^,          4      p	\        P                  ! \        V4      V	3\        P                  ! V P                  VP                  4      R7      pW„RV13;;,          V P                  RRV	13,          ,          uu&   V'       d/   W…RV13;;,          VP                  RRV	13,          ,          uu&   M-W…RV13;;,          VP                  RRV	13,          ,          uu&   V P!                  Wƒ3V P                  R7      # )é   rV   r    N©r#   éÿÿÿÿ)r-   r   Ú_add_sparser/   Úarray_equalr*   Ú
_with_datar)   Úunion1dÚsearchsortedr#   r=   Ú_invert_indexre   r0   Úresult_typeÚ_dia_container)
r?   ÚotherÚsubÚnew_offsetsÚself_idxÚ	other_idxÚself_dÚother_dÚnew_datarP   s
   &&&       rF   r€   Ú_dia_base._add_sparse°   s‹  € ä˜%¤×+Ò+Ø×$Ñ$ TÓ*Ð*ô �>Š>˜$Ÿ,™,¨¯©×6Ò6Ø—?‘?¿S 4§9¡9¨u¯z©zÕ#9ó ;ð ;Ø#'§9¡9¨u¯z©zÕ#9ó;ð ;ô —j’j §¡¨u¯}©}Ó=ˆÜ—?’? ;·±Ó=ˆÜ—O’O K·±Ó?ˆ	à—‘—‘ Õ#ˆØ—*‘*×"Ñ" 1Õ%ˆð Ô¤ [Ó!1´S¸¿¹Ó5FÔ!FØ—y‘y¤¨xÓ!8Õ9ˆHßØ A˜×&¨%¯*©*Õ4Õ&à A˜×&¨%¯*©*Õ4Õ&ØÔ¤3 {Ó#3´s¸5¿=¹=Ó7IÔ#IßØ!ŸJ™J¤}°YÓ'?Õ@Ð@‘à Ÿ:™:¤m°IÓ&>Õ?�Ø˜q�[×! T§Y¡YÕ.Õ!ô �D—J‘J˜q•M K°¥OÕ3°T·Z±ZÀµ]ÓCˆAô —x’xÜ�[Ó! 1Ð%Ü—n’n T§Y¡Y°·
±
Ó;ôˆHð ˜w ˜wÐ&×'¨4¯9©9°Q¸¸¸°UÕ+;Õ;Ó'ßØ H W HÐ,×-°·±¸A¸rÀ¸r¸EÕ1BÕBÔ-à H W HÐ,×-°·±¸A¸rÀ¸r¸EÕ1BÕBÓ-Ø×"Ñ" HÐ#:À$Ç*Á*Ð"ÓMÐMrS   c                ót   <€ \        V\        4      '       g   \        SV `  V4      # V P	                  VR R7      # )T)r‰   )r-   r   ÚsuperÚ_sub_sparser€   )r?   rˆ   Ú	__class__s   &&€rF   r“   Ú_dia_base._sub_sparseß   s6   ø€ ä˜%¤×+Ò+Ü‘7Ñ& uÓ-Ð-à×Ñ ¨4ÐÓ0Ð0rS   c                óF   € V P                  V P                  V,          4      # ©N)r‚   r)   )r?   rˆ   s   &&rF   Ú_mul_scalarÚ_dia_base._mul_scalaræ   s   € Ø�‰˜tŸy™y¨5Õ0Ó1Ð1rS   c                ó  <€ \        V4      '       d   V P                  V4      # \        V4      '       EdÎ   VP                  ^8”  d   V P	                  4       V,          # ^ V P
                  9   g#   ^V P
                  9   g   ^ VP
                  9   d   \        SV `  V4      # \        P                  ! V4      pVP
                  w  r#V P
                  w  rE\        V P                  P
                  ^,          V4      pV P                  RRV13,          P                  \        P                  ! V P                  V4      4      pV^8X  d   Wq^ RV13,          ,          pM™W$8w  d   \        R4      h\        P                  ! V4      pWd8”  d"   W€P                   R,          ,
          V,          p	M W€P                   R,          V,          ,
          p	V^8X  d   ^ pMW58w  d   \        R4      hWqW˜3,          ,          pV P#                  V4      # \%        V\&        4      '       d   VP
                  V P
                  8w  d   \        SV `  V4      # \        P(                  ! V P                   VP                   RRR7      w  r«p\        V P                  P
                  ^,          VP                  P
                  ^,          4      pV P                  VRV13,          VP                  VRV13,          ,          pV P+                  Wz3V P
                  R7      # )é   rV   Nzinconsistent shapesT)Úassume_uniqueÚreturn_indicesr~   rU   )r   r˜   r   r:   Útoarrayr#   r’   Úmultiplyr/   r5   re   r)   r<   r†   r4   rW   r*   r‚   r-   r   Úintersect1dr‡   )r?   rˆ   Ú
other_rowsÚ
other_colsÚrowsÚcolsrl   r)   ÚjÚir*   r‹   rŒ   r”   s   &&           €rF   rŸ   Ú_dia_base.multiplyé   sS  ø€ Ü˜×ÒØ×#Ñ# EÓ*Ð*ä�5�>‹>Ø�z‰z˜AŒ~Ø—|‘|“~¨Õ-Ð-ð �D—J‘JŒ ! t§z¡z¤/°Q¸%¿+¹+Ô5EÜ‘wÑ'¨Ó.Ð.ä—M’M %Ó(ˆEØ%*§[¡[Ñ"ˆJØŸ™‰JˆDÜ�D—I‘I—O‘O AÕ&¨Ó-ˆAØ—9‘9˜Q   ˜UÕ#×*Ñ*¬2¯>ª>¸$¿)¹)ÀUÓ+KÓLˆDØ˜QŒØ˜a  ! ˜e�Õ$‘ØÔ#Ü Ð!6Ó7Ð7ä—I’I˜a“L�Ø”8ØŸ\™\¨'Õ2Õ2°dÕ:‘AàŸL™L¨Õ1°DÕ8Õ8�AØ ”?Ø‘AØÔ'Ü$Ð%:Ó;Ð;Ø˜a˜d�Õ#�Ø—?‘? 4Ó(Ð(ô ˜%¤×+Ò+¨u¯{©{¸d¿j¹jÔ/HÜ‘7Ñ# EÓ*Ð*ô
 �NŠN˜4Ÿ<™<¨¯©Ø)-¸dôDñ 	%ˆ˜9ô �—	‘	—‘ Õ" E§J¡J×$4Ñ$4°QÕ$7Ó8ˆØ�y‰y˜ 2 A 2˜Õ&¨¯©°I¸rÀ¸r°MÕ)BÕBˆØ×"Ñ" D ?¸$¿*¹*Ð"ÓEÐErS   c                ó¼  € Tp\         P                  ! V P                  ^ ,          \        V P                  P
                  VP                  P
                  4      R7      pV P                  P                  ^,          pV P                  w  rV\        WV\        V P                  4      W@P                  V P                  VP                  4       VP                  4       4       V# ©r&   r    )r/   r0   r#   r   r!   Úcharr)   r   r=   r*   Úravel)r?   rˆ   rw   Úyrl   rj   rk   s   &&     rF   Ú_matmul_vectorÚ_dia_base._matmul_vector  s•   € Øˆä�HŠH�T—Z‘Z •]¬+°d·j±j·o±oØ78·w±w·|±|ó+Eô Fˆð �I‰I�O‰O˜AÕˆà�j‰j‰ˆä�1œ˜DŸL™LÓ)¨1¯l©l¸D¿I¹IØ—7‘7“9˜aŸg™g›iô	)ð ˆrS   c                ór  € \         P                  ! V P                  ^ ,          VP                  ^,          3\         P                  ! V P                  V4      R7      p\        . V P                  OV P                  P                  OV P                  NV P                  NVP                  ^,          NVNVN5!   V# r©   )r/   r0   r#   r†   r)   r   r*   )r?   rˆ   rx   s   && rF   Ú_matmul_multivectorÚ_dia_base._matmul_multivector)  s–   € Ü�hŠh˜Ÿ
™
 1� u§{¡{°1¥~Ð6ÜŸ^š^¨D¯I©I°uÓ=ô?ˆäð 	0�T—Z‘Zð 	0 $§)¡)§/¡/ð 	0°4·<±<ð 	0ÀÇÁð 	0Ø—K‘K •Nð	0Ø$)ð	0Ø+.ô	0àˆ
rS   c                ó¬  <€ \        V\        4      '       g   \        SV `  V4      # ^ V P                  9   g   ^ VP                  9   d6   V P                  V P                  ^ ,          VP                  ^,          34      # \        . V P                  OV P                  P                  OV P                  NV P                  NVP                  ^,          NVP                  P                  OVP                  NVP                  N5!  w  r#V P                  VP                  \        V4      R4      V3V P                  ^ ,          VP                  ^,          34      # )r&   r   )r-   r   r’   Ú_matmul_sparser#   r‡   r   r)   r*   Úreshaper=   )r?   rˆ   r*   r)   r”   s   &&  €rF   r³   Ú_dia_base._matmul_sparse0  s  ø€ ä˜%¤×+Ò+Ü‘7Ñ)¨%Ó0Ð0ð �—
‘
Œ?˜a 5§;¡;Ô.Ø×&Ñ&¨¯
©
°1­°u·{±{À1µ~Ð'FÓGÐGä"ð > D§J¡Jð >°·±·±ð >Ø#'§<¡<ð>Ø15·±ð>à#(§;¡;¨q¥>ð>à49·J±J×4DÑ4Dð>ð $)§=¡=ð>ð 38·*±*ó>‰ˆð ×"Ñ" D§L¡L´°W³¸rÓ$BÀGÐ#LØ$(§J¡J¨q¥M°5·;±;¸qµ>Ð#BóDð 	DrS   c                óœ  € V P                   w  r4VP                  ^ 8X  d   \        P                  pM\	        V4      pV^ 8  d   \        W2,           WE4      p^ pTpM\        W4V,
          V4      pTpW&,           pVP                  ^ 8w  d   VRV pV P                  P                   w  ršW P                  9   dm   WŠ8”  dG   \        P                  ! W˜3V P                  P                  R7      pV P                  VRRV
13&   W°n        WP                  V P                  V8H  Wx13&   R# \        P                  ! V P                  V P                  P                  P                  V4      4      V n        \        WŠ4      p\        P                  ! V	^,           V3V P                  P                  R7      pV P                  VRR1RV
13&   WRWx13&   W°n        R# )r&   Nr    rV   r   )r#   r:   r/   Úinfr=   re   r)   r*   r0   r!   ÚappendÚtyper3   )r?   ÚvaluesÚkrj   rk   Úvalues_nÚnÚ	min_indexÚ	max_indexÚ	data_rowsÚ	data_colsr)   Úms   &&&          rF   Ú_setdiagÚ_dia_base._setdiag@  su  € Ø�z‰z‰ˆà�;‰;˜!Ôä—v‘v‰Hä˜6“{ˆHàˆqŒ5Ü�A•E˜1Ó'ˆAØˆIØ‰Iä�A˜1•u˜hÓ'ˆAØˆIØ�ˆIà�;‰;˜!Ôà˜B˜Q�ZˆFà#Ÿy™yŸ™Ñˆ	Ø—‘ÔØÔ$Ü—x’x Ð 6¸d¿i¹i¿o¹oÔN�Ø&*§i¡i��Q˜
˜˜
�]Ñ#Ø ”	Ø@F�I‰I�d—l‘l aÑ'¨Ð)<Ð<Ó=äŸ9š9 T§\¡\°4·<±<×3EÑ3E×3JÑ3JÈ1Ó3MÓNˆDŒLÜ�IÓ)ˆAÜ—8’8˜Y¨�]¨AÐ.°d·i±i·o±oÔFˆDØ$(§I¡IˆD��"��j�y�j�Ñ!Ø,2��YÐ(Ð(Ñ)ØŽIrS   c                ó6   € V'       d   V P                  4       # V # r—   r$   )r?   r"   s   &&rF   r,   Ú_dia_base.todiae  s   € ßØ—9‘9“;ÐàˆKrS   c                óÚ  € Ve   VR8w  d   \        R4      hV P                  w  r4\        V P                  4      pV P                  ) p\        P
                  ! \        V4      \        P                  R7      R,          p\        P
                  ! V\        P                  R7      We,          R,          ,
          p\        ^ WPP                  P                  ^,          ,
          4      p	\        P                  ! V P                  \        P                  ! V P                  P                  ^ ,          V	3V P                  P                  R7      34      p
W§V3,          p
V P                  W¦3WC3VR7      # )NzvSparse arrays/matrices do not support an 'axes' parameter because swapping dimensions is the only logical permutation.r    )r#   r"   )r}   r&   rU   )r4   r#   r3   r*   r/   rW   r=   Úintcr)   Úhstackr0   r!   r‡   )r?   Úaxesr"   rX   rY   Úmax_dimr*   ÚrÚcÚ
pad_amountr)   s   &&&        rF   Ú	transposeÚ_dia_base.transposem  s  € ØÒ ¨¤Üð Ló Mð Mð "ŸZ™ZÑˆÜ�d—j‘j“/ˆð —<‘<�-ˆô �IŠI”c˜'“l¬"¯'©'Ô2°7Õ;ˆÜ�IŠI�h¤b§g¡gÔ.°'Õ2CÀWÕ1MÕMˆÜ˜˜G§I¡I§O¡O°AÕ$6Õ6Ó7ˆ
Ü�yŠy˜$Ÿ)™)¤R§X¢X¨t¯y©y¯©¸qÕ/AÀ:Ð.NØ48·I±I·O±Oô&Eð Fó Gˆà�q�D�zˆØ×"Ñ" D ?Øð; Ø&*ð #ó ,ð 	,rS   c                óD  € V P                   w  r#W) 8:  g   W8¼  d-   \        P                  ! ^ V P                  P                  R7      # \        P
                  ! V P                  V8H  4      w  p\        ^ V4      p\        W!,           V4      pWe,
          pVP                  ^ 8X  d,   \        P                  ! WpP                  P                  R7      # V P                  V^ ,          WV13,          pV\        V4      ,
          p	V	^ 8”  d   \        P                  ! V^ V	3RR7      pV# )r&   r    Úconstant)Úmode)r#   r/   Úemptyr)   r!   Únonzeror*   r3   re   Úsizer0   r=   Úpad)
r?   r»   r£   r¤   ÚidxÚ	first_colÚlast_colÚresult_sizeÚresultÚpaddings
   &&        rF   ÚdiagonalÚ_dia_base.diagonal…  s×   € Ø—Z‘Z‰
ˆØ�Œ:˜œÜ—8’8˜A T§Y¡Y§_¡_Ô5Ð5Ü�zŠz˜$Ÿ,™,¨!Ñ+Ó,‰ˆÜ˜˜1“Iˆ	Ü�t•x Ó&ˆØÕ*ˆØ�8‰8�qŒ=Ü—8’8˜K¯y©y¯©Ô?Ð?Ø—‘˜3˜q�6 9Ð#5Ð5Õ6ˆØ¤ F£Õ+ˆØ�QŒ;Ü—V’V˜F Q¨ L°zÔBˆFØˆrS   c                óä  € ^ V P                   9   g   \        V P                  4      ^ 8X  d(   V P                  V P                   V P                  R7      # V P                   w  r#V P
                  pV P                  \        WBV4      R7      p\        P                  ! V P                  4      P                  VRR7      p\        P                  ! W@P                  R7      p\        P                  ! WER7      p\        P                  ! ^V,           VR7      p	\        W#.V P                  P                   OV P                  P                  VRR7      NV P                  NVNVNVNV	N5!  p
V P                  \        W¢V4      R7      p\        VRV
 4      p\        VRV
 P                  VRR7      4      pV	P                  VRR7      p	V P                  WxV	3V P                   V P                  R7      pRVn        V# )r&   r    r   Fr$   N)r#   r!   T)r#   r=   r*   Ú_csr_containerr!   rL   r2   r3   r/   Úargsortr<   rÔ   r   r)   r   Úhas_canonical_format)r?   r"   Ún_rowsÚn_colsÚmax_nnzrB   ÚorderÚcsr_dataÚindicesÚindptrrL   rp   s   &&          rF   ÚtocsrÚ_dia_base.tocsr—  s¹  € Ø�—
‘
Œ?œc $§,¡,Ó/°1Ô4Ø×&Ñ& t§z¡z¸¿¹Ð&ÓDÐDàŸ™‰ˆØ—(‘(ˆð
 ×)Ñ)´°WÀfÓ1MÐ)ÓNˆ	Ü—
’
˜4Ÿ<™<Ó(×/Ñ/°	ÀÐ/ÓFˆÜ—8’8˜G¯:©:Ô6ˆÜ—(’(˜7Ô4ˆÜ—’˜!˜f�*¨IÔ6ˆä˜ð :¨¯©¯©ð :ØŸ™×+Ñ+¨I¸EÐ+ÓBð:ØDHÇIÁIð:àð:à'ð:à)0ð:à28ó:ˆð ×)Ñ)´°SÀ&Ó1IÐ)ÓJˆ	Ü ¨¨# Ó/ˆÜ˜w t¨˜}×3Ñ3°IÀEÐ3ÓJÓKˆØ—‘˜y¨u�Ó5ˆØ×!Ñ! 8°fÐ"=Ø(,¯
©
¸$¿*¹*ð "ó Fˆà#'ˆÔ Øˆ
rS   c                óÎ   € V'       d7   V P                  WP                  P                  4       3V P                  R7      # V P                  WP                  3V P                  R7      # )z�Returns a matrix with the same sparsity structure as self,
but with different data.  By default the structure arrays are copied.
r~   )r‡   r*   r"   r#   )r?   r)   r"   s   &&&rF   r‚   Ú_dia_base._with_data·  sb   € ÷ Ø×&Ñ&Ø—|‘|×(Ñ(Ó*Ð+°4·:±:ð 'ó ð ð ×&Ñ&Ø—|‘|Ð$¨D¯J©Jð 'ó ð rS   c                ó&  € \        V4      pVw  r#V P                  R RV13,          V n        W P                  ^ ,          8”  dÉ   \        P                  ! V P
                  V P                  ^ ,          ,           V P                  P                  ^,          8  4      '       dm   V P
                  R,          V P                  ^ ,          ,           \        P                  ! V P                  P                  ^,          4      8*  p^ V P                  V&   Wn        R# )rV   NrU   )r   r)   r#   r/   Úanyr*   rW   r+   )r?   r#   rj   rk   r\   s   &*   rF   ÚresizeÚ_dia_base.resizeÄ  s¶   € Ü˜EÓ"ˆØ‰ˆà—I‘I˜a  ! ˜eÕ$ˆŒ	à—
‘
˜1•ÔÜ—’�t—|‘| d§j¡j°¥mÕ3°d·i±i·o±oÀaÕ6HÑH×IÒIà—L‘L Õ)¨D¯J©J°q­MÕ9Ü—I’I˜dŸi™iŸo™o¨aÕ0Ó1ñ2ˆDàˆD�I‰I�d‰OàŽrS   )r+   r)   r*   )NNFr—   )NNN)Frq   )NF)T)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú_formatr'   rQ   r]   ra   r	   Ú__doc__rm   ri   r€   r“   r˜   rŸ   r­   r°   r³   rÃ   r,   rÏ   rÞ   rë   r‚   rñ   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r”   Ú__classdict__s   @@rF   r   r      s$  ù‡ € Ø€GñKGÈTõ KGòZ
ò	ô1ð $×1Ñ1×9Ñ9€MÔô(ð —o‘o×-Ñ-€G„Oô6ð@ —+‘+×%Ñ%€C„Kô-Nõ^1ò2õ/FòbòõDô #ôJð —M‘M×)Ñ)€E„Mô,ð,  ×)Ñ)×1Ñ1€IÔôð  ×'Ñ'×/Ñ/€HÔôð: —M‘M×)Ñ)€E„Môòð —^‘^×+Ñ+€F‡N„NrS   r   c                ót   € \         P                  ! V 4      p\         P                  ! \        V 4      4      W&   V# )z)Helper function to invert an index array.)r/   Ú
zeros_likerW   r=   )rØ   Úinvs   & rF   r…   r…   Ö  s)   € ä
�-Š-˜Ó
€CÜ�yŠyœ˜S›Ó"€C�HØ€JrS   c                ó"   € \        V \        4      # )aŠ  Is `x` of dia_matrix type?

Parameters
----------
x
    object to check for being a dia matrix

Returns
-------
bool
    True if `x` is a dia matrix, False otherwise

Examples
--------
>>> from scipy.sparse import dia_array, dia_matrix, coo_matrix, isspmatrix_dia
>>> isspmatrix_dia(dia_matrix([[5]]))
True
>>> isspmatrix_dia(dia_array([[5]]))
False
>>> isspmatrix_dia(coo_matrix([[5]]))
False
)r-   r   )rw   s   &rF   Úisspmatrix_diar  Ý  s   € ô. �aœÓ$Ð$rS   c                   ó   € ] tR tRtRtRtR# )r   iø  aH  
Sparse array with DIAgonal storage.

This can be instantiated in several ways:
    dia_array(D)
        where D is a 2-D ndarray

    dia_array(S)
        with another sparse array or matrix S (equivalent to S.todia())

    dia_array((M, N), [dtype])
        to construct an empty array with shape (M, N),
        dtype is optional, defaulting to dtype='d'.

    dia_array((data, offsets), shape=(M, N))
        where the ``data[k,:]`` stores the diagonal entries for
        diagonal ``offsets[k]`` (See example below)

Attributes
----------
dtype : dtype
    Data type of the array
shape : 2-tuple
    Shape of the array
ndim : int
    Number of dimensions (this is always 2)
nnz
size
data
    DIA format data array of the array
offsets
    DIA format offset array of the array
T

Notes
-----

Sparse arrays can be used in arithmetic operations: they support
addition, subtraction, multiplication, division, and matrix power.
Sparse arrays with DIAgonal storage do not support slicing.

Examples
--------

>>> import numpy as np
>>> from scipy.sparse import dia_array
>>> dia_array((3, 4), dtype=np.int8).toarray()
array([[0, 0, 0, 0],
       [0, 0, 0, 0],
       [0, 0, 0, 0]], dtype=int8)

>>> data = np.array([[1, 2, 3, 4]]).repeat(3, axis=0)
>>> offsets = np.array([0, -1, 2])
>>> dia_array((data, offsets), shape=(4, 4)).toarray()
array([[1, 0, 3, 0],
       [1, 2, 0, 4],
       [0, 2, 3, 0],
       [0, 0, 3, 4]])

>>> from scipy.sparse import dia_array
>>> n = 10
>>> ex = np.ones(n)
>>> data = np.array([ex, 2 * ex, ex])
>>> offsets = np.array([-1, 0, 1])
>>> dia_array((data, offsets), shape=(n, n)).toarray()
array([[2., 1., 0., ..., 0., 0., 0.],
       [1., 2., 1., ..., 0., 0., 0.],
       [0., 1., 2., ..., 0., 0., 0.],
       ...,
       [0., 0., 0., ..., 2., 1., 0.],
       [0., 0., 0., ..., 1., 2., 1.],
       [0., 0., 0., ..., 0., 1., 2.]])
rr   N©ró   rô   rõ   rö   rø   rù   rr   rS   rF   r   r   ø  ó   † õHrS   c                   ó   € ] tR tRtRtRtR# )r   iD  a[  
Sparse matrix with DIAgonal storage.

This can be instantiated in several ways:
    dia_matrix(D)
        where D is a 2-D ndarray

    dia_matrix(S)
        with another sparse array or matrix S (equivalent to S.todia())

    dia_matrix((M, N), [dtype])
        to construct an empty matrix with shape (M, N),
        dtype is optional, defaulting to dtype='d'.

    dia_matrix((data, offsets), shape=(M, N))
        where the ``data[k,:]`` stores the diagonal entries for
        diagonal ``offsets[k]`` (See example below)

Attributes
----------
dtype : dtype
    Data type of the matrix
shape : 2-tuple
    Shape of the matrix
ndim : int
    Number of dimensions (this is always 2)
nnz
size
data
    DIA format data array of the matrix
offsets
    DIA format offset array of the matrix
T

Notes
-----

Sparse matrices can be used in arithmetic operations: they support
addition, subtraction, multiplication, division, and matrix power.
Sparse matrices with DIAgonal storage do not support slicing.

Examples
--------

>>> import numpy as np
>>> from scipy.sparse import dia_matrix
>>> dia_matrix((3, 4), dtype=np.int8).toarray()
array([[0, 0, 0, 0],
       [0, 0, 0, 0],
       [0, 0, 0, 0]], dtype=int8)

>>> data = np.array([[1, 2, 3, 4]]).repeat(3, axis=0)
>>> offsets = np.array([0, -1, 2])
>>> dia_matrix((data, offsets), shape=(4, 4)).toarray()
array([[1, 0, 3, 0],
       [1, 2, 0, 4],
       [0, 2, 3, 0],
       [0, 0, 3, 4]])

>>> from scipy.sparse import dia_matrix
>>> n = 10
>>> ex = np.ones(n)
>>> data = np.array([ex, 2 * ex, ex])
>>> offsets = np.array([-1, 0, 1])
>>> dia_matrix((data, offsets), shape=(n, n)).toarray()
array([[2., 1., 0., ..., 0., 0., 0.],
       [1., 2., 1., ..., 0., 0., 0.],
       [0., 1., 2., ..., 0., 0., 0.],
       ...,
       [0., 0., 0., ..., 2., 1., 0.],
       [0., 0., 0., ..., 1., 2., 1.],
       [0., 0., 0., ..., 0., 1., 2.]])
rr   Nr  rr   rS   rF   r   r   D  r  rS   )r   r   r  )$rø   Ú__docformat__Ú__all__Únumpyr/   Ú
_lib._utilr   r   Ú_matrixr   Ú_baser   r   r	   r
   Ú_datar   Ú_sputilsr   r   r   r   r   r   r   r   Ú_sparsetoolsr   r   r   r   r   r…   r  r   r   rr   rS   rF   Ú<module>r     sv   ðÙ à%€â
7€ã ç 5Ý ß 7Ó 7Ý ÷÷ ó ÷ IÓ Hô,�ô ,òDò%ô6I�	˜7ô IôXI�˜9ö IrS   