+
    LV-j% ã                   ób  € R t Rt. ROt^ RIt^ RIHt ^ RI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 ^R	IHtHtHtHt ^R
IHt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( ^RI)H*t*H+t+ ^ RI,t, ! R R]]4      t-R t.R t/R t0R t1R t2R t3RR lt4R t5 ! R R]-]4      t6 ! R R]]-4      t7R# )z1A sparse matrix in COOrdinate or 'triplet' formatzrestructuredtext enÚ	coo_arrayÚ
coo_matrixN)Úwarn)Úcopy_if_needed)Úspmatrix)Ú	coo_tocsrÚcoo_todenseÚcoo_todense_ndÚ
coo_matvecÚcoo_matvec_ndÚcoo_matmat_denseÚcoo_matmat_dense_nd)ÚissparseÚSparseEfficiencyWarningÚ_spbaseÚsparray)Ú_data_matrixÚ_minmax_mixin)Úupcast_charÚ	to_nativeÚisshapeÚgetdtypeÚgetdataÚdowncast_intp_indexÚget_index_dtypeÚcheck_shapeÚcheck_reshape_kwargsÚisscalarlikeÚ	isintlikeÚisdense)Ú_validate_indicesÚ_broadcast_arraysc                   ó  a € ] tR t^t o Rt]! ^^A4      tR4RR/R llt]R 4       t	]	P                  R 4       t	]R 4       t]P                  R 4       tR	 t]P                  P                  ]n        R5R
 lt]P                  P                  ]n        R5R lt]P                   P                  ]n        R tR6R lt]P$                  P                  ]n        V 3R lR lt]P&                  P                  ]n        R7R lt]P(                  P                  ]n        R8R ltR8R ltR8R ltR8R lt]P0                  P                  ]n        R8R lt]P2                  P                  ]n        R8R lt]P4                  P                  ]n        R9R lt]P6                  P                  ]n        R tR:R ltR tR t R t!V 3R lR lt"R t#R  t$R! t%R" t&R# t'R$ t(R% t)R& t*R' t+R( t,R) t-R* t.R;R+ lt/R, t0R- t1R. t2R8R/ lt3R0 t4R1 t5R2 t6R3t7V t8R# )<Ú	_coo_baseÚcooNÚmaxprintc               ó`  aaa€ \         P                  ! WVR 7       S'       g   \        o\        V\        4      '       Ed   \        WP                  R7      '       dç   \        WP                  R7      V n        V P                  \        V P                  4      R7      o\        V\        R7      p\        ;QJ d3    . V3R l\        \        V P                  4      4       4       F  NK  	  5M,! V3R l\        \        V P                  4      4       4       4      V n        \         P"                  ! . VR7      V n        RV n        EM× Vw  rxTfr   \,        ;QJ d    R	 T 4       F  '       g   K   RM	  R
