관리-도구
편집 파일: test_generator_mt19937_regressions.cpython-311.pyc
� �܋f � �P � d dl mZmZ d dlZd dlZd dlmZmZ G d� d� � Z dS )� )�assert_�assert_array_equalN)� Generator�MT19937c �b � e Zd Zd� Zd� Zd� Zd� Zd� Zd� Zd� Z d� Z d � Zd � Zd� Z d� Zd � Zd� ZdS )�TestRegressionc �H � t t d� � � � | _ d S )Nl (vn4T�i )r r �mt19937��selfs ��/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib64/python3.11/site-packages/numpy/random/tests/test_generator_mt19937_regressions.py�setup_methodzTestRegression.setup_method s � � ��)>�!?�!?�@�@����� c � � t j ddd� � D ]p}| j � |dd� � }t t j |t j k � � o!t j |t j k � � � � �qd S )Ng �g @� � �2 )�np�linspacer �vonmisesr �all�pi)r �mu�rs r �test_vonmises_rangez"TestRegression.test_vonmises_range s| � � �+�c�2�q�)�)� ?� ?�B���%�%�b�!�R�0�0�A��B�F�1���v�:�&�&�=�2�6�!�r�u�*�+=�+=�>�>�>�>� ?� ?r c �N � t t j | j � dddd�� � dk � � � � t t j | j � dddd�� � dk � � � � d}t | j j |� dk � � d S ) N� � � � ��size� r )� r$ r$ )r r r r �hypergeometric)r �argss r �test_hypergeometric_rangez(TestRegression.test_hypergeometric_range s� � ����t�|�2�2�1�b�"�2�2�F�F��J�K�K�L�L�L����t�|�2�2�2�q�"�2�2�F�F��J�K�K�L�L�L� 1���+���+�T�2�Q�6�7�7�7�7�7r c � � d}| j � d|�� � }t j |dk � � |z }d|d�d�}t |dk |� � t j |d k � � |z }d|d�d �}t |dk |� � d S )N�� g�������?r! r zFrequency was �fz, should be > 0.45g�������?� z, should be < 0.23gq= ףp�?)r � logseriesr �sumr )r �N�rvsn�freq�msgs r �test_logseries_convergencez)TestRegression.test_logseries_convergence s� � ����|�%�%�c��%�2�2�� �v�d�a�i� � �1�$��9�t�9�9�9�9����t��S�!�!�!��v�d�a�i� � �1�$��9�t�9�9�9�9����t��S�!�!�!�!�!r c � � g d�g d�g d�g d�fD ]�}t t d� � � � }t j |t �� � }|� |� � t j |d |d |d |d gt �� � }t t j |t �� � |� � ��d S )N)r r+ r N)�r r �r+ r+ �r r N)r r5 r6 N)r4 r+ r Ni90 ��dtyper+ r r r )r r r �array�object�shuffler )r �tr �shuffled�expecteds r �test_shuffle_mixed_dimensionz+TestRegression.test_shuffle_mixed_dimension+ s� � �!�/�/�0�0�0�+�+�+�&�&�&�(� K� K�A� �����/�/�G��x���0�0�0�H��O�O�H�%�%�%��x��1��q��t�Q�q�T�1�Q�4� 8��G�G�G�H��r�x���?�?�?��J�J�J�J� K� Kr c �< � t j g d�� � }t d� � D ]u}t t |� � � � }t t d� � � � }t |� ddt j d� � dz �� � |� � �vd S )N) r � r r r r r rA r r# r i� r g $@)r"