+
    /iL}                         R t ^ RIt^ RIt^ RIHtHtHtHtHtH	t	H
t
HtHt ^ RIHtHtHt . ROtR tR tRR/R	 ltRR
 lt ! R R4      tR tR# )z
Matrix Market I/O in Python.
See http://math.nist.gov/MatrixMarket/formats.html
for information about the Matrix Market format.
N)	asarrayrealimagconjzerosndarrayconcatenateonescan_cast)	coo_arrayissparse
coo_matrixMMFilec                 f    \        V \        4      '       d   V P                  R 4      # \        V 4      # )latin1)
isinstancebytesdecodestr)ss   &L/var/www/html/photoedit/myenv/lib/python3.14/site-packages/scipy/io/_mmio.pyasstrr      s'    !Uxx!!q6M    c                ,    \         P                  V 4      # )a  
Return size and storage parameters from Matrix Market file-like 'source'.

Parameters
----------
source : str or file-like
    Matrix Market filename (extension .mtx) or open file-like object

Returns
-------
rows : int
    Number of matrix rows.
cols : int
    Number of matrix columns.
entries : int
    Number of non-zero entries of a sparse matrix
    or rows*cols for a dense matrix.
format : str
    Either 'coordinate' or 'array'.
field : str
    Either 'real', 'complex', 'pattern', or 'integer'.
symmetry : str
    Either 'general', 'symmetric', 'skew-symmetric', or 'hermitian'.

Examples
--------
>>> from io import StringIO
>>> from scipy.io import mminfo

>>> text = '''%%MatrixMarket matrix coordinate real general
...  5 5 7
...  2 3 1.0
...  3 4 2.0
...  3 5 3.0
...  4 1 4.0
...  4 2 5.0
...  4 3 6.0
...  4 4 7.0
... '''


``mminfo(source)`` returns the number of rows, number of columns,
format, field type and symmetry attribute of the source file.

