o
    ˷e/                     @   sB   d dl Z e dZe d d dlZd dlmZ G dd dZdS )    Nnumpyscipy)havel_hakimi_graphc                   @   s    e Zd Zedd Zdd ZdS )TestBetheHessianc                 C   s"   g d}t || _td| _d S )N)      r      r   r   )r   Gnx
path_graphP)clsdeg r   ^/var/www/ideatree/venv/lib/python3.10/site-packages/networkx/linalg/tests/test_bethehessian.pysetup_class   s   
zTestBetheHessian.setup_classc                 C   s   t g dg dg dg}g d}t jtj| jdd | t jtj| jd|d |t ||  t jtj| j	dd t
| j	  t jt| j	 tj| j	d	d  d
S )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permutationr   r   r   test_bethe_hessian   s$   
z#TestBetheHessian.test_bethe_hessianN)__name__
__module____qualname__classmethodr   r"   r   r   r   r   r   
   s    
r   )pytestimportorskipr   networkxr
   networkx.generators.degree_seqr   r   r   r   r   r   <module>   s    

