%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_scalarmath.pyo

�
�9Zc@`s�ddlmZmZmZddlZddlZddlZddlZddlZ	ddl
mZddlm
Z
mZmZmZmZmZmZe	je	je	je	je	je	je	je	je	je	je	je	je	j e	j!e	j"e	j#e	j$gZ%e	j&j'�Z(de
fd��YZ)de
fd��YZ*d	e
fd
��YZ+de
fd��YZ,d
e
fd��YZ-de
fd��YZ.de/fd��YZ0de
fd��YZ1de
fd��YZ2e3dkr�e�ndS(i(tdivisiontabsolute_importtprint_functionN(t_gen_alignment_data(tTestCasetrun_module_suitetassert_tassert_equalt
assert_raisestassert_almost_equaltassert_allcloset	TestTypescB`s5eZdd�Zdd�Zdd�Zd�ZRS(icC`s>x7tD]/}|d�}t|dkd||f�qWdS(Niserror with %r: got %r(ttypesR(tselftleveltatypeta((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_scalarmath.pyt
test_typess
cC`s�x�tt�D]�\}}|d�}tjdgd|�}x�tt�D]�\}}|d�}tjdgd|�}	||}
||	}t|
j|jd|tj|�j|tj|�jf�qJWq
WdS(Nitdtypeis$error with types (%d/'%c' + %d/'%c')(t	enumerateRtnptarrayRRtchar(R
RtkRta_scalarta_arraytltbtypetb_scalartb_arraytc_scalartc_array((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_scalarmath.pyt
test_type_adds

cC`s^xWtt�D]I\}}tjdddg|�}|dddg�}t||�q
WdS(Niii(RRRRR(R
RRRRtb((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_scalarmath.pyttest_type_create3scC`s+x$td�D]}tjdd�q
WdS(Ni@
i(trangeRtadd(R
ti((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_scalarmath.pyt	test_leak9s(t__name__t
__module__RR R"R&(((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_scalarmath.pyRstTestBaseMathcB`seZd�Zd�ZRS(c	C`sxtjdftjdfgD]�\}}x�td|ddd|�D]�\}}}}tj|�}tj|�|d<tj|�|d<ttj||�|d|�ttj|d	�|d	d|�ttjd	|�|d|�tj||d
|�t||d|�|dctj|j	d|�d	7<ttj
|�tj||�d|�ttj|�tj
d	|�d|�tj|�|d<tj|�|d<tj|d	d
|�t||d	d|�tjd	|d
|�t||d|�qGWqWdS(NiiRttypetbinarytmax_size.terr_msgitout(Rtfloat32tfloat64Rt	ones_liket
zeros_likeR	R$tarangetsizetsquaretmultiplyt
reciprocaltdivide(R
tdttszR.tinp1tinp2tmsgtexp1((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_scalarmath.pyttest_blockedAs.+#&cC`s�tjddtj�dd!jtj�}tjd	dtj�dd!jtj�}t|||d�tj||d|�tjtj|�|d|�tj|tj|�d|�tjtj|�|�tj|tj|��dS(
NiiRii����iR.i�i�(Rtzerostint8tviewR0R	R$R1(R
tdto((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_scalarmath.pyttest_lower_align_s++(R'R(R?RE(((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_scalarmath.pyR)@s	t	TestPowercB`s#eZd�Zd�Zd�ZRS(cC`sZxStjtjtjgD]9}|d�}|d}t|dkd||f�qWdS(NiiiQserror with %r: got %r(RRAtint16tfloat16R(R
ttRR!((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_scalarmath.pyttest_small_typesms
cC`s�x�tjtjtjtjtjgD]j}|d�}|d}d||f}tj|tj�r|t|dk|�q%t	|dd|�q%WdS(Ni3iserror with %r: got %ri�:gR-(
Rtint32tint64R/R0t
longdoublet
issubdtypetintegerRR	(R
RIRR!R=((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_scalarmath.pyttest_large_typesss+
c	C`s�tjtjtjtjtjtjtjtjtjg	}x�|D]�}x�|D]�}|d�}|d�}||}d|||df}tjtj	|�tj
�r�t|dk|�qPt|dd|�qPWqCWdS(Niis(error with %r and %r:got %r, expected %ri	R-(
RRARGRHR/R0RKRLRNRRORR	(R
ttypelisttt1tt2RR!tresultR=((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_scalarmath.pyttest_mixed_types}s


(R'R(RJRPRU(((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_scalarmath.pyRFls		
tTestModuluscB`s>eZejZejZd�Zd�Zd�Zd�ZRS(cC`s�tjdtjd}x�tj||�D]q\}}xbtjd
dfd
df�D]@\}}|dkr�|tjdkr�qXn|dkr�|tjdkr�qXnd}|||||f}tj|dd|�d}tj|d	d|�d
}	|j||	�}
|j||	�}t|
|	||d
|�|dkrut|	|koidkn|�qXt|	|ko�dkn|�qXWq+WdS(Nt
AllIntegertFloatii����tUnsignedIntegers"dt1: %s, dt2: %s, sg1: %s, sg2: %siGRiR-i(((	Rt	typecodest	itertoolstproductRtfloordivtmodRR(R
R9tdt1tdt2tsg1tsg2tfmtR=RR!tdivtrem((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_scalarmath.pyttest_modulus_basic�s"-&cC`s�ttdd��}ttdd��}|dg|}||}ttj||��}td�|D��}tj|dt�j\}}tj|dt�j\}	}
tj	|	dk|dk|dkA@d|	�}	tj	|
dk|dk@d|
�}
x�tj
d	D]�}d
|f}|j|�}
|j|�}gt|
|�D]\}}|j
||�^qR}gt|
|�D]\}}|j||�^q�}t||	d|�t||
d|�qWdS(Ni����iii�cs`s|]}t|�VqdS(N(tdivmod(t.0RI((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_scalarmath.pys	<genexpr>�sRgg�RXs	dtype: %sR-(tlistR#R[R\RRtinttTtfloattwhereRZtastypetzipR]R^R(R
tnlsttplsttdividendtdivisortargttgtRR!ttgtdivttgtremR9R=tfatfbta_tb_RdRe((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_scalarmath.pyttest_float_modulus_exact�s$
/%
44cC`sStjd}x?tj||�D]+\}}xtjd
dfd
df�D]�\}}d}|||||f}tj|ddd|�d
}tj|dd|�d}	|j||	�}
|j||	�}t|
|	||d|�|dkr$t|	|kod	kn|�qMt|	|ko>d	kn|�qMWq WdS(NRXii����s"dt1: %s, dt2: %s, sg1: %s, sg2: %siNg+i�)+p>RR-i(((	RRZR[R\RR]R^RR(R
R9R_R`RaRbRcR=RR!RdRe((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_scalarmath.pyttest_float_modulus_roundoff�s
-!&c		C`s�x�tjdD]�}tjdd|�}tjtjdd|�|�}|j||�}t||kd|�|j||�}t||kd|�qWtj��tjd�tjdt	�x�tjdD]�}tjdd|�}tjdd|�}tjtj
d|�}tjtjd|�}|j||�}ttj|�d|�|j||�}ttj|�d|�|j||�}ttj|�d|�q�WWdQXdS(NRXg�?Rgsdt: %stalwaystignore(
RRZRt	nextafterR^Rtwarningstcatch_warningstsimplefiltertRuntimeWarningtinftnantisnan(	R
R9R!RRetfonetfzertfinftfnan((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_scalarmath.pyttest_float_modulus_corner_cases�s*"

(	R'R(toperatorR]R^RfR|R}R�(((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_scalarmath.pyRV�s					tTestComplexDivisioncB`s#eZd�Zd�Zd�ZRS(c	C`sTtjdd��<x4tjtjgD] }|d�}|d�}ttj||��|ttjtj��}ttj||��|ttjtj��}ttj||��|ttjtj��}ttj||��|ttjtj��}ttj	||��|d�}ttj	||��q&WWdQXdS(NtallRgg�?(
Rterrstatet	complex64t
complex128RtisinftcomplexR�R�R�(R
RIRR!((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_scalarmath.pyttest_zero_division�scC`s/tjdd��xtjtjgD]�}d
ddfd
ddfdddfdddfdddfdddfdddfdd d!ff}x�|D]�}|d}|d}|d	}|t|d|d��|t|d|d��}t|j|d�t|j|d�q�Wq&WWdQXdS("NR�Rgg�g�?g�iii(gg�(gg�?(g�g�(gg�(gg�(g�?g�(gg�(g�g�(g�?g(gg�(g�g�?(g�g(gg�?(gg�(g�g(gg�(gg�(g�?g�(g�g�(gg�(g�?g�(g�g�?(gg�(g�g�(RR�R�R�R�Rtrealtimag(R
RItdatatcasestnRCtexRT((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_scalarmath.pyttest_signed_zeross"



8cC`s�tjdd���x�tjtjgD]�}t�}|jd	d
df�|jdd
df�x�|D]�}|d}|d}|d}|t|d|d��|t|d|d��}t|j|d�t|j	|d�qhWq&WWdQXdS(NR�Rg@g�?giii(g@g�?(g@g�?(g�?g(g�?g@(g�?g@(g�?g(
RR�R�R�RitappendR�RR�R�(R
RIR�R�R�RCR�RT((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_scalarmath.pyt
test_branchess	



8(R'R(R�R�R�(((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_scalarmath.pyR��s		tTestConversioncB`s5eZd�Zd�Zd�Zd�Zd�ZRS(cC`s�ddddddg}d
dddddg}xXdtjtjgD]A}tj|d|�}tg|D]}t|�^qk|�qFWtj|d dtj�}tg|D]}t|�^q�|d �dS(Ng��.Ag��mBg�Ngm��Cg��.�g��m�g�Ngm���i
iiiRii@BI���Id����
i@Bi���I���I�Z+���Id����
I�XLI�(tNoneRR0RLRRRjtuint64(R
RtliRkRt_m((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_scalarmath.pyttest_int_from_long;s*cC`sxUdD]M}tjtj|�jdd|�}tj|�j}t||k�qWxXtjdD]I}tjtj|�jd|�}tj|�j}t||k�qfWxVtjdD]G}tj|tj|�j�}tj|�j}t||k�q�WdS(NtbBhHiRRW(RRtiinfotmaxtminRRZttypeDict(R
tcodetresRu((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_scalarmath.pyttest_iinfo_long_valuesEs
%!cC`s.d�}xdD]}tt||�qWdS(NcS`s%tj|tj|�jd�dS(Ni(RR�R�R�(R((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_scalarmath.pytoverflow_error_funcVstlLqQ(Rt
OverflowError(R
R�R�((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_scalarmath.pyttest_int_raise_behaviourUs	
cC`sHtjtj�}tt|j�tjtj�}tt|j�dS(N(RRMR�RR�t__int__tclongdouble(R
tx((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_scalarmath.pyttest_longdouble_int\scC`sxtjdD]}tdtjdd|�dkd|f�tdtjdd|�d
kd|f�x�tjdD]�}ttjdd|�dtjdd|�dkd||f�ttjdd|�dtjdd|�dkd||f�q}WqWxqdD]i}tdtjdd|�dkd|f�tdtjdd|�dkd|f�tdtjdd|�dkd|f�x�d	D]�}ttjdd|�dtjdd|�dkd||f�ttjdd|�dtjdd|�dkd||f�ttjdd|�dtjdd|�dkd||f�q�WqWx�d
tjdD]t}tdtjdd|�dkd|f�tdtjdd|�dkd|f�tdtjdd|�dkd|f�x�d
tjdD]�}ttjdd|�dtjdd|�dkd||f�ttjdd|�d tjdd|�d!kd||f�ttjdd|�d"tjdd|�d#kd||f�q8Wq�WdS($NRWiiRstype %s failedstype %s and %s failedtBHILQPi����tbhilqptbhlqpRX(((((((((((((((((((((((((RRZRR(R
R_R`((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_scalarmath.pyt&test_numpy_scalar_relational_operatorscs<-.23
-.-
232-.-232(R'R(R�R�R�R�R�(((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_scalarmath.pyR�:s
	
			tTestReprcB`seZd�Zd�ZRS(c
C`sGtj|�}|j|j}|j}tj|�jd}xddgD]�}tjdg|dtj�}|dkr�|d}d|d}	d|	>||<nA|dkr�|d}d|d}	d|	>||<ntd��|j	|�d}
t
|
�}|t|��}|dko,|
d	ksKt|
|�qKqKWdS(
Nissmall denorms
small normiRiithmmg0��.�++(
RtfinfotnexptnmantRtitemsizeRtuint8t
ValueErrorRBtreprtevalR(
R
RIR�tlast_fraction_bit_idxtlast_exponent_bit_idxt
storage_bytestwhichtconstrtbytetbytebittvaltval_reprtval2((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_scalarmath.pyt_test_type_repr�s(	

cc`s/x(tjtjgD]}|j|fVqWdS(N(RR/R0R�(R
RI((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_scalarmath.pyttest_float_repr�s(R'R(R�R�(((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_scalarmath.pyR��s	t
TestSizeOfcB`seZd�Zd�ZRS(cC`s=x6tD].}|d�}ttj|�|jk�qWdS(Ni(RRtsyst	getsizeoftnbytes(R
R*R�((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_scalarmath.pyttest_equal_nbytes�s
cC`s#tj�}tt|jd�dS(NR(RR/Rt	TypeErrort
__sizeof__(R
RC((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_scalarmath.pyt
test_error�s(R'R(R�R�(((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_scalarmath.pyR��s	tTestAbscB`s#eZd�Zd�Zd�ZRS(cC`s~xwtD]o}|d�}t||�d�|d�}||�}t|d�|d�}||�}t|d�qWdS(Ng��g�?gg�(tfloating_typesR(R
tabsfuncttpR�R�((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_scalarmath.pyt_test_abs_func�s

cC`s|jt�dS(N(R�tabs(R
((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_scalarmath.pyttest_builtin_abs�scC`s|jtj�dS(N(R�RR�(R
((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_scalarmath.pyttest_numpy_abs�s(R'R(R�R�R�(((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_scalarmath.pyR��s		t__main__(4t
__future__RRRR�R[R�R�tnumpyRtnumpy.testing.utilsRt
numpy.testingRRRRRR	R
tbool_R�tubytetshorttushorttintctuintctint_tuinttlonglongt	ulonglongtsingletdoubleRMtcsingletcdoubleR�Rtfloatingt__subclasses__R�RR)RFRVR�R�tobjectR�R�R�R'(((sS/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_scalarmath.pyt<module>s.4*',"dH\!

Zerion Mini Shell 1.0