M! R	 T 4       4      '       d   \+        R4      h\        ;QJ d    . R T 4       F  NK  	  5M! R T 4       4      p\        Y P                  R7      T n        T P                  T\        T P.                  4      RR7      o\        ;QJ d    . TT3R lT 4       F  NK  	  5M! TT3R lT 4       4      T n        \1        TSTR7      T n        R
T n        EMÆ\3        V4      '       EdQ   VP4                  V P4                  8X  d°   S'       d¨   \        ;QJ d    . R VP                   4       F  NK  	  5M! R VP                   4       4      V n        VP$                  P7                  \        W14      4      V n        \        VP.                  V P                  R7      V n        VP&                  V n        EMêVP9                  SR7      p
\	        V
P                  4      V n        V
P$                  P7                  \        W:4      R
R7      V n        \        V
P.                  V P                  R7      V n        R
V n        EMd\         P:                  ! V4      p\        V \<        4      '       gA   \         P>                  ! V4      pVP@                  ^8w  d   \)        RVP@                   R24      h\        VP.                  V P                  R7      V n        VeC   \        W P                  R7      V P                  8w  d   RV RV P                   2p\+        V4      hV P                  \        V P                  4      R7      oVPC                  4       p\        ;QJ d    . V3R lV 4       F  NK  	  5M! V3R lV 4       4      V n        \1        W¸,          SVR7      V n        RV n        \        V P                  4      ^8”  dF   \        ;QJ d    . R V P                   4       F  NK  	  5M! R V P                   4       4      V n        V PE                  4        R#   \(        \*        3 d   p	\)        R4      T	hRp	?	ii ; i))r%   ©Úallow_nd©Úmaxval)Údefaultc              3   óT   <"  € T F  p\         P                  ! . SR 7      x € K  	  R# 5i©©ÚdtypeN©ÚnpÚarray)Ú.0Ú_Ú	idx_dtypes   & €Úb/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/scipy/sparse/_coo.pyÚ	<genexpr>Ú%_coo_base.__init__.<locals>.<genexpr>*   s'   øé € ð $GÙ.E¨ô %'§H¢H¨R°y×$AÑ$AÛ.Eùó   ƒ%(r.   Tzinvalid input formatNc              3   ó>   "  € T F  p\        V4      ^ 8H  x € K  	  R# 5i)é    N©Úlen©r3   Úidxs   & r6   r7   r8   5   s   é € Ð;±F¨Sœ3˜s›8 qž=³Fùó   ‚Fz4cannot infer dimensions from zero sized index arraysc              3   ó„   "  € T F6  p\         P                  ! \        P                  ! V4      4      ^,           x € K8  	  R# 5i©é   N)ÚoperatorÚindexr1   Úmaxr>   s   & r6   r7   r8   8   s0   é € ð "5Ù-3 cô #+§.¢.´·²¸³Ó"=À×"AÒ"AÛ-3ùs   ‚>A )r*   Úcheck_contentsc              3   óV   <"  € T F  p\         P                  ! VSSR 7      x € K   	  R# 5i)©Úcopyr/   Nr0   )r3   r?   rJ   r5   s   & €€r6   r7   r8   >   s(   øé € ð $8Ù06¨ô %'§H¢H¨S°tÀ9×$MÑ$MÛ06ùs   ƒ&)rI   c              3   ó@   "  € T F  qP                  4       x € K  	  R # 5i©N©rJ   r>   s   & r6   r7   r8   E   s   é € Ð'J¹k°s¯©¯
¨
»kùó   ‚rM   z!expected 2D array or matrix, not ÚDzinconsistent shapes: z != c              3   óJ   <"  € T F  pVP                  SR R7      x € K  	  R# 5i©FrM   N)Úastype)r3   r?   Úindex_dtypes   & €r6   r7   r8   _   s(   øé € ð $8Ù06¨ð %(§J¡J¨{À J×$GÐ$GÛ06ùó   ƒ #c              3   ób   "  € T F%  qP                  \        P                  R R7      x € K'  	  R# 5irQ   )rR   r1   Úint64r>   s   & r6   r7   r8   e   s"   é € ÐXÉKÀS§
¡
¬2¯8©8¸% 
× @Ð @ËKùs   ‚-/)#r   Ú__init__r   Ú
isinstanceÚtupler   Ú	_allow_ndr   Ú_shapeÚ_get_index_dtyperF   r   ÚfloatÚranger=   Úcoordsr1   r2   ÚdataÚhas_canonical_formatÚ	TypeErrorÚ
ValueErrorÚanyÚshaper   r   ÚformatrR   ÚtocooÚasarrayr   Ú
atleast_2dÚndimÚnonzeroÚ_check)ÚselfÚarg1re   r/   rJ   r%   Ú
data_dtypeÚobjr_   Úer$   ÚMÚmessager5   rS   s   &&&&f$       @@r6   rW   Ú_coo_base.__init__    s  ú€ Ü×Ò˜d°8Õ<ßÜ!ˆDä�dœE×"Ó"Ü�t§n¡n×5Ó5Ü)¨$¿¹ÔH�”Ø ×1Ñ1¼¸T¿[¹[Ó9IÐ1ÓJ�	Ü% e´UÔ;�
ß#œeô $GÜ.3´C¸¿¹Ó4DÔ.Eó$GŸe™eô $GÜ.3´C¸¿¹Ó4DÔ.Eó$Gó G�”äŸHšH R¨zÔ:�”	Ø,0�Ö)ðCØ"&‘K�Cð ’=ß“sÑ;±FÓ;—s—s’sÑ;±FÓ;×;Ò;Ü(ð *>ó ?ð ?ç!œEñ "5Ù-3ó"5ŸE™Eñ "5Ù-3ó"5ó 5�Eä)¨%¿.¹.ÔI�”Ø ×1Ñ1°&Ü9<¸T¿Z¹Z»ØAEð 2ó G�	÷ $œeõ $8Ù06ó$8Ÿe™eõ $8Ù06ó$8ó 8�”ä# C¨d¸%Ô@�”	Ø,1�Ö)ä˜�~‹~Ø—;‘; $§+¡+Ô-·$ß"'¤%Ñ'J¸d¿kºkÓ'J§%¡%Ñ'J¸d¿kºkÓ'JÓ"J�D”KØ $§	¡	× 0Ñ 0´¸%Ó1FÓ G�D”IÜ"-¨d¯j©jÀ4Ç>Á>Ô"R�D”KØ04×0IÑ0I�DÖ-àŸ*™*¨$˜*Ó/�CÜ"'¨¯
©
Ó"3�D”KØ #§¡§¡´¸Ó0DÈ5 Ó Q�D”IÜ"-¨c¯i©iÀ$Ç.Á.Ô"Q�D”KØ05�DÖ-ô —J’J˜tÓ$�Ü! $¬×0Ò0ÜŸš aÓ(�AØ—v‘v ”{Ü'Ð*KÈAÏFÉFÈ8ÐSTÐ(UÓVÐVä)¨!¯'©'¸D¿N¹NÔK�”ØÒ$Ü" 5·>±>ÔBÀdÇkÁkÔQØ$9¸%¸ÀÀTÇ[Á[ÀMÐ"R˜Ü(¨Ó1Ð1à"×3Ñ3¼3¸t¿{¹{Ó;KÐ3ÓL�ØŸ™›�ß#œeô $8Ù06ó$8Ÿe™eô $8Ù06ó$8ó 8�”ä# A¥I°DÀÔF�”	Ø,0�Ô)äˆt�{‰{Ó˜aÔßœ%ÑXÈDÏKÊKÓXŸ%™%ÑXÈDÏKÊKÓXÓXˆDŒKà�‰Žøôm "¤:Ð.ô CÜ#Ð$:Ó;ÀÐBûðCús   ÅV ÖV-ÖV(Ö(V-c                ó²   € V P                   ^8”  d   V P                  R,          # \        P                  ! V P                  4      pVP                  RR7       V# )rC   F)Úwriteéþÿÿÿ)rj   r_   r1   Ú
zeros_likeÚcolÚsetflags)rm   Úresults   & r6   ÚrowÚ_coo_base.rowi   s@   € à�9‰9�qŒ=Ø—;‘;˜r•?Ð"Ü—’˜tŸx™xÓ(ˆØ�‰˜eˆÔ$Øˆó    c                ó  € V P                   ^8  d   \        R4      h\        P                  ! WP                  R,          P
                  R7      pV P                  RR V3,           V P                  RR ,           V n        R# )é   z8cannot set row attribute of a 1-dimensional sparse arrayr.   Nrw   éÿÿÿÿ)rj   rc   r1   rh   r_   r/   )rm   Únew_rows   &&r6   r|   r}   r   s^   € à�9‰9�qŒ=ÜÐWÓXÐXÜ—*’*˜W¯K©K¸­O×,AÑ,AÔBˆØ—k‘k # 2Ð&¨'¨Õ3°d·k±kÀ"À#Ð6FÕFˆŽr~   c                ó(   € V P                   R,          # )rC   r�   ©r_   )rm   s   &r6   ry   Ú_coo_base.coly   s   € à�{‰{˜2�Ðr~   c                ó¢   € \         P                  ! WP                  R,          P                  R7      pV P                  RR V3,           V n        R# )rC   r.   Nr�   )r1   rh   r_   r/   )rm   Únew_cols   &&r6   ry   r…   }   s7   € ä—*’*˜W¯K©K¸­O×,AÑ,AÔBˆØ—k‘k # 2Ð&¨'¨Õ3ˆŽr~   c                óî  a	€ \        WP                  V P                  R 7      p\        V4      w  rEW0P                  8X  d   V'       d   V P	                  4       # V # \        V P                  V P                  VR7      p\        V4      ^8X  d8   VR8X  d   \        Wc^,          4      pM5\        Wc^ ,          4      RRR1,          pM\        P                  ! WcVR7      pV P                  V P                  \        V4      R7      o	\        ;QJ d    . V	3R lV 4       F  NK  	  5M! V	3R lV 4       4      pV'       d   V P                  P	                  4       pMV P                  pV P                  W‡3VRR7      # )	r'   ©ÚorderÚCNr)   c              3   óT   <"  € T F  p\         P                  ! VSR 7      x € K  	  R# 5ir-   ©r1   rh   )r3   Úcor5   s   & €r6   r7   Ú$_coo_base.reshape.<locals>.<genexpr>š   s   øé € ÐPÁZ¸rœ2Ÿ:š: b°	×:Ñ:ÃZùr9   F©re   rJ   r�   )r   re   rZ   r   rJ   Ú_ravel_coordsr_   r=   Údivmodr1   Úunravel_indexr\   rF   rY   r`   Ú	__class__)
rm   ÚargsÚkwargsre   rŠ   rJ   Úflat_coordsÚ
new_coordsÚnew_datar5   s
   &*,      @r6   ÚreshapeÚ_coo_base.reshape‚   s  ø€ Ü˜D§*¡*°t·~±~ÔFˆÜ*¨6Ó2‰ˆð —J‘JÔßØ—y‘y“{Ð"à�ô
 $ D§K¡K°·±À5ÔIˆÜˆu‹:˜Œ?Ø˜Œ|Ü# K°qµÓ:‘
ä# K°qµÓ:¹4¸R¸4Õ@‘
ä×)Ò)¨+ÀEÔJˆJà×)Ñ)¨$¯+©+¼cÀ%»jÐ)ÓIˆ	ß”UÔPÁZÓP—U‘UÔPÁZÓPÓPˆ
÷ Ø—y‘y—~‘~Ó'‰Hà—y‘yˆHà�~‰~˜xÐ4¸EÈˆ~ÓNÐNr~   c                ó.  a€ Ve   V^ 8X  Ed   V P                   ^8X  dô   \        V P                  4      o\        ;QJ d)    V3R lV P                   4       F  '       g   K   RM	  RM! V3R lV P                   4       4      '       d   \        R4      hV P                  P                   ^8w  gO   \        ;QJ d&    R V P                   4       F  '       g   K   RM	  RM! R V P                   4       4      '       d   \        R4      h\        S4      # V^ 8  d   WP                   ,          pWP                   8¼  d   \        R4      h\        P                  ! \        V P                  ^V,
          ,          4      V P                  ^V,
          ,          R7      # )	Nc              3   ó@   <"  € T F  p\        V4      S8g  x € K  	  R # 5irL   r<   )r3   r?   Únnzs   & €r6   r7   Ú$_coo_base._getnnz.<locals>.<genexpr>ª   s   øé € Ð:©k s”3�s“8˜s–?«kùs   ƒTFz3all index and data arrays must have the same lengthc              3   ó>   "  € T F  qP                   ^8g  x € K  	  R# 5irB   )rj   r>   s   & r6   r7   rŸ   ®   s   é € Ð)OÁ;¸C¯(©(°a®-Ã;ùr@   z'coordinates and data arrays must be 1-Dúaxis out of bounds©Ú	minlength)rj   r=   r`   rd   r_   rc   Úintr1   Úbincountr   re   )rm   Úaxisrž   s   &&@r6   Ú_getnnzÚ_coo_base._getnnz§   s  ø€ ØŠ<˜D A�I¨$¯)©)°q¬.Ü�d—i‘i“.ˆCß‹sÔ:¨d¯kªkÓ:�s�sŠsÔ:¨d¯kªkÓ:×:Ò:Ü ð "/ó 0ð 0ð �y‰y�~‰~ Ô"§c£cÑ)OÀ4Ç;Â;Ó)O§c§c¢cÑ)OÀ4Ç;Â;Ó)O×&OÒ&OÜ Ð!JÓKÐKä�s“8ˆOà�!Œ8Ø—I‘IÕˆDØ—9‘9ÔÜÐ1Ó2Ð2ä�{Š{Ô.¨t¯{©{¸1¸t½8Õ/DÓEØ%)§Z¡Z°°DµÕ%9ô;ð 	;r~   c                ó²  € V P                  4        Vf!   \        P                  ! V P                  4      # V^ 8  d   WP                  ,          pV^ 8  g   WP                  8¼  d   \        R4      hV P                  ^ 8g  pV P                  ^V,
          ,          V,          p\        P                  ! \        V4      V P                  ^V,
          ,          R7      # )Nr¡   r¢   )
Úsum_duplicatesr1   Úcount_nonzeror`   rj   rc   r_   r¥   r   re   )rm   r¦   ÚmaskÚcoords   &&  r6   r«   Ú_coo_base.count_nonzero½   s    € Ø×ÑÔØŠ<Ü×#Ò# D§I¡IÓ.Ð.à�!Œ8Ø—I‘IÕˆDØ�!Œ8�tŸy™yÔ(ÜÐ1Ó2Ð2Ø�y‰y˜A‰~ˆØ—‘˜A �HÕ% dÕ+ˆÜ�{Š{Ô.¨uÓ5ÀÇÁÈAÐPTÍHÕAUÔVÐVr~   c           
     ó  a€ V P                   \        V P                  4      8w  d/   \        R\        V P                  4       RV P                    24      h\	        V P                  4       FJ  w  rVP
                  P                  R8w  g   K"  \        RV RVP
                  P                   R2^R7       KL  	  V P                  V P                  \        V P                  4      R7      o\        ;QJ d!    . V3R	 lV P                   4       F  NK  	  5M! V3R	 lV P                   4       4      V n        \        V P                  4      V n        V P                  ^ 8”  d®   \	        V P                  4       F’  w  rVP                  4       V P                  V,          8¼  d4   \        R
V RVP                  4        RV P                  V,           24      hVP!                  4       ^ 8  g   Ku  \        RV RVP!                  4        24      h	  R# R# )z&Checks data structure for consistency z2mismatching number of index arrays for shape; got z, expected Úizindex array z has non-integer dtype (Ú)©Ú
stacklevelr)   c              3   óT   <"  € T F  p\         P                  ! VSR 7      x € K  	  R# 5ir-   r�   )r3   r?   r5   s   & €r6   r7   Ú#_coo_base._check.<locals>.<genexpr>Ù   s&   øé € ð 5Ù(3 ô ŸJšJ s°)×<Ñ<Û(3ùr9   zaxis z index z exceeds matrix dimension znegative axis z index: N)rj   r=   r_   rc   Ú	enumerater/   Úkindr   Únamer\   rF   re   rY   r   r`   rž   Úmin)rm   r°   r?   r5   s   &  @r6   rl   Ú_coo_base._checkÌ   sŸ  ø€ à�9‰9œ˜DŸK™KÓ(Ô(Üð $Ü$'¨¯©Ó$4Ð#5°[ÀÇÁÀðMó Nð Nô   §¡Ö,‰FˆAØ�y‰y�~‰~ Ö$Ü�| A 3Ð&>¸s¿y¹y¿~¹~Ð>NÈaÐPØ !÷#ñ -ð
 ×)Ñ)¨$¯+©+¼cÀ$Ç*Á*»oÐ)ÓNˆ	ß”eô 5Ø(,¯ªó5—e‘eô 5Ø(,¯ªó5ó 5ˆŒä˜dŸi™iÓ(ˆŒ	à�8‰8�aŒ<Ü# D§K¡KÖ0‘�Ø—7‘7“9 §
¡
¨1¥Ô-Ü$ u¨Q¨C¨w°s·w±w³y°kð B9Ø9=¿¹ÀA½¸ð&Ió Jð Jà—7‘7“9˜q–=Ü$ ~°a°S¸ÀÇÁÃÀÐ%LÓMÐMó 1ñ r~   c                ón  a € Vf!   \        S P                  4      R R R1,          pMŽ\        S \        4      '       dg   \	        VR4      '       d   \        V4      S P                  8w  d   \        R4      h\        \        V4      4      S P                  8w  d   \        R4      hMVR	8w  d   \        R4      h\        ;QJ d    . V 3R lV 4       F  NK  	  5M! V 3R lV 4       4      p\        ;QJ d    . V 3R lV 4       F  NK  	  5M! V 3R lV 4       4      pS P                  S P                  V3W2R7      # )
NÚ__len__z"axes don't match matrix dimensionszrepeated axis in transposezoSparse matrices do not support an 'axes' parameter because swapping dimensions is the only logical permutation.c              3   óJ   <"  € T F  pSP                   V,          x € K  	  R # 5irL   )r[   ©r3   r°   rm   s   & €r6   r7   Ú&_coo_base.transpose.<locals>.<genexpr>ò   s   øé € Ð<±t°!˜tŸ{™{¨1Ÿ~š~³tùrT   c              3   óJ   <"  € T F  pSP                   V,          x € K  	  R # 5irL   r„   r¾   s   & €r6   r7   r¿   ó   s   øé € Ð=¹°1 §¡¨A§¢»ùrT   r�   r�   )rC   r;   )r^   rj   rX   r   Úhasattrr=   rc   ÚsetrY   r”   r`   )rm   ÚaxesrJ   Úpermuted_shapeÚpermuted_coordss   f&&  r6   Ú	transposeÚ_coo_base.transposeå   sô   ø€ ØŠ<Ü˜Ÿ™Ó#¡D b DÕ)‰DÜ˜œg×&Ò&Ü˜4 ×+Ò+¬s°4«y¸D¿I¹IÔ/EÜ Ð!EÓFÐFÜ”3�t“9‹~ §¡Ô*Ü Ð!=Ó>Ð>ð +à�VŒ^Üð 9ó :ð :÷ œÔ<±tÓ<Ÿ™Ô<±tÓ<Ó<ˆßœ%Ô=¹Ó=Ÿ%™%Ô=¹Ó=Ó=ˆØ�~‰~˜tŸy™y¨/Ð:Ø$2ð ó ?ð 	?r~   c                ó   <€ V ^8„  d   QhRR/# ©r€   ÚreturnN© )rf   Ú__classdict__s   "€r6   Ú__annotate__Ú_coo_base.__annotate__ù   s   ø€ ÷ $ñ $ ñ $r~   c                ó‚  a	€ \        WP                  R 7      pV P                  ^8”  d   \        R4      h\	        V4      ^8”  d   \        R4      h\	        V4      V P                  8”  dr   \        V P                  V P                  4      p\        P                  ! V4      p\        P                  ! VRV V4      V n        V P                  RV V n        Wn        R# \	        V4      V P                  8  dš   V P                  R\	        V4      ^,
           R,           R	V P                  \	        V4      ,
          ,          ,           pV P                  V4      pVP                  R\	        V4       V n        VP                  R\	        V4       V n        \        ;QJ d0    R \!        V P                  V4       4       F  '       g   K   RM%	  RM!! R \!        V P                  V4       4       4      pV'       dÃ   \        P"                  P%                  \!        V P                  V4       UUu. uF	  w  rxWx8  NK  	  upp4      o	S	P'                  4       '       gd   \(        ;QJ d!    . V	3R lV P                   4       F  NK  	  5M! V	3R lV P                   4       4      V n        V P                  S	,          V n        Wn        R# u uppi )
r'   zonly 1-D or 2-D input acceptedz!shape argument must be 1-D or 2-DNc              3   ó.   "  € T F  w  rW8„  x € K  	  R # 5irL   rË   )r3   ÚoldÚnews   &  r6   r7   Ú#_coo_base.resize.<locals>.<genexpr>  s   é € ÐMÑ6L©(¨#˜CžIÓ6Lùs   ‚TFc              3   ó4   <"  € T F  qS,          x € K  	  R # 5irL   rË   ©r3   r?   r¬   s   & €r6   r7   rÓ     s   øé € Ð#E¹°#¨§I¢I»ùó   ƒ)r�   ©rC   )r   rZ   rj   rc   r=   r‘   r_   re   ÚmathÚprodr1   r“   r`   r[   rš   rd   ÚzipÚlogical_andÚreduceÚallrY   )
rm   re   r—   Úmax_sizeÚ	tmp_shapeÚtmpÚis_truncatingr?   Úsizer¬   s
   &*       @r6   ÚresizeÚ_coo_base.resizeù   sõ  ø€ Ü˜E¯N©NÔ;ˆØ�9‰9�qŒ=ÜÐ=Ó>Ð>Üˆu‹:˜Œ>ÜÐ@ÓAÐAäˆu‹:˜Ÿ	™	Ô!Ü'¨¯©°T·Z±ZÓ@ˆKÜ—y’y Ó'ˆHÜ×*Ò*¨;°y¸Ð+AÀ5ÓIˆDŒKØŸ	™	 ) 8Ð,ˆDŒIØŒKÙô ˆu‹:˜Ÿ	™	Ô!à—‘˜OœS ›Z¨!�^Ð,Øõà˜$Ÿ)™)¤c¨%£jÕ0Õ1õ2ð ð
 —,‘,˜yÓ)ˆCØŸ*™* [¤c¨%£jÐ1ˆDŒKØŸ)™) K¤S¨£ZÐ0ˆDŒK÷ ›ÑM´c¸$¿*¹*ÀeÔ6LÓMŸŸšÑM´c¸$¿*¹*ÀeÔ6LÓMÓMˆßÜ—>‘>×(Ñ(Ü,/°·±¸UÔ,Cô*Ù,C™y˜s�”
Ñ,Cò*ó ˆDð —8‘8—:’:ß#œeÔ#E¸¿ºÓ#EŸe™eÔ#E¸¿ºÓ#EÓE�”Ø ŸI™I d�O�”	àŽùó*s   È#J;
c                óŽ  € V P                  W4      p\        VP                  P                  4      pV'       g(   VP                  P                  '       g   \        R 4      hV P                  ^8X  dg   \        \        P                  ! ^.4      V P                  V P                  V P                  ^ ,          V P                  VP                  R4      V4       EMUV P                  ^8X  dX   V P                  w  rV\        WVV P                  V P                   V P"                  V P                  VP                  R4      V4       MíV'       d:   \        P$                  ! ^\        P&                  ! V P                  RR 4      4      pMP\        P$                  ! \        P&                  ! V P                  R,          RRR1,          4      RRR1,          ^4      p\        P(                  ! V P                  4      p\        WpP                  V P                  W€P                  VP                  R4      V4       VP+                  V P                  4      # )z&Output array must be C or F contiguousÚANºrC   NNr�   )Ú_process_toarray_argsr¤   ÚflagsÚf_contiguousÚc_contiguousrc   rj   r	   r1   r2   rž   r_   r`   Úravelre   r   r|   ry   ÚappendÚcumprodÚconcatenaterš   )	rm   rŠ   ÚoutÚBÚfortranrr   ÚNÚstridesr_   s	   &&&      r6   ÚtoarrayÚ_coo_base.toarray!  s~  € Ø×&Ñ& uÓ2ˆÜ�a—g‘g×*Ñ*Ó+ˆß˜qŸw™w×3×3Ð3ÜÐEÓFÐFð �9‰9˜Œ>Üœ2Ÿ8š8 Q C›=¨$¯(©(°D·I±IØŸ;™; q�>¨4¯9©9°a·g±g¸c³lÀGöMà�Y‰Y˜!Œ^Ø—:‘:‰DˆAÜ˜˜dŸh™h¨¯©°$·(±(¸D¿I¹IØŸ™ › gõ/÷ ÜŸ)š) A¤r§z¢z°$·*±*¸S¸b°/Ó'BÓC‘äŸ)š)¤B§J¢J¨t¯z©z¸"­~¹dÀ¸dÕ/CÓ$DÁTÀrÀTÕ$JÈAÓN�Ü—^’^ D§K¡KÓ0ˆFÜ˜7§H¡H¨d¯i©iØ!§9¡9¨a¯g©g°c«l¸GôEð �y‰y˜Ÿ™Ó$Ð$r~   c                ó€  € V P                   ^8w  d   \        RV P                    R24      hV P                  ^ 8X  d(   V P                  V P                  V P
                  R7      # ^RIHp V P                  VP                  4      w  r4rVV P                  WTV3VR7      pV P                  '       g   VP                  4        V# )aÙ  Convert this array/matrix to Compressed Sparse Column format

Duplicate entries will be summed together.

Examples
--------
>>> from numpy import array
>>> from scipy.sparse import coo_array
>>> row  = array([0, 0, 1, 3, 1, 0, 0])
>>> col  = array([0, 2, 1, 3, 1, 0, 0])
>>> data = array([1, 1, 1, 1, 1, 1, 1])
>>> A = coo_array((data, (row, col)), shape=(4, 4)).tocsc()
>>> A.toarray()
array([[3, 0, 1, 0],
       [0, 2, 0, 0],
       [0, 0, 0, 0],
       [0, 0, 0, 1]])

z+Cannot convert. CSC format must be 2D. Got rO   r.   )Ú	csc_array©re   )rj   rc   rž   Ú_csc_containerre   r/   Ú_cscrø   Ú_coo_to_compressedÚ_swapra   rª   )rm   rJ   rø   ÚindptrÚindicesr`   re   Úxs   &&      r6   ÚtocscÚ_coo_base.tocsc<  s¥   € ð( �9‰9˜Œ>ÜÐJÈ4Ï9É9È+ÐUVÐWÓXÐXØ�8‰8�qŒ=Ø×&Ñ& t§z¡z¸¿¹Ð&ÓDÐDå'Ø+/×+BÑ+BÀ9Ç?Á?Ó+SÑ(ˆF˜Tà×#Ñ# T°FÐ$;À5Ð#ÓIˆAØ×,×,Ð,Ø× Ñ Ô"ØˆHr~   c                óœ  € V P                   ^8”  d   \        RV P                    R24      hV P                  ^ 8X  d(   V P                  V P                  V P
                  R7      # ^RIHp V P                  VP                  VR7      pVw  rErgV P                  WeV3V P                  R7      pV P                  '       g   VP                  4        V# )aÖ  Convert this array/matrix to Compressed Sparse Row format

Duplicate entries will be summed together.

Examples
--------
>>> from numpy import array
>>> from scipy.sparse import coo_array
>>> row  = array([0, 0, 1, 3, 1, 0, 0])
>>> col  = array([0, 2, 1, 3, 1, 0, 0])
>>> data = array([1, 1, 1, 1, 1, 1, 1])
>>> A = coo_array((data, (row, col)), shape=(4, 4)).tocsr()
>>> A.toarray()
array([[3, 0, 1, 0],
       [0, 2, 0, 0],
       [0, 0, 0, 0],
       [0, 0, 0, 1]])

z*Cannot convert. CSR must be 1D or 2D. Got rO   r.   )Ú	csr_arrayrM   rù   )rj   rc   rž   Ú_csr_containerre   r/   Ú_csrr  rü   rý   ra   rª   )	rm   rJ   r  Úarraysrþ   rÿ   r`   re   r   s	   &&       r6   ÚtocsrÚ_coo_base.tocsr]  s³   € ð( �9‰9�qŒ=ÜÐIÈ$Ï)É)ÈÐTUÐVÓWÐWØ�8‰8�qŒ=Ø×&Ñ& t§z¡z¸¿¹Ð&ÓDÐDå'Ø×,Ñ,¨Y¯_©_À4Ð,ÓHˆFØ+1Ñ(ˆF˜Tà×#Ñ# T°FÐ$;À4Ç:Á:Ð#ÓNˆAØ×,×,Ð,Ø× Ñ Ô"ØˆHr~   c                ó„  € V! V P                   4      w  r4V P                  V P                  \        V P                  V4      R7      pV P
                  ^8X  dž   V'       d"   V P                  ^ ,          P                  4       MV P                  ^ ,          p\        V4      p\        P                  ! ^ V.VR7      pV'       d   V P                  P                  4       MV P                  p	W†W�P                  3# V! V P                  4      w  r«\        V