>>> mminfo(StringIO(text))
(5, 5, 7, 'coordinate', 'real', 'general')
)r   info)sources   &r   mminfor      s    ` ;;vr   spmatrixTc               6    \        4       P                  WR7      # )a?  
Reads the contents of a Matrix Market file-like 'source' into a matrix.

Parameters
----------
source : str or file-like
    Matrix Market filename (extensions .mtx, .mtz.gz)
    or open file-like object.
spmatrix : bool, optional (default: True)
    If ``True``, return sparse matrix. Otherwise return sparse array.

Returns
-------
a : ndarray or coo_array or coo_matrix
    Dense or sparse array depending on the matrix format in the
    Matrix Market file.

Examples
--------
>>> from io import StringIO
>>> from scipy.io import mmread

>>> text = '''%%MatrixMarket matrix coordinate real general
...  5 5 7
...  2 3 1.0
...  3 4 2.0
...  3 5 3.0
...  4 1 4.0
...  4 2 5.0
...  4 3 6.0
...  4 4 7.0
... '''

``mmread(source)`` returns the data as sparse matrix in COO format.

>>> m = mmread(StringIO(text), spmatrix=False)
>>> m
<COOrdinate sparse array of dtype 'float64'
     with 7 stored elements and shape (5, 5)>
>>> m.toarray()
array([[0., 0., 0., 0., 0.],
       [0., 0., 1., 0., 0.],
       [0., 0., 0., 2., 3.],
       [4., 5., 6., 7., 0.],
       [0., 0., 0., 0., 0.]])
)r   )r   read)r   r   s   &$r   mmreadr    T   s    ^ 8===33r   c                <    \        4       P                  WW#WE4       R# )a	  
Writes the sparse or dense array `a` to Matrix Market file-like `target`.

Parameters
----------
target : str or file-like
    Matrix Market filename (extension .mtx) or open file-like object.
a : array like
    Sparse or dense 2-D array.
comment : str, optional
    Comments to be prepended to the Matrix Market file.
field : None or str, optional
    Either 'real', 'complex', 'pattern', or 'integer'.
precision : None or int, optional
    Number of digits to display for real or complex values.
symmetry : None or str, optional
    Either 'general', 'symmetric', 'skew-symmetric', or 'hermitian'.
    If symmetry is None the symmetry type of 'a' is determined by its
    values.

Returns
-------
None

Examples
--------
>>> from io import BytesIO
>>> import numpy as np
>>> from scipy.sparse import coo_array
>>> from scipy.io import mmwrite

Write a small NumPy array to a matrix market file.  The file will be
written in the ``'array'`` format.

>>> a = np.array([[1.0, 0, 0, 0], [0, 2.5, 0, 6.25]])
>>> target = BytesIO()
>>> mmwrite(target, a)
>>> print(target.getvalue().decode('latin1'))
%%MatrixMarket matrix array real general
%
2 4
1
0
0
2.5
0
0
0
6.25

Add a comment to the output file, and set the precision to 3.

>>> target = BytesIO()
>>> mmwrite(target, a, comment='\n Some test data.\n', precision=3)
>>> print(target.getvalue().decode('latin1'))
%%MatrixMarket matrix array real general
%
% Some test data.
%
2 4
1.00e+00
0.00e+00
0.00e+00
2.50e+00
0.00e+00
0.00e+00
0.00e+00
6.25e+00

Convert to a sparse matrix before calling ``mmwrite``.  This will
result in the output format being ``'coordinate'`` rather than
``'array'``.

>>> target = BytesIO()
>>> mmwrite(target, coo_array(a), precision=3)
>>> print(target.getvalue().decode('latin1'))
%%MatrixMarket matrix coordinate real general
%
2 4 3
1 1 1.00e+00
2 2 2.50e+00
2 4 6.25e+00

Write a complex Hermitian array to a matrix market file.  Note that
only six values are actually written to the file; the other values
are implied by the symmetry.

>>> z = np.array([[3, 1+2j, 4-3j], [1-2j, 1, -5j], [4+3j, 5j, 2.5]])
>>> z
array([[ 3. +0.j,  1. +2.j,  4. -3.j],
       [ 1. -2.j,  1. +0.j, -0. -5.j],
       [ 4. +3.j,  0. +5.j,  2.5+0.j]])

>>> target = BytesIO()
>>> mmwrite(target, z, precision=2)
>>> print(target.getvalue().decode('latin1'))
%%MatrixMarket matrix array complex hermitian
%
3 3
3.0e+00 0.0e+00
1.0e+00 -2.0e+00
4.0e+00 3.0e+00
1.0e+00 0.0e+00
0.0e+00 5.0e+00
2.5e+00 0.0e+00

N)r   write)targetacommentfield	precisionsymmetrys   &&&&&&r   mmwriter)      s    X HNN6giBr   c            
         a  ] tR t^t o R+t]R 4       t]R 4       t]R 4       t]R 4       t	]R 4       t
]R 4       t]R 4       tRtR	t]]3t]R
 4       tRtRtRtRtRt]]]]]3t]R 4       tRtRtRtRt]]]]3t]R 4       t]R]R]R]R]R/t] R 4       t!] R 4       t"]R 4       t#] R,R l4       t$] R 4       t%] R 4       t&R  t'R!R"/R# lt(R-R% lt)R& t*R' t+R( t,R-R) lt-R*t.V t/R$# ).r   c                    V P                   # N)_rowsselfs   &r   rowsMMFile.rows       zzr   c                    V P                   # r,   )_colsr.   s   &r   colsMMFile.cols  r2   r   c                    V P                   # r,   )_entriesr.   s   &r   entriesMMFile.entries  s    }}r   c                    V P                   # r,   )_formatr.   s   &r   formatMMFile.format  s    ||r   c                    V P                   # r,   )_fieldr.   s   &r   r&   MMFile.field  s    {{r   c                    V P                   # r,   )	_symmetryr.   s   &r   r(   MMFile.symmetry  s    ~~r   c                b    V P                   V P                  V P                  V P                  39   # r,   )rC   SYMMETRY_SYMMETRICSYMMETRY_SKEW_SYMMETRICSYMMETRY_HERMITIANr.   s   &r   has_symmetryMMFile.has_symmetry  s2    ~~$"9"9"&">">"&"9"9"; ; 	;r   
coordinatearrayc                `    WP                   9  d   R V RV P                    2p\        V4      hR# )zunknown format type , must be one of N)FORMAT_VALUES
ValueError)r/   r=   msgs   && r   _validate_formatMMFile._validate_format#  s7    +++(0A$BTBTAUVCS/! ,r   integerunsigned-integerr   complexpatternc                `    WP                   9  d   R V RV P                    2p\        V4      hR# )zunknown field type rN   N)FIELD_VALUESrP   )r/   r&   rQ   s   && r   _validate_fieldMMFile._validate_field2  s7    )))'w.?@Q@Q?RSCS/! *r   general	symmetriczskew-symmetric	hermitianc                \    WP                   9  d   \        R V RV P                    24      hR# )zunknown symmetry type rN   N)SYMMETRY_VALUESrP   )r/   r(   s   &&r   _validate_symmetryMMFile._validate_symmetry@  sA    ///5hZ @//3/C/C.DF G G 0r   intpuint64dDc                     R # r,    rh   r   r   readerMMFile.readerM      r   c                     R # r,   rh   rh   r   r   writerMMFile.writerR  rk   r   c                   V P                  V4      w  r# VP                  4       pR VP                  4        4       w  rVrxp	VP                  R4      '       g   \	        R4      hVP                  4       R8X  g   \	        RV,           4      hVP                  4       R8X  d   V P                  pM!VP                  4       R8X  d   V P                  pV'       dF   VP                  4       '       d/   VP                  4       ^ ,          R9   d   VP                  4       pKL   VP                  4       '       g   VP                  4       pK(  VP                  4       p
WpP                  8X  dM   \        V
4      ^8X  g"   \	        RVP                  R	4      ,           4      h\        \        V
4      w  rW,          pMD\        V
4      ^8X  g"   \	        R
VP                  R	4      ,           4      h\        \        V
4      w  rpWWVP                  4       V	P                  4       3V'       d   VP                  4        # #   T'       d   TP                  4        i i ; i)aK  
Return size, storage parameters from Matrix Market file-like 'source'.

