
    Ui	
                     P    d dl Zd dlmZ d dlmZmZ d dlmZm	Z	m
Z
 d Zd Zd ZdS )    N)assert_equal)reverse_cuthill_mckeestructural_rank)	csc_array	csr_array	coo_arrayc                     t          j        g dg dg dg dg dg dg dg dgt                    } t          |           }t	          |          }t          j        g d          }t          ||           |j                            d	          |_        |j                            d	          |_        t	          |d
          }t          ||           d S )N)   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   )r
   r   r
   r   r
   r   r   r   )r   r
   r   r   r   r
   r   r
   dtype)            r
         r   int64T)	nparrayintr   r   r   indicesastypeindptr)Agraphpermcorrect_perms       /var/www/development/aibuddy-work/election-extract/venv/lib/python3.11/site-packages/scipy/sparse/csgraph/tests/test_reordering.py test_graph_reverse_cuthill_mckeer      s    
***(((((((((((((((((((((* 25	6 	6 	6A aLLE ''D844455L|$$$ M((11EM<&&w//EL --D|$$$$$    c                  $   t          j        dt                    } t          j        g d          }t          j        g d          }t	          | ||ff          }t          |          }t          j        g d          }t          ||           d S )N?   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   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
   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$   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%   r#   r   r*   r   r(   r   r   r$   r&   r
   r   )r   onesr   r   r   r   r   )datarowscolsr   r   r   s         r   )test_graph_reverse_cuthill_mckee_orderingr/      s    72C   D8 ( ( ( ) )D 8 " " " # #D td4[)**E ''D8 * * * + +L|$$$$$r    c                     t          g dg dg dg          } t          t          |           d           t          j        g d          }t          j        g d          }t          j        |          }t          |||ffd          }t          t          |          d	           t          g d
g dg          }t          t          |          d           t          t          |j                  d           d S )N)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   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#   )shaper   )r
   r   r   r   )r   r   r   r   r   )r   r   r   r   r   	ones_liker   T)r   r-   r.   r,   BCs         r   test_graph_structural_rankr6   2   s   9999999 	 	A ##Q''' 8CCCDDD8CCCDDD<D4d$E222A##Q''' 	<<<<<! 	" 	"A##Q''' %%q)))))r    )numpyr   numpy.testingr   scipy.sparse.csgraphr   r   scipy.sparser   r   r   r   r/   r6    r    r   <module>r<      s        & & & & & & G G G G G G G G 8 8 8 8 8 8 8 8 8 8% % %,% % %** * * * *r    