
    _Mh^}                         d Z ddlZddlZddlmZmZmZmZmZm	Z	m
Z
mZmZ ddlmZmZmZ g dZd Zd Zdd	d
ZddZ G d d          Zd ZdS )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)mminfommreadmmwriteMMFilec                 t    t          | t                    r|                     d          S t          |           S )Nlatin1)
isinstancebytesdecodestr)ss    N/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/scipy/io/_mmio.pyasstrr      s1    !U "xx!!!q66M    c                 6    t                               |           S )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   r   r      s    ` ;;vr   Tspmatrixc                H    t                                          | |          S )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 ``coo_matrix``. Otherwise return ``coo_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   r   r   T   s    ^ 88==(=333r    c                 R    t                                          | |||||           dS )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   r   r      s+    X HHNN61guiBBBBBr   c            
          e Zd ZdZed             Zed             Zed             Zed             Zed             Z	ed             Z
ed             Zd	Zd
ZeefZed             ZdZdZdZdZdZeeeeefZed             ZdZdZdZdZeeeefZed             ZededededediZed             Z ed             Z!ed             Z"ed-d            Z#ed              Z$ed!             Z%d" Z&d#d$d%Z'	 	 d.d(Z(d) Z)d* Z*d+ Z+	 	 d.d,Z,d'S )/r   )_rows_cols_entries_format_field	_symmetryc                     | j         S N)r.   selfs    r   rowszMMFile.rows   
    zr   c                     | j         S r5   )r/   r6   s    r   colszMMFile.cols  r9   r   c                     | j         S r5   )r0   r6   s    r   entrieszMMFile.entries  s
    }r   c                     | j         S r5   )r1   r6   s    r   formatzMMFile.format  s
    |r   c                     | j         S r5   )r2   r6   s    r   r*   zMMFile.field  s
    {r   c                     | j         S r5   )r3   r6   s    r   r,   zMMFile.symmetry  s
    ~r   c                 8    | j         | j        | j        | j        fv S r5   )r3   SYMMETRY_SYMMETRICSYMMETRY_SKEW_SYMMETRICSYMMETRY_HERMITIANr6   s    r   has_symmetryzMMFile.has_symmetry  s'    ~$"9"&">"&"9"; ; 	;r   
coordinatearrayc                 P    || j         vrd| d| j          }t          |          d S )Nzunknown format type , must be one of )FORMAT_VALUES
ValueError)r7   r?   msgs      r   _validate_formatzMMFile._validate_format#  s<    +++VVV$BTVVCS//! ,+r   integerunsigned-integerr   complexpatternc                 P    || j         vrd| d| j          }t          |          d S )Nzunknown field type rJ   )FIELD_VALUESrL   )r7   r*   rM   s      r   _validate_fieldzMMFile._validate_field2  s<    )))SSS@QSSCS//! *)r   general	symmetriczskew-symmetric	hermitianc                 L    || j         vrt          d| d| j                    d S )Nzunknown symmetry type rJ   )SYMMETRY_VALUESrL   )r7   r,   s     r   _validate_symmetryzMMFile._validate_symmetry@  sS    4/// Fh F F/3/CF F G G G 0/r   intpuint64dDc                      d S r5    ra   r   r   readerzMMFile.readerM      r   c                      d S r5   ra   ra   r   r   writerzMMFile.writerR  rc   r   c                    |                      |          \  }}	 |                                }d |                                D             \  }}}}}	|                    d          st	          d          |                                dk    st	          d|z             |                                dk    r| j        }n|                                dk    r| j        }|rH|                                r1|                                d         d	v r|                                }nn|H|	                                s(|                                }|	                                (|                                }
|| j        k    rVt          |
          d
k    s%t	          d|                    d          z             t          t          |
          \  }}||z  }nQt          |
          dk    s%t	          d|                    d          z             t          t          |
          \  }}}|||||                                |	                                f|r|                                 S S # |r|                                 w w xY w)a  
        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   X   K   | ]%}t          |                                          V  &d S r5   )r   strip).0parts     r   	<genexpr>zMMFile.info.<locals>.<genexpr>y  s2      >>tzz||$$>>>>>>r   z%%MatrixMarketz%source is not in Matrix Market formatmatrixzProblem reading file header: rH   rG   r   %%      zHeader line not of length 2: ascii   zHeader line not of length 3: )_openreadlinesplit
