3
Od                 @   s   d dl Z d dlZd dlmZmZmZ d dljZ	d dl
mZ dd Zdd Zdd	 Zd
d Ze jjdej d fejejfgdd Zdd Zdd Zdd Zdd ZdS )    N)assert_assert_equalassert_allclose)assert_func_equalc              C   st   t tjdt dtjt tjtjt tjdt dtjg} x6| D ].}tj|}ttj|j ttj|j q>W d S )Nr      )	complexnpnanscwrightomegar   isnanrealimag)ptspres r   X/var/www/html/virt/lib64/python3.6/site-packages/scipy/special/tests/test_wrightomega.pytest_wrightomega_nan	   s    




r   c              C   s   t tj tjd t tj tj d t tj dtj d t tj dtj d g} t ddt ddt ddt ddg}x<t| |D ].\}}tj|}t|j|j t|j	|j	 qW d S )	N      g        g       g       g       g       )
r   r   infpizipr
   r   r   r   r   )r   Zexpected_resultsr   expectedr   r   r   r   test_wrightomega_inf_branch   s    
r   c              C   sR   t tjdt tj dt dtjt dtj g} x| D ]}ttj|| q6W d S )N
   )r   r   r   r   r
   r   )r   r   r   r   r   test_wrightomega_inf(   s    


r   c              C   sT   t dtjt dtj g} x4| D ],}tj|}t|d ttj|jdk q W d S )Ng      ?Fg      g      g      )	r   r   r   r
   r   r   r   Zsignbitr   )r   r   r   r   r   r   test_wrightomega_singular1   s    



r   z
x, desiredc             C   s   t j| |kstd S )N)r
   r   AssertionError)xZdesiredr   r   r    test_wrightomega_real_infinities:   s    r"   c               C   s   t jtjt jstd S )N)r   r   r
   r   r	   r    r   r   r   r   test_wrightomega_real_nanB   s    r#   c              C   sj   dt jtj } d}t j|t j }t j|t j}d}d}ttj||d| d ttj||d| d d S )N   g@xDg?xDgAxDr   )atolrtol)	r   finfofloateps	nextafterr   r   r
   r   )desired_error	crossoverx_before_crossoverx_after_crossoverdesired_before_crossoverdesired_after_crossoverr   r   r   &test_wrightomega_real_series_crossoverF   s     r1   c              C   sj   dt jtj } d}t j|t j}t j|t j }d}d}ttj||d| d ttj||d| d d S )Nr$   2   gy~T}%m;g~T}%m;r   )r%   r&   i)	r   r'   r(   r)   r*   r   r   r
   r   )r+   r,   r-   r.   r/   r0   r   r   r   ,test_wrightomega_exp_approximation_crossover\   s     r3   c              C   s6   t jddd} tj| d j}ttj|| ddd d S )Ni  i  y                r   g+=)r%   r&   i)r   Zlinspacer
   r   r   r   )r!   resultsr   r   r   $test_wrightomega_real_versus_complexr   s    r5   )ZpytestZnumpyr   Znumpy.testingr   r   r   Zscipy.specialZspecialr
   Zscipy.special._testutilsr   r   r   r   r   markZparametrizer   r"   r#   r1   r3   r5   r   r   r   r   <module>   s   
		
