ó É9Zc@`s¼ddlmZmZmZddlZddlZddlZddlj j Z ddl 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.pyt test_simple"s  #,1c#`smt}tj‰|ˆtjdddtfV|ˆtjdddtfV|ˆdtjtjtjfV|ˆdtjtjtjfV|ˆdtjtjtjfV|ˆtjdtjdfV|ˆtj dtjtjfV|ˆtj dtjtjtjfV|ˆtjdtjtjfV|ˆtjdtjtj tjfV‡fd†}|dfV‡fd†}|dfV‡fd†}|dfV‡fd†}|dfV|ˆtjdtjtjfV|ˆtjdtjtjfV|ˆtjtjtjtjfV|ˆtjtj tjtjfV|ˆtjtjtjtjfVdS( Niiiÿÿÿÿgè?c `sˆd}tjddƒjˆtjtjtj tjƒƒƒ}|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 `sd}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ˆtjtjtj tjƒƒƒ}|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 `sd}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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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||tj tjtjtjfV||tj tjtjtjfV||dtjtjtjfV||dtjtjtjfV||dtjtjtjfV||tj dtjtjfV||tjdtjtjfVd„}|dfV||tjtjtjtjfV||tjdtjtjfV||tjdtjtjfV||tjtjtjtjfVdS(NiiiÿÿÿÿcS`s‘d}tjtjtjtj tjƒƒƒ}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|jdS(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 R@tlxRAtp_rtn_r((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pyt test_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|jdS(N(RRTRU(R((sV/opt/alt/python27/lib64/python2.7/site-packages/numpy/core/tests/test_umath_complex.pyRWscC`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.pyRs $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`sgg}}|jtjƒ|jtjƒttjtjtjtjfV|jtjƒ|jtj ƒttjtj tjtjfV|jtjƒ|jtjƒttjtjtjtjfV|jtj ƒ|jtjƒttjtj tjtjfVd„}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œttjtjtjtjtfVttjtjtjtj tfVttjtjtjtjfVttjtjtjtjfVttjdtjtjtfVttjdtjtjtfVttjdtjtjtfVttjdtjtj tfVttjtjddtjtfVttjtjddtjtfVttjtjddtjtfVttjtjddtjtfVdS(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öttjtj dtjtfVttjtj dtj tfVttjtjdtjtfVttjtjdtjtfVttjdtjdtjtfVttjdtj dtjtfVttjtj tjdtjtfVttjtj tj dtjtfVttjtjtjdtjtfVttjtjtj dtjtfVttjtj 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.pyts(   . $- cM(>B