4      pV
P                  VRR7      p
VP                  VRR7      p\        P                  ! V^,           VR7      p\        P                  ! WµR7      p\        P                  ! V P                  V P                  R7      p	\!        W4WzW°P                  W†V	4	       W†W�P                  3# )z?convert (shape, coords, data) to (indptr, indices, data, shape)r)   r.   FrM   )Ú_shape_as_2dr\   r_   rF   rž   rj   rJ   r=   r1   r2   r`   re   rR   ÚemptyÚ
empty_liker/   r   )rm   ÚswaprJ   rr   ró   r5   rÿ   rž   rþ   r`   ÚmajorÚminors   &&&         r6   rü   Ú_coo_base._coo_to_compressed  sG  € á�D×%Ñ%Ó&‰ˆð ×)Ñ)¨$¯+©+¼cÀ$Ç(Á(ÈAÓ>NÐ)ÓOˆ	à�9‰9˜Œ>ß/3�d—k‘k !•n×)Ñ)Ô+¸¿¹ÀQ½ˆGÜ�g“,ˆCÜ—X’X˜q #˜h¨iÔ8ˆFß'+�4—9‘9—>‘>Ô#°·±ˆDØ D¯*©*Ð4Ð4ñ ˜DŸK™KÓ(‰ˆÜ�%‹jˆØ—‘˜Y¨U�Ó3ˆØ—‘˜Y¨U�Ó3ˆä—’˜!˜a�% yÔ1ˆÜ—-’- Ô7ˆÜ�}Š}˜TŸY™Y¨d¯j©jÔ9ˆä�!˜ E¯9©9°fÀtÔLØ §j¡jÐ0Ð0r~   c                ó6   € V'       d   V P                  4       # V # rL   rM   )rm   rJ   s   &&r6   rg   Ú_coo_base.tocooš  s   € ßØ—9‘9“;ÐàˆKr~   c                óÆ  € V P                   ^8w  d   \        RV P                    R24      hV P                  4        V P                  V P                  ,
          p\
        P                  ! VRR7      w  r4\        V4      ^d8”  d    \        R\        V4       R2\        ^R7       V P                  P                  ^ 8X  d$   \
        P                  ! R
V P                  R7      pMf\
        P                  ! \        V4      V P                  P                  4       ^,           3V P                  R7      pV P                  WTV P                  3&   V P                  WS3V P                   R	7      # )r€   z+Cannot convert. DIA format must be 2D. Got rO   T)Úreturn_inversezConstructing a DIA matrix with z diagonals is inefficientr²   r.   rù   )r;   r;   )rj   rc   rª   ry   r|   r1   Úuniquer=   r   r   r`   râ   Úzerosr/   rF   Ú_dia_containerre   )rm   rJ   ÚksÚdiagsÚdiag_idxr`   s   &&    r6   ÚtodiaÚ_coo_base.todia¢  s  € Ø�9‰9˜Œ>ÜÐJÈ4Ï9É9È+ÐUVÐWÓXÐXØ×ÑÔØ�X‰X˜Ÿ™Õ ˆÜŸ)š) B°tÔ<‰ˆäˆu‹:˜ÔäÐ2´3°u³:°,ð ?"ð "ä(°Qõ8ð
 �9‰9�>‰>˜QÔÜ—8’8˜F¨$¯*©*Ô5‰Dä—8’8œS ›Z¨¯©¯©«¸Õ)9Ð:À$Ç*Á*ÔMˆDØ'+§y¡yˆD˜4Ÿ8™8Ð#Ñ$à×"Ñ" D =¸¿
¹
Ð"ÓCÐCr~   c                ó~  € V P                   ^8”  d   \        RV P                    R24      hV P                  4        V P                  V P                  V P
                  R7      pV P                   ^8X  d   V P                  ^ ,          pM\        V P                  !  p\        \        W0P                  4      4      Vn
        V# )r€   z*Cannot convert. DOK must be 1D or 2D. Got rO   r.   )rj   rc   rª   Ú_dok_containerre   r/   r_   rÚ   Údictr`   Ú_dict)rm   rJ   Údokr_   s   &&  r6   ÚtodokÚ_coo_base.todokº  s�   € Ø�9‰9�qŒ=ÜÐIÈ$Ï)É)ÈÐTUÐVÓWÐWØ×ÑÔØ×!Ñ! $§*¡*°D·J±JÐ!Ó?ˆà�9‰9˜Œ>Ø—[‘[ •^‰Fä˜$Ÿ+™+Ñ&ˆFäœ˜V§Y¡YÓ/Ó0ˆŒ	Øˆ
r~   c           
     ó   a	€ V P                   ^8w  d   \        R4      hV P                  w  r#W) 8:  g   W8¼  d-   \        P                  ! ^ V P
                  P                  R7      # \        P                  ! \        V\        V^ 4      ,           V\        V^ 4      ,
          4      V P                  R7      pV P                  V,           V P                  8H  o	V P                  '       d(   V P                  S	,          pV P
                  S	,          pMm\        ;QJ d!    . V	3R lV P                   4       F  NK  	  5M! V	3R lV P                   4       4      pV P                  WpP
                  S	,          4      w  w  rXpWdV\        V^ 4      ,           &   V# )r€   z diagonal requires two dimensionsr.   c              3   ó4   <"  € T F  qS,          x € K  	  R # 5irL   rË   )r3   r?   Ú	diag_masks   & €r6   r7   Ú%_coo_base.diagonal.<locals>.<genexpr>Ø  s   øé € Ð?±;¨C˜YŸš³;ùrÖ   )rj   rc   re   r1   r  r`   r/   r  r¹   rF   r|   ry   ra   rY   r_   Ú_sum_duplicates)
rm   ÚkÚrowsÚcolsÚdiagr|   r`   Úindsr4   r'  s
   &&       @r6   ÚdiagonalÚ_coo_base.diagonalÊ  s  ø€ Ø�9‰9˜Œ>ÜÐ?Ó@Ð@Ø—Z‘Z‰
ˆØ�Œ:˜œÜ—8’8˜A T§Y¡Y§_¡_Ô5Ð5Ü�xŠxœ˜D¤3 q¨!£9Õ,¨d´S¸¸A³YÕ.>Ó?Ø"Ÿj™jô*ˆà—X‘X •\ d§h¡hÑ.ˆ	à×$×$Ð$Ø—(‘(˜9Õ%ˆCØ—9‘9˜YÕ'‰Dç”5Ô?°4·;²;Ó?—5‘5Ô?°4·;²;Ó?Ó?ˆDØ!×1Ñ1°$¿	¹	À)Õ8LÓM‰N‰HˆS�dØ $ˆS”3�q˜!“9�_Ñàˆr~   c                ó   € V P                   ^8w  d   \        R4      hV P                  w  r4VP                   '       d   \        V4      '       g   R# V P                  P
                  pV P                  V P                  ,
          V8g  pV^ 8  d—   \        W2,           V4      pVP                   '       d   \        V\        V4      4      p\        P                  ! W`P                  V8¬  4      p\        P                  ! V) V) V,           VR7      p	\        P                  ! WuR7      p
M’\        W4V,
          4      pVP                   '       d   \        V\        V4      4      p\        P                  ! W`P                  V8¬  4      p\        P                  ! WuR7      p	\        P                  ! W"V,           VR7      p
VP                   '       d   VRV pM%\        P                  ! WpP
                  R7      pWR&   \        P                  ! V P                  V,          V	34      \        P                  ! V P                  V,          V
