+
    nDjX                         R t Rt. ROt^ RIHt ^ RIt^RIHt ^RI	H
t
HtHt ^RIHtHtHt ^R	IHtHtHtHtHt ^R
IHt  ! R R]
]4      tRR ltR t ! R R]]4      t ! R R]]4      tR# )z"List of Lists sparse matrix class
zrestructuredtext en	lil_array
lil_matrix)bisect_leftN)spmatrix)_spbasesparrayissparse)
IndexMixin	INT_TYPES_broadcast_arrays)getdtypeisshapeisscalarlikeupcast_scalarcheck_shape)_csparsetoolsc                     a  ] tR t^t o RtR+RR/R lltR tR tR tR	 t	R,R
 lt
]P                  P                  ]
n        R,R lt]P                  P                  ]n        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  t"]PD                  P                  ]"n        R!R"R#R/R$ lt#]PF                  P                  ]#n        R% t$]PH                  P                  ]$n        R-R& lt%]PJ                  P                  ]%n        R.R' lt&]PL                  P                  ]&n        R/R( lt']PN                  P                  ]'n        R/R) lt(]PP                  P                  ](n        R*t)V t*R# )0	_lil_baselilNFmaxprintc               @   \         P                  ! WVR 7       \        W1\        R7      V n        \        V4      '       d   VP                  R8X  d   V'       d   VP                  4       pMVP                  4       pVe   \        V4      pVP                  VRR7      p\        VP                  4      V n        VP                  V n        VP                  V n        VP                  V n        R# \        V\         4      '       d   \#        V4      '       d   Ve   \%        R4      hVw  r\        W34      V n        \&        P(                  ! V3\*        R7      V n        \&        P(                  ! V3\*        R7      V n        \-        V4       F!  p
. V P                  V
&   . V P                  V
&   K#  	  R# \/        R4      h V P1                  V4      p\        T \2        4      '       d+   TP4                  ^8w  d   \%        R
TP4                   R24      hT P7                  YcR7      P                  4       p\        TP                  4      T n        \        TP                  4      T n        TP                  T n        TP                  T n        R#   \.         d   p\/        R	4      ThRp?ii ; i))r   )defaultr   NFcopyzinvalid use of shape parameterdtypez(unrecognized lil_array constructor usagezunsupported matrix typezLIL arrays don't support zD input. Use 2D)r   __init__r   floatr   r   formatr   tolilastyper   shape_shaperowsdata
isinstancetupler   
ValueErrornpemptyobjectrange	TypeError_ascontainerr   ndim_csr_container)selfarg1r!   r   r   r   AnewdtypeMNies   &&&&&$      K/data/cameron/venvs/s3viz/lib/python3.14/site-packages/scipy/sparse/_lil.pyr   _lil_base.__init__   s   h7e59
 D>>{{e#IIKJJL #E?HHXEH2%agg.DKDJDIDIU##t}}$$%EFF)1&1HHaT8	HHaT8	qA#%DIIaL#%DIIaL "   JKKB%%d+ $((QVVq[ #<QVVHO!TUU##A#399;A%agg.DK!!''*DJDIDI  B 9:ABs   8J JJJc                    W,           V R&   V # NNN)r<   r<    r0   others   &&r8   __iadd___lil_base.__iadd__F       LS	    c                    W,
          V R&   V # r;   r=   r>   s   &&r8   __isub___lil_base.__isub__J   rB   rC   c                J    \        V4      '       d   W,          V R&   V # \        # r;   r   NotImplementedr>   s   &&r8   __imul___lil_base.__imul__N   #    DIK!!rC   c                J    \        V4      '       d   W,          V R&   V # \        # r;   rH   r>   s   &&r8   __itruediv___lil_base.__itruediv__U   rL   rC   c                   Vf/   \        V P                   Uu. uF  p\        V4      NK  	  up4      # V^ 8  d
   V^,          pV^ 8X  da   \        P                  ! V P
                  ^,          \        P                  R7      pV P                   F  pW4;;,          ^,          uu&   K  	  V# V^8X  dJ   \        P                  ! V P                   Uu. uF  p\        V4      NK  	  up\        P                  R7      # \        R4      hu upi u upi )Nr   axis out of bounds)
sumr$   lenr(   zerosr!   intpr#   arrayr'   )r0   axisrowvalsoutrows   &&   r8   _getnnz_lil_base._getnnz_   s    <DII>IGI>??!8AID19((4::a=8CyyA !JQY88CgS\C277SS122 ? Ds   DD
c                   Vf   \        R V P                   4       4      # V^ 8  d
   V^,          pV^ 8X  d   \        P                  ! V P                  ^,          \        P
                  R7      p\        V P                  V P                  4       F@  w  r4\        W44       UUu. uF  w  rVV^ 8w  g   K  VNK  	  pppW';;,          ^,          uu&   KB  	  V# V^8X  dU   \        P                  ! V P                   Uu. uF  p\        P                  ! V4      NK  	  up\        P
                  R7      # \        R4      hu uppi u upi )Nc              3   N   "   T F  p\         P                  ! V4      x  K  	  R # 5iN)r(   count_nonzero).0rX   s   & r8   	<genexpr>*_lil_base.count_nonzero.<locals>.<genexpr>r   s     J	Wr''00	s   #%r   rQ   )rR   r$   r(   rT   r!   rU   zipr#   rV   r`   r'   )	r0   rW   rY   rZ   r$   cdmaskrX   s	   &&       r8   r`   _lil_base.count_nonzerop   s    <J		JJJ!8AID19((4::a=8C DII6	&)#n?ndaQn?	Q	 7 JQY88:>))D)w!!'*)DBGG  122 @
 Es   "D;2D;:Ec                    V P                  ^V P                  ^,          3V P                  R7      pV P                  V,          VP                  ^ &   V P                  V,          VP                  ^ &   V# )zReturns a view of the 'i'th row (without copying).

Parameters
----------
i : int
    Row to return view of.

Returns
-------
lil_array or lil_matrix
    A view of the 'i'th row.
r   )_lil_containerr!   r   r#   r$   )r0   r6   news   && r8   
getrowview_lil_base.getrowview   sY     !!1djjm"4DJJ!Giiliil
rC   c                J   V P                   w  r#V^ 8  d	   W,          pV^ 8  g   W8  d   \        R4      hV P                  ^V3V P                  R7      pV P                  V,          R,          VP                  ^ &   V P
                  V,          R,          VP
                  ^ &   V# )zReturns a copy of the 'i'th row.

Parameters
----------
i : int
    Row to return a copy of.

Returns
-------
lil_array or lil_matrix
    A copy of the 'i'th row.
zrow index out of boundsr   r<   )r!   
IndexErrorrj   r   r#   r$   )r0   r6   r4   r5   rk   s   &&   r8   getrow_lil_base.getrow   s     zzq5FAq5AF677!!1a&

!;iil1oiil1o
rC   c                   \        V\        4      '       d[   \        V4      ^8X  dK   \        V^ ,          \        4      '       d.   \        V^,          \        4      '       d   V P                  ! V!  # \
        P                  ! W4      # )   )r%   r&   rS   r
   _get_intXintr	   __getitem__)r0   keys   &&r8   ru   _lil_base.__getitem__   s]    sE""s3x1}3q69--3q69--$$c**%%d00rC   c                    \         P                  ! V P                  ^ ,          V P                  ^,          V P                  V P                  W4      pV P
                  P                  V4      #     )r   lil_get1r!   r#   r$   r   type)r0   rZ   colvs   &&& r8   rt   _lil_base._get_intXint   sH    ""4::a=$**Q-#'99c8zzq!!rC   c                    \        VP                  V P                  ^ ,          4      !  pV P                  V\	        W"^,           4      4      # ry   )r+   indicesr!   _get_row_rangesslicer0   rZ   r}   s   &&&r8   _get_sliceXint_lil_base._get_sliceXint   s9    S[[A/0##CsE):;;rC   c                    V P                  VP                  4       \        W"^,           4      4      pVP                  ^8  d   VP	                  VP
                  4      # V# )   )r   ravelr   r.   reshaper!   )r0   rZ   r}   ress   &&& r8   _get_arrayXint_lil_base._get_arrayXint   sF    ""399;cq50AB88a<;;syy))
