관리-도구
편집 파일: test_polynomial.cpython-311.pyc
� �܋f�, � � � d dl Zd dlmZmZmZmZmZmZm Z d dl Z ej d ej d z dz Z G d� d� � Z dS )� N)�assert_�assert_equal�assert_array_equal�assert_almost_equal�assert_array_almost_equal� assert_raises�assert_allclose� AllInteger�AllFloat�Oc �� � e Zd Zd� Zd� Zd� Zej � de � � de ddfd�� � Zd� Zd � Z d � Zd� Zd� Zd � Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� ZdS )�TestPolynomialc � � t j g d�� � }t t |� � d� � t t |� � d� � t j g d�� � }t t |� � d� � t t |� � d� � t j g d�� � }t t |� � d� � t t t j g d �� � � � d � � d S )N�� �?� � zpoly1d([1., 2., 3.])z 2 1 x + 2 x + 3�� @r � zpoly1d([3., 2., 1.])� 2 3 x + 2 x + 1)y���[f�? @y � �g"GBtk~�y @ �?z= 3 2 (1.9 + 2j) x - 3j x - 5.123 x + (2 + 1j))���������z 2 -3 x - 2 x - 1)�np�poly1dr �repr�str)�self�p�q�rs �r/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib64/python3.11/site-packages/numpy/lib/tests/test_polynomial.py�test_poly1d_str_and_reprz'TestPolynomial.test_poly1d_str_and_repr s � ��I�j�j�j�!�!���T�!�W�W�4�5�5�5��S��V�V�%� &� &� &� �I�j�j�j�!�!���T�!�W�W�4�5�5�5��S��V�V�%� &� &� &� �I�>�>�>�?�?���S��V�V�@� A� A� A� �S���<�<�<�0�0�1�1�&� '� '� '� '� '� c �& � t j g d�� � }t j g d�� � }t |d� � d� � t |d� � d� � t |d� � d� � t |d� � d� � d S ) Nr r r r � g C@r g �U@�r r r �r r r! s r# �test_poly1d_resolutionz%TestPolynomial.test_poly1d_resolution% s� � ��I�j�j�j�!�!���I�j�j�j�!�!���Q�Q�q�T�T�3�����Q�Q�q�T�T�4� � � ��Q�Q�q�T�T�3�����Q�Q�q�T�T�4� � � � � r% c � � t j g d�� � }t j g d�� � }t ||z t j dg� � t j ddg� � f� � t |� � � t j g d�� � � � t |� d� � t j g d�� � � � t j g d�� � }t j g d �� � }t ||z t j g d �� � � � t ||z t j g d�� � � � t ||z t j g d�� � � � t |d z t j g d�� � � � t ||� � t j g d�� � � � t ||� � t j g d�� � � � t |� � � t j ddg� � � � t |� d� � t j dg� � � � t t j t j g d�� � t j ddg� � � � t j ddg� � t j dg� � f� � d S )N)r r � )� @r r � �?g �?g @)gUUUUUU�?r r- � r r r )r � @g ,@r0 r )r- r- r- )g �r/ � @r, ) r r0 g B@g Z@g �j@g �s@g @t@g k@g @T@)g "@� (@g 0@r0 g @)r r2 g @@g D@g A@r1 r )r r r r g �r/ )r r r �integ�deriv�polydivr) s r# �test_poly1d_mathzTestPolynomial.test_poly1d_math- se � ��I�j�j�j�!�!���I�j�j�j�!�!���Q�q�S�2�9�d�V�,�,�b�i��d��.D�.D�E�F�F�F��Q�W�W�Y�Y�� �*;�*;�*;� <� <�=�=�=��Q�W�W�Q�Z�Z���+<�+<�+<�!=�!=�>�>�>��I�j�j�j�!�!���I�j�j�j�!�!���Q��U�B�I�&;�&;�&;�<�<�=�=�=��Q��U�B�I�l�l�l�3�3�4�4�4��Q��U�B�I�m�m�m�4�4�5�5�5��Q�!�V�R�Y�'W�'W�'W�X�X�Y�Y�Y��Q�Q�q�T�T�2�9�%;�%;�%;�<�<�=�=�=��Q�Q�q�T�T�2�9�%=�%=�%=�>�>�?�?�?��Q�W�W�Y�Y�� �2�r�(� 3� 3�4�4�4��Q�W�W�Q�Z�Z���B�4���1�1�1��R�Z�� �*�*�*� 5� 5�r�y�!�Q��7H�7H�I�I��i��S� �*�*�B�I�r�d�O�O�<� >� >� >� >� >r% � type_code�returnNc �@ � t j |� � }t j g d�|�� � }t j |� � }t t j |� � |� � t t j |� � j |� � t t |� � d� � dddddd�}|� � � D ]Z\ }}|| }t ||� � |t j k rt |t � � sJ ��Et |j |� � �[d S )N�r r r )�dtyper r r r )r r r r r )r r; �arrayr r �asarray�len�items�object_� isinstance�int) r r7 r; �arr �comparison_dct�index�ref�scalars r# �test_poly1d_misczTestPolynomial.test_poly1d_miscB s � ����#�#�� �X�i�i�i�u� -� -� -���I�b�M�M�� �R�Z��]�]�B�'�'�'��R�Z��]�]�(�%�0�0�0��S��V�V�Q���� �A�!��a�8�8��(�.�.�0�0� 2� 2�J�E�3��u�X�F����%�%�%��� �"�"�!�&�#�.�.�.�.�.�.��V�\�5�1�1�1�1� 2� 2r% c �� � t j g d�d�� � }t t |� � d� � t j g d�d�� � }t t |� � d� � d S )Nr �y)�variablez 2 1 y + 2 y + 3�lambdaz! 2 1 lambda + 2 lambda + 3�r r r r )r r! s r# �test_poly1d_variable_argz'TestPolynomial.test_poly1d_variable_argW s| � ��I�j�j�j�3�/�/�/���S��V�V�%� &� &� &� �I�j�j�j�8�4�4�4���S��V�V�/� 0� 0� 0� 0� 0r% c � � t t j dt j d� � t j d� � g� � g d�� � g d�g d�g d�g}t t j |� � g d�� � t t j t j g d�� � � � � � t t j t j g d �� � � � � � t t j t j g d �� � � � � � t t j t j g d�� � � � � � t t j t j g d�� � � � � � t t j t j d dg� � � � � � t t j t j ddg� � � � � � t t j t j d dg� � � � � � t j � d� � t j � d� � d t j � d� � z z }t t j t j t j |t j |� � f� � � � � � � � d S )Nr r )r r r � r: )r, r'