
    Cpj&              	           S SK rS SKJr  S SKJr  S SKJrJrJ	r	J
r
  \R                  r\SSSSS \R                  SS4	S jrg)    N)issparse)convert_pydata_sparse_to_scipy)csgraph_to_densecsgraph_from_densecsgraph_masked_from_densecsgraph_from_maskedTFc                 D   U(       d  U(       d  [        S5      eU/nU	(       a  UR                  [        R                  5        U
(       a  UR                  [        R                  5        [        XS9n U(       d,  [        U 5      (       a  U R                  S:X  a  U R                  n [        U 5      (       ao  U(       a^  U R                  S:X  a0  U R                  US9n U R                  5         U R                  USS9n OU R                  US9R                  USS9n O[        XS9n O[        R                  R                  U 5      (       aC  U(       a0  U R                  n[        R                   " U R"                  X%S9n XU'   O[[%        U 5      n OOU(       a=  ['        U UUU
U	S	9n U R                  n[        R(                  " U R"                  US
9n XU'   O[+        XU	U
S9n U R,                  S:w  a  [        S5      eU R.                  S   U R.                  S   :w  a  [        S5      eU $ )z7Routine for validation and conversion of csgraph inputsz*Internal: dense or csr output must be true)	accept_fvcscbsr)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eliminate_zerosastyper   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/pdf-tiff/venv/lib/python3.13/site-packages/scipy/sparse/csgraph/_validation.pyvalidate_graphr/      s    ,EFFI  ,WJG (7++%0G))~~&!--^-<'')!..U.;!--^-<CCEPUCV&wJG			W	%	%<<Dhhw||5MG*DM)'2G/5B;H9A>K	MG
 <<DjjU;G*DM(7D2:<G ||q>??}}Q7==++GHHN    )numpyr   scipy.sparser   scipy.sparse._sputilsr   scipy.sparse.csgraph._toolsr   r   r   r   float64DTYPEr   r/    r0   r.   <module>r8      sE     ! @ 
 	

 -2"!&u!"266!%	;r0   