34      3V n        \        P                  ! V P                  V,          V34      V n        RV n        R# )r€   z*setting a diagonal requires two dimensionsNr.   ºNNNF)rj   rc   re   r=   r|   r/   ry   r¹   r1   Ú
logical_orÚaranger  rï   r_   r`   ra   )rm   Úvaluesr*  rr   ró   r5   Ú	full_keepÚ	max_indexÚkeepr‚   r‡   r™   s   &&&         r6   Ú_setdiagÚ_coo_base._setdiagà  s¼  € Ø�9‰9˜Œ>ÜÐIÓJÐJØ�z‰z‰ˆØ�;�;ˆ;œs 6Ÿ{š{ÙØ—H‘H—N‘Nˆ	ð —H‘H˜tŸx™xÕ'¨1Ñ,ˆ	ØˆqŒ5Ü˜A�C ›ˆIØ�{�{ˆ{Ü 	¬3¨v«;Ó7�	Ü—=’= ¯H©H¸	Ñ,AÓBˆDÜ—i’i   Q B¨¥N¸)ÔDˆGÜ—i’i 	Ô;‰Gä˜A �s›ˆIØ�{�{ˆ{Ü 	¬3¨v«;Ó7�	Ü—=’= ¯H©H¸	Ñ,AÓBˆDÜ—i’i 	Ô;ˆGÜ—i’i  y¥=¸	ÔBˆGð �;�;ˆ;Ø˜j˜yÐ)‰Hä—x’x 	·±Ô<ˆHØ �Q‰Kô —~’~ t§x¡x°¥~°wÐ&?Ó@Ü—~’~ t§x¡x°¥~°wÐ&?Ó@ðBˆŒä—N’N D§I¡I¨d¥O°XÐ#>Ó?ˆŒ	Ø$)ˆÖ!r~   c                óþ   € V'       dB   \         ;QJ d    . R V P                   4       F  NK  	  5M! R V P                   4       4      pMV P                  pV P                  W3V P                  VP                  R7      # )z|Returns a matrix with the same sparsity structure as self,
but with different data. By default the index arrays are copied.
c              3   ó@   "  € T F  qP                  4       x € K  	  R # 5irL   rM   r>   s   & r6   r7   Ú'_coo_base._with_data.<locals>.<genexpr>  s   é € Ð=±¨#Ÿ8™8Ÿ:˜:³ùrN   ©re   r/   )rY   r_   r”   re   r/   )rm   r`   rJ   r_   s   &&& r6   Ú
_with_dataÚ_coo_base._with_data  sU   € ÷ ß”UÑ=°·²Ó=—U‘UÑ=°·²Ó=Ó=‰Fà—[‘[ˆFØ�~‰~˜t˜n°D·J±JÀdÇjÁjˆ~ÓQÐQr~   c                óž  € \        WP                  V P                  4      w  r#rE\        P                  ! \        V P                  4      \        P                  R 7      p. p. p. p	\        \        W P                  4      4       EF;  w  p
w  r¼\        V\        4      '       d   WlV8H  ,          pK,  \        V\        4      '       dØ   V\        R4      8X  d   VP                  V4       Ke  VP                  V P                  V
,          4      w  rÞpV^8w  dW   V^ 8  d   WÍ8*  WÎ8„  ,          pMWÍ8¬  WÎ8  ,          p\        P                   ! WÍ,
          V4      w  ppVV^ 8H  V,          ,          pMWÍ8¬  WÎ8  ,          pWÍ,
          pVV,          pVP                  V4       EK  VP                  V4       V	P                  V4       EK>  	  VR8X  d=   V P                  V,          P#                  4       P%                  V P&                  RR7      # V Uu. uF  qÌV,          NK  	  ppV P                  V,          pV	'       Ed>   \)        V	!  p	V	^ ,          P                  p\        P*                  ! V	4      P-                  \        V	4      ^R	4      p\        P*                  ! V Uu. uF  qÌV,          NK  	  up4      R
,          pVV8H  P/                  ^ R7      pVP1                  4       w  ppVV,          pV Uu. uF  qÌV,          NK  	  pp\3        \        P4                  ! VVR7      4      p\        V4      VR	,          V^ ,          ,
          ^,           8X  d!   V^ ,          pVRV V,           VVR ,           pM	VV,           pV'       d¬   V'       d   \        P6                  ! V^ ,          4      pM<\        P8                  ! \        V4      V P                  ^ ,          P&                  R 7      pVP;                  V^ ,          V4       VR,           F#  p
VP;                  V
VP=                  4       4       K%  	  \?        VV3W0P&                  R7      # u upi u upi u upi )r.   NFrM   ©r¦   rù   rç   r>  rË   r�   ©r2  r2  N) r    re   rf   r1   Úonesr=   r`   Úbool_r¶   rÚ   r_   rX   r¤   Úslicerí   rÿ   r’   ÚsumrR   r/   r!   r2   rš   rÝ   rk   Úlistr“   rx   r  ÚinsertrJ   r   )rm   ÚkeyrE   Ú	new_shapeÚarr_int_posÚnone_posÚ
index_maskÚslice_coordsÚ
arr_coordsÚarr_indicesr°   r?   rŽ   ÚstartÚstopÚstepÚin_rangeÚnew_ixÚmr˜   r™   Ú	arr_shapeÚkeyarrÚfoundÚarr_coÚarr_ixÚnew_arr_coordsÚposÚ
coord_likes   &&                           r6   Ú__getitem__Ú_coo_base.__getitem__  st  € Ü2CØ—‘˜TŸ[™[ó3
Ñ/ˆ˜+ô —W’WœS §¡›^´2·8±8Ô<ˆ
ØˆØˆ
ØˆÜ%¤c¨%·±Ó&=×>‰LˆA‰y�Ü˜#œs×#Ò#Ø S™yÕ)’
Ü˜C¤×'Ò'Øœ% ›+Ô%Ø ×'Ñ'¨Ö+à(+¯©°D·J±J¸qµMÓ(BÑ%�E Ø˜q”yØ !œ8Ø(*©¸¹	Õ'B™Hà(*©¸¹	Õ'B˜HÜ$&§I¢I¨b­j¸$Ó$?™	˜ Ø" q¨A¡v°Õ&9Õ9™
à$&¡K°B±IÕ#>˜Ø!#¥˜Ø" hÕ.˜
Ø ×'Ñ'¨×/à×!Ñ! "Ô%Ø×"Ñ" 3×'ñ- ?ð0 ˜Œ?Ø—9‘9˜ZÕ(×,Ñ,Ó.×5Ñ5°d·j±jÀuÐ5ÓMÐMá/;Ó<©|¨˜—n�n©|ˆ
Ð<Ø—9‘9˜ZÕ(ˆ÷ ˆ;Ü+¨[Ñ9ˆKØ# A�×,Ñ,ˆIô —X’X˜kÓ*×2Ñ2´3°{Ó3CÀQÈÓKˆFÜŸš¹JÓ"G¹J°b j§> >¹JÑ"GÓHÈÕTˆJØ˜zÑ)×.Ñ.°AÐ.Ó6ˆEØ"Ÿ]™]›_‰NˆF�FØ Õ'ˆHÙ/9Ó:©z¨˜VŸ*˜*©zˆJÐ:Ü!¤"×"2Ò"2°6ÀÔ"KÓLˆNô �;Ó ;¨r¥?°[Àµ^Õ#CÀaÕ#GÔGà! !•n�Ø'¨¨Ð-°Õ>ÀÈCÈDÐAQÕQ‘
ð ,¨jÕ8�
çßÜŸ]š]¨:°a­=Ó9‘
äŸXšX¤c¨(£m¸4¿;¹;Àq½>×;OÑ;OÔP�
Ø×Ñ˜h q�k¨:Ô6Ø˜b—\�\�Ø×!Ñ! ! Z§_¡_Ó%6Ö7ñ "ä˜( JÐ/°yÏ
É
ÔSÐSùò] =ùò, #Hùò ;s   ÈQ ÊQË+Q
c           	     ó~  € \        WP                  V P                  4      w  r4rVV'       d;   \        V4      pVR R R1,           F  pVP	                  V4       K  	  \        V4      pV'       dg   \        V4      pV Uu/ uF   p\        W8,          ;p	4      '       d   K  W‰bK"  	  p
p\        V
P                  4       !  p\        W«4       F	  w  r‰W“V&   K  	  \        V4      '       d-   ^ VP                  9   d   R # \        W$V P                  4      w  rÍMA\        P                  ! W P                  R7      pVP                  ^ 8X  d   R # \!        W$4      w  rÍV P#                  V4      w  rï\%        V4      ^8X  d(   \%        V^ ,          4      ^ 8X  d   WïuV n        V n        R # R pRpV'       dš   V F“  p\+        V\,        4      '       d   K  \        V4      '       d   K.  VP                  p\%        V4      VR,          V^ ,          ,
          ^,           8X  d   V^ ,          pM^ pVVV\%        V4      ,            p\/        VV4      p M	  ^ p/ p\1        V4       FE  w  ppVV8X  d   V\%        V4      ,          p\+        V\,        4      '       g   K7  VVV&   V^,          pKG  	  R .V P2                  ,          p\%        V4      p\1        V4       F­  w  pp\        V4      '       d   \        P4                  ! VV34      VV&   K4  \+        V\,        4      '       dJ   VP7                  V P                  V,          4      w  pppVVVV,          ,          V,          ,           VV&   K“  VP9                  4       X,          VV&   K¯  	  VP;                  4       p\        P<                  ! V4      p\        P>                  ! V^RR7      w  pp\        P@                  ! VVV,          .4      V n        \
        ;QJ d'    . R \        VVRV3,          4       4       F  NK  	  5M ! R \        VVRV3,          4       4       4      V n        RV n!        R # u upi )Nr.   T)r¦   Úreturn_indexc              3   óN   "  € T F  p\         P                  ! V4      x € K  	  R # 5irL   )r1   Úhstack)r3   Úcs   & r6   r7   Ú(_coo_base.__setitem__.<locals>.<genexpr>Ò  s   é € ÐVÑ2U¨QœBŸIšI aŸL˜LÓ2Uùs   ‚#%r2  Fr�   )"r    re   rf   rH  ÚpoprY   r   r!   r5  rÚ   r   Ú_get_sparse_data_and_coordsr/   r1   rh   râ   Ú_get_dense_data_and_coordsÚ
_zero_manyr=   r`   r_   rX   rF  r‘   r¶   rj   Úbroadcast_torÿ   rì   rJ   r2   r  re  ra   )rm   rJ  r   rE   rK  rL  rM  Újr°   ÚarrÚarr_posrQ  Úx_dataÚx_coordsÚold_dataÚ
old_coordsrX  r^  r?   Ú	x_arr_cooÚx_arr_coo_ravelÚx_axÚx_axesr˜   Únew_nnzrR  rS  rT  r™   r4   Úinds   &&&                            r6   Ú__setitem__Ú_coo_base.__setitem__e  sw  € ä2CØ—‘˜TŸ[™[ó3
Ñ/ˆ˜+÷ Ü˜Y›ˆIØ™d ˜d—^�^�Ø—‘˜aÖ ñ $ä˜iÓ(ˆI÷ Ü˜“KˆEÙ'2ÓU¡{ !¼)È5Í8ÀOÀC×:T”v�q’v¡{ˆGÐUÜ+¨W¯^©^Ó-=Ñ>ˆKÜ˜gÖ3‘�Ø�a“ñ 4ô �A�;Š;Ø�A—G‘GŒ|ÙÜ:¸1ÈÏÉÓTÑˆF�Hä—
’
˜1§J¡JÔ/ˆAØ�v‰v˜Œ{ÙÜ9¸!ÓGÑˆFð  $Ÿ™¨uÓ5Ñˆäˆx‹=˜AÔ¤# h¨q¥kÓ"2°aÔ"7Ø%-Ð"ˆDŒI�t”{áð ˆ	Øˆßó �Ü! #¤u×-Ô-´iÀ·n´nØ #§	¡	�Iô
 ˜;Ó'¨K¸­O¸kÈ!½nÕ,LÈqÕ,PÔQØ)¨!�n™à˜ð !)¨¨S´3°y³>Õ-AÐ B�Iä&3°I¸yÓ&I�OÙñ# ð( ˆØˆÜ Ö&‰FˆAˆsØ�CŒxØœ˜I›Õ&�Ü˜#œu×%Ô%Ø ��q‘	Ø˜•	’ñ 'ð �V˜dŸi™iÕ'ˆ
Ü�f“+ˆÜ Ö&‰FˆAˆsÜ˜�~Š~Ü!#§¢°°w°jÓ!A�
˜1‘ÙÜ˜C¤×'Ò'Ø$'§K¡K°·
±
¸1µÓ$>Ñ!��t˜TØ!&¨°&¸µ)Õ)<¸tÕ)CÕ!C�
˜1“à #§	¡	£¨OÕ <�
˜1“ñ 'ð —;‘;“=ˆô —X’X˜jÓ)ˆ
Ü—’˜:¨A¸DÔA‰ˆˆ3ô —I’I˜x¨°#­Ð7Ó8ˆŒ	ß”eÑV´#°jÀ*ÈQÐPSÈVÕBTÔ2UÓV—e‘eÑV´#°jÀ*ÈQÐPSÈVÕBTÔ2UÓVÓVˆŒØ$)ˆÖ!ùò{ Vs   Á=P:ÂP:c                óT  € \         P                  ! \        V P                  4      \         P                  R 7      p. p. p\        \        WP                  4      4       EF3  w  pw  rg\        V\        4      '       d   W'V8H  ,          pK,  \        V\        4      '       d§   V\        R4      8w  d—   VP                  V P                  V,          4      w  r‰p
V
^8w  dT   V
^ 8  d   Wx8*  Wy8„  ,          pMWx8¬  Wy8  ,          p\         P                  ! Wx,
          V
4      pW,^ 8H  V,          ,          pKÑ  Wx8¬  Wy8  ,          pW+,          pKè  \        V\        4      '       d   V\        R4      8X  d   EK  VP                  V4       VP                  V4       EK6  	  V'       dË   \         P                  ! V4      P!                  \        V4      ^R4      p\         P                  ! V Uu. uF  qwV,          NK  	  up4      R,          pWÓ8H  P#                  ^ R7      pVP%                  4       w  pp\         P&                  ! V4      pRVVP%                  4       ^ ,          V,          &   VV,          pV P                   Uu. uF  qwV( ,          NK  	  ppV P                  V( ,          pVV3# u upi u upi )r.   NrB  Tr�   rC  )r1   rD  r=   r`   rE  r¶   rÚ   r_   rX   r¤   rF  rÿ   re   Úmodrí   r2   rš   rÝ   rk   rx   )rm   rE   rN  rP  rQ  r°   r?   rŽ   rR  rS  rT  rU  rW  rY  rZ  Úarr_coor4   Úarr_index_maskÚpruned_coordsÚpruned_datas   &&                  r6   rk  Ú_coo_base._zero_manyÕ  s  € ô —7’7œ3˜tŸy™y›>´·±Ô:ˆ
Øˆ
ØˆÜ%¤c¨%·±Ó&=×>‰LˆA‰y�Ü˜#œs×#Ò#Ø S™yÕ)’
Ü˜C¤×'Ò'¨C´5¸³;Ô,>Ø$'§K¡K°·
±
¸1µÓ$>Ñ!�˜TØ˜1”9Ø˜a”xØ$&¡K°B±IÕ#>™à$&¡K°B±IÕ#>˜ÜŸš˜r�z¨4Ó0�AØ¨¡6¨XÕ"5Õ5’Jà "¡°±	Õ:�HØÕ*’JÜ˜C¤×'Ò'¨C´5¸³;Ô,>âà×!Ñ! "Ô%Ø×"Ñ" 3×'ñ) ?÷. Ü—X’X˜kÓ*×2Ñ2´3°{Ó3CÀQÈÓKˆFÜŸš¹JÓ"G¹J°b j§> >¹JÑ"GÓHÈÕTˆJØÑ)×.Ñ.°AÐ.Ó6ˆEØŸ™›‰JˆG�QÜŸ]š]¨:Ó6ˆNØ?CˆN˜:×-Ñ-Ó/°Õ2°7Õ;Ñ<Ø˜.Õ(ˆJð 48·;²;Ó?±;¨R˜Z˜KŸ˜±;ˆÐ?Ø—i‘i  Õ,ˆØ˜MÐ)Ð)ùò #Hùò @s   Ç J É4J%c                ó   <€ V ^8„  d   QhRR/# rÉ   rË   )rf   rÌ   s   "€r6   rÍ   rÎ      s   ø€ ÷ 	)ñ 	) ñ 	)r~   c                ó¦   € V P                   '       d   R# V P                  V P                  V P                  4      pVw  V n        V n        RV n         R# )zUEliminate duplicate entries by adding them together

This is an *in place* operation
NT)ra   r)  r_   r`   )rm   Úsummeds   & r6   rª   Ú_coo_base.sum_duplicates   sC   € ð
 ×$×$Ð$ÙØ×%Ñ% d§k¡k°4·9±9Ó=ˆØ!'ÑˆŒ�T”YØ$(ˆÖ!r~   c           	     ó”  aa€ \        V4      ^ 8X  d   W3# \        P                  ! VRRR1,          4      o\        ;QJ d    . V3R lV 4       F  NK  	  5M! V3R lV 4       4      pVS,          p\        P                  P                  V Uu. uF  q3R,          VRR 8g  NK  	  up4      o\        P                  ! RS4      o\        ;QJ d    . V3R lV 4       F  NK  	  5M! V3R lV 4       4      p\        P                  ! S4      w  p\        P                  P                  V\        V4      V P                  R7      pW3# u upi )r;   Nc              3   ó4   <"  € T F  qS,          x € K  	  R # 5irL   rË   )r3   r?   rŠ   s   & €r6   r7   Ú,_coo_base._sum_duplicates.<locals>.<genexpr>  s   øé € Ð4©V c˜5—z’z«VùrÖ   rç   Tc              3   ó4   <"  € T F  qS,          x € K  	  R # 5irL   rË   )r3   r?   Úunique_masks   & €r6   r7   r‰    s   øé € Ð:±6¨C˜;×'Ò'³6ùrÖ   r.   r�   )r=   r1   ÚlexsortrY   r3  rÜ   rí   rk   ÚaddÚreduceatr   r/   )rm   r_   r`   r?   Úunique_indsrŠ   r‹  s   &&&  @@r6   r)  Ú_coo_base._sum_duplicates  sü   ù€ äˆt‹9˜Œ>Ø�<Ðô —
’
˜6¡$ B $�<Ó(ˆß”Ô4©VÓ4—‘Ô4©VÓ4Ó4ˆØ�E�{ˆÜ—m‘m×*Ñ*Ù+1ó,
Ù+1 C��G�s˜3˜B�xÔ©6ñ,
ó ˆô —i’i  kÓ2ˆß”Ô:±6Ó:—‘Ô:±6Ó:Ó:ˆÜ—z’z +Ó.‰ˆÜ�v‰v�‰˜tÔ%8¸Ó%EÈTÏZÉZˆÓXˆØˆ|Ðùò,
s   ÂEc                óú   a€ V P                   ^ 8g  oV P                   S,          V n         \        ;QJ d(    . V3R lV P                   4       F  NK  	  5V n        R# ! V3R lV P                   4       4      V n        R# )zKRemove zero entries from the array/matrix

This is an *in place* operation
c              3   ó4   <"  € T F  qS,          x € K  	  R # 5irL   rË   rÕ   s   & €r6   r7   Ú,_coo_base.eliminate_zeros.<locals>.<genexpr>%  s   øé € Ð=±¨# ŸIšI³ùrÖ   N)r`   rY   r_   )rm   r¬   s   &@r6   Úeliminate_zerosÚ_coo_base.eliminate_zeros  sM   ø€ ð
 �y‰y˜A‰~ˆØ—I‘I˜d•OˆŒ	ß”eÔ=°·²Ó=—eˆŽ�eÔ=°·²Ó=Ó=ˆŽr~   c                ó  € VP                   V P                   8w  d'   \        R V P                    RVP                    R24      h\        V P                  P                  VP                  P                  4      p\
        P                  ! WRR7      p\        VP                  P                  4      pV P                  ^8X  dg   \        \
        P                  ! ^.4      V P                  V P                  V P                  ^ ,          V P                  VP                  R4      V4       EMUV P                  ^8X  dX   V P                   w  rV\#        WVV P                  V P$                  V P&                  V P                  VP                  R4      V4       MíV'       d:   \
        P(                  ! ^\
        P*                  ! V P                   RR
 4      4      pMP\
        P(                  ! \
        P*                  ! V P                   R,          RRR
1,          4      RRR
1,          ^4      p\
        P,                  ! V P                  4      p\        WpP                  V P                  W€P                  VP                  R4      V4       V P/                  VRR	7      # )úIncompatible shapes (ú and r±   T)r/   rJ   ræ   Nrç   FrM   r�   )re   rc   r   r/   Úcharr1   r2   r¤   ré   rê   rj   r	   rž   r_   r`   rì   r  r   r|   ry   rí   rî   rï   Ú
_container)	rm   Úotherr/   r{   rò   rr   ró   rô   r_   s	   &&       r6   Ú
_add_denseÚ_coo_base._add_dense+  s³  € Ø�;‰;˜$Ÿ*™*Ô$ÜÐ4°T·Z±Z°LÀÀeÇkÁkÀ]ÐRSÐTÓUÐUÜ˜DŸJ™JŸO™O¨U¯[©[×-=Ñ-=Ó>ˆÜ—’˜%°4Ô8ˆÜ�f—l‘l×/Ñ/Ó0ˆØ�9‰9˜Œ>Üœ2Ÿ8š8 Q C›=¨$¯(©(°D·I±IØŸ;™; q�>¨4¯9©9°f·l±lÀ3Ó6GÈöRà�Y‰Y˜!Œ^Ø×$Ñ$‰DˆAÜ˜˜dŸh™h¨¯©°$·(±(¸D¿I¹IØŸ™ SÓ)¨7õ4÷ ÜŸ)š) A¤r§z¢z°$·*±*¸S¸b°/Ó'BÓC‘äŸ)š)¤B§J¢J¨t¯z©z¸"­~¹dÀ¸dÕ/CÓ$DÁTÀrÀTÕ$JÈAÓN�Ü—^’^ D§K¡KÓ0ˆFÜ˜7§H¡H¨d¯i©iØ!§9¡9¨f¯l©l¸3Ó.?ÀôJà�‰˜v¨EˆÓ2Ð2r~   c                ó  € V P                   ^8  d    V P                  4       P                  V4      # VP                  V P                  8w  d'   \	        RV P                   RVP                   R24      hV P                  V4      p\        P                  ! V P                  VP                  34      p\        \        P                  ! V P                  VP                  3^R7      4      pV P                  W#3V P                  R7      pV# ©é   r—  r˜  r±   rB  rù   )rj   r  Ú_add_sparsere   rc   r”   r1   rï   r`   rY   r_   ©rm   r›  r™   r˜   ræ   s   &&   r6   r¡  Ú_coo_base._add_sparseC  sÁ   € Ø�9‰9�qŒ=Ø—:‘:“<×+Ñ+¨EÓ2Ð2à�;‰;˜$Ÿ*™*Ô$ÜÐ4°T·Z±Z°LÀÀeÇkÁkÀ]ÐRSÐTÓUÐUØ—‘˜uÓ%ˆÜ—>’> 4§9¡9¨e¯j©jÐ"9Ó:ˆÜœ2Ÿ>š>¨4¯;©;¸¿¹Ð*EÈAÔNÓOˆ
Ø�N‰N˜HÐ1¸¿¹ˆNÓDˆØˆr~   c                ó  € V P                   ^8  d    V P                  4       P                  V4      # VP                  V P                  8w  d'   \	        RV P                   RVP                   R24      hV P                  V4      p\        P                  ! V P                  VP                  ) 34      p\        \        P                  ! V P                  VP                  3^R7      4      p\        W#3V P                  R7      pV# rŸ  )rj   r  Ú_sub_sparsere   rc   r”   r1   rï   r`   rY   r_   r   r¢  s   &&   r6   r¥  Ú_coo_base._sub_sparseO  s½   € Ø�9‰9�qŒ=Ø—:‘:“<×+Ñ+¨EÓ2Ð2à�;‰;˜$Ÿ*™*Ô$ÜÐ4°T·Z±Z°LÀÀeÇkÁkÀ]ÐRSÐTÓUÐUØ—‘˜uÓ%ˆÜ—>’> 4§9¡9¨u¯z©z¨kÐ":Ó;ˆÜœ2Ÿ>š>¨4¯;©;¸¿¹Ð*EÈAÔNÓOˆ
Ü�xÐ,°D·J±JÔ?ˆØˆr~   c           	     ó(  € V P                   ^8”  EdK   \        P                  ! \        P                  ! V P
                  RR 4      \        V P                  P                  VP                  P                  4      R7      p\        P                  ! V P
                  4      p\        P                  ! \        P                  ! VRR RRR1,          4      RRR1,          R,          ^4      p\        P                  ! V P                  4      p\        V P                  \!        V P
                  4      WEV P"                  W4       VP%                  V P
                  RR 4      pV# V P                   ^8”  d   V P
                  ^ ,          M^p\        P                  ! V\        V P                  P                  VP                  P                  4      R7      pV P                   ^8X  d   V P&                  pV P(                  pMSV P                   ^8X  d+   V P                  ^ ,          p\        P*                  ! V4      pM\-        RV P                    24      h\/        V P                  W‡V P"                  W4       \1        V \2        4      '       d   V^8X  d
   V^ ,          # V# )r€   Nr.   rç   z$coo_matvec not implemented for ndim=r�   )rj   r1   r  rØ   rÙ   re   r   r/   r™  r2   rí   rî   rï   r_   r   rž   r=   r`   rš   ry   r|   rx   ÚNotImplementedErrorr
   rX   r   )	rm   r›  r{   re   rô   r_   Úresult_shapery   r|   s	   &&       r6   Ú_matmul_vectorÚ_coo_base._matmul_vector[  sÌ  € Ø�9‰9�q�=Ü—X’XœdŸiši¨¯
©
°3°B¨Ó8Ü$/°·
±
·±ÀÇÁ×AQÑAQÓ$RôTˆFä—H’H˜TŸZ™ZÓ(ˆEÜ—i’i¤§
¢
¨5°°"¨:±d¸°dÕ+;Ó <¹T¸r¸TÕ BÀ2Õ FÈÓJˆGÜ—^’^ D§K¡KÓ0ˆFÜ˜$Ÿ(™(¤C¨¯
©
£O°WÀdÇiÁiØô)ð —^‘^ D§J¡J¨s° OÓ4ˆFØˆMð )-¯	©	°A¬�t—z‘z !–}¸1ˆÜ—’˜,Ü +¨D¯J©J¯O©O¸U¿[¹[×=MÑ=MÓ NôPˆà�9‰9˜Œ>Ø—(‘(ˆCØ—(‘(‰CØ�Y‰Y˜!Œ^Ø—+‘+˜a•.ˆCÜ—-’- Ó$‰Cä%Ø6°t·y±y°kÐBóDð Dô 	�4—8‘8˜S t§y¡y°%Ô@ä�dœG×$Ò$¨¸Ô):Ø˜!•9ÐØˆr~   c                ób  € \        V4      '       d   V P                  V4      #  VP                  p\        \        V4      R R 4      \        \        V4      RR  R R R1,          4      ,           pVP                  V4      pV P                  p\        \        V4      R R 4      \        \        V4      RR  R R R1,          4      ,           pV P                  V4      P                  V4      pV\        J d   \        # V^8X  g   V^8X  d   \        VP                  4      pMQ\        \        VP                  4      R R 4      \        \        VP                  4      RR  R R R1,          4      ,           pVP                  V4      #   \         d'    \        P
                  ! T4      pTP                  p EL}i ; i)Nrw   r�   )r   Ú_mul_scalarrj   ÚAttributeErrorr1   rh   rY   r^   rÆ   Ú_matmul_dispatchÚNotImplemented)rm   r›  Úo_ndimÚpermÚtrÚs_ndimÚrets   &&     r6   Ú_rmatmul_dispatchÚ_coo_base._rmatmul_dispatch|  sa  € Ü˜×ÒØ×#Ñ# EÓ*Ð*ð$ØŸ™�ô œ˜v› s¨Ð+Ó,¬u´U¸6³]À2À3Ð5GÉÈ"ÈÕ5MÓ/NÕNˆDØ—‘ Ó&ˆBà—Y‘YˆFÜœ˜v› s¨Ð+Ó,¬u´U¸6³]À2À3Ð5GÉÈ"ÈÕ5MÓ/NÕNˆDØ—.‘. Ó&×7Ñ7¸Ó;ˆCØ”nÓ$Ü%Ð%à˜Œ{˜f¨œkÜ˜SŸX™X“‘äœU 3§8¡8›_¨S¨bÐ1Ó2´U¼5ÀÇÁ»?È2È3Ð;OÑPTÐRTÐPTÕ;UÓ5VÕV�Ø—=‘= Ó&Ð&øô! "ô $ÜŸ
š
 5Ó)�ØŸ™“ð$ús   ¤E= Å=-F.Æ-F.c                ó–  € \        V4      '       d   V P                  V4      # \        V4      '       gk   \        V4      '       gZ   \        P
                  ! V4      pVP                  ^ 8X  d&   VP                  \        P                  8X  d   \        #  VP                   V P                  ^8  d(   VP                  ^8  d   \        P                  ! W4      # V P                  R	,          pRpVP                  \        P                  J Ed9   VP                  V38X  d   V P!                  V4      # VP                  V^38X  dB   V P!                  VP#                  4       4      pVP$                  ! . V P                  RR	 O^N5!  # VP                  ^8X  d(   V RV RVP                  ^ ,           R2p\'        V4      hVP                  R
,          V8X  dM   V P                  RR
 pVP                  RR
 pWx8w  d    \        P(                  ! Wx4       V P+                  V4      # \'        V RV RVP                  R
,           R24      h\        V4      '       d   V P-                  V4      # \        V4      '       EdŒ   V P                  ^8H  p	VP                  ^8H  p
V	'       d   V P%                  V P.                  4      p V
'       d%   VP%                  VP                  ^ ,          ^34      pW1P                  R
,          8w  d&   \'        V RV RVP                  R
,           R24      hV P                  ^8”  g   VP                  ^8”  d<   V P                  RR
 pVP                  RR
 pWx8w  d    \        P(                  ! Wx4       V P1                  V4      pV	'       dE   VP%                  \3        VP                  RR
 4      \3        VP                  R	R 4      ,           4      pV
'       d   VP%                  VP                  RR	 4      pV# R#   \         d    Tp ELui ; i  \&         d    \'        R4      hi ; i  \&         d    \'        R4      hi ; i)r;   z)matmul: dimension mismatch with signatureNz (n,k=z),(k=z,)->(n,)z&Batch dimensions are not broadcastablez	 (n,..,k=z,..,m)->(n,..,m)r�   rw   )r   Úmultiplyr   r   r1   Ú
asanyarrayrj   r/   Úobject_r°  re   r®  r   r¯  r”   Úndarrayrª  rì   rš   rc   Úbroadcast_shapesÚ_matmul_multivectorr­  r  Ú_matmul_sparserY   )rm   r›  Úother_aró   Ú
err_prefixr{   ÚmsgÚbatch_shape_AÚbatch_shape_BÚ
self_is_1dÚother_is_1ds   &&         r6   r¯  Ú_coo_base._matmul_dispatch•  sª  € Ü˜×ÒØ—=‘= Ó'Ð'ä˜—’¤7¨5§>¢>ä—m’m EÓ*ˆGà�|‰|˜qÔ  W§]¡]´b·j±jÔ%@ô &Ð%ð Ø—’ð �9‰9�qŒ=˜UŸZ™Z¨!œ^Ü×+Ò+¨DÓ8Ð8à�J‰J�r�NˆØ@ˆ
Ø�?‰?œbŸj™jÔ(Ø�{‰{˜q˜dÔ"Ø×*Ñ*¨5Ó1Ð1Ø�{‰{˜q !˜fÔ$Ø×,Ñ,¨U¯[©[«]Ó;�Ø—~’~Ð: t§z¡z°#°2 Ð:¸Ó:Ð:Ø�z‰z˜QŒØ#˜ F¨1¨#¨U°5·;±;¸qµ>Ð2BÀ(ÐK�Ü  “oÐ%Ø�{‰{˜2� !Ô#à $§
¡
¨3¨B �Ø %§¡¨C¨RÐ 0�Ø Ô1ðSä×+Ò+¨MÔIð ×/Ñ/°Ó6Ð6ä Ø!�l )¨A¨3¨e°E·K±KÀµOÐ3DÐDTÐUóð ô ˜×Òà×#Ñ# EÓ*Ð*ä�E�?‹?ØŸ™ a™ˆJØŸ*™*¨™/ˆK÷ Ø—|‘| D×$5Ñ$5Ó6�çØŸ™ u§{¡{°1¥~°qÐ&9Ó:�ð —K‘K •OÔ#Ü Ø!�l )¨A¨3¨e°E·K±KÀµOÐ3DÐDTÐUóð ð �y‰y˜1Œ} §
¡
¨Q¤Ø $§
¡
¨3¨B �Ø %§¡¨C¨RÐ 0�Ø Ô1ðSä×+Ò+¨MÔIð ×(Ñ(¨Ó/ˆF÷ àŸ™¬¨f¯l©l¸3¸BÐ.?Ó(@Ü(-¨f¯l©l¸2¸3Ð.?Ó(@õ)Aó B�çØŸ™¨¯©°S°bÐ(9Ó:�ØˆMñM øôM "ô  Ø“ð ûô2 &ô SÜ(Ð)QÓRÐRðSûôN &ô SÜ(Ð)QÓRÐRðSús*   ÂP Ç6P Í&P1 ÐPÐPÐP.Ð1Qc                ó²  € \        V P                  P                  VP                  P                  4      pV P                  ^8¼  g   VP                  ^8¼  Edì   V P                  ^8X  dw   V P	                  ^V P
                  ^ ,          4      P                  V4      pVP	                  \        VP
                  RR 4      \        VP
                  RR 4      ,           4      # \        P                  ! V P
                  RR VP
                  RR 4      pW@P
                  RR ,           pWAP
                  RR ,           pV P                  V4      p \        P                  ! W4      pW@P
                  RR ,           VP
                  RR ,           p\        P                  ! WrR7      p\        V P                  \        V P
                  4      VP
                  R,          \        P                   ! V4      \        P                   ! V4      \        P"                  ! V P$                  4      V P&                  VP)                  R4      V4	       V# V P                  ^8X  d@   V P
                  ^ ,          VP
                  ^,          3pV P*                  pV P,                  p	MNV P                  ^8X  d>   VP
                  ^,          3pV P$                  ^ ,          p\        P.                  ! V4      p	\        P                  ! XVR7      p\1        V P                  VP
                  R,          X	XV P&                  VP)                  R4      V4       VP3                  \5        V4      R7      # )r   Nr.   r‹   )Útyperw   r�   )r   r/   r™  rj   rš   re   r¾  rY   r1   r½  Ú_broadcast_torl  r  r   rž   r=   r2   rï   r_   r`   rì   ry   r|   rx   r   ÚviewrÉ  )
rm   r›  Úresult_dtyper{   Úbroadcast_shapeÚ
self_shapeÚother_shaper©  ry   r|   s
   &&        r6   r¾  Ú_coo_base._matmul_multivectorò  s\  € Ü" 4§:¡:§?¡?°E·K±K×4DÑ4DÓEˆØ�9‰9˜Œ>˜UŸZ™Z¨1�_à�y‰y˜AŒ~ØŸ™ a¨¯©°A­Ó7×KÑKÈEÓR�Ø—~‘~¤e¨E¯K©K¸¸Ð,<Ó&=ÄÀeÇkÁkÐRTÐRUÐFVÓ@WÕ&WÓXÐXä ×1Ò1°$·*±*¸S¸b°/À5Ç;Á;ÈsÐPRÐCSÓTˆOØ(¯:©:°b°c¨?Õ:ˆJØ)¯K©K¸¸Ð,<Õ<ˆKà×%Ñ% jÓ1ˆDÜ—O’O EÓ7ˆEØ*¯Z©Z¸¸2Ð->Õ>ÀÇÁÈRÈSÐAQÕQˆLÜ—X’X˜lÔ?ˆFÜ §¡¬#¨d¯j©j«/¸5¿;¹;Àr½?Ü "§¢¨Ó 5´r·x²xÀÓ7MÜ "§¢¨t¯{©{Ó ;Ø $§	¡	¨5¯;©;°sÓ+;¸VôEð ˆMà�9‰9˜Œ>Ø ŸJ™J q�M¨5¯;©;°q­>Ð:ˆLØ—(‘(ˆCØ—(‘(‰CØ�Y‰Y˜!Œ^Ø!ŸK™K¨�NÐ,ˆLØ—+‘+˜a•.ˆCÜ—-’- Ó$ˆCÜ—’˜,¨lÔ;ˆÜ˜Ÿ™ 5§;¡;¨r¥?°C¸ØŸ™ E§K¡K°Ó$4°fô	>à�{‰{¤ U£ˆ{Ó,Ð,r~   c                ó  € \        V4      '       gŽ   \        V4      '       g}   \        V4      '       gl   \        P                  ! V4      pVP
                  ^ 8X  d8   VP                  \        P                  8X  d   \        R\        V4       R24      h VP                   \        V4      '       d	   W,          # V P                  R,          VP                  RR ^ ,          8w  d'   \        RV P                   RVP                   R24      hV P
                  ^8  d   VP
                  ^8  d	   W,          # \        V4      '       d   V P                  V4      # V P                  VP                  4       4      #   \         d    Tp Låi ; i)	ah  Return the dot product of two arrays.

Strictly speaking a dot product involves two vectors.
But in the sense that an array with ndim >= 1 is a collection
of vectors, the function computes the collection of dot products
between each vector in the first array with each vector in the
second array. The axis upon which the sum of products is performed
is the last axis of the first array and the second to last axis of
the second array. If the second array is 1-D, the last axis is used.

Thus, if both arrays are 1-D, the inner product is returned.
If both are 2-D, we have matrix multiplication. If `other` is 1-D,
the sum product is taken along the last axis of each array. If
`other` is N-D for N>=2, the sum product is over the last axis of
the first array and the second-to-last axis of the second array.

Parameters
----------
other : array_like (dense or sparse)
    Second array

Returns
-------
output : array (sparse or dense)
    The dot product of this array with `other`.
    It will be dense/sparse if `other` is dense/sparse.

Examples
--------

>>> import numpy as np
>>> from scipy.sparse import coo_array
>>> A = coo_array([[1, 2, 0], [0, 0, 3], [4, 0, 5]])
>>> v = np.array([1, 0, -1])
>>> A.dot(v)
array([ 1, -3, -1], dtype=int64)

For 2-D arrays it is the matrix product:

>>> A = coo_array([[1, 0], [0, 1]])
>>> B = coo_array([[4, 1], [2, 2]])
>>> A.dot(B).toarray()
array([[4, 1],
       [2, 2]])

For 3-D arrays the shape extends unused axes by other unused axes.

>>> A = coo_array(np.arange(3*4*5*6)).reshape((3,4,5,6))
>>> B = coo_array(np.arange(3*4*5*6)).reshape((5,4,6,3))
>>> A.dot(B).shape
(3, 4, 5, 5, 4, 3)
z"dot argument not supported type: 'Ú'Nzshapes r˜  z are not aligned for n-D dotr�   rw   )r   r   r   r1   rº  rj   r/   r»  rb   rÉ  re   r®  rc   Ú
_dense_dotÚ_sparse_dotrg   )rm   r›  Úo_arrays   && r6   ÚdotÚ_coo_base.dot  s3  € ôl ˜—’¤7¨5§>¢>´\À%×5HÒ5Hä—m’m EÓ*ˆGà�|‰|˜qÔ  W§]¡]´b·j±jÔ%@ÜÐ"DÄTÈ%Ã[ÀMÐQRÐ SÓTÐTð Ø—’ô
 ˜×ÒØ•<Ðð �:‰:�b�>˜UŸ[™[¨¨Ð-¨aÕ0Ô0Ü˜w t§z¡z l°%¸¿¹°}Ø;ð<ó =ð =ð �9‰9�qŒ=˜UŸZ™Z¨!œ^Ø•<ÐÜ�5�>Š>Ø—?‘? 5Ó)Ð)Ø×Ñ §¡£Ó.Ð.øô! "ô  Ø’ð ús   ÂE5 Å5FÆFc                óÂ  € \        W P                  ^,
          .4      w  r#\        V\        ^ VP                  ^,
          4      .4      w  rEW$P                  ,          pVP	                  4       pW5,           p. pV'       d   W53MV3p	\        VP                  V	4       F*  w  r«VP                  \        P                  ! W«4      4       K,  	  \        VP                  V3VR7      # )rC   rù   )Ú_convert_to_2drj   rF   ÚTrg   rÚ   r_   Úextendr1   r“   r   r`   )rm   r›  Úself_2dÚs_new_shapeÚother_2dÚo_new_shaperÙ   Úcombined_shaper_   Ú
new_shapesrf  Úss   &&          r6   rÔ  Ú_coo_base._sparse_dote  s¸   € ô  .¨d·Y±YÀµ]°OÓDÑˆÜ .¨u´s¸1¸e¿j¹jÈ1½nÓ7MÐ6NÓ OÑˆàŸ™Õ#ˆØ�z‰z‹|ˆð %Õ2ˆð ˆß3>�kÑ/À[ÀNˆ
Ü˜Ÿ™ ZÖ0‰DˆAØ�M‰Mœ"×*Ò*¨1Ó0Ö1ñ 1ô ˜$Ÿ)™) VÐ,°NÔCÐCr~   c                ó|  € V P                   pV^8:  d!   V^8X  d   RMV P                  ^ ,          3pT pM\        W P                   ^,
          .4      w  rCVP                   pV^8:  d!   V^8X  d   RMVP                  R,          3pTpM—VP                  RR VP                  RR ,           pV^,
          .\        V^,
          4      OV^,
          N5p\        P
                  ! W4      p	V	P                  VP                  R,          \        P                  ! V4      34      pWG,          p
W6,           pV
P                  V4      # )r€   NrË   r�   rw   )	rj   re   rÙ  r^   r1   rÆ   rš   rØ   rÙ   )rm   r›  r´  rÝ  rÜ  r±  rß  rÞ  Úreorder_dimsÚo_reorgrÙ   rà  s   &&          r6   rÓ  Ú_coo_base._dense_dotz  s  € ð —‘ˆØ�QŒ;Ø &¨!¤™"°$·*±*¸Qµ-Ð1AˆKØ‰Gä#1°$¿¹ÀQ½¸Ó#HÑ ˆGà—‘ˆØ�QŒ;Ø &¨!¤™"°%·+±+¸bµ/Ð1CˆKØ‰HàŸ+™+ c rÐ*¨U¯[©[¸¸Ð-=Õ=ˆKØ" Q�JÐG¬¨v¸­zÓ):ÐG¸FÀQ½JÑGˆLÜ—l’l 5Ó7ˆGØ—‘¨¯©°B­¼¿ºÀ;Ó9OÐ'PÓQˆHàÕ!ˆð %Õ2ˆØ�|‰|˜NÓ+Ð+r~   c                ó´  a a€ \        S4      '       g}   \        S4      '       gl   \        P                  ! S4      pVP                  ^ 8X  d8   VP
                  \        P                  8X  d   \        R\        S4       R24      h SP                   \        S P                  SP                  V4      w  rE\        ;QJ d)    VV 3R l\        WE4       4       F  '       g   K   RM	  RM! VV 3R l\        WE4       4       4      '       d   \        R4      h\        S4      '       d   S P                  SWE4      # S P!                  SWE4      #   \         d    To LÆi ; i)a4
  Return the tensordot product with another array along the given axes.

The tensordot differs from dot and matmul in that any axis can be
chosen for each of the first and second array and the sum of the
products is computed just like for matrix multiplication, only not
just for the rows of the first times the columns of the second. It
takes the dot product of the collection of vectors along the specified
axes.  Here we can even take the sum of the products along two or even
more axes if desired. So, tensordot is a dot product computation
applied to arrays of any dimension >= 1. It is like matmul but over
arbitrary axes for each matrix.

Given two tensors, `a` and `b`, and the desired axes specified as a
2-tuple/list/array containing two sequences of axis numbers,
``(a_axes, b_axes)``, sum the products of `a`'s and `b`'s elements
(components) over the axes specified by ``a_axes`` and ``b_axes``.
The `axes` input can be a single non-negative integer, ``N``;
if it is, then the last ``N`` dimensions of `a` and the first
``N`` dimensions of `b` are summed over.

Parameters
----------
a, b : array_like
    Tensors to "dot".

axes : int or (2,) array_like
    * integer_like
      If an int N, sum over the last N axes of `a` and the first N axes
      of `b` in order. The sizes of the corresponding axes must match.
    * (2,) array_like
      A 2-tuple of sequences of axes to be summed over, the first applying
      to `a`, the second to `b`. The sequences must be the same length.
      The shape of the corresponding axes must match between `a` and `b`.

Returns
-------
output : coo_array
    The tensor dot product of this array with `other`.
    It will be dense/sparse if `other` is dense/sparse.

See Also
--------
dot

Examples
--------
>>> import numpy as np
>>> import scipy.sparse
>>> A = scipy.sparse.coo_array([[[2, 3], [0, 0]], [[0, 1], [0, 5]]])
>>> A.shape
(2, 2, 2)

Integer axes N are shorthand for (range(-N, 0), range(0, N)):

>>> A.tensordot(A, axes=1).toarray()
array([[[[ 4,  9],
         [ 0, 15]],
<BLANKLINE>
        [[ 0,  0],
         [ 0,  0]]],
<BLANKLINE>
<BLANKLINE>
       [[[ 0,  1],
         [ 0,  5]],
<BLANKLINE>
        [[ 0,  5],
         [ 0, 25]]]])
>>> A.tensordot(A, axes=2).toarray()
array([[ 4,  6],
       [ 0, 25]])
>>> A.tensordot(A, axes=3)
array(39)

Using tuple for axes:

>>> a = scipy.sparse.coo_array(np.arange(60).reshape(3,4,5))
>>> b = np.arange(24).reshape(4,3,2)
>>> c = a.tensordot(b, axes=([1,0],[0,1]))
>>> c.shape
(5, 2)
>>> c
array([[4400, 4730],
       [4532, 4874],
       [4664, 5018],
       [4796, 5162],
       [4928, 5306]])

z#tensordot arg not supported type: 'rÒ  c              3   óv   <"  € T F.  w  rSP                   V,          SP                   V,          8g  x € K0  	  R # 5irL   rù   )r3   ÚaxÚbxr›  rm   s   &  €€r6   r7   Ú&_coo_base.tensordot.<locals>.<genexpr>ü  s/   øé € ð 9Ù7‘6�2ð �z‰z˜"�~ §¡¨R¥Ö0Û7ùs   ƒ69TFz*sizes of the corresponding axes must match)r   r   r1   rº  rj   r/   r»  rb   rÉ  re   r®  Ú_process_axesrd   rÚ   rc   Ú_dense_tensordotÚ_sparse_tensordot)rm   r›  rÃ   Úother_arrayÚ	axes_selfÚ
axes_others   ff&   r6   Ú	tensordotÚ_coo_base.tensordot•  s  ù€ ôr �u�~Š~¤h¨u§o¢oäŸ-š-¨Ó.ˆKà×Ñ 1Ô$¨×):Ñ):¼b¿j¹jÔ)HÜÐ"EÄdÈ5ÃkÀ]ÐRSÐ TÓUÐUð$Ø—’ô !.¨d¯i©i¸¿¹ÀTÓ JÑˆ	÷ ‹3õ 9Ü  Ô7ó9�3�3Š3õ 9Ü  Ô7ó9÷ 9ò 9äÐIÓJÐJä�5�>Š>Ø×(Ñ(¨°	ÓFÐFà×)Ñ)¨%°ÓGÐGøô "ô $Ø#’ð$ús   ÂE ÅEÅEc                óž  € \        W4      w  rE\        W4      w  rgWFP                  ,          p\        V4      '       g   V# VP                  4       pWW,           p	. p
V'       d   WW3MV3p\	        VP
                  V4       F4  w  rÍV'       g   K  V
P                  \        P                  ! WÍ4      4       K6  	  \        VP                  V
3V	R 7      # )rù   )rÙ  rÚ  r   rg   rÚ   r_   rÛ  r1   r“   r   r`   )rm   r›  Ús_axesÚo_axesrÜ  rÝ  rÞ  rß  rÙ   rà  r_   rá  rf  râ  s   &&&&          r6   rï  Ú_coo_base._sparse_tensordot  s¯   € ô  .¨dÓ;ÑˆÜ .¨uÓ =Ñˆð Ÿ™Õ#ˆä˜�~Š~ØˆKØ�z‰z‹|ˆð %Õ2ˆð ˆß3>�kÑ/À[ÀNˆ
Ü˜Ÿ™ ZÖ0‰DˆAß‰qØ—‘œb×.Ò.¨qÓ4Ö5ñ 1ô
 ˜$Ÿ)™) VÐ,°NÔCÐCr~   c                ó~  € \        V P                  4      p\        VP                  4      p\        V4       Uu. uF  qfV9  g   K  VNK  	  ppV Uu. uF  q`P                  V,          NK  	  ppV Uu. uF  q`P                  V,          NK  	  p	p\        V4       Uu. uF  qfV9  g   K  VNK  	  p
pV Uu. uF  qaP                  V,          NK  	  ppV
 Uu. uF  qaP                  V,          NK  	  ppV P                  Wr,           4      p\        P                  ! WR R V,           V
RR  ,           4      p. V	O\
        P                  ! V4      N5p. VR R O\
        P                  ! V4      NVRR  O5pVP                  V4      P                  VP                  V4      4      # u upi u upi u upi u upi u upi u upi )Nr�   )	r=   re   r^   rÆ   r1   rØ   rÙ   rš   rÖ  )rm   r›  rö  r÷  r´  r±  r°   Ú
s_non_axesÚs_axes_shapeÚs_non_axes_shapeÚ
o_non_axesÚo_axes_shapeÚo_non_axes_shapeÚleftÚrightÚreshape_leftÚreshape_rights   &&&&             r6   rî  Ú_coo_base._dense_tensordot  sˆ  € Ü�T—Z‘Z“ˆÜ�U—[‘[Ó!ˆä!& v¤ÓB¡˜A¸6±/—a�a¡ˆ
ÐBÙ/5Ó6©v¨!Ÿ
™
 1Ÿ˜©vˆÐ6Ù3=Ó>±:¨aŸJ™J qŸM˜M±:ÐÐ>ä!& v¤ÓB¡˜A¸6±/—a�a¡ˆ
ÐBÙ06Ó7±¨1Ÿ™ AŸ˜±ˆÐ7Ù4>Ó?±J¨qŸK™K¨ŸN˜N±JÐÐ?à�~‰~˜jÕ1Ó2ˆÜ—’˜U¨s° O°fÕ$<¸zÈ"È#¸Õ$NÓOˆàCÐ)ÐC¬4¯9ª9°\Ó+BÑCˆð1Ð*¨3¨BÐ/ð 1´·²¸<Ó1Hð 1Ø*¨2¨3Ð/ñ1ˆð �|‰|˜LÓ)×-Ñ-¨e¯m©m¸MÓ.JÓKÐKùò CùÚ6ùÚ>ùâBùÚ7ùÚ?s/   ¸F!ÁF!ÁF&Á2F+ÂF0Â)F0Â5F5ÃF:c                ó8  € V P                   ^8  d(   VP                   ^8  d   \        P                  ! W4      # V P                  pVP                  p\        P
                  ! VRR VRR 4      p\        V4      VRR ,           p\        V4      VRR ,           pV P                  V4      pVP                  V4      p\        V4      p	\        V4      p
Wš,          P                  4       p\        V. VOV P                  R,          NVP                  R,          N5R7      # )a¡  
Perform sparse-sparse matrix multiplication for two n-D COO arrays.
The method converts input n-D arrays to 2-D block array format,
uses csr_matmat to multiply them, and then converts the
result back to n-D COO array.

Parameters:
self (COO): The first n-D sparse array in COO format.
other (COO): The second n-D sparse array in COO format.

Returns:
prod (COO): The resulting n-D sparse array after multiplication.
Nrù   rw   r�   )rj   r   r¿  re   r1   r½  rY   rÊ  Ú_block_diagrg   Ú_extract_block_diag)rm   r›  rÎ  rÏ  rÍ  Úself_new_shapeÚother_new_shapeÚself_broadcastedÚother_broadcastedÚself_block_diagÚother_block_diagÚprod_block_diags   &&          r6   r¿  Ú_coo_base._matmul_sparse4  s  € ð �9‰9�qŒ=˜UŸZ™Z¨!œ^Ü×)Ò)¨$Ó6Ð6ð —Z‘Zˆ
Ø—k‘kˆô ×-Ò-¨j¸¸"¨o¸{È3ÈBÐ?OÓPˆÜ˜Ó/°*¸R¸S°/ÕAˆÜ Ó0°;¸r¸sÐ3CÕCˆà×-Ñ-¨nÓ=ÐØ!×/Ñ/°Ó@Ðô &Ð&6Ó7ˆÜ&Ð'8Ó9Ðð +Õ=×DÑDÓFˆô #ØØE�OÐE T§Z¡Z°¥^ÐE°U·[±[Àµ_ÑEô
ð 	
r~   c           	     ó\  € V P                   V8X  d   V'       d   V P                  4       # T # V P                   p\        V4      \        V4      8  d   \        R 4      hR	\        V4      \        V4      ,
          ,          \	        V4      ,           p\
        ;QJ d%    R \        WA4       4       F  '       g   K   RM	  RM! R \        WA4       4       4      '       d   \        RV R24      hV P                  V4      p \        V P                  \        V4      R7      pV P                  pV P                  pVR
R p^p	VR
,          VR
,          8w  db   VR
,          p
Wš,          p	\        P                  ! Wz4      p\        P                  ! \        P                  ! ^ W¥R7      V P                   4      pV3p\#        R\        V4      ^,           ) R
4       FÐ  pWL,          W,          8w  d”   W,          p
Wš,          p	\        V4      p\        P                  ! Wz4      p\	        \        P                  ! WŒ^,           R V
4      4      p\        P                  ! \        P                  ! ^ W¥R7      V4      pV3V,           pK©  \        P                  ! Wl,          V	4      pV3V,           pKÒ  	  \%        Wx3V4      # )zDNew shape must have at least as many dimensions as the current shapec              3   óH   "  € T F  w  rV^8g  ;'       d    W8g  x € K  	  R# 5irB   rË   )r3   ÚoÚns   &  r6   r7   Ú*_coo_base._broadcast_to.<locals>.<genexpr>m  s%   é € ÐEÑ/D¡t q��Q‘×!Ð!˜1™6Ô!Ó/Dùs   ‚"•"TFzcurrent shape z- cannot be broadcast to new shape {new_shape}r)   Nr.   r×   r�   rw   )re   rJ   r=   rc   rY   rd   rÚ   rš   r   r_   rF   r`   r1   ÚtileÚrepeatr4  rž   r^   r   )rm   rK  rJ   Ú	old_shapere   r5   r_   r™   r˜   Ú
cum_repeatÚrepeat_countÚnew_dimr°   rž   s   &&&           r6   rÊ  Ú_coo_base._broadcast_to^  s%  € Ø�:‰:˜Ô"ß"&�4—9‘9“;Ð0¨DÐ0à—J‘Jˆ	ô ˆy‹>œC 	›NÔ*Üð 5ó 6ð 6ð œ˜I›¬¨Y«Õ7Õ8¼5ÀÓ;KÕKˆ÷ ‹3ÑE¬s°5Ô/DÓE�3�3Š3ÑE¬s°5Ô/DÓE×EÒEÜ˜~¨i¨[ð 9Bð Bó Cð Cð �|‰|˜EÓ"ˆä# D§K¡K¼¸I»ÔGˆ	Ø—‘ˆØ—9‘9ˆØ˜B˜C�[ˆ
Øˆ
à��9˜	 "�Ô%Ø$ R�=ˆLØÕ&ˆJÜ—w’w˜xÓ6ˆHÜ—i’i¤§	¢	¨!¨\Ô KÈTÏXÉXÓVˆGØ!˜ˆJä�rœS ›Z¨�\˜?¨BÖ/ˆAØ�x˜9�<Ô'Ø(�|�ØÕ*�
Ü˜(“m�ô Ÿ7š7 8Ó:�Ü"¤2§7¢7¨:¸µc°dÐ+;¸\Ó#JÓK�
ô Ÿ)š)¤B§I¢I¨a°Ô$OÐQTÓU�Ø%˜Z¨*Õ4’
ô Ÿ'š' &¥)¨ZÓ8�Ø%˜Z¨*Õ4’
ñ! 0ô$ ˜(Ð/°Ó;Ð;r~   c                óª   € \        W4      w  rE\        P                  ! VP                  ^,          ^3VR7      pWF,          P	                  V4      VR&   V# )rC   r.   .)rÙ  r1   rD  re   rš   )rm   r¦   Ú	res_dtyperð   ÚA2drK  rD  s   &&&&   r6   Ú_sum_ndÚ_coo_base._sum_nd•  sF   € ä'¨Ó3‰ˆÜ�wŠw˜Ÿ	™	 !� aÐ(°	Ô:ˆà•J×'Ñ'¨	Ó2ˆˆC‰Øˆ
r~   c                óÀ   € \        W4      w  rEVP                  ^W#4      p\        P                  ! VP                  ^ ,          V4      p\        VP                  V3V4      # r×   )rÙ  Ú_min_or_max_axisr1   r“   r_   r   r`   )rm   r¦   Ú
min_or_maxÚexplicitr  rK  ÚresÚunraveled_coordss   &&&&    r6   Ú_min_or_max_axis_ndÚ_coo_base._min_or_max_axis_nd�  sR   € Ü'¨Ó3‰ˆØ×"Ñ" 1 jÓ;ˆÜ×+Ò+¨C¯J©J°q­M¸9ÓEÐä˜#Ÿ(™(Ð$4Ð5°yÓAÐAr~   c                ód   € \        W4      w  rVVP                  ^W#V4      pVP                  V4      # r×   )rÙ  Ú_argminmax_axisrš   )rm   r¦   Ú	argminmaxÚcomparer$  r  rK  Úres_flats   &&&&&   r6   Ú_argminmax_axis_ndÚ_coo_base._argminmax_axis_nd¤  s3   € Ü'¨Ó3‰ˆØ×&Ñ& q¨)¸hÓGˆØ×Ñ 	Ó*Ð*r~   )r[   r_   r`   ra   )NNFrL   )NF)NN)F)r;   )T)r€   )9Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú_formatr^   rZ   rW   Úpropertyr|   Úsetterry   rš   r   Ú__doc__r§   r«   rl   rÆ   rã   rõ   r  r  rü   rg   r  r#  r/  r   r9  r?  r`  rz  rk  rª   r)  r”  rœ  r¡  r¥  rª  r¶  r¯  r¾  rÖ  rÔ  rÓ  ró  rï  rî  r¿  rÊ  r  r'  r.  Ú__static_attributes__Ú__classdictcell__©rÌ   s   @r6   r#   r#      s;  ø‡ € Ø€GÙ�a˜“€IñGÈTõ GðR ñó ðð 	‡Z�ZñGó ðGð ñó ðð 	‡Z�Zñ4ó ð4ò!OðF —o‘o×-Ñ-€G„Oô;ð( —o‘o×-Ñ-€G„OôWð $×1Ñ1×9Ñ9€MÔòNô2?ð$  ×)Ñ)×1Ñ1€IÔ÷$ð $ðL —^‘^×+Ñ+€F„Nô%ð2 —o‘o×-Ñ-€G„OôôB ôD1ô6ð —M‘M×)Ñ)€E„MôDð, —M‘M×)Ñ)€E„Môð —M‘M×)Ñ)€E„Môð( $×,Ñ,×4Ñ4€HÔò$*ôNRòRTòhn*ò`)*÷V	)ð 	)òò&>ò3ò0
ò
òòB'ò2[òz!-òFN/ò`Dò*,ô6nHò`Dò4Lò*(
ôT5<ònòB÷+ð +r~   r#   c                ób  € V P                   ^8  d   \        R4      h\        P                  ! V P                  RR 4      pV P                  R,          pV P                  R,          pV P                  WV34      pVP                  ^,          VP                  ^ ,          VP                  ^,          ,          ,           VP                  ^,          VP                  ^ ,          VP                  ^,          ,          ,           3pW,          W,          3p\        V P                  \        V4      3VR7      # )zØ
Converts an N-D COO array into a 2-D COO array in block diagonal form.

Parameters:
self (coo_array): An N-Dimensional COO sparse array.

Returns:
coo_array: A 2-Dimensional COO sparse array in block diagonal form.
zarray must have atleast dim=2Nrù   rw   r�   )
rj   rc   rØ   rÙ   re   rš   r_   r   r`   rY   )rm   Ú
num_blocksÚn_colÚn_rowÚres_arrr˜   rK  s   &      r6   r  r  ª  sä   € ð ‡y�y�„{ÜÐ8Ó9Ð9Ü—’˜4Ÿ:™: c r˜?Ó+€JØ�J‰J�r�N€EØ�J‰J�r�N€EØ�l‰l˜J¨uÐ5Ó6€Gà�‰�qÕ˜GŸN™N¨1Õ-°·±¸aÕ0@Õ@Õ@Ø�‰�qÕ˜GŸN™N¨1Õ-°·±¸aÕ0@Õ@Õ@ð€Jð
 Õ# ZÕ%7Ð8€IÜ�d—i‘i¤ zÓ!2Ð3¸9ÔEÐEr~   c                 ó´  € VR,          VR,          r2V P                   pV P                  V P                  re\        P                  ! \        V4      V P                  3\        R7      pWR,          VR&   Wc,          VR&   WR,          p\        \        V4      ^,
          RR4       F  p	W,          p
WŠ,          Wy&   WŠ,          pK  	  \        V\        V4      3VR7      # )r€   r.   rù   rw   r�   )r`   r|   ry   r1   r  r=   rž   r¤   r^   r   rY   )rm   re   r>  r=  r`   r|   ry   r˜   Útemp_block_idxr°   râ   s   &&         r6   r  r  Ã  s¸   € Ø˜•9˜e B�iˆ5ð �9‰9€DØ�x‰x˜Ÿ™ˆô —’œ3˜u›: t§x¡xÐ0¼Ô<€Jð •[€Jˆr�NØ•[€Jˆr�Nð •\€NÜ”3�u“: •> 2 rÖ*ˆØ�xˆØ&Õ-ˆ
‰Ø'Õ/Šñ +ô �dœE *Ó-Ð.°eÔ<Ð<r~   c                 ó2  € V P                  4       p V P                  4        \        V P                  4      pV P                  P                  VR R7      pV P                  pW8X  d   WC3# \        V4      \        V4      ,
          pV^ 8”  dR   ^.V,          \        V4      ,           p\        P                  ! V^ ,          4      p\        V.V,          V,           4      pV^ 8  dY   \        V) 4       FH  pV^ ,          ^8X  d   VR,          pVR,          pK%  VR,          ^8X  d   VRR pVRR pK?  \        R4      h	  ^p	\        \        W4      4       F�  w  p
w  r¼W¼8X  d   K  V^8w  d   \        R4      h\        V^ ,          4      p\        P                  ! \        P                   ! V4      V4      W:&   \        V4       F%  w  rïWê8X  d   K  \        P"                  ! Wû4      W>&   K'  	  W›,          p	KŸ  	  \        P"                  ! VP%                  4       V	4      pWC3# )FrM   rç   Nzshape mismatch in assignmentr�   )rg   rª   rH  r_   r`   rR   re   r=   r1   Ú	zeroslikerY   r^   rc   r¶   rÚ   r  r4  r  rì   )r   rK  r/   rq  rp  Úx_shapeÚlen_diffÚcoord_zerosr4   Ú
tot_expandr°   ÚnnÚnxÚx_nnzrm  rŽ   s   &&&             r6   ri  ri  Ü  sÇ  € Ø	�‰‹	€AØ×ÑÔä�A—H‘H‹~€HØ�V‰V�]‰]˜5 uˆ]Ó-€FØ�g‰g€GàÔØÐÐô �9‹~¤ G£Õ,€HØ�!„|à�#˜•.¤4¨£=Õ0ˆÜ—l’l 8¨A¥;Ó/ˆÜ˜+˜¨Õ1°HÕ<Ó=ˆð �!„|Ü˜�yÖ!ˆAØ�q�z˜QŒØ! "�+�Ø# B�<’Ø˜• Ô!Ø! # 2˜,�Ø# C R˜=’ä Ð!?Ó@Ð@ñ "ð €JÜ ¤ YÓ!8Ö9‰ˆ‰8ˆBØŒ8ÙØ�Œ7ÜÐ;Ó<Ð<Ü�H˜Q•KÓ ˆÜ—i’i¤§	¢	¨"£¨uÓ5ˆ‰Ü˜xÖ(‰EˆAØŒvÙÜŸ'š' "›/ˆH‹Kñ )ð 	ÕŠ
ñ :ô �WŠW�V—\‘\“^ ZÓ0€FØÐÐr~   c                 ó:  € V P                   V8w  d&   \        P                  ! V P                  4       V4      p VR8X  dE   \	        \        P
                  ! ^ .4      .\        V4      ,          4      pV P                  4       pW23# V P                  4       pW,          pW23# )r;   rË   )	re   r1   rl  ÚsqueezerY   r2   r=   rì   rk   )r   rK  rq  rp  s   &&  r6   rj  rj    s}   € Ø‡w�w�)ÔÜ�OŠO˜AŸI™I›K¨Ó3ˆà�B„Üœ"Ÿ(š( A 3›-˜¬3¨y«>Õ9Ó:ˆØ—‘“ˆð ÐÐð —9‘9“;ˆØ•ˆØÐÐr~   c                 ój  a a€ \        V\        4      '       dU   V^8  g   V\        S S4      8”  d   \        R4      h\	        \        S V,
          S 4      4      p\	        \        V4      4      pMû\        V\        \        ,          4      '       dÐ   \        V4      ^8w  d   \        R4      hVw  r4\        V4      \        V4      8w  d   \        R4      h\        ;QJ d    V 3R lV 4       F  '       g   K   RM	  RM! V 3R lV 4       4      '       gA   \        ;QJ d    V3R lV 4       F  '       g   K   RM	  RM! V3R lV 4       4      '       d   \        R4      hM\        R	4      hV Uu. uF  qU^ 8  d
   VS ,           MTNK  	  ppV Uu. uF  qU^ 8  d
   VS,           MTNK  	  ppW43# u upi u upi )
