
    ިsg/                     |    d dl Z  e j                  d      Z e j                  d       d dlZd dlmZ  G d d      Zy)    Nnumpyscipy)havel_hakimi_graphc                   "    e Zd Zed        Zd Zy)TestBetheHessianc                 `    g d}t        |      | _        t        j                  d      | _        y )N)      r
      r   r	   )r   Gnx
path_graphP)clsdegs     Z/var/www/html/venv/lib/python3.12/site-packages/networkx/linalg/tests/test_bethehessian.pysetup_classzTestBetheHessian.setup_class   s#    "3'a     c                    t         j                  g dg dg dg      }g d}t         j                  j                  t	        j
                  | j                  d      j                         |       t         j                  j                  t	        j
                  | j                  d|      j                         |t         j                  ||                t         j                  j                  t	        j
                  | j                  d      j                         t	        j                  | j                        j                                t         j                  j                  t	        j
                  | j                        j                         t	        j
                  | j                  d	      j                                y
)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_hessianz#TestBetheHessian.test_bethe_hessian   s1    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__classmethodr   r&    r   r   r   r   
   s    ! !

r   r   )pytestimportorskipr   networkxr   networkx.generators.degree_seqr   r   r+   r   r   <module>r0      s:    V!   G   =
 
r   