+
    Y°³j²l  ã                   óØ   € R t Rt. ROt^ RIt^ RIt^RIHt ^RIH	t	H
t
Ht ^RIHt ^RIHtHtHtHtHtHtHtHt ]! 4       t ! R	 R
]	]]4      tR t ! R R]]
4      t ! R R]]4      tR# )zDictionary Of Keys based matrixzrestructuredtext enÚ	dok_arrayÚ
dok_matrixN)Úspmatrix)Ú_spbaseÚsparrayÚissparse)Ú
IndexMixin)ÚisdenseÚgetdtypeÚisshapeÚ	isintlikeÚisscalarlikeÚupcastÚupcast_scalarÚcheck_shapec                   óâ  a a€ ] tR t^t oRtR<tR=RR/R lltR tR>R ltR>R lt	]
P                  P                  ]n        ]
P                  P                  ]	n        R tR	 tR>R
 ltR tR t]3R ltR tR tR tR tR tR tR tR tR?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# t(R$ t)R% t*R& t+R' t,R( t-R) t.R* t/R+ t0R, t1R- t2R. t3R/ t4R0 t5R1 t6R@V 3R2 llt7]
Pn                  P                  ]7n        RAR3 lt8]
Pp                  P                  ]8n        R4 t9]
Pr                  P                  ]9n        ]:RBR5 l4       t;RCR6 lt<]
Px                  P                  ]<n        RCR7 lt=]
Pz                  P                  ]=n        RCR8 lt>]
P|                  P                  ]>n        R9 t?]
P~                  P                  ]?n        RDR: lt@]
P€                  P                  ]@n        R;tAVtBV ;tC# )EÚ	_dok_baseÚdokNÚmaxprintc               ó   € \         P                  ! WVR 7       \        V\        4      '       dW   \	        WP
                  R7      '       d;   \        WP
                  R7      V n        / V n        \        V\        R7      V n        R# \        V4      '       d±   VP                  V P                  8X  d   V'       d   VP                  4       MTpMVP                  4       pVe   VP!                  VRR7      pVP                  V n        \        VP"                  V P
                  R7      V n        \        VP                  4      V n        R#  \$        P&                  ! V4      pTP,                  ^8”  d   \/        RTP,                   R24      hTP,                  ^8X  d`   Te   TP!                  TRR7      p\1        T4       UUu/ uF  w  rxT^ 8w  g   K  YxbK  	  uppT n        \        TP                  4      T n        MLT P3                  YTR	7      P                  4       p	T	P                  T n        \        T	P                  4      T n        \        TP"                  T P
                  R7      T n        R#   \(         d   p\+        R4      ThRp?ii ; iu uppi )
)r   ©Úallow_nd)ÚdefaultNF©ÚcopyzInvalid input format.zDOK arrays don't yet support zD input.©ÚshapeÚdtype)r   Ú__init__Ú
isinstanceÚtupler   Ú	_allow_ndr   Ú_shapeÚ_dictr
   Úfloatr   r   Úformatr   ÚtodokÚastyper   ÚnpÚasarrayÚ	ExceptionÚ	TypeErrorÚndimÚ
