
    sh                     p    S SK r S SKr\ R                  " S5      r\ R                  " S5         " S S5      rg)    Nnumpyscipyc                   *    \ rS rSr\S 5       rS rSrg)TestBetheHessian	   c                 x    / SQn[         R                  " U5      U l        [         R                  " S5      U l        g )N)      r
      r   r	   )nxhavel_hakimi_graphG
path_graphP)clsdegs     {/Users/tiagomarins/Projetos/claudeai/copy_bank/venv/lib/python3.13/site-packages/networkx/linalg/tests/test_bethehessian.pysetup_classTestBetheHessian.setup_class
   s)    %%c*a     c                 ~   [         R                  / SQ/ SQ/ SQ/5      n/ SQn[         R                  R                  [        R
                  " U R                  SS9R                  5       U5        [         R                  R                  [        R
                  " U R                  SUS9R                  5       U[         R                  X"5         5        [         R                  R                  [        R
                  " U R                  SS9R                  5       [        R                  " U R                  5      R                  5       5        [         R                  R                  [        R
                  " U R                  5      R                  5       [        R
                  " U R                  S	S9R                  5       5        g
)zBethe Hessian matrix)   r   )r      r   )r   r   r   )r
   r   r   r
   )r)r   nodelistr   g      ?N)nparraytestingassert_equalr   bethe_hessian_matrixr   todenseix_r   laplacian_matrix)selfHpermutations      r   test_bethe_hessian#TestBetheHessian.test_bethe_hessian   s/    HHj! " #  


 7 7! D L L NPQR


##DFFa+FNNPbff[./	

 	

##DFFa088:'//1	

 	

##DFF+335##DFFd3;;=	
r    N)__name__
__module____qualname____firstlineno__classmethodr   r(   __static_attributes__r*   r   r   r   r   	   s    ! !

r   r   )pytestnetworkxr   importorskipr   r   r*   r   r   <module>r4      s3     !   G 
 
r   