rC   c                (    V P                  V3V4      # r_   r   r   s   &&&r8   _get_intXslice_lil_base._get_intXslice   s    ##SFC00rC   c                v    \        VP                  V P                  ^ ,          4      !  pV P                  W4      # ry   )r+   r   r!   r   r   s   &&&r8   _get_sliceXslice_lil_base._get_sliceXslice   s.    S[[A/0##C--rC   c                $    V P                  W4      # r_   r   r   s   &&&r8   _get_arrayXslice_lil_base._get_arrayXslice   s    ##C--rC   c                h    \         P                  ! WP                  ^R7      pV P                  W4      # )r   )r   ndmin)r(   rV   r   _get_columnXarrayr   s   &&&r8   _get_intXarray_lil_base._get_intXarray   s'    hhs))15%%c//rC   c                    \         P                  ! VP                  V P                  ^ ,          4      !  pV P	                  W4      # ry   )r(   aranger   r!   r   r   s   &&&r8   _get_sliceXarray_lil_base._get_sliceXarray   s2    iiTZZ]34%%c//rC   c                N    \        VR,          V4      w  rV P                  W4      # )r<   )r<   N)r   _get_arrayXarrayr   s   &&&r8   r   _lil_base._get_columnXarray   s%    $S[#6$$S..rC   c           
     j   \        \        P                  \        W4      4      w  r4V P	                  VP
                  V P                  R 7      p\        P                  ! V P
                  ^ ,          V P
                  ^,          V P                  V P                  VP                  VP                  W44       V# r   )mapr(   
atleast_2d_prepare_index_for_memoryviewrj   r!   r   r   lil_fancy_getr#   r$   )r0   rZ   r}   r6   jrk   s   &&&   r8   r   _lil_base._get_arrayXarray   s}    2=="?"IJ!!!''!<##DJJqM4::a=$(IItyy$'HHchh$%	* 
rC   c                   VP                  V P                  ^,          4      w  r4p\        W4V4      p\        V4      pV P	                  \        V4      V3V P
                  R7      p\        P                  ! V P                  ^ ,          V P                  ^,          V P                  V P                  VP                  VP                  VW4WW4       V# )a[  
Fast path for indexing in the case where column index is slice.

This gains performance improvement over brute force by more
efficient skipping of zeros, by accessing the elements
column-wise in order.

Parameters
----------
rows : sequence or range
    Rows indexed. If range, must be within valid bounds.
col_slice : slice
    Columns indexed

r   )
r   r!   r+   rS   rj   r   r   lil_get_row_rangesr#   r$   )	r0   r#   	col_slicej_startj_stopj_stride	col_rangenjrk   s	   &&&      r8   r   _lil_base._get_row_ranges   s      %.$5$5djjm$D!'84	^!!3t9b/!D((A