ValueErrorÚ	enumerateÚ_coo_container)
ÚselfÚarg1r   r   r   r   ÚeÚiÚvÚds
   &&&&&$    ÚR/home/luca/screen-checking/.venv/lib/python3.14/site-packages/scipy/sparse/_dok.pyr   Ú_dok_base.__init__   s×  € Ü×Ò˜¨hÕ7ä�dœE×"Ò"¤w¨t¿n¹n×'MÓ'MÜ% d·^±^ÔDˆDŒKØˆDŒJÜ! %´Ô7ˆDŽJÜ�d�^Š^Ø�{‰{˜dŸk™kÔ)ß&*�t—y‘y”{°‘à—z‘z“|�àÒ Ø—{‘{ 5¨u�{Ó5�àŸ™ˆDŒJÜ% d§j¡j¸4¿>¹>ÔJˆDŒKÜ! $§*¡*Ó-ˆDŽJð@Ü—z’z $Ó'�ð �y‰y˜1Œ}Ü Ð#@ÀÇÁÀÈ8Ð!TÓUÐUà�y‰y˜AŒ~ØÒ$ØŸ;™; u°5˜;Ó9�DÜ/8¸¬ÔI©¡t qÀ!ÀqÁ&œd˜ašd©ÒI�”
Ü% d§j¡jÓ1�•
à×'Ñ'¨ÀÐ'ÓG×MÑMÓO�ØŸW™W�”
Ü% a§g¡gÓ.�”
Ü% d§j¡j¸4¿>¹>ÔJˆDŽKøô ô @ÜÐ 7Ó8¸aÐ?ûð@üó Js$   ÅI+ Æ=J
ÇJ
É+JÉ6JÊJc                óÌ  € \        V\        4      '       d   VP                  4       pMTpV EF  w  r4\        V4      '       d   V3M
\	        V4      p\        V4      V P                  8w  d   \        RV R24      h\        ;QJ d/    R \        WPP                  4       4       F  '       d   K   RM$	  RM ! R \        WPP                  4       4       4      '       d   K°  \        WPP                  4       FO  w  rg\        V4      '       g   \        RV 24      hV^ 8  d   \        RV R24      hWg8¼  g   KB  \        R	V R
24      h	  EK  	  V P                  P                  V4       R# )aÒ  Update values from a dict, sparse dok or iterable of 2-tuples like
``.items()``.

Parameters
----------
val : dict, dok_array, iterable of 2-tuples
    The values to update in the dok_array. If a dict or dok_array is
    provided, the keys and values will be taken from it. If an iterable
    of 2-tuples is provided, each tuple should contain a key and a value.
    Keys of the input must be sequences of nonnegative integers less than
    the shape for each axis.
úIndex ú! length needs to match self.shapec              3   óx   "  € T F0  w  r\        V4      ;'       d    ^ Tu;8*  ;'       d    V8  Mu x € K2  	  R# 5i©é    N)r   )Ú.0ÚidxÚmax_idxs   &  r6   Ú	<genexpr>Ú#_dok_base.update.<locals>.<genexpr>U   s5   é € ð á$:‘L�Cô ˜#“×5Ð5 1¨×#5Ô#5¨gÔ#5Ô5Û$:ùs   ‚:›:ª:FTz&integer keys required for update. Got znegative index z not allowed in updatezindex z is too large for self.shapeN)r   ÚdictÚitemsr   r    Úlenr,   Ú
IndexErrorÚallÚzipr   r#   Úupdate)r0   ÚvalÚinputsÚkeyÚvalueÚindexr?   r@   s   &&      r6   rI   Ú_dok_base.update?   s'  € ô �cœ4× Ò Ø—Y‘Y“[‰FàˆFä ‰JˆCÜ'¨Ÿnšn�S‘F´%¸³*ˆEÜ�5‹z˜TŸY™YÔ&Ü  6¨#¨Ð.OÐ!PÓQÐQß“3ñ ä$'¨¯z©zÔ$:ó—3—3’3ñ ä$'¨¯z©zÔ$:ó÷ ô ô
 %(¨¯z©zÖ$:‘L�CÜ$ SŸ>š>Ü(Ð+QÐRUÐQVÐ)WÓXÐXØ˜Q”wÜ(¨?¸3¸%Ð?UÐ)VÓWÐWØ–~Ü(¨6°#°Ð6RÐ)SÓTÐTô %;ñ !ð" 	�
‰
×Ñ˜&Ö!ó    c                óJ   € Ve   \        R4      h\        V P                  4      # )Nz7_getnnz over an axis is not implemented for DOK format.)ÚNotImplementedErrorrE   r#   ©r0   Úaxiss   &&r6   Ú_getnnzÚ_dok_base._getnnzd   s(   € ØÒÜ%ØIóð ô �4—:‘:‹ÐrP   c                óŠ   € Ve!   V P                  4       P                  VR7      # \        R V P                  4        4       4      # )N)rT   c              3   ó*   "  € T F	  q^ 8g  x € K  	  R# 5ir<   © )r>   Úxs   & r6   rA   Ú*_dok_base.count_nonzero.<locals>.<genexpr>n   s   é € Ð1¡=˜a˜–6£=ùs   ‚)ÚtocooÚcount_nonzeroÚsumÚvaluesrS   s   &&r6   r]   Ú_dok_base.count_nonzerok   s9   € ØÒØ—:‘:“<×-Ñ-°4Ð-Ó8Ð8ÜÑ1 4§;¡;¤=Ó1Ó1Ð1rP   c                ó,   € \        V P                  4      # ©N)rE   r#   ©r0   s   &r6   Ú__len__Ú_dok_base.__len__s   s   € Ü�4—:‘:‹ÐrP   c                ó   € WP                   9   # rb   ©r#   ©r0   rL   s   &&r6   Ú__contains__Ú_dok_base.__contains__v   s   € Ø—j‘jÑ Ð rP   c               ó8   € V P                   P                  W4      # )aQ  Insert key with a value of default if key is not in the dictionary.

Parameters
----------
key : int or tuple of int
    The key to look for in the dok_array.
default : optional
    The value to insert if `key` is not found. Default is None.

Returns
-------
scalar
    The value for `key` if `key` is in the dictionary, else `default`.
)r#   Ú
setdefault©r0   rL   r   s   """r6   rl   Ú_dok_base.setdefaulty   s   € ð �z‰z×$Ñ$ SÓ2Ð2rP   c               ó    € V P                   V R # rb   rg   rh   s   ""r6   Ú__delitem__Ú_dok_base.__delitem__Š   s   € Ø�J‰J�sŠOrP   c                ó:   € V P                   P                  4        R# )z$Remove all items from the dok_array.N)r#   Úclearrc   s   &r6   rs   Ú_dok_base.clear�   s   € à�
‰
×ÑÖrP   c               ó‚   € V\         J d   V P                  P                  V4      # V P                  P                  W4      # )a¢  Remove specified key and return the corresponding value.

Parameters
----------
key : tuple
    The key to remove from the dok_array.
default : optional
    The value to return if `key` is not found. If not provided and
    `key` is not found, a KeyError is raised.

Returns
-------
scalar
    The value associated with the removed key.

Raises
------
KeyError
    If the key is not found and default is not provided.
)Ú_NoValuer#   Úpoprm   s   """r6   rw   Ú_dok_base.pop‘   s2   € ð* ”hÓØ—:‘:—>‘> #Ó&Ð&à—:‘:—>‘> #Ó/Ð/rP   c                ó   € \        R 4      h)z*reversed is not defined for dok_array type)r+   rc   s   &r6   Ú__reversed__Ú_dok_base.__reversed__«   s   € ÜÐDÓEÐErP   c                óx   € \        V 4      P                   R \        V4      P                   2p\        RV 24      h©z and z unsupported operand type for |: ©ÚtypeÚ__name__r+   ©r0   ÚotherÚ
type_namess   && r6   Ú__or__Ú_dok_base.__or__®   ó;   € Ü˜T›
×+Ñ+Ð,¨E´$°u³+×2FÑ2FÐ1GÐHˆ
ÜÐ:¸:¸,ÐGÓHÐHrP   c                óx   € \        V 4      P                   R \        V4      P                   2p\        RV 24      hr}   r~   r�   s   && r6   Ú__ror__Ú_dok_base.__ror__²   r†   rP   c                óx   € \        V 4      P                   R \        V4      P                   2p\        RV 24      hr}   r~   r�   s   && r6   Ú__ior__Ú_dok_base.__ior__¶   r†   rP   c                ó6   € V P                   P                  4       # )a  
Remove and return a (key, value) pair as a 2-tuple, returned in LIFO (last-in,
first-out) order.

Returns
-------
key : tuple
    The key of the removed item.
value : scalar
    The value of the removed item.

Raises
------
KeyError
    If the dict is empty.
)r#   Úpopitemrc   s   &r6   rŽ   Ú_dok_base.popitemº   s   € ð" �z‰z×!Ñ!Ó#Ð#rP   c                ó6   € V P                   P                  4       # )z¥
Return a set-like object providing a view on the array's items.

Returns
-------
dict_items
    A view object displaying a list of a array's key-value tuple pairs.
)r#   rD   rc   s   &r6   rD   Ú_dok_base.itemsÍ   s   € ð �z‰z×ÑÓ!Ð!rP   c                ó6   € V P                   P                  4       # )z¡
Return a set-like object providing a view on the dict's keys.

Returns
-------
dict_keys
    A view object displaying a list of all the keys in the dictionary.
)r#   Úkeysrc   s   &r6   r“   Ú_dok_base.keysØ   s   € ð �z‰z�‰Ó Ð rP   c                ó6   € V P                   P                  4       # )zŸ
Return an object providing a view on the dict's values.

Returns
-------
dict_values
    A view object displaying a list of all the values in the dictionary.
)r#   r_   rc   s   &r6   r_   Ú_dok_base.valuesã   s   € ð �z‰z× Ñ Ó"Ð"rP   c                óV  € WP                   9   d   V P                   V,          # \        V4      '       d   V P                  ^8X  d   V3pV P                  \        V4      8w  d   \	        RV R24      h V F  p\        V4      '       d   K  Q h	  \        ;QJ d'    . R \        YP                  4       4       F  NK  	  5M ! R \        YP                  4       4       4      p\        ;QJ d/    R \        YP                  4       4       F  '       g   K   RM$	  RM ! R \        YP                  4       4       4      '       d   \	        R	4      hT P                  ^8X  d
   T^ ,          pT P                   P                  Y4      #   \
        \        \        3 d   p\	        R4      ThRp?ii ; i)
