%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/
Upload File :
Create Path :
Current File : //opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pyc

�
�9Zc@`s�ddlmZmZmZddlZddlZddlZddlj	j
Zddlm
Z
mZmZmZmZmZejdd��Pejeejd��jdkp�ejeejd��jejkZWdQXejjd�p�eZd�Zdefd	��YZ d
e
fd��YZ!defd
��YZ"de
fd��YZ#defd��YZ$defd��YZ%e&d�Z'e&d�Z(e)dkr�e�ndS(i(tdivisiontabsolute_importtprint_functionN(tTestCasetrun_module_suitetassert_equaltassert_array_equaltassert_almost_equaltdectalltignoretlinuxcC`stjtd�|�S(Ns�Numpy is using complex functions (e.g. sqrt) provided by yourplatform's C library. However, they do not seem to behave accordingto C99 -- so C99 tests are skipped.(Rtskipiftskip_complex_tests(tfunc((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pyt
platform_skips	tTestCexpcB`s;eZd�Zed��Zejed�d��ZRS(cc`s�t}tj}||ddtjd�dtfV||ddtjd�tjd�tfVtjd�tjtjd�tjd��}||dd|j|jtfVdS(Nii(	tcheck_complex_valuetnptexptFalsetcostsintcomplextrealtimag(tselftchecktftref((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pyttest_simple"s	#,1c#`smt}tj�|�tjdddtfV|�tjdddtfV|�dtjtjtjfV|�dtjtjtjfV|�dtjtjtjfV|�tjdtjdfV|�tjdtjtjfV|�tjdtjtjtjfV|�tjdtjtjfV|�tjdtjtjtjfV�fd�}|dfV�fd�}|dfV�fd�}|dfV�fd�}|dfV|�tjdtjtjfV|�tjdtjtjfV|�tjtjtjtjfV|�tjtjtjtjfV|�tjtjtjtjfVdS(	Niii����g�?c	`s�d}tjdd��j�tjtjtjtj���}|jdks_|jdkr~t||j|jf��nWdQXdS(Ns0cexp(-inf, inf) is (%f, %f), expected (+-0, +-0)tinvalidR
i(RterrstatetarrayRtinfRRtAssertionError(tdummytmsgformtz(R(sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pyt_check_ninf_infIs
(c	`s�d}tjdd��q�tjtjtjtj���}tj|j�sftj|j�r�t	||j|jf��nWdQXdS(Ns1cexp(inf, inf) is (%f, %f), expected (+-inf, nan)RR
(
RR R!RR"tisinfRtisnanRR#(R$R%R&(R(sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pyt_check_inf_infSs
'&c	`s�d}tjdd��j�tjtjtjtj���}|jdks_|jdkr~t||j|jf��nWdQXdS(Ns0cexp(-inf, nan) is (%f, %f), expected (+-0, +-0)RR
i(	RR R!RR"tnanRRR#(R$R%R&(R(sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pyt_check_ninf_nan]s
(c	`s�d}tjdd��q�tjtjtjtj���}tj|j�sftj|j	�r�t
||j|j	f��nWdQXdS(Ns2cexp(-inf, nan) is (%f, %f), expected (+-inf, nan)RR
(RR R!RR"R+R(RR)RR#(R$R%R&(R(sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pyt_check_inf_nangs
'&(
RRRtPZERORtNZEROR"R+tpitNone(RRR'R*R,R-((RsV/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pyttest_special_values,s2	   !( (  #$s/cexp(nan + 0I) is wrong on most implementationscc`s0t}tj}||tjdtjdfVdS(Ni(RRRR+(RRR((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pyttest_special_values2{s	(	t__name__t
__module__RRR2RtknownfailureiftTrueR3(((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pyR!s	
OtTestClogcB`s>eZd�Zeejej�dkd�d���ZRS(cC`s�tjddg�}tjtj|��dtj|�}tj|�}x/tt|��D]}t||||�q`WdS(Niyy@y�?y�?y�?@(RR!tlogtabstangletrangetlenR(Rtxty_rtyti((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pyR�s
)tarmv5telsSee gh-413.cC`s�g}g}tjdd��Rtjtjgdtj�}tjtjtj�}|jttj	|�WdQXtjdd��t
tj	|�|�WdQX|j|�|j|�tjdd��Ltjdgdtj�}tjtjd�}|jttj	|�WdQXtjdd��t
tj	|�|�WdQX|j|�|j|�tjtdtj�gdtj�}tjtjdtj�}t
tj	|�|�|j|�|j|�tjtdtj�gdtj�}t
tj	|�|�|j|�|j|�tjd	d��Dtjtd
tj�gdtj�}tjtjtj�}WdQXtjd	d��t
tj	|�|�WdQX|j|�|j|�tjd	d��.tjtjdtjgdtj�}WdQXtjd	d��t
tj	|�|�WdQX|j|�|j|�tjtjdgdtj�}tjtjtj�}t
tj	|�|�|j|�|j|�tjtjdgdtj�}tjtjd�}t
tj	|�|�|j|�|j|�tjttjtj�gdtj�}tjtjdtj�}t
tj	|�|�|j|�|j|�tjttjtj�gdtj�}tjtjd
tj�}t
tj	|�|�|j|�|j|�tjttjtj�gdtj�}tjtjtj�}t
tj	|�|�|j|�|j|�tjttjtj�gdtj�}t
tj	|�|�|j|�|j|�tjttjd�gdtj�}tjtjtj�}t
tj	|�|�|j|�|j|�tjttjtj�gdtj�}tjtjtj�}t
tj	|�|�|j|�|j|�tjttjtj�gdtj�}tjtjtj�}t
tj	|�|�|j|�|j|�tj|dtj�}tj|dtj�}tjdd��LxDt
t|��D]0}t
tj	||j��||j��q�WWdQXdS(NtdividetraisetdtypeR
iig�?i����Rg�?y�?g�?g�?(RR R!R/RR"R0tassertRaisestFloatingPointErrorR9RtappendR+R<R=tconj(RtxltylR>R@txatyaRA((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pyR2�s�



'

'

'

/

#

"

+

*

*

+

'

*

*

(	R4R5RRRRtplatformtmachineR2(((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pyR8�s	t	TestCsqrtcB`s)eZd�Zd�Zed��ZRS(cc`sottjddddfVttjdddtjd�dtjd�tfVttjddddfVdS(Niig�?ii����(RRtsqrtR(R((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pyRs7cc`sQtjtjtjdd���}d�}t|dd|j|jtfVdS(NicS`stjtj|��S(N(RRQRI(R&((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pyR#s(RRIRQRRRRR(RRR((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pyttest_simple_conjugate s$	cc`sst}tj}||tjdddfV||tjdddfV||dtjtjtjfV||dtjtjtjfV||tjtjtjtjfV||tjtjtjtjfV||tjtjtjtjfV||tjtjtjtjfV||tjtjtjtjfV||dtjtjtjfV||dtjtjtjfV||dtjtjtjfV||tjdtjtjfV||tjdtjtjfVd�}|dfV||tjtjtjtjfV||tjdtjtjfV||tjdtjtjfV||tjtjtjtjfVdS(Niii����cS`s�d}tjtjtjtjtj���}tjdd��Htj|j�oetj	|j
�s�t||j|j
f��nWdQXdS(Ns3csqrt(-inf, nan) is (%f, %f), expected (nan, +-inf)RR
(RRQR!RR"R+R R)RR(RR#(R$R%R&((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pyR,Ks
+$(RRRQR.R/R"R+R1(RRRR,((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pyR2*s,	  ###$$   ! 	#  (R4R5RRRRR2(((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pyRPs	
	
tTestCpowcB`s5eZd�Zd�Zd�Zd�Zd�ZRS(cC`stjdd�|_dS(NRR
(Rtseterrtolderr(R((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pytsetUpbscC`stj|j�dS(N(RRTRU(R((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pyttearDownescC`svtjdddtjtjg�}|d}tj|d�}x/tt|��D]}t||||�qSWdS(	Niy�?iy@iy�?�?y@y�?@(RR!R"R+tpowerR<R=R(RR>R?R@RA((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pyRhs
$
cC`stjddddtjtjg�}tjddd
dddg�}ttt|���}g|D]$}t||�t||�^qg}ttjtj�|d	<g|D]}||||^q�}x-|D]%}t||||d
d|�q�WdS(Niy�?ig@y�G�z��?g�y�?iiterr_msgsLoop %d
y@�G�z��?y��?y��?(	RR!R"R+tlistR<R=RR(RR>R@tlxRAtp_rtn_r((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pyttest_scalaros'!1%
cC`s�tjddddtjtjg�}tjddd
dddg�}ttt|���}g|D]$}t||�t||�^qg}ttjtj�|d	<||}x-|D]%}t||||d
d|�q�WdS(Niy�?ig@y�G�z��?g�y�?iiRYsLoop %d
y@�G�z��?y��?y��?(	RR!R"R+RZR<R=RR(RR>R@R[RAR\R]((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pyt
test_array|s'!1

(R4R5RVRWRR^R_(((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pyRSas
				
tTestCabscB`s5eZd�Zd�Zd�Zd�Zd�ZRS(cC`stjdd�|_dS(NRR
(RRTRU(R((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pyRV�scC`stj|j�dS(N(RRTRU(R((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pyRW�scC`s�tjdd	d
tjtjg�}tjtjd�dtjd�tjtjg�}tj|�}x/tt|��D]}t||||�q|WdS(Niy�?iy@g@iiy�?�?y@y�?@(	RR!R"R+RQR:R<R=R(RR>R?R@RA((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pyR�s
$6cC`stjdgdtj�}ttj|�tj|��tjtdtj�gdtj�}ttj|�tj|��tjttjtj�gdtj�}ttj|�tj|��tjttjtj�gdtj�}ttj|�tj|��dS(NiyREy�?(	RR!RRR:RR/R"R+(RR>((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pyt	test_fabs�s'**cc`s�gg}}|jtj�|jtj�ttjtjtjtjfV|jtj�|jtj�ttjtjtjtjfV|jtj�|jtj�ttjtjtjtjfV|jtj�|jtj�ttjtjtjtjfVd�}d�}tj|dtj�}xMtt	|��D]9}|||||�}t||||||fVqNWdS(NcS`stjtj|��S(N(RR:RI(ta((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pyR�scS`stjtj||��S(N(RR:R(Rbtb((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pytg�sRE(
RHRR+tcheck_real_valueR:R"R!RR<R=(RR>R@RRdRLRAR((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pyttest_cabs_inf_nan�s&
 ! !		(R4R5RVRWRRaRf(((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pyR`�s
				tTestCargcB`s5eZd�Zejed�d��Zd�ZRS(cC`s|ttjdddt�ttjdddtjt�ttjdddtjt�ttjtjtjtj�dS(Niig�?g�?(Retncut_argRRR0R.(R((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pyR�s  sCComplex arithmetic with signed zero is buggy on most implementationcc`s�ttjtjtjtjtfVttjtjtjtjtfVttjtjtjtjfVttjtjtjtjfVttjdtjtjtfVttjdtjtjtfVttjdtjtjtfVttjdtjtjtfVttjtjddtjtfVttjtjddtjtfVttjtjddtjtfVttjtjddtjtfVdS(Nii����g�?g�(ReRhRiRR/R.R0R(R((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pyt	test_zero�s#$     !$$$cc`s�ttjtjdtjtfVttjtjdtjtfVttjtjdtjtfVttjtjdtjtfVttjdtjdtjtfVttjdtjdtjtfVttjtjtjdtjtfVttjtjtjdtjtfVttjtjtjdtjtfVttjtjtjdtjtfVttjtj	d	tj	tfVttjd	tj	tj	tfVttjtj	tjtj	tfVttjtjtj	tj	tfVdS(
Nii����g�?g�g�?g�g�?gпi(
ReRhRiRR"R0RR.R/R+(R((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pyR2�s!"  $%()'(  #(R4R5RRR6R7RjR2(((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pyRg�s		cC`sNtjt||�g�}|r7t||�|�nt||�|�dS(N(RR!RRR(Rtx1ty1R>texacttz1((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pyRe	scC`sytjt||�g�}tj||�}tjdd��4|r\t||�|�nt||�|�WdQXdS(NRR
(RR!RR RR(RRkRltx2ty2RmRntz2((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pyRst__main__(*t
__future__RRRtsysRNtnumpyRtnumpy.core.umathtcoretumathRht
numpy.testingRRRRRRR RRR"RR9R/R0tfunctions_seem_flakyt
startswithR
RtobjectRR8RPRSR`RgR7ReRR4(((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pyt<module>s(.$-	c�M(>B	

Zerion Mini Shell 1.0