
    tKg                         d dl Z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 d Zd Zd Zd Zej                   j#                  d	d
dg      ej                   j#                  dee	g      d               Zy)    N)assert_array_almost_equal)	csr_array)breadth_first_treedepth_first_treecsgraph_to_densecsgraph_from_densec                      t        j                  g dg dg dg dg dg      } t        | d      } t        j                  g dg dg d	g d
g d
g      }dD ]$  }t        | d|      }t	        t        |      |       & y )Nr         r   r   r   r   r   r      r   r   r      r   r   r   r   r   r   r   r   r   r   r   r   
null_valuer   r   r   r   r   )r   r   r   r   r   r   r   r   r   r   TFnparrayr   r   r   r   csgraphbfirstdirectedbfirst_tests       m/home/alanp/www/video.onchill/myenv/lib/python3.12/site-packages/scipy/sparse/csgraph/tests/test_traversal.pytest_graph_breadth_firstr!   	   s    hh''''	) *G
 !Q7GXX&&&&	( )F "(!X>!"2;"?"(	* "    c                      t        j                  g dg dg dg dg dg      } t        | d      } t        j                  g dg d	g d
g dg dg      }dD ]$  }t        | d|      }t	        t        |      |       & y )Nr
   r   r   r   r   r   r   )r   r   r   r   r   r   r   )r   r   r   r   r   )r   r   r   r   r   r   r   r   r   r   r   r   )r   dfirstr   dfirst_tests       r    test_graph_depth_firstr'      s    hh''''	) *G
 !Q7GXX&&&&	( )F "&w8<!"2;"?"(	* "r"   c                      t        j                  dgg      } t        | d      } t        j                  dgg      }dD ]$  }t        | d|      }t	        t        |      |       & y Nr   r   r   r   r   s       r    &test_graph_breadth_first_trivial_graphr*   1   s[    hhuoG Q7GXXse_F!(!X>!"2;"?"(	* "r"   c                      t        j                  dgg      } t        | d      } t        j                  dgg      }dD ]$  }t        | d|      }t	        t        |      |       & y r)   r$   r   s       r    $test_graph_depth_first_trivial_graphr,   =   s[    hhuoG Q7GXXse_F!&w8<!"2;"?"(	* "r"   r   TF	tree_funcc                    t        dgt        j                  dgdggt        j                        fd      }|j                  j
                  t        j                  k(  sJ  | |d|      }t        t        |      ddgddgg       y )Nr   r   )dtype)r   r   )shape)r   )r   r   r   int64indicesr/   r   r   )r-   r   gtrees       r    test_int64_indicesr5   I   ss     	A31#s288<=VLA99??bhh&&&QH-D.t41v1v6FGr"   )numpyr   pytestnumpy.testingr   scipy.sparser   scipy.sparse.csgraphr   r   r   r   r!   r'   r*   r,   markparametrizer5    r"   r    <module>r>      s{      3 "* **(*(	*	* dE]3'9;K&LMH N 4Hr"   