Parameters
----------
source : str or file-like
    Matrix Market filename (extension .mtx) or open file-like object

Returns
-------
rows : int
    Number of matrix rows.
cols : int
    Number of matrix columns.
entries : int
    Number of non-zero entries of a sparse matrix
    or rows*cols for a dense matrix.
format : str
    Either 'coordinate' or 'array'.
field : str
    Either 'real', 'complex', 'pattern', or 'integer'.
symmetry : str
    Either 'general', 'symmetric', 'skew-symmetric', or 'hermitian'.
c              3   T   "   T F  p\        VP                  4       4      x  K   	  R # 5ir,   )r   strip).0parts   & r   	<genexpr>MMFile.info.<locals>.<genexpr>y  s     >tzz|$$s   &(z%%MatrixMarketz%source is not in Matrix Market formatmatrixzProblem reading file header: rL   rK   zHeader line not of length 2: asciizHeader line not of length 3: %%   )_openreadlinesplit
startswithrP   lowerFORMAT_ARRAYFORMAT_COORDINATElstriprq   lenr   mapintclose)r/   r   streamclose_itlinemmidrv   r=   r&   r(   
split_liner0   r5   r9   s   &&            r   r   MMFile.infoW  s   6  ::f-/	 ??$D>> 2D&??#344 !HII<<>X- !@4!GHH ||~(**</// ;;==T[[]1%5%B!??,D jjll(J***:!+$%D%)[[%9&: ; ; j1
+:!+$%D%)[[%9&: ; ;&)#z&:#GNN$&  x s    B>H, H, *AH, /C#H, ,Ic                *    \         P                  ! V 4      p T^ ,          R8X  Ed8   \         P                  P	                  T 4      '       g   \         P                  P	                  T R,           4      '       d   T R,           p Mk\         P                  P	                  T R,           4      '       d   T R,           p M5\         P                  P	                  T R,           4      '       d
   T R,           p T P                  R4      '       d   ^ RIpTP                  Y4      pTR
3# T P                  R4      '       d   ^ RIpTP                  T R	4      pTR
3# \        Y4      p TR
3# T RR R8w  d
   T R,           p \        Y4      pTR
3#   \         d    T R3u # i ; i)a  Return an open file stream for reading based on source.

If source is a file name, open it (after trying to find it with mtx and
gzipped mtx extensions). Otherwise, just return source.

Parameters
----------
filespec : str or file-like
    String giving file name or file-like object
mode : str, optional
    Mode with which to open file, if `filespec` is a file name.

Returns
-------
fobj : file-like
    Open file-like object.
close_it : bool
    True if the calling function should close this file when done,
    false otherwise.
Frz.mtxz.mtx.gzz.mtx.bz2z.gzNz.bz2rbT)
osfspath	TypeErrorpathisfileendswithgzipopenbz2BZ2File)filespecmoder   r   r   s   &&   r   r{   MMFile._open  s^   4	#yy*H 7c> 77>>(++77>>(6/22'&0HWW^^HY$677')3HWW^^HZ$788'*4H  ''82 t| ""6**Xt4 t| h- t|	 }&#f,()Ft|A  	#U?"	#s   F   FFc                  a a S P                   w  poVS8w  d   \        P                  # R pR pS P                  P                  R9   p\        S 4      '       dq   S P                  4       o S P                  4       w  rVWV8  P                  4       WV8  P                  4       8w  d   \        P                  # S P                  4       o V 3R lpMV V3R lpV! 4        F  w  rp
V'       d   V
'       d   V^ 8w  d   RpMcV'       d	   W8w  d   Rp\        P                  ! RR7      ;_uu_ 4        V'       d
   W) 8w  d   RpRRR4       V'       d   V\        V	4      8w  d   RpV'       d   K  V'       d   K  V'       d   K   M	  V'       d   \        P                  # V'       d   \        P                  # V'       d   \        P                  # \        P                  #   + '       g   i     L; i)TFDc               3      <"   SP                  4        F.  w  w  rpW8  d   SW3,          pW#R 3x  K   W8X  g   K(  W"R3x  K0  	  R# 5i)FTN)items)ijaijajir$   s       r   symm_iterator+MMFile._get_symmetry.<locals>.symm_iterator  sG     %&WWYMVaSug"//".. &/s
   4AAc               3      <"   \        S4       F=  p \        V S4       F*  pSV,          V ,          SV ,          V,          r2W#W8H  3x  K,  	  K?  	  R # 5ir,   )range)r   r   r   r   r$   ns       r   r   r     sH     qA"1a[#$Q47AaDGS"00 ) "s   AAFignore)overN)shaper   SYMMETRY_GENERALdtypecharr   tocoononzerosumtodoknperrstater   rF   rG   rH   )r$   missymmisskewishermrowcolr   r   r   is_diagonalr   s   f          @r   _get_symmetryMMFile._get_symmetry  s[   ww16***% A;; 	AJS	 SYOO$55... 	A/1 (5#S{+#(cj"F[[h//#+!& 0 cT#Y."FFff (7  ,,,111,,,&&&! 0/s   $GG"c           
         \         P                  R V,          \         P                  R\         P                  R\         P                  RW3,          /P                  V R4      # )z%%.%ie
z%i
z%u
z%%.%ie %%.%ie
N)r   
FIELD_REALFIELD_INTEGERFIELD_UNSIGNEDFIELD_COMPLEXget)r&   r'   s   &&r   _field_templateMMFile._field_template&  sW    !!:	#9$$f%%v$$&7*'+
 #eT"	#r   c                *    V P                   ! R/ VB  R # )Nrh   )_init_attrs)r/   kwargss   &,r   __init__MMFile.__init__0  s    "6"r   r   Tc               0   V P                  V4      w  r4 V P                  V4       V P                  V4      pV'       d   VP                  4        T'       d"   \	        T\
        4      '       d   \        T4      pT#   T'       d   TP                  4        i i ; i)a  