rC   z.axes integer is out of bounds for input arraysz%axes must be a tuple/list of length 2z,axes lists/tuples must be of the same lengthc              3   óH   <"  € T F  qS8¬  ;'       g    VS) 8  x € K  	  R # 5irL   rË   )r3   rê  Úndim_as   & €r6   r7   Ú _process_axes.<locals>.<genexpr>&  ó$   øé € Ð=±f°�V‰|×+Ð+˜r V G™|Ô+³fùó   ƒ"“"TFc              3   óH   <"  € T F  qS8¬  ;'       g    VS) 8  x € K  	  R # 5irL   rË   )r3   rë  Úndim_bs   & €r6   r7   rP  '  rQ  rR  z/axes indices are out of bounds for input arraysz3axes must be an integer or a tuple/list of integers)
rX   r¤   r¹   rc   rH  r^   rY   r=   rd   rb   )rO  rT  rÃ   Úaxes_aÚaxes_br¦   s   ff&   r6   rí  rí    sS  ù€ Ü�$œ×ÒØ�!Œ8�tœc &¨&Ó1Ô1ÜÐMÓNÐNÜ”e˜F T�M¨6Ó2Ó3ˆÜ”e˜D“kÓ"‰Ü	�Dœ%¤$�,×	'Ò	'Üˆt‹9˜Œ>ÜÐDÓEÐEØ‰ˆÜˆv‹;œ#˜f›+Ô%ÜÐKÓLÐLß‹3Ô=±fÓ=�3�3Š3Ô=±fÓ=×=Ò=ß‹3Ô=±fÓ=�3�3Š3Ô=±fÓ=×=Ò=ÜÐNÓOÐOð >ô ÐMÓNÐNá>DÓE¹f°d aœxˆd�VŽm¨TÒ1¹f€FÐEÙ>DÓE¹f°d aœxˆd�VŽm¨TÒ1¹f€FÐEØˆ>Ðùò FùÚEs   Å,F+ÆF0c                 óT  a a€ \         ;QJ d    . V 3R  lS 4       F  NK  	  5M! V 3R  lS 4       4      p\         ;QJ d    . V 3R lS 4       F  NK  	  5M! V 3R lS 4       4      p\        W#4      p\        S P                  4      p\         ;QJ d     . V3R l\	        V4       4       F  NK  	  5M! V3R l\	        V4       4       4      pV'       d    \         ;QJ d    . V 3R lV 4       F  NK  	  5M! V 3R lV 4       4      p\         ;QJ d    . V 3R lV 4       F  NK  	  5M! V 3R lV 4       4      p\        Wx4      p	W”3p
\
        P                  ! V4      \
        P                  ! V4      3pMV3p
