a
    CCCf	                  	   @   sd   d dl Zd dlmZmZ d dlmZ d dlmZm	Z	m
Z
mZ ejZeddddd ejddf	ddZdS )	    N)
csr_matrixissparse)convert_pydata_sparse_to_scipy)csgraph_to_densecsgraph_from_densecsgraph_masked_from_densecsgraph_from_maskedTFc                 C   s  |s|st dt| } |s4t| r4| jdkr4| j} t| r^|rPt| t|d} qt| |d} ntj	
| r|r| j}tj| jt|d} || |< qt| } nF|rt| |||
|	d} | j}tj| jtd} || |< nt| ||	|
d} | jdkrt d	| jd
 | jd krt d| S )z7Routine for validation and conversion of csgraph inputsz*Internal: dense or csr output must be trueZcsc)dtypecopy)
null_value)r
   r   nan_nullinfinity_null)r	   )r   r   r      z#compressed-sparse graph must be 2-Dr      z,compressed-sparse graph must be shape (N, N))
ValueErrorr   r   formatTr   DTYPEr   npmaZisMaskedArraymaskarraydatar   r   Zasarrayr   ndimshape)ZcsgraphZdirectedr	   Z
csr_outputZdense_outputZcopy_if_denseZcopy_if_sparseZnull_value_inZnull_value_outr   r   r    r   \/var/www/html/django/DPS/env/lib/python3.9/site-packages/scipy/sparse/csgraph/_validation.pyvalidate_graph   sD    



r   )numpyr   Zscipy.sparser   r   Zscipy.sparse._sputilsr   Zscipy.sparse.csgraph._toolsr   r   r   r   Zfloat64r   infr   r   r   r   r   <module>   s   