Reads the contents of a Matrix Market file-like 'source' into a matrix.

Parameters
----------
source : str or file-like
    Matrix Market filename (extensions .mtx, .mtz.gz)
    or open file object.
spmatrix : bool, optional (default: True)
    If ``True``, return sparse matrix. Otherwise return sparse array.

Returns
-------
a : ndarray or coo_array or coo_matrix
    Dense or sparse array depending on the matrix format in the
    Matrix Market file.
)r{   _parse_header_parse_bodyr   r   r   r   )r/   r   r   r   r   datas   &&$   r   r   MMFile.read4  sy    $  ::f-	v&##F+D 
433d#D	  s   "A: :BNc                   V P                  VR4      w  rx V P                  WrW4WV4       V'       d   VP                  4        R# VP                  4        R#   T'       d   TP                  4        i TP                  4        i ; i)a  
Writes sparse or dense array `a` to Matrix Market file-like `target`.

Parameters
----------
target : str or file-like
    Matrix Market filename (extension .mtx) or open file-like object.
a : array like
    Sparse or dense 2-D array.
comment : str, optional
    Comments to be prepended to the Matrix Market file.
field : None or str, optional
    Either 'real', 'complex', 'pattern', or 'integer'.
precision : None or int, optional
    Number of digits to display for real or complex values.