1)-DII),388)-)0(		H 
rC   c           	         \         P                  ! V P                  ^ ,          V P                  ^,          V P                  V P                  WV4       R# rz   N)r   
lil_insertr!   r#   r$   )r0   rZ   r}   xs   &&&&r8   _set_intXint_lil_base._set_intXint  s5      A

1tyy!%Ca	9rC   c           	         \        \        P                  \        WV4      4      w  rEp\        P
                  ! V P                  ^ ,          V P                  ^,          V P                  V P                  WEV4       R# r   )	r   r(   r   r   r   lil_fancy_setr!   r#   r$   )r0   rZ   r}   r   r6   r   s   &&&&  r8   _set_arrayXarray_lil_base._set_arrayXarray	  sR    bmm%B3Q%OPa##DJJqM4::a=$(IItyy$%!	-rC   c                    \         P                  ! VP                  4       V P                  R 7      p\	        W14      w  r4V P                  WV4       R# )r   N)r(   asarraytoarrayr   r   r   )r0   rZ   r}   r   _s   &&&& r8   _set_arrayXarray_sparse!_lil_base._set_arrayXarray_sparse  s8    JJqyy{$**5 (c*rC   c                   \        V\        4      '       Ed   \        V4      ^8X  Ed   Vw  r4\        V\        4      '       d   \        V\        4      '       d   \	        V4      '       d   VP                  4       p\        V\        P                  4      '       d   VP                  4       pV P                  P                  V4      pVP                  ^8  d   \        R4      hV P                  W4V4      # \        V\        4      '       d   \        V\        4      '       d   V\        R4      8X  d}   V\        R4      8X  dm   \	        V4      '       d\   VP                  V P                  8X  dA   V P!                  W P                  R7      pVP"                  V n        VP$                  V n        R# \&        P(                  ! WV4       R# )rs   z&Trying to assign a sequence to an itemNr   )r%   r&   rS   r
   r   r   r(   ndarrayitemr   r|   sizer'   r   r   r!   rj   r#   r$   r	   __setitem__)r0   rv   r   rZ   r}   s   &&&  r8   r   _lil_base.__setitem__  s-   c5!!c#h!mHC#y))ji.H.HA;;		Aa,,AJJOOA&66A:$%MNN((1553&&:c5+A+A5;&3%++=QKKAGGtzz$9'''<FF	FF	t!,rC   c                D   V^ 8X  d*   V P                  V P                  V P                  R7      pV# \        V P                  V4      pV P	                  V4      p\        VP                  4       F*  w  rEV Uu. uF  qfV,          NK  	  upVP                  V&   K,  	  V# u upi )rz   r   )rj   r!   r   r   r    	enumerater$   )r0   r?   rk   	res_dtyper   rX   vals   &&     r8   _mul_scalar_lil_base._mul_scalar-  s    A:%%djj

%CC 
 &djj%8I++i(C'1
4;<GS5yyG< 2
 =s   6Bc                <   \        V4      '       dq   V P                  4       p\        P                  ! W4      Vn        \        VP                  4       F*  w  r4V Uu. uF  qUV,          NK  	  upVP                  V&   K,  	  V# V P                  4       V,          # u upi r_   )r   r   r(   result_typer   r   r$   tocsr)r0   r?   rk   r   rX   r   s   &&    r8   __truediv___lil_base.__truediv__:  sx    ))+Ct3CI'1
4;<GS5yyG< 2J::<%'' =s   Bc                   V P                   w  rV P                  V P                   V P                  R 7      p\        P                  ! WV P
                  V P                  VP
                  VP                  \        V4      ^ V^V4       V# r   )r!   rj   r   r   r   r#   r$   r+   )r0   r4   r5   rk   s   &   r8   r   _lil_base.copyE  si    zz!!$**DJJ!?((tyy$))),388U1X)*Aq!	5 
rC   orderCr   c                  \        W0P                  4      pW0P                  8X  d   V'       d   V P                  4       # V # V P                  W0P                  R 7      pVR8X  d|   V P                  ^,          p\        V P                  4       FM  w  rg\        V4       F9  w  r\        P                  ! We,          V	,           V4      w  rWV	3,          WJV3&   K;  	  KO  	  V# VR8X  d|   V P                  ^ ,          p\        V P                  4       FM  w  rg\        V4       F9  w  r\        P                  ! WiV,          ,           W14      w  rWV	3,          WJV3&   K;  	  KO  	  V# \        R4      h)r   r   Fz'order' must be 'C' or 'F')
r   r!   r   rj   r   r   r#   r(   unravel_indexr'   )r0   r   r   r!   rk   ncolsr6   rZ   r}   r   new_rnew_cnrowss   &$$*         r8   r   _lil_base.reshapeP  s/   E::. JJyy{"!!%zz!:C<JJqME#DII.'nFC#%#3#3AIM5#ILE(,T
Cu% - / 
 c\JJqME#DII.'nFC#%#3#3AE	M5#PLE(,T
Cu% - / 
 9::rC   c                2   \        V4      pVw  r#V P                  w  rEW$8  d*   V P                  R V V n        V P                  R V V n        MW$8  d}   \        P
                  ! V P                  V4      V n        \        P
                  ! V P                  V4      V n        \        WB4       F!  p. V P                  V&   . V P                  V&   K#  	  W58  d=   \        V P                  V P                  4       F  w  rx\        Ws4      p	WyR 1 WR 1 K  	  Wn	        R # r_   )
r   r!   r#   r$   r(   resizer+   rd   r   r"   )
r0   r!   new_Mnew_Nr4   r5   r6   rZ   r$   truncs
   &*        r8   r   _lil_base.resizeo  s    E"zz9		&5)DI		&5)DIY		$))U3DI		$))U3DI1_!		!!		! % 9 DII6	#C/KL 7
 rC   c                    V P                  W4      p\        V P                  4       F7  w  rE\        V4       F#  w  rgV P                  V,          V,          W4V3&   K%  	  K9  	  V# r_   )_process_toarray_argsr   r#   r$   )r0   r   rY   rf   r6   rZ   posr   s   &&&     r8   r   _lil_base.toarray  sV    &&u2		*FA#C.))A,s+Q$ ) + rC   c                h    V P                  VR 7      P                  VRR7      P                  RR 7      # )r   F)axesr   )r   	transposer   )r0   r   r   s   &&&r8   r   _lil_base.transpose  s2    zztz$..Du.EKKQVKWWrC   c                6    V'       d   V P                  4       # V # r_   r   )r0   r   s   &&r8   r   _lil_base.tolil  s    99;KrC   c                   V P                   w  r#V^ 8X  g   V^ 8X  d   V P                  W#3V P                  R7      # W#,          \        P                  ! \        P
                  4      P                  8:  d~   \        P
                  p\        P                  ! V^,           VR7      p^ V^ &   \        P                  ! V P                  VR,          4       \        P                  ! WUR7       VR,          pMV P                  VR7      p\        P                  ! W$R7      p\        P                  ! V P                  V4       VP                  \        P                  R7      pV P                  \        W64      R7      p\        P                  ! V^,           VR7      p^ V^ &   \        P                  ! WtVR,          R7       \        P                  ! WdR7      p\        P                  ! W`P                  R7      p	\        P                  ! V P                  V4       \        P                  ! V P                   V	4       V P                  WV3V P                   R7      # )rz   r   :r   NN)rY   )maxval)r   rY   )r!   )r!   r/   r   r(   iinfoint32maxr)   r   lil_get_lengthsr#   cumsum_get_index_dtyperR   int64lil_flatten_to_arrayr$   )
r0   r   r4   r5   	idx_dtypeindptrnnzlengthsr   r$   s
   &&        r8   r   _lil_base.tocsr  s   zz6Q!V&&vTZZ&@@ 3"((288$(((IXXa!e95FF1I))$))VBZ@IIf)*C--Q-7Ihhq2G))$))W=++BHH+-C--S[-AIXXa!e95FF1IIIgF2J?((30xx::.**499g>**499d; ""D6#:$**"MMrC   )r"   r$   r   r#   )NNFr_   )NN)NF)F)+__name__
__module____qualname____firstlineno___formatr   r@   rE   rJ   rN   r[   r   __doc__r`   rl   rp   ru   rt   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   __static_attributes____classdictcell__)__classdict__s   @r8   r   r      s    G-T -^""3 oo--GO3& $1199M$.1"
<1..00/
:9-+-0	( <<''DLC e : oo--GO. ^^++FN oo--GOX  ))11I MM))EMN@ MM))EMMrC   r   c                   V P                   VP                   8  d   VP                  V P                   4      pM6V P                   VP                   8  d   V P                  VP                   4      p V P                  P                  '       d0   V P                   \        P
                  \        P                  39  d    V P                  \        P                  4      p VP                  P                  '       d0   VP                   \        P
                  \        P                  39  d    VP                  \        P                  4      pVe1   VP                  P                  '       g   VP                  4       pWV3# W3# )a  
