← Back
Editing: test_sputils.cpython-311.pyc
� d�c� � �\ � d Z ddlZddlmZ ddlmZ ddlm Z ddlmZ G d� d� � Z dS ) z'unit tests for sparse utility functions� N)�assert_equal)�raises)�_sputils)�matrixc �\ � e Zd Zd� Zd� Zd� Zd� Zd� Zd� Zd� Z d� Z d � Zd � Zd� Z d� Zd � ZdS )�TestSparseUtilsc � � t t j d� � t j � � t t j dd� � t j � � t t j dt t � � t j � � t t j dd� � t j � � d S )N�intc�int32�float32�bool�i�d) r �sputils�upcast�npr �float64�complex�float� complex128��selfs �A/usr/lib/python3/dist-packages/scipy/sparse/tests/test_sputils.py�test_upcastzTestSparseUtils.test_upcast s� � ��W�^�F�+�+�R�W�5�5�5��W�^�G�Y�7�7���D�D�D��W�^�F�G�U�;�;�R�]�K�K�K��W�^�C��-�-�r�z�:�:�:�:�:� c �r � t j dgd�� � }t t j d t �� � t � � t t j d |�� � t j � � t t d�� � 5 t j d� � d d d � � d S # 1 swxY w Y d S ) N� �int8��dtype)�default)�az0object dtype is not supported by sparse matrices��match�O) r �arrayr r �getdtyper r � assert_raises� ValueError)r �As r � test_getdtypezTestSparseUtils.test_getdtype s� � ��H�a�S��'�'�'���W�%�d�E�:�:�:�E�B�B�B��W�%�d�a�0�0�0�"�'�:�:�:� ��D� � � � "� "� ��S�!�!�!� "� "� "� "� "� "� "� "� "� "� "� "���� "� "� "� "� "� "s � B,�,B0�3B0c � � t t j d� � d� � t t j d� � d� � t t j d� � d� � t t j d� � d� � t t j t j d� � � � d� � t t j d� � d� � t t j t j dg� � � � d� � t t j dgg� � d� � t t j d � � d� � t t j d � � d� � d S )N� @T���� @� �? @� �16F�r �r � )r r �isscalarliker r&