symmetry : None or str, optional
    Either 'general', 'symmetric', 'skew-symmetric', or 'hermitian'.
    If symmetry is None the symmetry type of 'a' is determined by its
    values.
wbN)r{   _writer   flush)	r/   r#   r$   r%   r&   r'   r(   r   r   s	   &&&&&&&  r   r"   MMFile.writeU  s\    .  ::fd3	KK79G  s   A A +B c           	     X   V P                   P                  pV Uu. uF  q3R,          NK  	  pp\        VP                  4       4      \        V4      ,
          pV'       d   \	        R\        V4       RV 24      hV F&  p\        WVP                  VR,          R4      4       K(  	  R# u upi )zZ
Initialize each attributes with the corresponding keyword arg value
or a default of None
:   NNzfound z, invalid keyword arguments, please only use N)	__class__	__slots__setkeysrP   tuplesetattrr   )r/   r   attrsattrpublic_attrsinvalid_keyss   &,    r   r   MMFile._init_attrsx  s     ((-23UTRU36;;=)C,==veL&9%: ;;;G.J K K DD

48T :;  4s   B'c           	     l    V P                   P                  V4      w  r#rErgV P                  W#WEWgR 7       R# ))r0   r5   r9   r=   r&   r(   N)r   r   r   )r/   r   r0   r5   r9   r=   r&   r(   s   &&      r   r   MMFile._parse_header  s9    NN' 	5GUdw$ 	 	9r   c                :
   V P                   V P                  V P                  V P                  V P                  V P
                  3w  r#rErgV P                  P                  VR 4      pV P                  p	W`P                  8H  p
W`P                  8H  pW`P                  8H  pWpP                  8H  pWpP                  8H  pW`P                  8H  pWPP                  8X  Ed   \!        W#3VR7      p^p^ ^ ppV'       d   ^ VVV3&   VV^,
          8  d
   V^,          pV'       EdH   VP#                  4       pV'       d%   V^ ,          R9   g   VP%                  4       '       g   KG  V
'       d   \'        V4      pMMV'       d   \'        V4      pM9V'       d'   \)        \+        \,        VP/                  4       4      !  pM\-        V4      pVVVV3&   V	'       d9   VV8w  d2   V'       d
   V) VVV3&   M V'       d   \1        V4      VVV3&   MVVVV3&   VV^,
          8  d   V^,           pEK	  V^,           pV	'       g   ^ pEK  TpV'       g   EK,  ^ VVV3&   VV^,
          8  g   EKD  V^,          pEKP  V'       d&   V^ V39   d   VV^,
          8X  g   \3        R4      h V# V^ V39   d   VV8X  g   \3        R4      h V# WPP4                  8X  EdW   V^ 8X  d   \7        W#3VR7      # \!        VRR7      p\!        VRR7      pV'       d   \9        VRR7      pMOV
'       d   \!        VRR7      pM9V'       d   \!        VRR7      pM#V'       d   \!        VRR7      pM\!        VRR7      p^ pV EF  pV'       d%   V^ ,          R9   g   VP%                  4       '       g   K2  V^,           V8  d   \3        R	4      hVP/                  4       p\+        \&        VR
,          4      w  VV&   VV&   V'       g|   V
'       d   \'        V^,          4      VV&   M]V'       d   \'        V^,          4      VV&   M?V'       d#   \)        \+        \,        VR,          4      !  VV&   M\-        V^,          4      VV&   V^,          pEK
  	  VV8  d   \3        R4      hV^,          pV^,          pV	'       dr   VV8g  pVV,          pVV,          pVV,          p\;        VV34      p\;        VV34      pV'       d   VR,          pMV'       d   VP=                  4       p\;        VV34      p\7        VVV33W#3VR7      pV# \?        V4      h)N)r   z$Parse error, did not read all lines.intcint8rc   rd   rV   floatz5'entries' in header is smaller than number of entries:N   N:r   NNz4'entries' in header is larger than number of entries)r   r   rx   ) r0   r5   r9   r=   r&   r(   DTYPES_BY_FIELDr   rI   r   r   r   rG   rH   FIELD_PATTERNr   r   r|   rq   r   rV   r   r   r}   r   rP   r   r   r	   r   	conjugateNotImplementedError)r/   r   r0   r5   r9   r=   r&   symmr   rI   
is_integeris_unsigned_integer
is_complexis_skewis_herm
is_patternr$   r   r   r   r   IJVentry_numberlmaskod_Iod_Jod_Vs   &&                            r   r   MMFile._parse_body  s|   48IItyy48LL$++48JJ4O0GU $$((5((000
#':'::000
666111000
&&&tl%0ADaqA!Q$tax<FA$(tAw)34::<<d)C(d)C!3udjjl#;<C+C!Q$AF#&$!Q$ "&s)!Q$"%!Q$tAv:AAAA'"7&'AadG 46z !QaVTAX$%KLL )6V Q aVT	$%KLL )2P K --- !| $U;;gV,AgV,A/'0$'2'3'1LtAw)34::<<>G+$ &9 : :JJL36sAbE?0,<!!*-ad),,*-ad),#*13uae3D*E,*/!+,!) * g%  "5 6 6 FAFAQwwwD	*D	*BJD>>+DD	*1q!f+d\GA  &f--r   c                   \        V\        4      '       g@   \        V\        4      '       g*   \        V\        4      '       g   \	        VR 4      '       Ed   V P
                  p\        V4      p\        VP                  4      ^8w  d   \        R4      hVP                  w  rVe   W@P                  8X  d:   \        VP                  R4      '       g   \        R4      hVP                  R4      pMW@P                  8X  d.   VP                  P                   R9  d   VP                  R4      pMuW@P"                  8X  d-   VP                  P                   R9  d   VP                  R4      pM8\%        V4      '       g   \        R	\'        V4       24      hR
pVP                  w  rVP                  P                   p
Vf   V
R9   d   ^pM^pVfx   VP                  P(                  pVR8X  d+   \        VP                  R4      '       g   \        R4      hRpM0VR8X  d   RpM&VR8X  d   RpMVR8X  d   RpM\+        RV,           4      hVf   V P-                  V4      pV P.                  P1                  V4       V P.                  P3                  V4       V P.                  P5                  V4       RV RV RV R2pVP7                  VP9                  R4      4       VP;                  R4       F)  pRV R2pVP7                  VP9                  R4      4       K+  	  V P=                  WE4      pWpP
                  8X  Ed   RW3,          pVP7                  VP9                  R4      4       W@P                  V P                  V P>                  39   Ed.   W`P@                  8X  dX   \C        V	4       FF  p\C        V4       F4  pWVV3,          ,          pVP7                  VP9                  R4      4       K6  	  KH  	  R# W`PD                  8X  d`   \C        V	4       FN  p\C        V^,           V4       F4  pWVV3,          ,          pVP7                  VP9                  R4      4       K6  	  KP  	  R# \C        V	4       FF  p\C        W4       F4  pWVV3,          ,          pVP7                  VP9                  R4      4       K6  	  KH  	  R# W@P"                  8X  d   W`P@                  8X  do   \C        V	4       F]  p\C        V4       FK  pVVV3,          pV\G        V4      \I        V4      3,          pVP7                  VP9                  R4      4       KM  	  K_  	  R# \C        V	4       F]  p\C        W4       FK  pVVV3,          pV\G        V4      \I        V4      3,          pVP7                  VP9                  R4      4       KM  	  K_  	  R# W@PJ                  8X  d   \        R4      h\+        RV 24      hVPM                  4       pW`P@                  8w  dh   VPN                  VPP                  8  p\S        VPT                  V,          VPN                  V,          VPP                  V,          33VP                  R7      pRWVPV                  3,          pVP7                  VP9                  R4      4       V P=                  WE^,
          4      pW@PJ                  8X  df   \Y        VPN                  ^,           VPP                  ^,           4       F1  w  ppRVV3,          pVP7                  VP9                  R4      4       K3  	  R# W@P                  V P                  V P>                  39   d   \Y        VPN                  ^,           VPP                  ^,           VPT                  4       F@  w  pppRVV3,          VV,          ,           pVP7                  VP9                  R4      4       KB  	  R# W@P"                  8X  d   \Y        VPN                  ^,           VPP                  ^,           VPT                  4       FV  w  pppRVV3,          VVPF                  VPH                  3,          ,           pVP7                  VP9                  R4      4       KX  	  R# \+        RV 24      h) 	__array__zExpected 2 dimensional arrayNrc   zBmmwrite does not support integer dtypes larger than native 'intp'.fdre   r   rf   zunknown matrix type: rK   fFr   rT   fr   crV   urU   zunexpected dtype kind z%%MatrixMarket matrix  
r   ry   z%i %i
z*pattern type inconsisted with dense formatzUnknown field type )r   z	%i %i %i
z%i %i )-r   listr   r   hasattrr   r   r   r   rP   r   r
   r   OverflowErrorastyper   r   r   r   typekindr   r   r   rR   rZ   ra   r"   encoder}   r   r   r   r   rG   r   r   r   r   r   r   r   r   nnzzip)r/   r   r$   r%   r&   r'   r(   repr0   r5   typecoder  r   r   templater   r   r   coolower_triangle_maskr   r  re   s   &&&&&&&                r   r   MMFile._write  s   a*Q"8"8a71k#:#:##C