aK  This provides dict.get method functionality with type checking.

Parameters
----------
key : int or tuple of int
    The key to look for in the dok_array.
default : optional
    The value to return if `key` is not found. Default is 0.0.

Returns
-------
value
    The value associated with `key` if it exists, otherwise `default`.
r9   r:   z%Index must be or consist of integers.Nc              3   óH   "  € T F  w  rV^ 8  d	   W,           MTx € K  	  R# 5ir<   rY   ©r>   r3   ÚMs   &  r6   rA   Ú _dok_base.get.<locals>.<genexpr>  s!   é € ÐKÑ6J©d¨a˜Q œU�A–E¨Ô)Ó6Jùs   ‚ "c              3   óH   "  € T F  w  rV^ 8  ;'       g    W8¬  x € K  	  R# 5ir<   rY   r™   s   &  r6   rA   r›   	  s"   é € Ð@Ñ+?¡4 1ˆq�1‰u�ˆ˜™ŒÓ+?ùs   ‚"•"TFzIndex out of bounds.)r#   r   r,   rE   rF   ÚAssertionErrorr+   r-   r    rH   r   ÚanyÚget)r0   rL   r   r3   r2   s   &&&  r6   rŸ   Ú_dok_base.getî   s:  € ð —*‘*ÔØ—:‘:˜c•?Ð"Ü�S�>Š>˜dŸi™i¨1œnØ�&ˆCØ�9‰9œ˜C›Ô Ü˜v c UÐ*KÐLÓMÐMð	MÛ�Ü  —|”|Ð#�|ñ ÷ ŒeÑK´c¸#¿z¹zÔ6JÓK�e‰eÑK´c¸#¿z¹zÔ6JÓKÓKˆß‹3Ñ@¬3¨s·J±JÔ+?Ó@�3�3Š3Ñ@¬3¨s·J±JÔ+?Ó@×@Ò@ÜÐ3Ó4Ð4Ø�9‰9˜Œ>Ø�a•&ˆCØ�z‰z�~‰~˜cÓ+Ð+øô ¤	¬:Ð6ô 	MÜÐDÓEÈ1ÐLûð	Mús   Á3F ÂF ÆF(ÆF#Æ#F(c                ój   € V P                   P                  WP                  P                  ^ 4      4      # ©r=   ©r#   rŸ   r   r   )r0   r?   s   &&r6   Ú_get_intÚ_dok_base._get_int  s"   € Ø�z‰z�~‰~˜c§:¡:§?¡?°1Ó#5Ó6Ð6rP   c                óˆ   € \        VP                  V P                  ^ ,          4      !  pV P                  \	        V4      4      # r¢   )ÚrangeÚindicesr   Ú
_get_arrayÚlist)r0   r?   Úi_ranges   && r6   Ú
_get_sliceÚ_dok_base._get_slice  s0   € Ü˜Ÿ™ T§Z¡Z°¥]Ó3Ñ4ˆØ�‰œt G›}Ó-Ð-rP   c                ó–  € \         P                  ! V4      pVP                  ^ 8X  d`   V P                  P	                  \        V4      V P                  P                  ^ 4      4      p\         P                  ! W P                  R7      # V P                  VP                  V P                  R7      pVP                  4        Uu. uF  q@P                  P	                  V^ 4      NK   	  ppV'       d×   \        VP                  4      ^8X  d/   \        V4       F  w  rFV'       g   K  WcP                  V&   K  	  V# \         P                  ! \         P                  ! \        V4      4      VP                  4      p\        V4      ^8X  d
   V^ ,          M\!        V!  p\!        WuRR7       F  w  rFV'       g   K  WcP                  V&   K  	  V# u upi )r=   )Ústype©r   T)Ústrict)r(   r)   r,   r#   rŸ   Úintr   r   ÚarrayÚ_dok_containerr   ÚravelrE   r.   Úunravel_indexÚarangerH   )r0   r?   rJ   Únew_dokr3   Údok_valsr4   Únew_idxs   &&      r6   r©   Ú_dok_base._get_array  sB  € Ü�jŠj˜‹oˆØ�8‰8�qŒ=Ø—*‘*—.‘.¤ S£¨4¯:©:¯?©?¸1Ó+=Ó>ˆCÜ—8’8˜C§z¡zÔ2Ð2Ø×%Ñ% c§i¡i°t·z±zÐ%ÓBˆØ25·)±)´+Ó>±+¨Q—J‘J—N‘N 1 aÖ(±+ˆÐ>ßÜ�3—9‘9‹~ Ô"Ü% hÖ/‘D�Aß‘qØ+,Ÿ™ aÓ(ñ 0ð ˆô ×*Ò*¬2¯9ª9´S¸³]Ó+CÀSÇYÁYÓO�Ü(+¨G«¸Ô(9˜' !ž*¼sÀG¹}�Ü ¸$×?‘D�Aß‘qØ+,Ÿ™ aÓ(ñ @ð ˆùò ?s   Ã $Gc                ón   € V P                   P                  W3V P                  P                  ^ 4      4      # r¢   r£   ©r0   ÚrowÚcols   &&&r6   Ú_get_intXintÚ_dok_base._get_intXint,  s&   € Ø�z‰z�~‰~˜s˜j¨$¯*©*¯/©/¸!Ó*<Ó=Ð=rP   c                óF   € V P                  \        W^,           4      V4      # ©é   ©Ú_get_sliceXsliceÚslicer½   s   &&&r6   Ú_get_intXsliceÚ_dok_base._get_intXslice/  s   € Ø×$Ñ$¤U¨3°aµÓ%8¸#Ó>Ð>rP   c                óF   € V P                  V\        W"^,           4      4      # rÃ   rÅ   r½   s   &&&r6   Ú_get_sliceXintÚ_dok_base._get_sliceXint2  s   € Ø×$Ñ$ S¬%°¸1µWÓ*=Ó>Ð>rP   c                ó&  € VP                  V P                  ^ ,          4      w  r4pVP                  V P                  ^,          4      w  rgp\        W4V4      p	\        WgV4      p
\        V	4      \        V
4      3p\        V 4      ^V^ ,          ,          V^,          ,          8¼  d   V P	                  Wš4      # V P                  W°P                  R7      pV P                  4        F«  p\        \        V^ ,          4      V,
          V4      w  rïV^ 8w  g   V^ 8  g   Wë^ ,          8¼  d   KE  \        \        V^,          4      V,
          V4      w  ppV^ 8w  g   V^ 8  g   VV^,          8¼  d   K‰  V P                  V,          VP                  VV3&   K­  	  V# )r=   r°   )r¨   r   r§   rE   Ú_get_columnXarrayr´   r   r“   Údivmodr²   r#   )r0   r¾   r¿   Ú	row_startÚrow_stopÚrow_stepÚ	col_startÚcol_stopÚcol_stepÚ	row_rangeÚ	col_ranger   ÚnewdokrL   r3   ÚriÚjÚrjs   &&&               r6   rÆ   Ú_dok_base._get_sliceXslice5  sD  € Ø(+¯©°D·J±J¸qµMÓ(BÑ%ˆ	˜XØ(+¯©°D·J±J¸qµMÓ(BÑ%ˆ	˜XÜ˜)¨xÓ8ˆ	Ü˜)¨xÓ8ˆ	Ü�Y“¤ Y£Ð0ˆô ˆt‹9˜˜E !�H� u¨Q¥xÕ/Ô/à×)Ñ)¨)Ó?Ð?à×$Ñ$ U·*±*Ð$Ó=ˆØ—9‘9–;ˆCÜœ3˜s 1�v›;¨Õ2°HÓ=‰EˆAØ�QŒw˜!˜aœ% 1¨a­¤=ÙÜœ3˜s 1�v›;¨Õ2°HÓ=‰EˆAˆrØ�QŒw˜!˜aœ% 1¨¨a­¤=ÙØ!%§¡¨C¥ˆF�L‰L˜˜A˜Óñ ð ˆrP   c                óD   € V P                  V.VP                  4       4      # rb   )rÎ   rµ   r½   s   &&&r6   Ú_get_intXarrayÚ_dok_base._get_intXarrayL  s   € Ø×%Ñ% s e¨S¯Y©Y«[Ó9Ð9rP   c                ó    € V P                  VP                  4       V.4      pVP                  ^8”  d   VP                  VP                  4      # V# rÃ   )rÎ   rµ   r,   Úreshaper   )r0   r¾   r¿   Úress   &&& r6   Ú_get_arrayXintÚ_dok_base._get_arrayXintO  s?   € Ø×$Ñ$ S§Y¡Y£[°3°%Ó8ˆØ�8‰8�aŒ<Ø—;‘;˜sŸy™yÓ)Ð)Øˆ
rP   c                óˆ   € \        \        VP                  V P                  ^ ,          4      !  4      pV P	                  W4      # r¢   ©rª   r§   r¨   r   rÎ   r½   s   &&&r6   Ú_get_sliceXarrayÚ_dok_base._get_sliceXarrayU  ó3   € Ü”5˜#Ÿ+™+ d§j¡j°¥mÓ4Ñ5Ó6ˆØ×%Ñ% cÓ/Ð/rP   c                óˆ   € \        \        VP                  V P                  ^,          4      !  4      pV P	                  W4      # rÃ   ræ   r½   s   &&&r6   Ú_get_arrayXsliceÚ_dok_base._get_arrayXsliceY  ré   rP   c                ó$  € V P                  \        V4      \        V4      3V P                  R 7      p\        V4       FO  w  rE\        V4       F;  w  rgV P                  P                  WW3^ 4      pV'       g   K,  WƒP                  WF3&   K=  	  KQ  	  V# ©r°   )r´   rE   r   r.   r#   rŸ   )	r0   r¾   r¿   rØ   r3   ÚrrÚ   Úcr4   s	   &&&      r6   rÎ   Ú_dok_base._get_columnXarray]  sx   € à×$Ñ$¤c¨#£h´°C³Ð%9ÀÇÁÐ$ÓLˆä˜c–N‰DˆAÜ! #ž‘�Ø—J‘J—N‘N A 6¨1Ó-�ß‘1Ø)*—L‘L  Ó&ó 'ñ #ð
 ˆrP   c                óÜ  € \        \        P                  \        P                  ! W4      4      w  r4V P	                  VP
                  V P                  R 7      p\        P                  ! \        VP
                  ^ ,          4      \        VP
                  ^,          4      4       FE  pV P                  P                  W6,          WF,          3^ 4      pV'       g   K7  WuP                  V&   KG  	  V# rî   )Úmapr(   Ú
atleast_2dÚbroadcast_arraysr´   r   r   Ú	itertoolsÚproductr§   r#   rŸ   )r0   r¾   r¿   r3   rÚ   rØ   rL   r4   s   &&&     r6   Ú_get_arrayXarrayÚ_dok_base._get_arrayXarrayh  s£   € ä”2—=‘=¤"×"5Ò"5°cÓ"?Ó@‰ˆØ×$Ñ$ Q§W¡W°D·J±JÐ$Ó?ˆä×$Ò$¤U¨1¯7©7°1­:Ó%6¼¸a¿g¹gÀa½jÓ8IÖJˆCØ—
‘
—‘ ¥¨­Ð/°Ó3ˆAß‰qØ$%—‘˜SÓ!ñ Kð ˆrP   c                ót   € V'       d   W P                   V&   R # WP                   9   d   V P                   V R # R # rb   rg   )r0   r?   rZ   s   &&&r6   Ú_set_intÚ_dok_base._set_intt  s*   € ßØ�J‰J�s‹OØ—J‘JÔØ—
‘
˜3’ñ rP   c                ó¬  € VP                  4       pVP                  4       p\        V4      \        V4      8w  dP   \        V4      ^8X  d5   \        P                  ! \        V4      V^ ,          V P                  R7      pM\        R4      h\        W44       F<  w  rVV'       d   W`P                  V&   K  WPP                  9   g   K/  V P                  V K>  	  R# )rÄ   r°   z*Need len(index)==len(data) or len(data)==1N)rµ   rE   r(   Úfullr   r-   rH   r#   )r0   r?   rZ   Úidx_setÚx_setr3   r4   s   &&&    r6   Ú
_set_arrayÚ_dok_base._set_arrayz  s�   € Ø—)‘)“+ˆØ—‘“	ˆÜˆw‹<œ3˜u›:Ô%Ü�5‹z˜QŒÜŸš¤ G£¨e°A­h¸d¿j¹jÔI‘äÐKÓLÐLÜ˜Ö'‰DˆAßØ !—
‘
˜1“Ø—j‘j–Ø—J‘J˜q’Mó	 (rP   c                óz   € W3pV'       d   W0P                   V&   R # W@P                   9   d   V P                   V R # R # rb   rg   )r0   r¾   r¿   rZ   rL   s   &&&& r6   Ú_set_intXintÚ_dok_base._set_intXint‰  s1   € ØˆjˆßØ�J‰J�s‹OØ—J‘JÔØ—
‘
˜3’ñ rP   c                óÚ  € \        \        \        VP                  4       4      4      p\        \        \        VP                  4       4      4      pVP                  4       pV P                  P                  \        \        W4      V4      4       \        P                  ! V^ 8H  4      ^ ,           F:  pW,          W$,          3pV P                  V,          ^ 8X  g   K-  V P                  V K<  	  R# r<   )	rª   ró   r²   rµ   r#   rI   rH   r(   Únonzero)r0   r¾   r¿   rZ   r3   rL   s   &&&&  r6   Ú_set_arrayXarrayÚ_dok_base._set_arrayXarray�  s    € Ü”3”s˜CŸI™I›KÓ(Ó)ˆÜ”3”s˜CŸI™I›KÓ(Ó)ˆØ�G‰G‹IˆØ�
‰
×Ñœ#œc #›m¨QÓ/Ô0ä—’˜A ™FÓ# A×&Ð&ˆAØ•6˜3�6Ð"ˆCØ�z‰z˜#� !Ö#à—J‘J˜s’Oó	 'rP   c                óì  a€ \        V4      '       d¦   \        V P                  V4      pV P                  V P                  VR 7      o\
        P                  ! V P                   Uu. uF  p\        V4      NK  	  up!   F5  pV P                  P                  V^ 4      V,           pV'       g   K0  VSV&   K7  	  S# \        V4      '       Edd   VP                  V P                  8w  d   \        R4      h\        V P                  VP                  4      pV P                  V P                  VR 7      oV P                  P                  4       Sn        VP                  R8X  d   VP                  4       pMpVP!                  4       pV P"                  ^8X  d)   \%        VP&                  ^ ,          VP(                  4      pM'\%        \%        VP&                  !  VP(                  4      p\*        P,                  ! RR7      ;_uu_ 4        SP                  P/                  V3R lV 4       4       RRR4       S# \1        V4      '       d   V P3                  4       V,           oS# \4        # u upi   + '       g   i     S# ; i)r°   z Matrix dimensions are not equal.r   Úignore)Úoverc              3   óL   <"  € T F  w  rVSV,          V,           3x € K  	  R # 5irb   rY   )r>   Úkr4   Únews   &  €r6   rA   Ú$_dok_base.__add__.<locals>.<genexpr>´  s   øé € Ð E¹W±T°Q ! S¨¥V¨a¥Z¥»Wùs   ƒ!$N)r   r   r   r´   r   rö   r÷   r§   r#   rŸ   r   r-   r   r   r%   rD   r\   r,   rH   ÚcoordsÚdatar(   ÚerrstaterI   r	   ÚtodenseÚNotImplemented)r0   r‚   Ú	res_dtyper5   rL   ÚaijÚo_itemsr  s   &&     @r6   Ú__add__Ú_dok_base.__add__œ  sÉ  ø€ Ü˜×ÒÜ% d§j¡j°%Ó8ˆIØ×%Ñ% d§j¡j¸	Ð%ÓBˆCä ×(Ò(¸T¿ZºZÓ*H¹Z¸¬5°®8¹ZÑ*HÔI�Ø—j‘j—n‘n S¨!Ó,¨uÕ4�ß‘3Ø"�C˜“Hñ Jð0 ˆ
ô) �e�_‹_Ø�{‰{˜dŸj™jÔ(Ü Ð!CÓDÐDÜ˜tŸz™z¨5¯;©;Ó7ˆIØ×%Ñ% d§j¡j¸	Ð%ÓBˆCØŸ
™
Ÿ™Ó)ˆCŒIØ�|‰|˜uÔ$ØŸ+™+›-‘àŸ™›�Ø—9‘9 ”>Ü! %§,¡,¨q¥/°5·:±:Ó>‘Gä!¤# u§|¡|Ñ"4°e·j±jÓA�GÜ—’ (×+Ö+Ø—	‘	× Ñ Ô E¹WÓ EÔE÷ ,ð ˆ
ô	 �U�^Š^Ø—,‘,“. 5Õ(ˆCð ˆ
ô "Ð!ùò/ +I÷$ ,Ö+ð ˆ
ús   Á$IÇ=&I"É"I3	c                ó   € W,           # rb   rY   ©r0   r‚   s   &&r6   Ú__radd__Ú_dok_base.__radd__»  s
   € Ø�|ÐrP   c                ó   € V P                   P                  R 8X  d   \        R4      hV P                  V P                  V P                   R7      pVP
                  P                  R V P                  4        4       4       V# )Úbz2Negating a sparse boolean matrix is not supported.r°   c              3   ó.   "  € T F  w  rW) 3x € K  	  R # 5irb   rY   )r>   r  r4   s   &  r6   rA   Ú$_dok_base.__neg__.<locals>.<genexpr>Ä  s   é € Ð:©\¡T Q˜!˜R�«\ùs   ‚)r   ÚkindrR   r´   r   r#   rI   rD   ©r0   r  s   & r6   Ú__neg__Ú_dok_base.__neg__¾  sd   € Ø�:‰:�?‰?˜cÔ!Ü%ØDóð ð ×!Ñ! $§*¡*°D·J±JÐ!Ó?ˆØ�	‰	×ÑÑ:¨T¯Z©Z¬\Ó:Ô:Øˆ
rP   c                óÔ   a€ \        V P                  S4      pV P                  V P                  VR 7      pVP                  P                  V3R lV P                  4        4       4       V# )r°   c              3   ó<   <"  € T F  w  rWS,          3x € K  	  R # 5irb   rY   ©r>   r  r4   r‚   s   &  €r6   rA   Ú(_dok_base._mul_scalar.<locals>.<genexpr>Ë  s   øé € ÐB±\©T¨Q˜1 %�i�.³\ùó   ƒ)r   r   r´   r   r#   rI   rD   ©r0   r‚   r  r  s   &f  r6   Ú_mul_scalarÚ_dok_base._mul_scalarÇ  sO   ø€ Ü! $§*¡*¨eÓ4ˆ	à×!Ñ! $§*¡*°IÐ!Ó>ˆØ�	‰	×ÑÔB°T·Z±Z´\ÓBÔCØˆ
rP   c                óî  a a€ \        S P                  SP                  4      pS P                  ^8X  dÛ   \        S4      '       dŠ   SP                  R8X  d'   S P                  4       SP                  4       ,          pM6S P                  4       SP                  4       P                  ^ ,          ,          pV! \        VV 3R lV 4       4      4      # \        S4      '       d*   V! \        V3R lS P                  4        4       4      4      # \        # \        P                  ! S P                  ^ ,          VR7      pS P                  4        F*  w  w  rVpWE;;,          VSV,          ,          ,          uu&   K,  	  V# )rÄ   r   c              3   óz   <"  € T F0  pSP                   V,          SP                   V,          ,          x € K2  	  R # 5irb   rg   )r>   r  r‚   r0   s   & €€r6   rA   Ú+_dok_base._matmul_vector.<locals>.<genexpr>Ø  s)   øé € Ð$RÉTÈ T§Z¡Z°¥]°U·[±[Àµ^×%CÒ%CËTùs   ƒ8;c              3   óH   <"  € T F  w  rSV,          V,          x € K  	  R # 5irb   rY   r)  s   &  €r6   rA   r1  Ú  s   øé € Ð$K¹l±d°a U¨1¥X°§\¢\»lùó   ƒ"r°   )r   r   r,   r   r%   r“   r\   r  r^   r	   rD   r  r(   Úzerosr   )r0   r‚   r  r“   Úresultr3   rÚ   r4   s   ff      r6   Ú_matmul_vectorÚ_dok_base._matmul_vectorÎ  sú   ù€ Ü˜4Ÿ:™: u§{¡{Ó3ˆ	ð �9‰9˜Œ>Ü˜�ŠØ—<‘< 5Ô(ØŸ9™9›;¨¯©«Õ5‘DàŸ9™9›;¨¯©«×)=Ñ)=¸aÕ)@Õ@�DÙ ¤Õ$RÉTÓ$RÓ!RÓSÐSÜ˜—’Ù ¤Ô$K¸d¿j¹j¼lÓ$KÓ!KÓLÐLä%Ð%ô —’˜$Ÿ*™* Q�-¨yÔ9ˆØŸ™ž‰I‰FˆQ�AØ�I˜˜U 1�X�Õ%�Iñ &àˆrP   c                óæ  a€ \        V P                  SP                  4      pV P                  ^8X  d.   \        V3R lV P                  P                  4        4       4      # V P                  ^ ,          pSP                  ^8X  d   V3MVSP                  ^,          3p\        P                  ! WBR7      pV P                  4        F*  w  w  rgpWV;;,          VSV,          ,          ,          uu&   K,  	  V# )rÄ   c              3   óH   <"  € T F  w  rVSV,          ,          x € K  	  R # 5irb   rY   )r>   rÚ   r4   r‚   s   &  €r6   rA   Ú0_dok_base._matmul_multivector.<locals>.<genexpr>é  s   øé € ÐCÑ0B©¨�q˜5 �8—|’|Ó0Bùr3  r°   )	r   r   r,   r^   r#   rD   r   r(   r4  )	r0   r‚   Úresult_dtyperš   Ú	new_shaper5  r3   rÚ   r4   s	   &f       r6   Ú_matmul_multivectorÚ_dok_base._matmul_multivectorä  s¬   ø€ Ü˜dŸj™j¨%¯+©+Ó6ˆà�9‰9˜Œ>äÔC°·
±
×0@Ñ0@Ô0BÓCÓCÐCð �J‰J�q�MˆØ!ŸJ™J¨!œO�Q‘D°!°U·[±[Àµ^Ð1Dˆ	Ü—’˜)Ô8ˆØŸ™ž‰I‰FˆQ�AØ�I˜˜U 1�X�Õ%�Iñ &àˆrP   c                óœ   a€ \        S4      '       d6   V P                  P                  V3R  lV P                  4        4       4       V # \        # )c              3   ó<   <"  € T F  w  rWS,          3x € K  	  R # 5irb   rY   r)  s   &  €r6   rA   Ú%_dok_base.__imul__.<locals>.<genexpr>õ  ó   øé € ÐF¹±°˜q e¥)�n»ùr+  ©r   r#   rI   rD   r  r  s   &fr6   Ú__imul__Ú_dok_base.__imul__ó  ó7   ø€ Ü˜×ÒØ�J‰J×ÑÔF¸¿¹¼ÓFÔFØˆKÜÐrP   c                ó$  a€ \        S4      '       di   \        V P                  S4      pV P                  V P                  VR 7      pVP
                  P                  V3R lV P                  4        4       4       V# V P                  4       S,          # )r°   c              3   ó<   <"  € T F  w  rWS,          3x € K  	  R # 5irb   rY   r)  s   &  €r6   rA   Ú(_dok_base.__truediv__.<locals>.<genexpr>ý  rB  r+  )	r   r   r   r´   r   r#   rI   rD   Útocsrr,  s   &f  r6   Ú__truediv__Ú_dok_base.__truediv__ù  sk   ø€ Ü˜×ÒÜ% d§j¡j°%Ó8ˆIØ×%Ñ% d§j¡j¸	Ð%ÓBˆCØ�I‰I×ÑÔF¸¿¹¼ÓFÔGØˆJØ�z‰z‹|˜eÕ#Ð#rP   c                óœ   a€ \        S4      '       d6   V P                  P                  V3R  lV P                  4        4       4       V # \        # )c              3   ó<   <"  € T F  w  rWS,          3x € K  	  R # 5irb   rY   r)  s   &  €r6   rA   Ú)_dok_base.__itruediv__.<locals>.<genexpr>  rB  r+  rC  r  s   &fr6   Ú__itruediv__Ú_dok_base.__itruediv__  rF  rP   c                ó,   € \         P                  V 4      # rb   )rC   Ú
__reduce__rc   s   &r6   rS  Ú_dok_base.__reduce__  s   € ô �‰˜tÓ$Ð$rP   c                óZ   <€ V P                   ^8X  d   \        SV `	  V4      # \        R4      h)é   z diagonal requires two dimensions)r,   ÚsuperÚdiagonalr-   )r0   r  Ú	__class__s   &&€r6   rX  Ú_dok_base.diagonal  s*   ø€ Ø�9‰9˜Œ>Ü‘7Ñ# AÓ&Ð&ÜÐ;Ó<Ð<rP   c                ó.  € V P                   ^8X  d   V P                  4       # Ve   VR8w  d   \        R4      hV P                  w  r4V P	                  WC3V P
                  VR7      pVP                  P                  R V P                  4        4       4       V# )rÄ   zvSparse arrays/matrices do not support an 'axes' parameter because swapping dimensions is the only logical permutation.)r   r   c              3   ó6   "  € T F  w  w  rq2V3V3x € K  	  R # 5irb   rY   )r>   ÚleftÚrightrJ   s   &   r6   rA   Ú&_dok_base.transpose.<locals>.<genexpr>!  s   é € ÐVÉÑ3E±=°DÀ# 4˜=¨#Õ.Ëùs   ‚)rÄ   r=   )	r,   r   r-   r   r´   r   r#   rI   rD   )r0   Úaxesr   rš   ÚNr  s   &&&   r6   Ú	transposeÚ_dok_base.transpose  s„   € Ø�9‰9˜Œ>Ø—9‘9“;ÐàÒ ¨¤Üð>óð ð �z‰z‰ˆØ×!Ñ! 1 &°·
±
ÀÐ!ÓFˆØ�	‰	×ÑÑVÈÏÉÌÓVÔWØˆ
rP   c                óž   € V P                  V P                  V P                  R 7      pVP                  P	                  V P                  4       V# rî   )r´   r   r   r#   rI   r$  s   & r6   r   Ú_dok_base.copy&  s:   € Ø×!Ñ! $§*¡*°D·J±JÐ!Ó?ˆØ�	‰	×Ñ˜Ÿ™Ô$Øˆ
rP   c               óN  € \         P                  W4      p\        \        \	        V4      4      \
        4      '       d<   \
        ;QJ d    . R  \        V!   4       F  NK  	  5M! R  \        V!   4       4      pM\        V4      ^,           3pV ! V\        V4      R7      pW5n	        V# )c              3   óF   "  € T F  p\        V4      ^,           x € K  	  R# 5i)rÄ   N)Úmax)r>   r?   s   & r6   rA   Ú%_dok_base.fromkeys.<locals>.<genexpr>1  s   é € Ð<±)¨3œ#˜c›( QŸ,š,³)ùs   ‚!r°   )
rC   Úfromkeysr   ÚnextÚiterr    rH   rh  r   r#   )ÚclsÚiterablerM   Útmpr   r5  s   """   r6   rj  Ú_dok_base.fromkeys-  st   € ä�m‰m˜HÓ,ˆÜ”dœ4 ›9“o¤u×-Ò-ß”EÑ<´#°s²)Ó<—E‘EÑ<´#°s²)Ó<Ó<‰Eä˜“X •\�OˆEÙ�U¤$ u£+Ô.ˆØŒØˆrP   c                ód  aa€ V P                   oS^ 8X  d(   V P                  V P                  V P                  R7      # V P	                  \        V P                  4      R7      o\        P                  ! V P                  4       V P                  SR7      pV P                  ^8”  d   \        V P                  4       !  MV P                  4       3p\        ;QJ d    . VV3R lV 4       F  NK  	  5M! VV3R lV 4       4      pV P                  W$3V P                  V P                  R7      pRVn        V# )r=   r°   )Úmaxval©r   Úcountc              3   óV   <"  € T F  p\         P                  ! VSSR 7      x € K   	  R# 5i)rs  N)r(   Úfromiter)r>   ÚixÚ	idx_dtypeÚnnzs   & €€r6   rA   Ú"_dok_base.tocoo.<locals>.<genexpr>A  s!   øé € ÐRÉTÀr”r—{’{ 2¨Y¸c×BÑBËTùs   ƒ&)r   T)ry  r/   r   r   Ú_get_index_dtyperh  r(   rv  r_   r,   rH   r“   r    Úhas_canonical_format)r0   r   r  Úindsr  ÚArx  ry  s   &&    @@r6   r\   Ú_dok_base.tocoo8  sØ   ù€ Ø�h‰hˆØ�!Œ8Ø×&Ñ& t§z¡z¸¿¹Ð&ÓDÐDà×)Ñ)´°T·Z±Z³Ð)ÓAˆ	Ü�{Š{˜4Ÿ;™;›=°·
±
À#ÔFˆà$(§I¡I°¤MŒs�D—I‘I“KÒ ¸¿	¹	»°~ˆß”ÕRÉTÓR—‘ÕRÉTÓRÓRˆØ×Ñ  °d·j±jÈÏ
É
ÐÓSˆØ!%ˆÔØˆrP   c                ó6   € V'       d   V P                  4       # V # rb   r   ©r0   r   s   &&r6   r&   Ú_dok_base.todokH  s   € ßØ—9‘9“;ÐØˆrP   c                ó~   € V P                   ^8X  d   \        R4      hV P                  RR7      P                  VR7      # )rÄ   z%tocsr() not valid for 1d sparse arrayFr   )r,   rR   r\   Útocscr�  s   &&r6   r„  Ú_dok_base.tocscO  s8   € Ø�9‰9˜Œ>Ü%Ð&MÓNÐNØ�z‰z˜uˆzÓ%×+Ñ+°Ð+Ó6Ð6rP   c                óî  € \        WP                  R 7      p\        V4      \        V P                  4      8w  d   \        hV P
                  ^8X  dC   VR,          p\        V P                  4       F  pW28¼  g   K  V P                  V K  	  Wn        R# Vw  rBV P                  w  rVWE8  g   W&8  d?   \        V P                  4       4       F!  w  r7W48¼  g	   Wr8¼  g   K  V P                  W73 K#  	  Wn        R# )r   Néÿÿÿÿ)
r   r!   rE   r   rR   r,   rª   r#   r"   r“   )r0   r   ÚnewNr3   ÚnewMrš   ra  rÚ   s   &*      r6   ÚresizeÚ_dok_base.resizeV  s»   € Ü˜E¯N©NÔ;ˆÜˆu‹:œ˜TŸZ™Z›Ô(ä%Ð%à�9‰9˜Œ>Ø˜•9ˆDÜ˜$Ÿ*™*Ö%�Ø–9ØŸ
™
 1šñ &ð  ŒKÙà‰
ˆØ�z‰z‰ˆØŒ8�t”xä˜TŸY™Y›[Ö)‘�Ø”9 ¦	ØŸ
™
 1 4Ò(ñ *ð ŽrP   c                ó|  € \         P                  ! V4      pV P                  V8w  d}   V P                  V P                  VR 7      p\         P                  ! \        V P                  P                  4       4      VR 7      p\        \        V P                  V4      4      Vn        V# V'       d   V P                  4       # V # rî   )r(   r   r´   r   r³   rª   r#   r_   rC   rH   r   )r0   r   Úcastingr   r5  r  s   &&&&  r6   r'   Ú_dok_base.astypep  s†   € Ü—’˜“ˆØ�:‰:˜ÔØ×(Ñ(¨¯©¸5Ð(ÓAˆFÜ—8’8œD §¡×!2Ñ!2Ó!4Ó5¸UÔCˆDÜ¤ D§J¡J°Ó 5Ó6ˆFŒLØˆMßØ—9‘9“;ÐØˆrP   )r#   r"   r   )rÄ   rV  )NNFrb   )g        r¢   )NFrÃ   )F)ÚunsafeT)Dr€   Ú
__module__Ú__qualname__Ú__firstlineno__Ú_formatr!   r   rI   rU   r]   r   Ú__doc__rd   ri   rl   rp   rs   rv   rw   rz   r„   rˆ   r‹   rŽ   rD   r“   r_   rŸ   r¤   r¬   r©   rÀ   rÈ   rË   rÆ   rÞ   rã   rç   rë   rÎ   rø   rû   r  r  r  r  r  r%  r-  r6  r=  rD  rK  rP  rS  rX  rb  r   Úclassmethodrj  r\   r&   r„  rŠ  r'   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)rY  Ú__classdict__s   @@r6   r   r      s  ù‡ € Ø€GØ€Iñ%KÈTõ %KòN#"ôJô2ð
 —o‘o×-Ñ-€G„OØ#×1Ñ1×9Ñ9€MÔòò!ô3ò"òð  (ô 0ò4FòIòIòIò$ò&	"ò	!ò	#ô,òD7ò.òò*>ò?ò?òò.:òò0ò0ò	ò	ò ò"ò ò
$òò>òòòò,òò$òò%÷=ð
 ×'Ñ'×/Ñ/€HÔôð   ×)Ñ)×1Ñ1€IÔòð
 —<‘<×'Ñ'€D„Làóó ðôð —M‘M×)Ñ)€E„Môð
 —M‘M×)Ñ)€E„Mô7ð
 —M‘M×)Ñ)€E„Mòð. —^‘^×+Ñ+€F„Nô	ð —^‘^×+Ñ+€F‡N„NrP   r   c                ó"   € \        V \        4      # )a/  Is `x` of dok_array type?

.. warning::

   SciPy sparse is shifting from a sparse matrix interface to a sparse
   array interface. In the next few releases we expect to deprecate the
   sparse matrix interface. For documentation of the matrix
   interface, see the :ref:`spmatrix interface docs <spmatrix_api>`.
   For guidance on converting existing code to sparse arrays, see
   :ref:`Migration from spmatrix to sparray <migration_to_sparray>`.

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

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

Examples
--------
>>> from scipy.sparse import dok_array, dok_matrix, coo_matrix, isspmatrix_dok
>>> isspmatrix_dok(dok_matrix([[5]]))
True
>>> isspmatrix_dok(dok_array([[5]]))
False
>>> isspmatrix_dok(coo_matrix([[5]]))
False
)r   r   )rZ   s   &r6   Úisspmatrix_dokr›  ~  s   € ô@ �aœÓ$Ð$rP   c                   ó   € ] tR tRtRtRtR# )r   i¢  aw  
Dictionary Of Keys based sparse array.

This is an efficient structure for constructing sparse
arrays incrementally.

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

    dok_array(S)
        with another sparse array or matrix S (equivalent to S.todok())

    dok_array((M,N), [dtype])
        create the array with initial shape (M,N)
        dtype is optional, defaulting to dtype='d'

Attributes
----------
dtype : dtype
    Data type of the array
shape : 2-tuple
    Shape of the array
ndim : int
    Number of dimensions (this is always 2)
format : str
    Three letter code for the format of the array storage, e.g. 'dok'
nnz : int
    Number of values stored in the array
size : int
    Number of values stored in the array
T : dok_array
    The transpose of the array
mT : dok_array
    The matrix transpose of the array

Notes
-----

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

- Allows for efficient O(1) access of individual elements.
- Duplicates are not allowed.
- Can be efficiently converted to a coo_array once constructed.

Examples
--------
>>> import numpy as np
>>> from scipy.sparse import dok_array
>>> S = dok_array((5, 5), dtype=np.float32)
>>> for i in range(5):
...     for j in range(5):
...         S[i, j] = i + j    # Update element

rY   N)r€   r�  r‘  r’  r”  r–  rY   rP   r6   r   r   ¢  s   † õ7rP   c                   ó\   a € ] tR tRt o RtR tR t]! ]]R7      tR t	R t
R tR	 tR
tV tR# )r   iÝ  a$  
Dictionary Of Keys based sparse matrix.

This is an efficient structure for constructing sparse
matrices incrementally.

.. warning::

   SciPy sparse is shifting from a sparse matrix interface to a sparse
   array interface. In the next few releases we expect to deprecate the
   sparse matrix interface. For documentation of the matrix
   interface, see the :ref:`spmatrix interface docs <spmatrix_api>`.
   For guidance on converting existing code to sparse arrays, see
   :ref:`Migration from spmatrix to sparray <migration_to_sparray>`.

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

    dok_matrix(S)
        with another sparse array or matrix S (equivalent to S.todok())

    dok_matrix((M,N), [dtype])
        create the matrix with initial shape (M,N)
        dtype is optional, defaulting to dtype='d'

Attributes
----------
dtype : dtype
    Data type of the matrix
shape : 2-tuple
    Shape of the matrix
ndim : int
    Number of dimensions (this is always 2)
format : str
    Three letter code for the format of the matrix storage, e.g. 'dok'
nnz : int
    Number of values stored in the matrix
size : int
    Number of values stored in the matrix
T : dok_matrix
    The transpose of the matrix
mT : dok_matrix
    The matrix transpose

Notes
-----

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

- Allows for efficient O(1) access of individual elements.
- Duplicates are not allowed.
- Can be efficiently converted to a coo_matrix once constructed.

Examples
--------
>>> import numpy as np
>>> from scipy.sparse import dok_matrix
>>> S = dok_matrix((5, 5), dtype=np.float32)
>>> for i in range(5):
...     for j in range(5):
...         S[i, j] = i + j    # Update element

c                ó€   € V P                  VR R7      P                  V P                  4      pVP                  V n        R# )Fr   N)rá   Úasformatr%   Ú__dict__)r0   r   Ú
new_matrixs   && r6   Ú	set_shapeÚdok_matrix.set_shape   s0   € Ø—\‘\ %¨e�\Ó4×=Ñ=¸d¿k¹kÓJˆ
Ø"×+Ñ+ˆŽrP   c                ó   € V P                   # )zGet shape of a sparse matrix.)r"   rc   s   &r6   Ú	get_shapeÚdok_matrix.get_shape$  s   € à�{‰{ÐrP   )ÚfgetÚfsetc                ó6   € V P                   P                  4       # rb   )r#   rz   rc   s   &r6   rz   Údok_matrix.__reversed__*  s   € Ø�z‰z×&Ñ&Ó(Ð(rP   c                óŽ   € \        V\        4      '       d   V P                  VP                  ,          # V P                  V,          # rb   ©r   r   r#   r  s   &&r6   r„   Údok_matrix.__or__-  ó1   € Ü�eœY×'Ò'Ø—:‘: §¡Õ+Ð+Ø�z‰z˜EÕ!Ð!rP   c                óŽ   € \        V\        4      '       d   V P                  VP                  ,          # V P                  V,          # rb   r¬  r  s   &&r6   rˆ   Údok_matrix.__ror__2  r®  rP   c                ó®   € \        V\        4      '       d&   V ;P                  VP                  ,          un        V # V ;P                  V,          un        V # rb   r¬  r  s   &&r6   r‹   Údok_matrix.__ior__7  s=   € Ü�eœY×'Ò'Ø�JŠJ˜%Ÿ+™+Õ%�Jð ˆð �JŠJ˜%Õ�JØˆrP   )r   N)r€   r�  r‘  r’  r”  r¢  r¥  Úpropertyr   rz   r„   rˆ   r‹   r–  r—  )r™  s   @r6   r   r   Ý  s=   ø‡ € ñ@òD,òñ ˜)¨)Ô4€Eò)ò"ò
"÷
ð rP   )r   r   r›  )r”  Ú__docformat__Ú__all__rö   Únumpyr(   Ú_matrixr   Ú_baser   r   r   Ú_indexr   Ú_sputilsr	   r
   r   r   r   r   r   r   Úobjectrv   rC   r   r›  r   r   rY   rP   r6   Ú<module>r¼     st   ðÙ %à%€â
7€ã Û å ß -Ñ -Ý ÷;÷ ;ó ;ñ ‹8€ôg	,�˜ Tô g	,òT %ôH8�	˜7ô 8ôv_�˜9ö _rP   