o
    h	                  	   @   sX   d dl Zd dlmZ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   )csgraph_to_densecsgraph_from_densecsgraph_masked_from_densecsgraph_from_maskedTFc                 C   s
  |s|st d|st| r| jdkr| j} t| r+|r$t| t|d} nHt| |d} nAtj	| rI|rD| j
}tj| jt|d} || |< n(t| } n#|rdt| |||
|	d} | j
}tj| jtd} || |< nt| ||	|
d} | jdkrut d	| jd
 | jd krt d| S )z7Routine for validation and conversion of csgraph inputsz*Internal: dense or csr output must be truecsc)dtypecopy)
null_value)r   r   nan_nullinfinity_null)r
   )r   r   r      z#compressed-sparse graph must be 2-Dr   r   z,compressed-sparse graph must be shape (N, N))
ValueErrorr   formatTr   DTYPEr   npmaisMaskedArraymaskarraydatar   r   asarrayr   ndimshape)csgraphdirectedr
   
csr_outputdense_outputcopy_if_densecopy_if_sparsenull_value_innull_value_outr   r   r    r%   [/var/www/html/scripts/venv/lib/python3.10/site-packages/scipy/sparse/csgraph/_validation.pyvalidate_graph	   sB   



r'   )numpyr   scipy.sparser   r   _toolsr   r   r   r   float64r   infr'   r%   r%   r%   r&   <module>   s    