Convert index and data arrays to form suitable for passing to the
Cython fancy getset routines.

The conversions are necessary since to (i) ensure the integer
index arrays are in one of the accepted types, and (ii) to ensure
the arrays are writable so that Cython memoryview support doesn't
choke on them.

Parameters
----------
i, j
    Index arrays
x : optional
    Data arrays

Returns
-------
i, j, x
    Re-formatted arrays (x is omitted, if input was None)

)	r   r    flags	writeabler(   r   r   rU   r   )r6   r   r   s   &&&r8   r   r     s    . 	wwHHQWW	
177	HHQWW77"((/C CHHRWW77"((/C CHHRWW}ww   AQwtrC   c                "    \        V \        4      # )a0  Is `x` of lil_matrix 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 lil matrix

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

Examples
--------
>>> from scipy.sparse import lil_array, lil_matrix, coo_matrix, isspmatrix_lil
>>> isspmatrix_lil(lil_matrix([[5]]))
True
>>> isspmatrix_lil(lil_array([[5]]))
False
>>> isspmatrix_lil(coo_matrix([[5]]))
False
)r%   r   )r   s   &r8   isspmatrix_lilr    s    @ a$$rC   c                       ] tR tRtRtRtR# )r   i  a@  
Row-based LIst of Lists sparse array.

