a
    CCCf                     @   sB   d dl ZG dd dZG dd dZdd Zdd	 Zdd
dZdS )    Nc                   @   s   e Zd Zdd ZdS )_FakeMatrixc                 C   s   || _ |j| _d S N)_dataZ__array_interface__selfdata r   S/var/www/html/django/DPS/env/lib/python3.9/site-packages/scipy/linalg/_testutils.py__init__   s    z_FakeMatrix.__init__N)__name__
__module____qualname__r
   r   r   r   r	   r      s   r   c                   @   s   e Zd Zdd ZdddZdS )_FakeMatrix2c                 C   s
   || _ d S r   r   r   r   r   r	   r
      s    z_FakeMatrix2.__init__Nc                 C   s   | j S r   r   )r   dtypecopyr   r   r	   	__array__   s    z_FakeMatrix2.__array__)NN)r   r   r   r
   r   r   r   r   r	   r   
   s   r   c                 C   s   t | dkrB| d dkrBtj| |d}d|dddf< d|d< |S t | dkr| d | d krtj| |d}t| d }d|||f< d||dd |dd d f< d||dd d |dd f< |S tjd tjj|  |S dS )zz
    Get a test array of given shape and data type.
    Returned NxN matrices are posdef, and 2xN are banded-posdef.

       r   r      Ni  )lennpZzerosZarangerandomseedZrandnZastype)shaper   xjr   r   r	   
_get_array   s      r   c                 C   s   | S r   r   )r   r   r   r	   _id+   s    r   c              	      s   |du rt jt jt jt jg}|D ] dD ]ztttfD ]j fdd|D }fdd|D }| |  d dd}t||D ]\}}t j	j
|||d	 qq6q(q dS )
zA
    Test that a call does not overwrite its input arguments
    N)CFc                    s   g | ]}t | qS r   )r   ).0sr   r   r	   
<listcomp>:       z'assert_no_overwrite.<locals>.<listcomp>c                    s   g | ]} | qS r   )r   )r"   r   )fakerorderr   r	   r$   ;   r%   zcall modified inputs [z, ])err_msg)r   Zfloat32Zfloat64Z	complex64Z
complex128r   r   r   ziptestingZassert_equal)callZshapesZdtypesZorig_inputsinputsmsgabr   )r   r&   r'   r	   assert_no_overwrite/   s    r1   )N)numpyr   r   r   r   r   r1   r   r   r   r	   <module>   s
   