A177|q  !?@@JD ...#AGGV44+ -P Q Q(Aoo-ww||4/HHSM000ww||4/HHSM A;; #8a	!BCCCJD77<<4		=77<<Ds{00' )L M M!!* 84 ?@@))!,H 	'',&&u-))(3 (uAeWAhZrBT[[*+ MM$'DtfB<DLLX./ ( ''9###|+DLLX./++T__,,. .444"4[!&tA#+1g#5D"LLX)>? "- )
 !=!=="4[!&q1ud!3A#+1g#5D"LLX)>? "4 ) #4[!&qA#+1g#5D"LLX)>? "0 )
 ,,,444"4[!&tA"#AqD'C#+tCy$s).D#DD"LLX)>? "- ) #4[!&qA"#AqD'C#+tCy$s).D#DD"LLX)>? "0 ) ,,, !MNN  "5eW =>> '')C 000&)gg&8#*=!>!$)<!=!$)<!=!?!@ '*ii1  4sww"77DLLX./++EQ;?H***	377195DAq$1v-DLLX!67 6 --t..0 0"37719cggaiBGAq!$1v-(Q,?DLLX!67  C ,,,"37719cggaiBGAq!$1v-(affaff=M2MNDLLX!67  C  "5eW =>>r   rh   )r-   r4   r8   r<   r@   rC   )r    NNN)0__name__