\
        P                  ! V4      3pRp\        S P                  V
3VR7      pWÈ3# )c              3   óJ   <"  € T F  pSP                   V,          x € K  	  R # 5irL   r„   ©r3   r°   r$   s   & €r6   r7   Ú!_convert_to_2d.<locals>.<genexpr>2  s   øé € Ð4©t¨!˜Ÿ
™
 1Ÿš«tùrT   c              3   óJ   <"  € T F  pSP                   V,          x € K  	  R # 5irL   rù   rY  s   & €r6   r7   rZ  3  s   øé € Ð2©T¨�s—y‘y —|’|«TùrT   c              3   ó8   <"  € T F  qS9  g   K  Vx € K  	  R # 5irL   rË   )r3   r°   r¦   s   & €r6   r7   rZ  7  s   øé € Ð=¡˜1¸©}—Q’Q£ùs   ƒ�
c              3   óJ   <"  € T F  pSP                   V,          x € K  	  R # 5irL   r„   rY  s   & €r6   r7   rZ  9  s   øé € Ð@±x°! §
¡
¨1§¢³xùrT   c              3   óJ   <"  € T F  pSP                   V,          x € K  	  R # 5irL   rù   rY  s   & €r6   r7   rZ  :  s   øé € Ð>±X°˜sŸy™y¨Ÿ|š|³XùrT   rù   rË   )	rY   r‘   r=   r_   r^   rØ   rÙ   r   r`   )r$   r¦   Úaxis_coordsÚ
axis_shapeÚ
axis_ravelrj   Únon_axisÚnon_axis_coordsÚnon_axis_shapeÚnon_axis_ravelÚ	coords_2dÚshape_2dÚnew_coos   ff           r6   rÙ  rÙ  1  s$  ù€ ß”%Ô4©tÓ4—%‘%Ô4©tÓ4Ó4€Kß”Ô2©TÓ2—‘Ô2©TÓ2Ó2€JÜ˜{Ó7€Jäˆs�z‰z‹?€DßŒuÔ=¤ d¤Ó=�u‰uÔ=¤ d¤Ó=Ó=€Hßßœ%Ô@±xÓ@Ÿ%™%Ô@±xÓ@Ó@ˆßœÔ>±XÓ>Ÿ™Ô>±XÓ>Ó>ˆÜ& ÓGˆØ#Ð0ˆ	Ü—I’I˜nÓ-¬t¯yªy¸Ó/DÐE‰à�Mˆ	Ü—I’I˜jÓ)Ð+ˆØˆä˜Ÿ™ 9Ð-°XÔ>€GØÐ"Ð"r~   c                ó:  € \        V 4      ^8X  d
   V ^ ,          # \        V 4      ^8X  dÜ   Vw  r4V w  rVVR8X  d^   V\        ^ V^,
          4      ,          \        ^ V^,
          4      ,           p\        VR7      p\        P                  ! WEVR7      V,           # VR8X  d^   V\        ^ V^,
          4      ,          \        ^ V^,
          4      ,           p\        VR7      p\        P                  ! W6VR7      V,           # \        R4      h\        P                  ! WVR7      # )z;Like np.ravel_multi_index, but avoids some overflow issues.r‹   r)   r.   ÚFz'order' must be 'C' or 'F'r‰   )r=   rF   r   r1   r¹  rc   Úravel_multi_index)	r_   re   rŠ   ÚnrowsÚncolsr|   ry   r*   r5   s	   &&&      r6   r‘   r‘   G  sé   € ä
ˆ6ƒ{�aÔØ�a�yÐä
ˆ6ƒ{�aÔØ‰ˆØ‰ˆØ�CŒ<Øœc ! U¨Q¥YÓ/Õ/´#°a¸À½Ó2CÕCˆFÜ'¨vÔ6ˆIÜ—;’;˜u°Ô;¸cÕAÐAØ�cŒ\Øœc ! U¨Q¥YÓ/Õ/´#°a¸À½Ó2CÕCˆFÜ'¨vÔ6ˆIÜ—;’;˜u°Ô;¸cÕAÐAäÐ9Ó:Ð:Ü×Ò °UÔ;Ð;r~   c                ó"   € \        V \        4      # )aŠ  Is `x` of coo_matrix type?

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

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

Examples
--------
>>> from scipy.sparse import coo_array, coo_matrix, csr_matrix, isspmatrix_coo
>>> isspmatrix_coo(coo_matrix([[5]]))
True
>>> isspmatrix_coo(coo_array([[5]]))
False
>>> isspmatrix_coo(csr_matrix([[5]]))
False
)rX   r   )r   s   &r6   Úisspmatrix_cooro  \  s   € ô. �aœÓ$Ð$r~   c                   ó   € ] tR tRtRtRtR# )r   iw  a©  
A sparse array in COOrdinate format.