startswithrL   lowerFORMAT_ARRAYFORMAT_COORDINATElstriprh   lenr   mapintclose)r7   r   streamclose_itlinemmidrl   r?   r*   r,   
split_liner8   r;   r=   s                 r   r   zMMFile.infoW  s   6  ::f--/	 ??$$D>>>>> 2D&&%??#344 J !HIII<<>>X-- !@4!GHHH ||~~((*<///  ;;== T[[]]1%5%B%B!??,,DD	   jjll )(( jjll ) J***:!++$%D%)[[%9%9&: ; ; ; j11
d+:!++$%D%)[[%9%9&: ; ; ;&)#z&:&:#dG$NN$$&  x s   H<I. .Jrbc                    	 t          j        |           } n# t          $ r | dfcY S w xY w|d         dk    rt           j                            |           swt           j                            | dz             r| dz   } nOt           j                            | dz             r| dz   } n't           j                            | dz             r| dz   } |                     d          rddl}|                    | |          }nd|                     d	          rddl}|	                    | d
          }n4t          | |          }n#| dd         dk    r| dz   } t          | |          }|dfS )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.
        Fr   rz.mtxz.mtx.gzz.mtx.bz2z.gzNz.bz2r   T)
osfspath	TypeErrorpathisfileendswithgzipopenbz2BZ2File)filespecmoder   r   r   s        r   rs   zMMFile._open  s   4	#y**HH 	# 	# 	#U?"""	# 7c>> 7>>(++ 57>>(6/22 5'&0HHW^^HY$677 5')3HHW^^HZ$788 5'*4H  '' .8T22""6** .


Xt44h-- }&&#f,(D))Ft|s    ((c                      j         \  }|k    rt          j        S d}d} j        j        dv }t                     r                                                                   \  }}||k                                     ||k                                    k    rt          j        S  	                                  fd}n fd} |            D ]t\  }}	}
|r|
r	|dk    rd}nY|r||	k    rd}t          j        d          5  |r	||	 k    rd}d d d            n# 1 swxY w Y   |r|t          |	          k    rd}|s|s|s nu|rt          j        S |rt          j        S |rt          j        S t          j        S )	NTFDc               3      K                                    D ]-\  \  } }}| |k    r|| f         }||dfV   | |k    r||dfV  .d S )NFT)items)ijaijajir(   s       r   symm_iteratorz+MMFile._get_symmetry.<locals>.symm_iterator  sy      %&WWYY / /MVaS1uu1g"C/////a"C..../ /r   c               3      K   t                    D ]<} t          |           D ])}|         |          |          |         }}|||| k    fV  *=d S r5   )range)r   r   r   r   r(   ns       r   r   z+MMFile._get_symmetry.<locals>.symm_iterator  su      q 1 1A"1a[[ 1 1#$Q47AaDGS"Ca0000011 1r   r   Fignore)over)shaper   SYMMETRY_GENERALdtypecharr   tocoononzerosumtodoknperrstater   rC   rD   rE   )r(   missymmisskewishermrowcolr   r   r   is_diagonalr   s   `          @r   _get_symmetryzMMFile._get_symmetry  s-   w166**% A;; 	1 		AJS#c	  S3YOO$5$555.. 		A/ / / / / /1 1 1 1 1 1 (5} 	 	#S#{ 
#+ 
##(( #cSjj"F[h/// ' ' '##++!&' ' ' ' ' ' ' ' ' ' ' ' ' ' '  #cT#YY.."F f    	-,, 	211 	-,,&&s   DD!	$D!	c           
          t           j        d|z  t           j        dt           j        dt           j        d||fz  i                    | d           S )Nz%%.%ie
