U
    É»|e	  ã                	   @   s\   d dl Zd dlmZ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Ú
isspmatrixÚisspmatrix_cscé   )Úcsgraph_to_denseÚcsgraph_from_denseÚcsgraph_masked_from_denseÚcsgraph_from_maskedTFc                 C   s   |s|st dƒ‚|s"t| ƒr"| j} t| ƒrL|r>t| t|d�} qÎt| |d�} n‚tj 	| ¡rˆ|r~| j
}tj| jt|d�} || |< qÎt| ƒ} nF|r¾t| |||
|	d�} | j
}tj| jtd�} || |< nt| ||	|
d�} | jdkràt 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 true)Ú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   ÚTr   r   ÚDTYPEr   ÚnpÚmaÚisMaskedArrayÚmaskÚarrayÚdatar	   r   Úasarrayr   ÚndimÚshape)ÚcsgraphÚdirectedr
   Ú
csr_outputÚdense_outputÚcopy_if_denseÚcopy_if_sparseZnull_value_inZnull_value_outr   r   r   © r"   ú]/var/www/website-v5/atlas_env/lib/python3.8/site-packages/scipy/sparse/csgraph/_validation.pyÚvalidate_graph	   sB    

ü
þ
r$   )Únumpyr   Úscipy.sparser   r   r   Ú_toolsr   r   r   r	   Úfloat64r   Úinfr$   r"   r"   r"   r#   Ú<module>   s       ü