%PDF- %PDF-
Mini Shell

Mini Shell

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

�
�9Zc@`s�dZddlmZmZmZddlZddlmZddl	Z
ddlmZm
Z
mZmZmZmZddlmZmZmZmZmZddlmZee
eeeefZd�Ze
jjZd	d
�Zd�Zd�Zd
�Z d�Z!d�Z"d�Z#d�Z$d�Z%d�Z&d�Z'd�Z(d�Z)d�Z*d�Z+d�Z,d�Z-d�Z.d�Z/d�Z0d�Z1d�Z2d �Z3d!�Z4d"�Z5d#�Z6d$�Z7d%�Z8e9d&kr�e�ndS('s�Test inter-conversion of different polynomial classes.

This tests the convert and cast methods of all the polynomial classes.

i(tdivisiontabsolute_importtprint_functionN(tNumber(t
PolynomialtLegendret	ChebyshevtLaguerretHermitetHermiteE(tassert_almost_equalt
assert_raisestassert_equaltassert_trun_module_suite(tlongcc`sfx;tD]3}x*tD]"}t||fVt||fVqWqWx!tD]}t|fVt|fVt|fVt|fVt|fVt|fVt	|fVt
|fVt|fVt|fVt
|fVt|fVt|fVt|fVt|fVt|fVt|fVt|fVt|fVt|fVt|fVt|fVt|fVt|fVt|fVqEWdS(N(tclassestcheck_conversiont
check_castt
check_calltcheck_identitytcheck_basistcheck_fromrootst	check_fittcheck_equaltcheck_not_equalt	check_addt	check_subt	check_multcheck_floordivt
check_truedivt	check_modtcheck_divmodt	check_powtcheck_integtcheck_derivtcheck_rootstcheck_linspacetcheck_mapparmstcheck_degreet
check_copytcheck_cutdegtcheck_truncatet
check_trim(tPoly1tPoly2tPoly((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/polynomial/tests/test_classes.pyttest_class_methodss<


tcC`s�yUttj|j|jk��ttj|j|jk��t|j|j�Wn/tk
r�d||ff}t|��nXdS(NsResult: %s
Target: %s(R
tnptalltdomaintwindowR
tcoeftAssertionError(tp1tp2tmsg((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/polynomial/tests/test_classes.pytassert_poly_almost_equal@s
c
C`s�tjddd�}td
�}|jtd�d}|jtd�d}||d|d|�}|jtd
�d}|jtd�d}|jd	|d|d|�}	t|	j|�t|	j|�t|	|�||��dS(Niii
iig�?R3R4tkind(i(i(i(i(i(R1tlinspacetrandomR3R4tconvertR
(
R,R-txR5td1tw1R7td2tw2R8((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/polynomial/tests/test_classes.pyROsc
C`s�tjddd�}td	�}|jtd
�d}|jtd�d}||d|d|�}|jtd�d}|jtd
�d}|j|d|d|�}	t|	j|�t|	j|�t|	|�||��dS(Niii
iig�?R3R4(i(i(i(i(i(R1R<R=R3R4tcastR
(
R,R-R?R5R@RAR7RBRCR8((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/polynomial/tests/test_classes.pyR`scC`s�|jtd�d}|jtd	�d}tj|d|dd�}|jd|d|�}t|j|�t|j|�t||�|�dS(
Nig�?iiiR3R4(i(i(R3R=R4R1R<tidentityRR
(R.tdtwR?tp((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/polynomial/tests/test_classes.pyRvscC`s�|jtd�d}|jtd	�d}|jdd|d|�}t|j|�t|j|�t|jdgddg�dS(
Nig�?iR3R4ii(i(i(R3R=R4tbasisRR5(R.RFRGRH((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/polynomial/tests/test_classes.pyR�scC`s�|jtd	�d}|jtd
�d}td�}|j|d|d|�}t|j�t|��t|j|�t|j|�t||�d�tj}tj}tj	|d|d|�}t|j
dd�dS(Nig�?iR3R4ii����i(i(i(i(R3R=R4t	fromrootsRtdegreetlenR
RRDR5(R.RFRGtrR7tpdomtpwinR8((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/polynomial/tests/test_classes.pyR�s		cC`s�d�}tjdd�}||�}|j||d�}t|jddg�t||�|�t|j�d�|jtd
�d}|jtd�d}|j||dd|d|�}t||�|�t|j|�t|j|�|j||ddddgd|d|�}t||�|�t|j|�t|j|�|j||dg�}t|j|j�t|j|j�|j||ddddgg�}t|j|j�t|j|j�tj	|�}|t|j
�d}d|ddd�<|j|ddd�|ddd�d�}|j||dd	|�}	|j||ddddgd	|�}
t||�|	|��t|	|�|
|��dS(NcS`s||d|dS(Nii((R?((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/polynomial/tests/test_classes.pytf�siiig�?R3R4iRG(i(i(R1R<tfitR
R3RRKR=R4t
zeros_liketshape(R.RPR?tyRHRFRGtzR7R8tp3((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/polynomial/tests/test_classes.pyR�s>	!-$/'cC`s�|dddgdddgdddg�}|dddgdddgdddg�}|dddgdddgdddg�}|dddgdddgdddg�}t||k�t||k�t||k�t||k�dS(NiiiR3iR4(R
(R.R7R8RVtp4((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/polynomial/tests/test_classes.pyR�s----cC`s�|dddgdddgdddg�}|dddgdddgdddg�}|dddgdddgdddg�}|dddgdddgdddg�}t||k�t||k�t||k�t||k�dS(NiiiR3iR4(R
(R.R7R8RVRW((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/polynomial/tests/test_classes.pyR�s----c	C`s�ttd�d�}ttd	�d�}||�}||�}||}t|||�t|||�t|||�t|t|�|�tt|�||�t|tj|�|�ttj|�||�tttj	||dgd|j
d��tttj	||dgd|jd��|tkritttj	|t
dg��ntttj	|tdg��dS(
Nig�?iiR3iR4(i(i(tlistR=R:ttupleR1tarrayRt	TypeErrortoptaddR3R4RR(R.tc1tc2R7R8RV((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/polynomial/tests/test_classes.pyR�s"
,,"c	C`s�ttd�d�}ttd	�d�}||�}||�}||}t|||�t|||�t|||�t|t|�|�tt|�||�t|tj|�|�ttj|�||�tttj	||dgd|j
d��tttj	||dgd|jd��|tkrmtttj	|t
dg��ntttj	|tdg��dS(
Nig�?iiR3iR4(i(i(RXR=R:RYR1RZRR[R\tsubR3R4RR(R.R^R_R7R8RV((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/polynomial/tests/test_classes.pyR�s"
,,"c	C`s�ttd	�d�}ttd
�d�}||�}||�}||}t|||�t|||�t|||�t|t|�|�tt|�||�t|tj|�|�ttj|�||�t|d||dg��td|||dg��tttj	||dgd|j
d��tttj	||dgd|jd��|tkr�tttj	|t
dg��ntttj	|tdg��dS(Nig�?iiiR3iR4(i(i(RXR=R:RYR1RZRR[R\tmulR3R4RR(R.R^R_R7R8RV((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/polynomial/tests/test_classes.pyR
s&
,,"c		C`s�ttd	�d�}ttd
�d�}ttd�d�}||�}||�}||�}|||}t|j�}t|||�t|||�t|||�t|t|�|�tt|�||�t|tj|�|�ttj|�||�td||dg��t|dd|�ttt	j
||dgd|jd��ttt	j
||dgd|jd��|t
kr�ttt	j
|tdg��nttt	j
|t
dg��dS(Nig�?iiiR3iR4(i(i(i(RXR=R5R:RYR1RZRR[R\tfloordivR3R4RR(	R.R^R_tc3R7R8RVRWtc4((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/polynomial/tests/test_classes.pyR!s0))"cC`s�|dddg�}|d}xqtjD]f}t|t�s)t|t�rTq)n|d�}ttj||�|�tt	tj||�q)WxRt
ttfD]A}|d�}ttj||�|�tt	tj||�q�WxOt
gD]D}|dd�}ttj||�|�tt	tj||�q�Wxat�t�t�t�tjdg�gD]2}tt	tj||�tt	tj||�qhWx*tD]"}tt	tj||d��q�WdS(Niiiii(R1t
ScalarTypet
issubclassRtboolR:R\ttruedivRR[tintRtfloattcomplexRYRXtdictRZR(R.R7R8tstypetstptype((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/polynomial/tests/test_classes.pyR=s*
4
c		C`s�ttd	�d�}ttd
�d�}ttd�d�}||�}||�}||�}|||}t|j�}t|||�t|||�t|||�t|t|�|�tt|�||�t|tj|�|�ttj|�||�td||dg��t|d|dg��ttt	j
||dgd|jd��ttt	j
||dgd|jd��|t
kr�ttt	j
|tdg��nttt	j
|t
dg��dS(Nig�?iiiR3iR4(i(i(i(RXR=R5R:RYR1RZRR[R\tmodR3R4RR(	R.R^R_RcR7R8RVRWRd((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/polynomial/tests/test_classes.pyRXs,,,"c	C`sttd	�d�}ttd
�d�}ttd�d�}||�}||�}||�}|||}t|j�}t||�\}	}
t|	|�t|
|�t||�\}	}
t|	|�t|
|�t||�\}	}
t|	|�t|
|�t|t|��\}	}
t|	|�t|
|�tt|�|�\}	}
t|	|�t|
|�t|tj|��\}	}
t|	|�t|
|�ttj|�|�\}	}
t|	|�t|
|�t|d�\}	}
t|	d|�t|
|dg��td|�\}	}
t|	|dg��t|
|dg��tt	t||dgd|j
d��tt	t||dgd|jd��|tkr�tt	t|t
dg��ntt	t|tdg��dS(Nig�?iiiR3iR4(i(i(i(RXR=R5tdivmodR:RYR1RZRR[R3R4RR(R.R^R_RcR7R8RVRWRdtquotrem((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/polynomial/tests/test_classes.pyR ssP













))cC`s�|jtd�d}|jtd�d}tjtd��}tj|j|d|d|�j��}t||�tj|j|�j��}t||�dS(	Nig�?iR3R4(i(i(i(R3R=R4R1tsortRJtrootsR
(R.RFRGttgttres((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/polynomial/tests/test_classes.pyR$�s*
cC`s&|jd�}t|j�d�dS(Ni(RIRRK(R.RH((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/polynomial/tests/test_classes.pyR'�scC`s�|jd�}|j�}t||k�t||k	�t|j|jk	�t|j|jk	�t|j|jk	�dS(Ni(RItcopyR
R5R3R4(R.R7R8((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/polynomial/tests/test_classes.pyR(�scC`skt}|j|ddd
g��}|j|j��}|j|jd��}t||ddddg��t||dddddg��|j|dddg��}|j|jdd��}|j|jddddg��}t||ddddg��t||dddddg��|j|dddg��}|j|jdd��}|j|jddd��}t||ddddg��t||d	ddddg��d|j}|j|dddg�d
|�}|j|j��}|j|jd��}t||ddddg��t||dddddg��dS(Niiiiitktlbndi����iR3iiiiiiiiiiii(RRDtintegR:R3(R.tPtp0R7R8RF((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/polynomial/tests/test_classes.pyR"�s,"$""
$cC`s>|jtd�d}|jtd	�d}|dddgd|d|�}|jddddg�}|jdddg�}t|jd�j|j�t|jd�j|j�|dddg�}|jddddg�}|jdddg�}t|jd�j|j�t|jd�j|j�dS(
Nig�?iiR3R4Ry(i(i(R3R=R4R{R
tderivR5(R.RFRGR7R8RV((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/polynomial/tests/test_classes.pyR#�s!cC`s|jtd	�d}|jtd
�d}|dddgd|d|�}tj|d|dd�}||�}|jd�\}}t||�t||�tjddd�}||�}|jddddg�\}}t||�t||�dS(Nig�?iiR3R4ii(i(i(R3R=R4R1R<R
(R.RFRGRHtxtgttytgttxrestyres((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/polynomial/tests/test_classes.pyR%�s!

!
cC`s"|jtd
�d}|jtd�d}|dgd|d|�}|dddgd|d|�}x/td�D]!}t|||�||}qwW|dg�}|dddg�}x/td�D]!}t|||�||}q�Wtttj|d�tttj|d	�dS(Nig�?iR3R4iig�?i����(i(i(	R3R=R4trangeR:Rt
ValueErrorR\tpow(R.RFRGRvttstti((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/polynomial/tests/test_classes.pyR!�s!cC`s}t}|j}tj|d|dd�}|j|dddg��}d|dd|}||�}t||�dS(Niiiii(RR3R1R<RDR
(R.R|RFR?RHRvRw((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/polynomial/tests/test_classes.pyRs	cC`s�|dddg�}tt|jd�tt|jd�tt|jd��d�tt|jd��d�tt|jd��d�tt|jd��d�dS(Niiig�?i����i(RR�tcutdegRRL(R.RH((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/polynomial/tests/test_classes.pyR)scC`s�|dddg�}tt|jd�tt|jd�tt|jd��d�tt|jd��d�tt|jd��d�tt|jd��d�dS(Niiig�?ii(RR�ttruncateRRL(R.RH((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/polynomial/tests/test_classes.pyR*$scC`svddddg}||�}t|j�j|d �t|jd�j|d �t|jd�j|d �dS(	Nig���ư>g�-���q=iig�����|�=ig�h㈵��>(RttrimR5(R.tcRH((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/polynomial/tests/test_classes.pyR+.s
cC`s�|j}|j}|dgd|d|�}tddg|j��d|d}|dgd|d|�}tddg|j��dS(NiR3R4ii(R3R4R
tmapparms(R.RFRGRH((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/polynomial/tests/test_classes.pyR&6s		t__main__(:t__doc__t
__future__RRRtoperatorR\tnumbersRtnumpyR1tnumpy.polynomialRRRRRR	t
numpy.testingR
RRR
Rtnumpy.compatRRR/R=R:RRRRRRRRRRRRRRR R$R'R(R"R#R%R!RR)R*R+R&t__name__(((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/polynomial/tests/test_classes.pyt<module>sR.(	$			
				,									-			
						
	
		

Zerion Mini Shell 1.0