z%i
z%u
z%%.%ie %%.%ie
)r   
FIELD_REALFIELD_INTEGERFIELD_UNSIGNEDFIELD_COMPLEXget)r*   r+   s     r   _field_templatezMMFile._field_template&  sP    !:	#9$f%v$&7	*'+
 #eT""	#r   c                       | j         di | d S )Nra   )_init_attrs)r7   kwargss     r   __init__zMMFile.__init__0  s!    ""6"""""r   Tr    c                >   |                      |          \  }}	 |                     |           |                     |          }|r|                                 n# |r|                                 w w xY w|r$t	          |t
                    rt          |          }|S )aB  
        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 ``coo_matrix``. Otherwise return ``coo_array``.

        Returns
        -------
        a : ndarray or coo_array or coo_matrix
            Dense or sparse array depending on the matrix format in the
            Matrix Market file.
        )rs   _parse_header_parse_bodyr~   r   r   r   )r7   r   r!   r   r   datas         r   r#   zMMFile.read4  s    $  ::f--	v&&&##F++D     	$
433 	$d##Ds   *A A4r$   Nc                 &   |                      |d          \  }}	 |                     ||||||           |r|                                 dS |                                 dS # |r|                                 w |                                 w xY w)a7  
        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)rs   _writer~   flush)	r7   r'   r(   r)   r*   r+   r,   r   r   s	            r   r&   zMMFile.writeU  s    .  ::fd33	KK7E9hGGG    s   A# #-Bc           
      D   | j         j        }d |D             }t          |                                          t          |          z
  }|r"t	          dt          |           d|           |D ]/}t          | ||                    |dd         d                     0dS )zr
        Initialize each attributes with the corresponding keyword arg value
        or a default of None
        c                 "    g | ]}|d d         S )   Nra   )ri   attrs     r   
<listcomp>z&MMFile._init_attrs.<locals>.<listcomp>  s     333TQRR333r   zfound z, invalid keyword arguments, please only use r   N)	__class__	__slots__setkeysrL   tuplesetattrr   )r7   r   attrspublic_attrsinvalid_keysr   s         r   r   zMMFile._init_attrsx  s     (33U3336;;==))C,=,== 	K JeL&9&9 J J;GJ J K K K  	< 	<DD$

48T : :;;;;	< 	<r   c                 ~    | j                             |          \  }}}}}}|                     ||||||           d S )N)r8   r;   r=   r?   r*   r,   )r   r   r   )r7   r   r8   r;   r=   r?   r*   r,   s           r   r   zMMFile._parse_header  sZ    N'' 	5dGVUHdwv$x 	 	9 	9 	9 	9 	9r   c           	         | j         | j        | j        | j        | j        | j        f\  }}}}}}| j                            |d           }| j        }	|| j	        k    }
|| j
        k    }|| j        k    }|| j        k    }|| j        k    }|| j        k    }|| j        k    ryt!          ||f|          }d}d\  }}|rd|||f<   ||dz
  k     r|dz  }|r|                                }|r|d         dv s|                                s8|
rt'          |          }nR|rt'          |          }n@|r/t)          t+          t,          |                                           }nt-          |          }||||f<   |	r/||k    r)|r	| |||f<   n|rt1          |          |||f<   n||||f<   ||dz
  k     r|dz   }n#|dz   }|	sd}n|}|rd|||f<   ||dz
  k     r|dz  }||r |d|fv r	||dz
  k    st3          d          nv|d|fv r||k    st3          d          nY|| j        k    r>|dk    rt7          ||f|          S t!          |d          }t!          |d          }|rt9          |d          }nM|
rt!          |d	          }n9|rt!          |d
          }n%|rt!          |d          }nt!          |d          }d}|D ]}|r|d         dv s|                                s#|dz   |k    rt3          d          |                                }t+          t&          |d d                   \  ||<   ||<   |sx|