__module____qualname____firstlineno__r   propertyr0   r5   r9   r=   r&   r(   rI   r   r   rO   classmethodrR   r   r   r   r   r   rY   rZ   r   rF   rG   rH   r`   ra   r   staticmethodri   rm   r   r{   r   r   r   r   r"   r   r   r   r   __static_attributes____classdictcell__)__classdict__s   @r   r   r      s    I             ; ; %L&5M" " M'NJMM!>:}!#L " " !$.$');.0BDO G G
 %f%x!3$c$c	+O     K K\ ; ;| =' ='@ # ##t B F<$9EPW? W?r   c                    . p ^ RI pVP                  VP                  4        ^ RIpVP                  VP
                  4       \        V4      p\        W4      '       * #   \         d     LHi ; i  \         d     L9i ; i)z
Check whether `stream` is compatible with numpy.fromfile.

Passing a gzipped file object to ``fromfile/fromstring`` doesn't work with
Python 3.
N)r   appendGzipFileImportErrorr   r   r   r   )r   bad_clsr   r   s   &   r   _is_fromfile_compatibler*    sy     Gt}}%s{{# GnG&***  
  s"   A A/ A,+A,/A=<A=)r   r    r)   r   r  )__doc__r   numpyr   r   r   r   r   r   r   r   r	   r
   scipy.sparser   r   r   __all__r   r   r    r)   r   r*  rh   r   r   <module>r/     s`    
 # # # 9 8
30j/4t /4hlC`x
? x
?v+r   