Also known as the 'ijv' or 'triplet' format.

This can be instantiated in several ways:
    coo_array(D)
        where D is an ndarray

    coo_array(S)
        with another sparse array or matrix S (equivalent to S.tocoo())

    coo_array(shape, [dtype])
        to construct an empty sparse array with shape `shape`
        dtype is optional, defaulting to dtype='d'.

    coo_array((data, coords), [shape])
        to construct from existing data and index arrays:
            1. data[:]       the entries of the sparse array, in any order
            2. coords[i][:]  the axis-i coordinates of the data entries

        Where ``A[coords] = data``, and coords is a tuple of index arrays.
        When shape is not specified, it is inferred from the index arrays.

Attributes
----------
dtype : dtype
    Data type of the sparse array
shape : tuple of integers
    Shape of the sparse array
ndim : int
    Number of dimensions of the sparse array
nnz
size
data
    COO format data array of the sparse array
coords
    COO format tuple of index arrays
has_canonical_format : bool
    Whether the matrix has sorted coordinates and no duplicates
format
T

Notes
-----

Sparse arrays can be used in arithmetic operations: they support
addition, subtraction, multiplication, division, and matrix power.

Advantages of the COO format
    - facilitates fast conversion among sparse formats
    - permits duplicate entries (see example)
    - very fast conversion to and from CSR/CSC formats