rt'          |d                   ||<   n]|rt'          |d                   ||<   nB|r(t)          t+          t,          |dd                     ||<   nt-          |d                   ||<   |dz  }||k     rt3          d          |dz  }|dz  }|	ro||k    }||         }||         }||         }t;          ||f          }t;          ||f          }|r|dz  }n|r|                                }t;          ||f          }t7          |||ff||f|          }nt?          |          |S )N)r   r   )r   r   r   rm   z$Parse error, did not read all lines.intcint8r\   r]   rQ   floatz5'entries' in header is smaller than number of entriesrp   z4'entries' in header is larger than number of entries)r   r   ) r8   r;   r=   r?   r*   r,   DTYPES_BY_FIELDr   rF   r   r   r   rD   rE   FIELD_PATTERNrx   r   rt   rh   r}   rQ   r|   r   ru   r   rL   ry   r   r
   r	   	conjugateNotImplementedError)r7   r   r8   r;   r=   r?   r*   symmr   rF   
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   zMMFile._parse_body  s   48Ity48L$+48J4O0dGVUD $((55(d00
#t'::d00
$66$11d00
T&&&tTl%000ADDAq !Q$tax<<FA  '(( tAw)334::<<3 &d))CC( &d))CC &!3udjjll#;#;<CC++C!Q$ &AFF &#&$!Q$  &"&s))!Q$"%!Q$tAv::AAAAA' '" '&'AadG 46zz !QA   'D  MaVTAX$%KLLL )6 aVT		$%KLLL )2 t--- !|| $U;;;;gV,,,AgV,,,A 	2/// 2'000$ 2'222 2'333'111L " " tAw)334::<<3>G++$ &9 : : :JJLL36sAbqbE??0,<! 6! 6*-ad)),, 6*-ad)),# 6*13uae3D3D*E,*/!++,!g%%  "5 6 6 6 FAFA +QwwwD	**D	** ,BJDD ,>>++DD	**1q!f+dD\GGGAA%f---r   c                 |   t          |t                    s:t          |t                    s%t          |t                    st	          |d          r| j        }t          |          }t          |j                  dk    rt          d          |j        \  }}	||| j
        k    r:t          |j        d          st          d          |                    d          }n|| j        k    r$|j        j        dvr|                    d          }ni|| j        k    r#|j        j        dvr|                    d	          }n:t%          |          st          d
t'          |                     d}|j        \  }}	|j        j        }
|	|
dv rd}nd}|f|j        j        }|dk    r't          |j        d          st          d          d}n-|dk    rd}n$|dk    rd}n|dk    rd}nt+          d|z             ||                     |          }| j                            |           | j                            |           | j                            |           d| d| d| d}|                    |                    d                     |                    d          D ]0}d| d}|                    |                    d                     1|                     ||          }|| j        k    rd||	fz  }|                    |                    d                     || j
        | j        | j        fv r,|| j         k    r[tC          |	          D ]I}tC          |          D ]7}||||f         z  }|                    |                    d                     8Jd S || j"        k    r_tC          |	          D ]M}tC          |dz   |          D ]7}||||f         z  }|                    |                    d                     8Nd S tC          |	          D ]J}tC          ||          D ]7}||||f         z  }|                    |                    d                     8Kd S || j        k    r|| j         k    rytC          |	          D ]g}tC          |          D ]U}|||f         }|tG          |          tI          |          fz  }|                    |                    d                     Vhd S tC          |	          D ]h}tC          ||          D ]U}|||f         }|tG          |          tI          |          fz  }|                    |                    d                     Vid S || j%        k    rt          d          t+          d |           |&                                }|| j         k    rK|j'        |j(        k    }tS          |j*        |         |j'        |         |j(        |         ff|j        !          }d"||	|j+        fz  }|                    |                    d                     |                     ||dz
            }|| j%        k    rWtY          |j'        dz   |j(        dz             D ]4\  }}d||fz  }|                    |                    d                     5d S || j
        | j        | j        fv rdtY          |j'        dz   |j(        dz   |j*                  D ];\  }}}d#||fz  ||z  z   }|                    |                    d                     <d S || j        k    rptY          |j'        dz   |j(        dz   |j*                  D ]G\  }}}d#||fz  ||j#        |j$        fz  z   }|                    |                    d                     Hd S t+          d |           )$N	__array__rp   zExpected 2 dimensional arrayr\   zBmmwrite does not support integer dtypes larger than native 'intp'.fdr^   r   r_   zunknown matrix type: rG   fF      r   rO   fr   crQ   urP   zunexpected dtype kind z%%MatrixMarket matrix  