This is a structure for constructing sparse arrays incrementally.
Note that inserting a single item can take linear time in the worst case;
to construct the array efficiently, make sure the items are pre-sorted by
index, per row.

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

    lil_array(S)
        with another sparse array or matrix S (equivalent to S.tolil())

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

Attributes
----------
data : ndarray
    LIL format data array of the array
rows : ndarray
    LIL format row index array of the array
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. 'lil'
nnz : int
    Number of values stored in the array
size : int
    Number of values stored in the array
T : lil_array
    The transpose of the array
mT : lil_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.

Advantages of the LIL format
    - supports flexible slicing
    - changes to the array sparsity structure are efficient

Disadvantages of the LIL format
    - arithmetic operations LIL + LIL are slow (consider CSR or CSC)
    - slow column slicing (consider CSC)
    - slow matrix vector products (consider CSR or CSC)

Intended Usage
    - LIL is a convenient format for constructing sparse arrays
    - once an array has been constructed, convert to CSR or
      CSC format for fast arithmetic and matrix vector operations
    - consider using the COO format when constructing large arrays

Data Structure
    - An array (``self.rows``) of rows, each of which is a sorted
      list of column indices of non-zero elements.
    - The corresponding nonzero values are stored in similar
      fashion in ``self.data``.

r=   Nr  r  r  r  r  r  r=   rC   r8   r   r     s    DrC   c                       ] tR tRtRtRtR# )r   iV  a	  
Row-based LIst of Lists sparse matrix.