Disadvantages of the COO format
    - does not directly support:
        + arithmetic operations
        + slicing

Intended Usage
    - COO is a fast format for constructing sparse arrays
    - Once a COO array has been constructed, convert to CSR or
      CSC format for fast arithmetic and matrix vector operations
    - By default when converting to CSR or CSC format, duplicate (i,j)
      entries will be summed together.  This facilitates efficient
      construction of finite element matrices and the like. (see example)

Canonical format
    - Entries and coordinates sorted by row, then column.
    - There are no duplicate entries (i.e. duplicate (i,j) locations)
    - Data arrays MAY have explicit zeros.

Examples
--------

>>> # Constructing an empty sparse array
>>> import numpy as np
>>> from scipy.sparse import coo_array
>>> coo_array((3, 4), dtype=np.int8).toarray()
array([[0, 0, 0, 0],
       [0, 0, 0, 0],
       [0, 0, 0, 0]], dtype=int8)

>>> # Constructing a sparse array using ijv format
>>> row  = np.array([0, 3, 1, 0])
>>> col  = np.array([0, 3, 1, 2])
>>> data = np.array([4, 5, 7, 9])
>>> coo_array((data, (row, col)), shape=(4, 4)).toarray()
array([[4, 0, 9, 0],
       [0, 7, 0, 0],
       [0, 0, 0, 0],
       [0, 0, 0, 5]])

>>> # Constructing a sparse array with duplicate coordinates
>>> row  = np.array([0, 0, 1, 3, 1, 0, 0])
>>> col  = np.array([0, 2, 1, 3, 1, 0, 0])
>>> data = np.array([1, 1, 1, 1, 1, 1, 1])
>>> coo = coo_array((data, (row, col)), shape=(4, 4))
>>> # Duplicate coordinates are maintained until implicitly or explicitly summed
>>> np.max(coo.data)
1
>>> coo.toarray()
array([[3, 0, 1, 0],
       [0, 2, 0, 0],
       [0, 0, 0, 0],
       [0, 0, 0, 1]])

rË   N)r0  r1  r2  r3  r7  r8  rË   r~   r6   r   r   w  s   † õkr~   c                   ó6   a € ] tR tRt o RtR tR tR tRtV t	R# )r   iæ  a¾  
A sparse matrix in COOrdinate format.

Also known as the 'ijv' or 'triplet' format.

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

    coo_matrix(S)
        with another sparse array or matrix S (equivalent to S.tocoo())

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

    coo_matrix((data, (i, j)), [shape=(M, N)])
        to construct from three arrays:
            1. data[:]   the entries of the matrix, in any order
            2. i[:]      the row indices of the matrix entries
            3. j[:]      the column indices of the matrix entries

        Where ``A[i[k], j[k]] = data[k]``.  When shape is not
        specified, it is inferred from the index arrays

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
    COO format data array of the matrix
row
    COO format row index array of the matrix
col
    COO format column index array of the matrix
has_canonical_format : bool
    Whether the matrix has sorted indices and no duplicates
format
T

Notes
-----

Sparse matrices can be used in arithmetic operations: they support
addition, subtraction, multiplication, division, and matrix power.

Advantages of the COO format
    - facilitates fast conversion among sparse formats
    - permits duplicate entries (see example)
    - very fast conversion to and from CSR/CSC formats

Disadvantages of the COO format
    - does not directly support:
        + arithmetic operations
        + slicing

Intended Usage
    - COO is a fast format for constructing sparse matrices
    - Once a COO matrix has been constructed, convert to CSR or
      CSC format for fast arithmetic and matrix vector operations
    - By default when converting to CSR or CSC format, duplicate (i,j)
      entries will be summed together.  This facilitates efficient
      construction of finite element matrices and the like. (see example)

Canonical format
    - Entries and coordinates sorted by row, then column.
    - There are no duplicate entries (i.e. duplicate (i,j) locations)
    - Data arrays MAY have explicit zeros.

Examples
--------

>>> # Constructing an empty matrix
>>> import numpy as np
>>> from scipy.sparse import coo_matrix
>>> coo_matrix((3, 4), dtype=np.int8).toarray()
array([[0, 0, 0, 0],
       [0, 0, 0, 0],
       [0, 0, 0, 0]], dtype=int8)

>>> # Constructing a matrix using ijv format
>>> row  = np.array([0, 3, 1, 0])
>>> col  = np.array([0, 3, 1, 2])
>>> data = np.array([4, 5, 7, 9])
>>> coo_matrix((data, (row, col)), shape=(4, 4)).toarray()
array([[4, 0, 9, 0],
       [0, 7, 0, 0],
       [0, 0, 0, 0],
       [0, 0, 0, 5]])

>>> # Constructing a matrix with duplicate coordinates
>>> row  = np.array([0, 0, 1, 3, 1, 0, 0])
>>> col  = np.array([0, 2, 1, 3, 1, 0, 0])
>>> data = np.array([1, 1, 1, 1, 1, 1, 1])
>>> coo = coo_matrix((data, (row, col)), shape=(4, 4))
>>> # Duplicate coordinates are maintained until implicitly or explicitly summed
>>> np.max(coo.data)
1
>>> coo.toarray()
array([[3, 0, 1, 0],
       [0, 2, 0, 0],
       [0, 0, 0, 0],
       [0, 0, 0, 1]])

c                ó”   € R V9  d&   VP                  R4      VP                  R4      3VR &   V P                  P                  V4       R# )r_   r|   ry   N)rh  Ú__dict__Úupdate)rm   Ústates   &&r6   Ú__setstate__Úcoo_matrix.__setstate__W  s>   € Ø˜5Ô ð  %Ÿy™y¨Ó/°·±¸5Ó1AÐBˆE�(‰OØ�‰×Ñ˜UÖ#r~   c                ó   € \        R 4      h)z('coo_matrix' object is not subscriptable©rb   )rm   rJ  s   &&r6   r`  Úcoo_matrix.__getitem__^  s   € ÜÐBÓCÐCr~   c                ó   € \        R 4      h)z4'coo_matrix' object does not support item assignmentry  )rm   rJ  r   s   &&&r6   rz  Úcoo_matrix.__setitem__a  s   € ÜÐNÓOÐOr~   rË   N)
r0  r1  r2  r3  r7  rv  r`  rz  r8  r9  r:  s   @r6   r   r   æ  s#   ø‡ € ñnò`$òD÷Pð Pr~   )r   r   ro  )r‹   )8r7  Ú__docformat__Ú__all__rØ   Úwarningsr   Únumpyr1   Ú
_lib._utilr   Ú_matrixr   Ú_sparsetoolsr   r   r	   r
   r   r   r   Ú_baser   r   r   r   Ú_datar   r   Ú_sputilsr   r   r   r   r   r   r   r   r   r   r   r   Ú_indexr    r!   rD   r#   r  r  ri  rj  rí  rÙ  r‘   ro  r   r   rË   r~   r6   Ú<module>rˆ     s¶   ðÙ 8à%€â
7€ã Ý ã å 'Ý ÷0÷ 0ñ 0÷ GÓ Fß .÷+÷ +÷ +ó +÷ 9ã ôK+�˜mô K+ò\,Fò2=ò2.òb
òò.#ô,<ò*%ô6l�	˜7ô lô^|P�˜9ö |Pr~   