r   rn   z%i %i
r   z*pattern type inconsisted with dense formatzUnknown field type )r   z	%i %i %i
z%i %i )-r   listr   r   hasattrrx   r   r{   r   rL   r   r   r   OverflowErrorastyper   r   r   r   typekindr   r   r   rN   rU   r[   r&   encoderu   r   r   r   r   rD   r   r   r   r   r   r   r   r   nnzzip)r7   r   r(   r)   r*   r+   r,   repr8   r;   typecoder   r   r   templater   r   r   coolower_triangle_maskr   r   r^   s                          r   r   zMMFile._write  s   a 	!*Q"8"8 	!a	!#*1k#:#:	!#C

A17||q   !?@@@JD$ D...#AGV44 Q+ -P Q Q Q((AAdo--w|4//HHSMMd000w|4//HHSMM A;; D !Ba!B!BCCCCJD$7<4			=7<Ds{{00 M' )L M M M!!* 84 ?@@@))!,,H 	'',,,&&u---))(333 CBBeBBhBBBT[[**+++ MM$'' 	0 	0Dt<<<DLLX..////''y99$###d|+DLLX..///+T_,. . .t444"4[[ @ @!&t @ @A#+a1g#5D"LLX)>)>????@@ @
 !==="4[[ @ @!&q1ud!3!3 @ @A#+a1g#5D"LLX)>)>????@@ @ #4[[ @ @!&q$ @ @A#+a1g#5D"LLX)>)>????@@ @
 $,,,t444"4[[ @ @!&t @ @A"#AqD'C#+tCyy$s)).D#DD"LLX)>)>????@@ @ #4[[ @ @!&q$ @ @A"#AqD'C#+tCyy$s)).D#DD"LLX)>)>????@@ @ $,,, !MNNN   =e = =>>> ''))C 4000&)g&8#*=!>!$)<!=!$)<!=!?!@ '*i1 1 1  4sw"77DLLX..///++E9Q;??H***	371955 8 8DAq$1v-DLLX!6!677778 8 4-t.0 0 0"3719cgaiBB 8 8GAq!$1v-(Q,?DLLX!6!677778 8 $,,,"3719cgaiBB 8 8GAq!$1v-(afaf=M2MNDLLX!6!677778 8   =e = =>>>r   )r   r$   NNN)-__name__
__module____qualname__r   propertyr8   r;   r=   r?   r*   r,   rF   ry   rx   rK   classmethodrN   r   r   r   r   r   rT   rU   r   rC   rD   rE   rZ   r[   r   staticmethodrb   re   r   rs   r   r   r   r#   r&   r   r   r   r   ra   r   r   r   r      s       I   X   X   X   X   X   X ; ; X; %L&5M" " [" M'NJMM!>:}!#L " " [" !$.$');.0BDO G G [G
 %f%x!3$c$c	+O   \   \ K K [K\ ; ; ; \;| =' =' \='@ # # \## # # (,     B BF       F< < <$9 9 9E E EP CGW? W? W? W? W? W?r   r   c                    g }	 ddl }|                    |j                   n# t          $ r Y nw xY w	 ddl}|                    |j                   n# t          $ r Y nw xY wt          |          }t          | |           S )z
    Check whether `stream` is compatible with numpy.fromfile.

    Passing a gzipped file object to ``fromfile/fromstring`` doesn't work with
    Python 3.
    r   N)r   appendGzipFileImportErrorr   r   r   r   )r   bad_clsr   r   s       r   _is_fromfile_compatibler    s     Gt}%%%%   


s{####    GnnG&'****s   # 
00A 
A A r  )__doc__r   numpyr   r   r   r   r   r   r   r	   r
   r   scipy.sparser   r   r   __all__r   r   r   r   r   r  ra   r   r   <module>r     sd    
			    # # # # # # # # # # # # # # # # # # # # # # 9 8 8 8 8 8 8 8 8 8
3
3
3  0 0 0j  $ /4 /4 /4 /4 /4hlC lC lC lC`x
? x
? x
? x
? x
? x
? x
? x
?v+ + + + +r   