This is a structure for constructing sparse matrices incrementally.
Note that inserting a single item can take linear time in the worst case;
to construct the matrix efficiently, make sure the items are pre-sorted by
index, per row.

.. 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:
    lil_matrix(D)
        where D is a 2-D ndarray

    lil_matrix(S)
        with another sparse array or matrix S (equivalent to S.tolil())

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

Attributes
----------
data : ndarray
    LIL format data array of the matrix
rows : ndarray
    LIL format row index array of the matrix
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. 'lil'
nnz : int
    Number of values stored in the matrix
size : int
    Number of values stored in the matrix
T : lil_matrix
    The transpose of the matrix
mT : lil_array
    The transpose of the matrix

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

Advantages of the LIL format
    - supports flexible slicing
    - changes to the matrix sparsity structure are efficient

Disadvantages of the LIL format
    - arithmetic operations LIL + LIL are slow (consider CSR or CSC)
    - slow column slicing (consider CSC)
    - slow matrix vector products (consider CSR or CSC)

Intended Usage
    - LIL is a convenient format for constructing sparse matrices
    - once a matrix has been constructed, convert to CSR or
      CSC format for fast arithmetic and matrix vector operations
    - consider using the COO format when constructing large matrices

Data Structure
    - An array (``self.rows``) of rows, each of which is a sorted
      list of column indices of non-zero elements.
    - The corresponding nonzero values are stored in similar
      fashion in ``self.data``.

r=   Nr  r=   rC   r8   r   r   V  s    MrC   )r   r   r  r_   )r  __docformat____all__bisectr   numpyr(   _matrixr   _baser   r   r   _indexr	   r
   r   _sputilsr   r   r   r   r    r   r   r   r  r   r   r=   rC   r8   <module>r     sv    &
7    - - < <$ $ j* j*Z&R %HE	7 EPN9 NrC   