
    _MhE
              	       p    d dl Zd dl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ZdS )    N)issparse)convert_pydata_sparse_to_scipy)csgraph_to_densecsgraph_from_densecsgraph_masked_from_densecsgraph_from_maskedTFc                    |s|st          d          |g}|	r|                    t          j                   |
r|                    t          j                   t          | |          } |s!t          |           r| j        dk    r| j        } t          |           rE|r1| 	                    |          
                    t          d          } nt          | |          } nt          j                            |           r@|r.| j        }t          j        | j        t          |          } || |<   nft%          |           } nV|rAt'          | |||
|	          } | j        }t          j        | j        t          	          } || |<   nt+          | ||	|

          } | 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)	accept_fvcsc)copyF)
null_value)dtyper   )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))
ValueErrorappendnpinfnanr   r   formatTtocsrastypeDTYPEr   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   s                `/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/scipy/sparse/csgraph/_validation.pyvalidate_graphr.      s     G, GEFFFI !    !   ,W	JJJG  (7++ %0G0G) < 	Kmmm88??E?RRGG&w>JJJGG			W	%	% < 	3<Dhw|5}MMMG*GDMM)'22GG 	</5B;H9A>K	M M MG
 <DjU;;;G*GDMM(]7D2:< < <G |q>???}Q7=+++GHHHN    )numpyr   scipy.sparser   scipy.sparse._sputilsr   scipy.sparse.csgraph._toolsr   r   r   r   float64r   r   r.    r/   r-   <module>r6      s        ! ! ! ! ! ! @ @ @ @ @ @           
 	
 -2"!&u!"26!%	6 6 6 6 6 6r/   