K iN ddlZddlZddlZddlZddlZddlZddlmZddlm Z m Z ddl m Z m Z mZmZmZmZmZmZmZdddddej*d d z fd d d dZej.ej0j2dkr dddddddddZn dddddddd dZej6d!e"d#Zej6d$Zd%ZGd&d'ZGd(d)Z Gd*d+Z!Gd,d-Z"Gd.d/Z#Gd0d1Z$Gd2d3Z%ejLjOe d45Gd6d7Z(Gd8d9Z)d:Z*d;Z+d<Z,d=Z-d>Z.d?Z/d@Z0dAZ1dBZ2y)CN)random)MT19937PCG64) IS_WASMassert_assert_array_almost_equalassert_array_equal assert_equalassert_no_warnings assert_raises assert_warnssuppress_warnings)gY@g333333?)?)r rg@)dr)$@))binomial geometrichypergeometric logseries multinomialnegative_binomialpoissonzipf@2fbead005fc63942decb5326d36a1f32fe2c9d32c904ee61e46866b88447c263@23ead5dcde35d4cfd4ef2c105e4c3d43304b45dc1b1444b7823b9ee4fa144ebb@0d764db64f5c3bad48c8c33551c13b4d07a1e7b470f77629bef6c985cac76fcf@7b59bf2f1691626c5815cdcd9a49e1dd68697251d4521575219e4d2a1b8b2c67@d754fa5b92943a38ec07630de92362dd2e02c43577fc147417dc5b9db94ccdd3@8eb216f7cb2a63cf55605422845caaff002fddc64a7dc8b2d45acd477a49e824@70c891d76104013ebd6f6bcf30d403a9074b886ff62e4e6b8eb605bf1a4673b7@01f074f97517cd5d21747148ac6ca4074dde7fcb7acbaec0a936606fecacd93f)rrrrrrrr@8626dd9d052cb608e93d8868de0a7b347258b199493871a1dc56e2a26cacb112@8edd53d272e49c4fc8fbbe6c7d08d563d62e482921f3131d0a0e068af30f0db9@83496cc4281c77b786c9b7ad88b74d42e01603a55c60577ebab81c3ba8d45657@65878a38747c176bc00e930ebafebb69d4e1e16cd3a704e264ea8f5e24f548db@7a984ae6dca26fd25374479e118b22f55db0aedccd5a0f2584ceada33db98605@d636d968e6a24ae92ab52fe11c46ac45b0897e98714426764e820a7d77602a61@956552176f77e7c9cb20d0118fc9cf690be488d790ed4b4c4747b965e61b0bb4@f84ba7feffda41e606e20b28dfc0f1ea9964a74574513d4a4cbc98433a8bfa45module)scopeparamscd|jt|jt|jfSN)param INT_FUNCSINT_FUNC_HASHES)requests i/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/numpy/random/tests/test_randomstate.pyint_funcr98s* MM9W]]3 GMM * ,,c#Ktjj}dtjj|yw)z:Ensures that the singleton bitgen is restored after a testN)nprget_bit_generatorset_bit_generator) orig_bitgens r8restore_singleton_bitgenr@>s/))--/K II ,sAAct|d|dt|dd|ddt|dd|ddt|d|dt|d|dy)N bit_generatorstatekeypos has_gaussgauss)r r )abs r8assert_mt19937_state_equalrJFsr?#Q%78qz%(!G*U*;<qz%(!G*U*;<;;07QwZ(r:c6eZdZdZdZdZdZdZdZdZ y) TestSeedctjd}t|jddtjd}t|jddy)Nrii)r RandomStater randintselfss r8 test_scalarzTestSeed.test_scalarOsF   q !QYYt_c*   z *QYYt_c*r:ctjtd}t|j ddtjt j d}t|j ddtjdg}t|j ddtjdg}t|j ddy)NrrNirirOi )rrPranger rQr<arangerRs r8 test_arrayzTestSeed.test_arrayUs   uRy )QYYt_c*   ryy} -QYYt_c*   s #QYYt_c*    | ,QYYt_c*r:ctttjdtttjdy)Nr TypeErrorrrP ValueErrorrSs r8test_invalid_scalarzTestSeed.test_invalid_scalar_s&i!3!3T:j&"4"4b9r:cHtttjdgtttjdgtttjdgtttjgdtttjgdy)Nr[r\r)rr)rcrr]r`s r8test_invalid_arrayzTestSeed.test_invalid_arraydsdi!3!3dV<j&"4"4rd;j&"4"4zlCj&"4"46HIj&"4"46IJr:ctttjt j gtj tttjgdgtttjgdgdgy)Ndtypercr)r)r r_rrPr<arrayint64r`s r8test_invalid_array_shapez!TestSeed.test_invalid_array_shapels\j&"4"4bhhrEGXX7O Pj&"4"4ykBj&"4"4y7@7B Cr:ctjtd}tt5|j ddddy#1swYyxYw)Nr)rrPrr r^seed)rSrss r8test_cannot_seedzTestSeed.test_cannot_seedts>   a ) 9 %  GGDM   s A  AcJtttjtyr3)r r_rrPrr`s r8test_invalid_initializationz$TestSeed.test_invalid_initializationysj&"4"4g>r:N) __name__ __module__ __qualname__rUrYrarerortrvr:r8rLrLNs'+ +: KC ?r:rLceZdZdZdZy) TestBinomialctjdd}dD]D}ttjd|dk(t tj|||Fy)Nrintrg)rrrcr)r<zerosrrrr )rSrps r8 test_n_zerozTestBinomial.test_n_zero~sR%( AA FOOAq)Q. / vua8% @ Ar:c`tttjdtj y)Nrc)r r_rrr<nanr`s r8 test_p_is_nanzTestBinomial.test_p_is_nansj&//1bff=r:N)rwrxryrrrzr:r8r|r|}s A>r:r|cBeZdZdZdZdZdZdZdZdZ dZ d Z y ) TestMultinomialc4tjdddgy)Nr皙?皙?rrr`s r8 test_basiczTestMultinomial.test_basics3c +r:c4tjdgdy)Nr)rrrrrr`s r8test_zero_probabilityz%TestMultinomial.test_zero_probabilitys3 9:r:ctdtjddcxkxrdknctjddd}ttjd|kttj|dky)Nr\rl)rrrQr<allrSxs r8test_int_negative_intervalz*TestMultinomial.test_int_negative_intervalsYfnnR,1r12 NN2r1 %rQw q2vr:c ddg}ttjd|tjdj dttjd|tjdj dttjd|tjdj dttjd|ddgj dttjd|dj dttjd|tj dj dtttjd|tdy)Nrrcrcrrrrrrr) r rrr<uint32shapermr r^floatrSrs r8 test_sizezTestMultinomial.test_sizes  #JV''1biil;AA6JV''1biil;AA6JV''1biil;AA6JV''1q!f5;;YGV''1f5;;YGV''1bhhv.>?EE  i!3!3QAh r:ctttjdddgtttjdddgy)Nr皙?r皙?r r_rrr`s r8test_invalid_probz!TestMultinomial.test_invalid_probs2j&"4"4cC:Fj&"4"4cC:Fr:cHtttjdddgy)Nr\rrrr`s r8test_invalid_nzTestMultinomial.test_invalid_nsj&"4"4b3*Er:chtjd}|tj|dddz}|ddd}tjdtj d|}tjdtj dtj |}t||y)Ng.@rcrji۠iUr)pvals)r<rXsumrrrrascontiguousarrayr )rSrr non_contigcontigs r8test_p_non_contiguousz%TestMultinomial.test_p_non_contiguouss IIcN RVVAaddG_!$Q$ J''59  J##Cr/C/CE/JK:v.r:ctjgdtj}||jz }d}t j t |5tjd|dddy#1swYyxYw)N) Gz?r& .>rrrrrrrrgz-[\w\s]*pvals array is cast to 64-bit floatingmatchrc) r<rmfloat32rpytestraisesr_rr)rSrrrs r8test_multinomial_pvals_float32z.TestMultinomial.test_multinomial_pvals_float32sd HH:AC MAEEG @ ]]:U 3 )   q% ( ) ) )s A88Bc4tjdddgy)Ng Y@rrrr`s r8test_multinomial_n_floatz(TestMultinomial.test_multinomial_n_floats53*-r:N) rwrxryrrrrrrrrrrzr:r8rrs1,;  GF/).r:rcNeZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z y ) TestSetStatecd|_tj|j|_|jj |_yNiI)rrrrP random_state get_staterCr`s r8 setup_methodzTestSetState.setup_methods6 "..tyy9&&002 r:c|jjd}|jj|j|jjd}t t j ||k(y)N)rtomaxint set_staterCrr<rrSoldnews r8rzTestSetState.test_basics[((, ##DJJ/((,scz"#r:c|jjd}|jj|j|jjd}t t j ||k(yNrjsize)rstandard_normalrrCrr<rrs r8test_gaussian_resetz TestSetState.test_gaussian_resetsa//Q/7 ##DJJ///Q/7scz"#r:cT|jj|jj}|jjd}|jj||jjd}t t j ||k(yr)rrrrrr<r)rSrCrrs r8 test_gaussian_reset_in_media_resz-TestSetState.test_gaussian_reset_in_media_ress ))+!!++-//Q/7 ##E*//Q/7scz"#r:c|jdd}|jjd}|jj||jjd}|jj|j|jjd}t t j ||k(t t j ||k(y)Nrdrr)rCrrrrr<r)rS old_statex1x2x3s r8test_backwards_compatibilityz)TestSetState.test_backwards_compatibilitysJJsO    . .B . 7 ##I.    . .B . 7 ##DJJ/    . .B . 7rRx !rRx !r:c<|jjddyNr)rrr`s r8test_negative_binomialz#TestSetState.test_negative_binomials ++C5r:c.tjt}t5}|j t }|j }tt|dk(t|tsJ|ddk(sJ dddy#1swYyxYw)NrcrBr) rrPrrrecordRuntimeWarningrrlen isinstancedict)rSrssupwrCs r8test_get_state_warningz#TestSetState.test_get_state_warnings}    (   5C >*ALLNE CFaK eT* **)W4 44  5 5 5s AB  Bc|jj}d|ddz}tt|jj|tt |jjt j|t|jjd}|d=tt|jj|y)N)UnknownrcrgFlegacyrB) rrr r_rr^r<rmobject)rSrC new_states r8!test_invalid_legacy_state_settingz.TestSetState.test_invalid_legacy_state_settings!!++-!E!"I- j$"3"3"="=yIi!2!2!(>Dd 1(:(>(>(BDZZd"Z5F 00 1 fr * +r:N)rwrxryrrQrr<rrr"rr rrrnr!rrrr rrr.rmarkskipifrrr4r7r>rzr:r8rrs NNEWWbggrxx299 XXryy"((BII 7E=B M @ !1@ [[ ))E1?AOAO,".+r:rcteZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!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/Z1e2jfjid0e5jld1d2d3e5jnd4gd5Z8d6Z9d7Z:d8Z;d9Zd<Z?d=Z@d>ZAd?ZBd@ZCdAZDdBZEdCZFdDZGdEZHdFZIdGZJdHZKdIZLdJZMdKZNdLZOdMZPdNZQdOZRdPZSdQZTdRZUdSZVdTZWdUZXdVZYdWZZyX)YTestRandomDistcd|_yrrrr`s r8rzTestRandomDist.setup_methods  r:ctj|jtjdd}tjddgddgddgg}t ||d y) Nrjr_\*?琛?<p?,o?H?Z?decimal)rrrrandr<rmrrSr6r3s r8 test_randzTestRandomDist.test_rands` DIIQ"((02EF02EF/1CDFG "&'2>r:ctj|jtj}d}t||dy)NrFrLrM)rrrrOrrPs r8test_rand_singletonz"TestRandomDist.test_rand_singletons. DII%!&'2>r:cNtj|jtjdd}tjddgddgddgg}t ||d tj|jtj}t ||d d y) Nrjr! DII!&'$-Dr:ctj|jtjddd}tjddgddgd d gg}t ||y) Ncrjrrrj))rrrrQr<rmr rPs r8 test_randintzTestRandomDist.test_randintsW DIIRf5((RG "I #J() 67+r:c|tj|jt5}|jt}tj ddd}t t|dk(dddtjddgdd gd d gg}t|tj|jt5}|jt}tj d d}t t|dk(dddt||d zy#1swYxYw#1swY%xYw)Nr`rarbrrcrcrjrdrerfrgr) rrrrrDeprecationWarningrandom_integersrrr<rmr )rSrrr6r3s r8test_random_integersz#TestRandomDist.test_random_integerss DII   !C -.A++C&AF CFaK  !((RG "I #J() 67+ DII   !C -.A++Cf=F CFaK  ! 67S=1 ! ! ! !sAD& AD2&D/2D;cJtj|jtj|j}|jd}t j tj jdk(r/t jddgddgdd ggtj }n.t jd d gd dgddggtj }t|||j|j|j}t||dy)Nrbrii4Oi˕+iRKiriFbqirglK+W+ylr&&J]l; lnBz l@XHTlD+l++r[) rrrrPrr<rr9rrmrnr )rSrsr6r3s r8 test_tomaxintzTestRandomDist.test_tomaxints DII    *&) 88BGG  J .hhi 8!+i 8!+i 8 :ACKGhh!46I J!46I J!46I J L&(XX/G VW%  VWT]+r:c 4t5}|jt}tjt j djt j dj}tt|dk(dddt j dj}t|t5}|jt}t jdj}tj|t j dj|t j dj}tt|dk(dddt||y#1swYxYw#1swY"xYw)Nr/rc) rrrkrrlr<rrrrr rhr;)rSrrr6r3typers r8test_random_integers_max_intz+TestRandomDist.test_random_integers_max_ints'   !C -.A++BHHSM,=,=,.HHSM,=,=?F CFaK  ! ((3-##VW%   !C -.AHHSM&&E++E"((3-2C2C,D,1"((3-2C2C,DFF CFaK  ! VW% ! ! ! !sA=FB(FF Fc tj5tjdtt tt j tjdjt tt j tjdjtjdjdddy#1swYyxYw)Nerrorr/) warningscatch_warnings simplefilterrkr rrlr<rrr`s r8test_random_integers_deprecatedz.TestRandomDist.test_random_integers_deprecated$s  $ $ & @  ! !'+= > , 00((3-++ - , 00((3-++RXXc]->-> @ @ @ @s B1CCcLtj|jtjd}tjddgddgddgg}t ||d tj|jtj}t ||d d y) NrbrFrGrHrIrJrKrLrMr[)rrrrr<rmrrPs r8test_random_samplez!TestRandomDist.test_random_sample2s DII%%f-((02EF02EF/1CDFG "&'2> DII%%'!&'$-Dr:ctj|jtjdd}tjgd}t ||y)Nrk)rrjrrjrrrchoicer<rmr rPs r8test_choice_uniform_replacez*TestRandomDist.test_choice_uniform_replace>s: DIIq!$((<(67+r:ctj|jtjddgd}tjgd}t ||y)Nrk)皙?r皙?rr)rcrcrrr|rPs r8test_choice_nonuniform_replacez-TestRandomDist.test_choice_nonuniform_replaceDs= DIIq!';<((<(67+r:ctj|jtjddd}tjgd}t ||y)NrkrjFreplace)rrcrjr|rPs r8test_choice_uniform_noreplacez,TestRandomDist.test_choice_uniform_noreplaceJs< DIIq!U3((9%67+r:ctj|jtjdddgd}tjgd}t ||y)NrkrjF)r333333?rrrr)rrjrcr|rPs r8 test_choice_nonuniform_noreplacez/TestRandomDist.test_choice_nonuniform_noreplacePs? DIIq!U6JK((9%67+r:ctj|jtjgdd}tjgd}t ||y)N)rHrIcdrk)rrrrr|rPs r8test_choice_nonintegerz%TestRandomDist.test_choice_nonintegerVs< DII3Q7((/067+r:c jtj}tt|ddtt|ddtt|ddgddggdtt|gdtt|gddddgddgg tt|ddgdgd  tt|ddgdd d g tt|ddgdd d g tt|gdddtt|gdddtt|gdddtt|gdddtt|gdddgdy)Nr\rj@rcrrk)rcrrjrkg?r)rrrrrrriFrrd)r\)r\rc)rcrrr)rr}r r_)rSr<s r8test_choice_exceptionsz%TestRandomDist.test_choice_exceptions\s j&"a0j&"a0j&Aq6Aq6*:A>j&"a0j&,d|4 6j&1a&!Gj&1a&!T{Cj&1a&!SzBj&)QFj&)RGj&)UEJj&)WeLj&)Q#y 2r:c  ddg}ttjtjddttjtjddttjtjdd|ttjtjdd|ttjtjddgdttjdgddutj ddg}tj dt }||d <ttj|d|ud }ttjtjd|d ttjtjd|d ttjtjd|d| ttjtjd|d| ttjtjddg|d ttjdg|djd k(tj ddg}tj dt }||d <ttj||dj|ud }gd }ttjd|dj|ttjd|dj|ttjd|d|j|ttjd|d|j|ttjtjd|dj|ttjd d djdttjd dd jdttjddd jdttjd d jdttjgdjdttjddgdjdtttjgdy)NrrrTrFrrcrgrrz)rrj)rrrrrrr)rjrrkri)rrrHrI)rr<isscalarrr}rmemptyrndimitemr rrXrQr r_)rSrrHarrrTs r8test_choice_return_shapez'TestRandomDist.test_choice_return_shapeos #J FMM!T:;< FMM!U;<= FMM!TQ?@A FMM!Ua@AB FMM1a&$?@A tfd3t;< HHaV hhq'A c40A56 BKK aD ABBCBKK aE BCCDBKK aDA FGGHBKK aEQ GHHIBKK q!fa FGGH tfa6;;q@A HHaV hhq'A c1d388:a?@  *V]]1a6<V]]C:I>DD j&--R8r:c|tjgd}gd}tttj ||y)N)*rcr)NNNr)r<rmr r_rr})rSrHrs r8test_choice_nan_probabilitiesz,TestRandomDist.test_choice_nan_probabilitiess' HHZ  j&--a8r:c vtjddz }d|ddd<tj|jtjdd|ddd}tj|jtjddtj |ddd}t ||y)Nrrlrrcrrjr)r<onesrrrr}rr )rSrrrs r8test_choice_p_non_contiguousz+TestRandomDist.test_choice_p_non_contiguouss GGBK!O!$Q$ DII]]1a1SqS62  DIIq!r';';AccF'CD:v.r:ctj|jtjd}d}t||y)Nrs Ui+Wf)rrrbytesr rPs r8 test_byteszTestRandomDist.test_bytess/ DIIb!.VW%r:c ddddddddd d d f D]X}tj|j|gd }tj||}|gd }t||Zy)Nc,tjgSr3)r<rmrs r8z-TestRandomDist.test_shuffle..srxx|r:c|Sr3rzrs r8rz-TestRandomDist.test_shuffle..sqr:cftj|jtjSr3)r<asarrayastyperrs r8rz-TestRandomDist.test_shuffle..srzz!}33BGG<r:cftj|jtjSr3)r<rrrrs r8rz-TestRandomDist.test_shuffle..srzz!}33BJJ?r:cftj|jtjSr3)r<rr complex64rs r8rz-TestRandomDist.test_shuffle..srzz!}33BLLAr:cRtj|jtSr3)r<rrrrs r8rz-TestRandomDist.test_shuffle..srzz!}33F;r:c0|Dcgc]}||fc}Scc}wr3rzris r8rz-TestRandomDist.test_shuffle..s21A22s cVtj|Dcgc]}||gc}Scc}wr3)r<rrs r8rz-TestRandomDist.test_shuffle..s!rzz1*=aAq6*=>*=s &cDtj||gjSr3)r<vstackTrs r8rz-TestRandomDist.test_shuffle..sryy!Q022r:ctj|Dcgc]}||fc}dtfdtfgjtjScc}w)NrHrI)r<rr~r)recarrayrs r8rz-TestRandomDist.test_shuffle..sE A+>qQF+>-0#Jc +C!E!%bkk!2+>s Actj|Dcgc]}||fc}dtdfdtjdfgScc}w)NrHrcrI)r<rrrrs r8rz-TestRandomDist.test_shuffle..sBrzz1*=aAq6*=,/+>,/4+@+B C*=s A rcrrjrkrlrr r rrcrrrrkrlrrrj)rrrshuffler )rSconvalistr6r3s r8 test_shufflezTestRandomDist.test_shuffles, <?A;2>24CD 0D" KK "78E NN5 !F9:G vw /- 0r:ctjjtjt dddzdz d}tjjtj ddzdz d}|j }|j }t dD]}tj|tt|j|jt|j|jtj|tt|j|jt|j|jd}y)Nr)rlrkrjrcr\2cltjd}tttj |y)Nrj)r<rmr r^rrrs r8test_shuffle_invalid_objectszHTestRandomDist.test_shuffle_masked..test_shuffle_invalid_objectss A )V^^Q 7r:) r<ma masked_valuesreshaperWrXcopyrrr sorteddatamask)rSrHrIa_origb_origrrs r8test_shuffle_maskedz"TestRandomDist.test_shuffle_maskeds  EE   59f = AA Er J EE   "  1A 5r :r LA NN1  qvvqvvg' V[[L0I)J L NN1  qvvqvvg' V[[L0I)J L  L 8r:ctj|jgd}tj|}gd}t||tj|jt j gdj }tj|}t|t j |j tj|jd}tttj|tj|jd}tttj|d}gd}tj|jtj|}t||y)Nrrabcdg333333?r) rrrrlrcrjrkrrr) rrr permutationr r< atleast_2drr IndexError)rSrr6r3arr_2d bad_x_str bad_x_float integer_vals r8test_permutationzTestRandomDist.test_permutations DII.##E*067+ DII=>@@##F+62==#9#;#;< DII j&"4"4i@ DII j&"4"4kB 0 DII##K067+r:ctj|jtjddd}tjddgddgd d gg}t ||d y) NrrrbrgAKč?ghA?g ҇o>gάXf+q?gS1$?g'8zX ?rLrM)rrrbetar<rmrrPs r8 test_betazTestRandomDist.test_betasb DIIR&1(()+BC)+BC)+BCEF "&'2>r:cLtj|jtjddd}tjddgddgd d gg}t ||tj|jtjdd}d}t ||y) NgZd;Y@gv/?rbr%+r0.-)rrrrr<rmr rPs r8 test_binomialzTestRandomDist.test_binomials DII$V<((RHHH&' 67+ DII$/67+r:ctj|jtjdd}tjddgddgdd gg}t ||d y) Nrrbrg+Q]uO@g+Q@gY7`ZqP@ge(fG@gvtR@gEIȋR@ rM)rrr chisquarer<rmrrPs r8test_chisquarezTestRandomDist.test_chisquaresb DII!!"62((13GH13GH02FGIJ "&'2>r:c2tj|jtjddg}tj|d}tjddgddggd d gd d ggd dgddggg}t ||dtjddg}t ttj|tj|jtjddg}tj|}t ||ddy)NIHHgx01 j&"2"2I> DII.0DEF!!%(!&'$-Dr:ctjddg}ttj|tj dj dttj|tj dj dttj|tj dj dttj|ddgj dttj|dj dttj|tjdj dtttj|tdy)Nrrrcrrrr) r<rmr rrrrr r^rrs r8test_dirichlet_sizez"TestRandomDist.test_dirichlet_size*s HH*,@A BV%%a16<r:cttjddtttjdyNrscale)r rrr r_r`s r8test_exponential_0z!TestRandomDist.test_exponential_0Ms)V''a0!4j&"4"4C@r:ctj|jtjddd}tjddgddgd d gg}t ||d y) N Mrbrg7?g`j?g6"+?gܳ2>?gc>+Y?g_}S?rLrM)rrrfr<rmrrPs r8test_fzTestRandomDist.test_fQsb DII"bv.((02EF02EF02EFHI "&'2>r:ctj|jtjddd}tjddgddgd d gg}t ||d y) NrlrjrbrgԏGM8@gȌ<@g ":@gv#)@gZQ?@gr[@@rM)rrrgammar<rmrrPs r8 test_gammazTestRandomDist.test_gammaYsb DIIa0((13GH13GH13GHJK "&'2>r:cttjdddtttjddy)Nr)rrr)r rrr r_r`s r8 test_gamma_0zTestRandomDist.test_gamma_0as)V\\3Q7j&,,cEr:ctj|jtjdd}tjddgddgddgg}t ||y) N_c97ݚ?rbrrrrlr)rrrrr<rmr rPs r8test_geometriczTestRandomDist.test_geometricesW DII!!*6:((QFHG%& 67+r:c0tttjdtttjdgdztttjdtttjdgdzt 5}|j t tttjtjtttjtjgdzdddy#1swYyxYw)Nrrr) r r_rrrrrr<rrSrs r8test_geometric_exceptionsz(TestRandomDist.test_geometric_exceptionsmsj&"2"2C8j&"2"2SEBJ?j&"2"2D9j&"2"2TFRK@   GC JJ~ & *f&6&6 ? *f&6&62 F G G Gs A4D  Dctj|jtjddd}tjddgddgd d gg}t ||d y) Nr @rblocrrgؕ?gs0?g#0g(xg-KD?gůp`@rLrM)rrrgumbelr<rmrrPs r8 test_gumbelzTestRandomDist.test_gumbelwsb DII:SvF((02EF02FG02FGIJ "&'2>r:cttjddtttjdyr)r rrr r_r`s r8 test_gumbel_0zTestRandomDist.test_gumbel_0%V]]+Q/j&--s;r:ctj|jtjdddd}tjddgddgddgg}t ||tjdd d d }tjgd }t ||tjd d dd }tjgd}t ||tjd dd d }tjgd}t ||tjd d dd }tjgd}t ||y)Ng333333$@g@rrbrrrrlrrjrk)rjrjrjrjrLr)rrrr)rrrr)rrrrr<rmr rPs r8test_hypergeometricz"TestRandomDist.test_hypergeometrics DII&&tS"6B((RHHF$% 67+&&q!QQ7((<(67+&&r1bq9((+,67+&&q!QQ7((<(67+&&q"bq9((<(67+r:ctj|jtjddd}tjddgddgd d gg}t ||d y) Nr rrbrg bO?g¸?gpJm @g{K*t @g:^w-gY~o?rLrM)rrrlaplacer<rmrrPs r8 test_laplacezTestRandomDist.test_laplacesb DIIJcG((02EF02EF13FGIJ "&'2>r:cttjddtttjdyr)r rrr r_r`s r8test_laplace_0zTestRandomDist.test_laplace_0s%V^^!,a0j&..r:ctj|jtjddd}tjddgddgd d gg}t ||d y) Nr rrb)meansigmargɁ0@go,+4FB@g)ʭ6@g5?gnxNnP@g)U@rrM)rrr lognormalr<rmrrPs r8test_lognormalzTestRandomDist.test_lognormalsd DII!!z6J((13GH13FG13GHJK "&'2>r:cttjddtttjdy)Nr)r'rcr)r rr(r r_r`s r8test_lognormal_0zTestRandomDist.test_lognormal_0s)V%%A.2j&"2"2#>r:ctj|jtjdd}tjddgddgddgg}t ||y)Ngƀ@?rb)rrrrr rj)rrrrr<rmr rPs r8test_logserieszTestRandomDist.test_logseriessW DII!!JV<((QFGF$% 67+r:c8tjddk(sJy)Nrrc)rrr`s r8test_logseries_zeroz"TestRandomDist.test_logseries_zeros"a'''r:valuerr\?g@cTtjd5tjt5t j |dddtjt5t j tj|gdzdddtjt5t j tj|gdzdddddddddy#1swYxYw#1swYrxYw#1swY*xYw#1swYyxYw)Nignoreinvalidrr)r<errstaterrr_rrrm)rSr0s r8test_logseries_exceptionsz(TestRandomDist.test_logseries_exceptionss [[ * >z* (  ' (z* 9  5'B,!78 9z* >  5'B,!7!!<= >  > > ( ( 9 9 > >  > >sRDC:!D(-D!D63D)D:D ?DD DD DD'ctj|jtjddgdzd}tjgdgdggdgd ggd gd gg}t ||y) NrUUUUUU?rrbr)rkrjrlrkrr)rlrrrrrc)rjrkrjrrrk)rrcrkrjrrk)rkrkrrlrrj)rkrjrkrrjrk)rrrrr<rmr rPs r8test_multinomialzTestRandomDist.test_multinomialsl DII##B1 6B((//1//1//1 23 67+r:ctj|jd}ddgddgg}d}tj|||}tjddgddggd d gd d ggd dgddggg}t ||dtj||}tjddg}t ||dddg}ddgddgg}t ttj||ttj||dtttj||dtjddgddggtj}t5}tj|||jt}t|dk(sJ dddtjd}tj d}tttj||dtttjtjd|tttj|tj"dtttj|tj dy#1swYxYw)N)r rrcrrbg4Vj?gy'@gI1?gSB#@g e<@g4W(@g6R¿?g9r v"@gс?g{#@g4xg"f"@rLrMgN}O6?gYMW"@rr3) check_validraiserrgother)rrcrcrj)rrrmultivariate_normalr<rmrr rr r r_rrrrreyer) rSr&covrr6r3rrmus r8test_multivariate_normalz'TestRandomDist.test_multivariate_normalsI DII1v1v++D#t<((/1BC/1BCE/1CD/1BCE/1BC02CDF GH "&'2>++D#6((-/?@A!&'2>1v1v1v^V%?%?sK 655tS'/ 1 j&"<"   C  & &tS 1 >*Aq6Q; ;  XXa[ffQij&"<"&>RVV L *f&>&>66(R- ) ) ) )s A6B  Bctj|jtjddd}tjddgddgdd gg}t ||d tjd d d}tjddgddgddgg}t ||d tj|jtjddd}tjddgddgddgg}t ||d y)Nrlrb)dfnoncrgG7@g!ܴ*@g1}z9?@g+驸0@g26E_r#@gI!1@rrMrrg?gTD?g?T?g+qnl?g~|D?g밬?rg{01#@gprs'@g~;$@g"dI @g*@g }',@)rrrnoncentral_chisquarer<rmrrPs r8test_noncentral_chisquarez(TestRandomDist.test_noncentral_chisquare!s DII,,G((13GH13GH02FGIJ "&'2>,,&I((03FG03FG.1DEGH "&'2> DII,,G((.0BC/1BC/1CDFG "&'2>r:ctj|jtjdddd}tjddgdd gd d gg}t ||d y)Nrlrrcrb)dfnumdfdenrJrg^~?g/+c?g". @g@g7?gE?rrM)rrr noncentral_fr<rmrrPs r8test_noncentral_fz TestRandomDist.test_noncentral_f6si DII$$1AA*02((02EF02EF02DEGH "&'2>r:ctj|jtjddtj}tj |sJy)Nrlr)rNrOrJ)rrrrPr<risnan)rSr6s r8test_noncentral_f_nanz$TestRandomDist.test_noncentral_f_nan?s< DII$$1ABFFCxxr:ctj|jtjddd}tjddgddgd d gg}t ||d y) Nr rrbrg&&n@gOG_ @g~w@gtw]տgm&5@g$>@rLrM)rrrnormalr<rmrrPs r8 test_normalzTestRandomDist.test_normalDsb DII:SvF((02EF.0DE02EFHI "&'2>r:cttjddtttjdyr)r rrVr r_r`s r8 test_normal_0zTestRandomDist.test_normal_0Lrr:ctj|jtjdd}tjddgddgdd gg}tj j ||d y) Nr rbrHrgW I@g Ԩy@gy]0Ag1~\Aga@gY 7A)nulp)rrrparetor<rmtestingassert_array_almost_equal_nulprPs r8 test_paretozTestRandomDist.test_paretoPsm DII&9(()+BC)+BC)+BCEF 11&'1Kr:ctj|jtjdd}tjddgddgddgg}t ||y)Nr rb)lamrrrc)rrrrr<rmr rPs r8 test_poissonzTestRandomDist.test_poisson_sU DIIJV<((QFFF$% 67+r:crtjdj}d}ttt j |ttt j |gdzttt j |ttt j |gdzt5}|jtttt j tjttt j tjgdzdddy#1swYyxYw)Nr/r\r) r<rrr r_rrrrrr)rSlambiglamnegrs r8test_poisson_exceptionsz&TestRandomDist.test_poisson_exceptionsgs#""j&..&9j&..6(R-@j&..&9j&..6(R-@   EC JJ~ & *fnnbff = *fnnrvvhm D E E Es 0A4D--D6ctj|jtjdd}tjddgddgdd gg}t ||d y) Nr rbr[g;'?gܴw*?g5?gFG?gD]?g$`?rLrM)rrrpowerr<rmrrPs r8 test_powerzTestRandomDist.test_powerss` DII 8((02EF02EF02EFHI "&'2>r:ctj|jtjdd}tjddgddgdd gg}t ||d y) Nrrb)rrg"u+@gN$MB*@g7v8B4@g55@ge&@g~ӣZ1@rrM)rrrrayleighr<rmrrPs r8 test_rayleighzTestRandomDist.test_rayleigh{s` DIIr7((02DE13GH13GHJK "&'2>r:cttjddtttjdyr)r rrmr r_r`s r8test_rayleigh_0zTestRandomDist.test_rayleigh_0s%V__1-q1j&//=r:ctj|jtjd}tjddgddgddgg}t ||d y) NrbrgMoDL?g6([9grF=?gM' -gVgVA:Qy?rLrM)rrrstandard_cauchyr<rmrrPs r8test_standard_cauchyz#TestRandomDist.test_standard_cauchys` DII''V4((02FG02FG13FGIJ "&'2>r:ctj|jtjd}tjddgddgddgg}t ||d y) Nrbrg܁?gc!z?g&N"@gNI@gF>?g~ME?rLrM)rrrstandard_exponentialr<rmrrPs r8test_standard_exponentialz(TestRandomDist.test_standard_exponentials` DII,,&9((02EF/1DE/1DEGH "&'2>r:ctj|jtjdd}tjddgddgdd gg}t ||d y) Nrjrb)rrg)@gľ@gd],q@gPk{@g9B #1@gv @rrM)rrrstandard_gammar<rmrrPs r8test_standard_gammaz"TestRandomDist.test_standard_gammasb DII&&QV<((02EF02EF02CDFG "&'2>r:cttjddtttjdy)Nr)rr)r rrxr r_r`s r8test_standard_gamma_0z$TestRandomDist.test_standard_gamma_0s)V**3Q7j&"7"7sCr:ctj|jtjd}tjddgddgddgg}t ||d y) NrbrrUrVrWrXrYrZrLrM)rrrrr<rmrrPs r8test_standard_normalz#TestRandomDist.test_standard_normals` DII''V4((02EF.0CD.0CDFG "&'2>r:ctj|jtj}tjd}t ||dy)NrUrLrMr\rPs r8test_randn_singletonz#TestRandomDist.test_randn_singletons8 DII((./!&'2>r:ctj|jtjdd}tjddgddgdd gg}t ||d y) Nrrb)rIrg\VH?ghU%gH$M?gLgVqdzǿg㖀?rLrM)rrr standard_tr<rmrrPs r8test_standard_tzTestRandomDist.test_standard_tsb DII""bv6((02FG02FG13FGIJ "&'2>r:ctj|jtjdddd}tjddgdd gd d gg}t ||d y)Ng{Gz@g(\u$@gףp= W4@rb)leftmoderightrg:}\)@ghرTj(@gǨL30@g6ڜA0@g6sh&@g<,@rrM)rrr triangularr<rmrrPs r8test_triangularzTestRandomDist.test_triangularsi DII""5(.0((13FG13GH13FGIJ "&'2>r:ctj|jtjddd}tjddgddgd d gg}t ||d y) NGz?gGz%@rb)lowhighrg>#H@gu@g#@g}d]#@gN@gw )* @rLrM)rrruniformr<rmrrPs r8 test_uniformzTestRandomDist.test_uniformsb DIIDu6B((02EF02EF02EFHI "&'2>r:c,tjdj}tjdj}tj }t t|tj dt t|dtjt t|||t t|tj gdgt t|dgtjgt j tj|d|dz y)Nrrrcg؅W4vC)rr) r<finforrrrr OverflowErrorinf nextafter)rSfminfmaxfuncs r8test_uniform_range_boundsz(TestRandomDist.test_uniform_range_boundssxx $$xx $$~~mTBFF7A6mT1bff5mT46mTRVVG9qc:mTA39 2<<a0td{Cr:czGddtj}tjdj|}t t t j||Gddtj}tjdj|}t t t j|ddy)NceZdZdZy)GTestRandomDist.test_scalar_exception_propagation..ThrowingFloatctr3r^r`s r8 __float__zQTestRandomDist.test_scalar_exception_propagation..ThrowingFloat.__float__r:N)rwrxryrrzr:r8 ThrowingFloatr r:rr1ceZdZdZy)ITestRandomDist.test_scalar_exception_propagation..ThrowingIntegerctr3rr`s r8__int__zQTestRandomDist.test_scalar_exception_propagation..ThrowingInteger.__int__rr:N)rwrxryrrzr:r8ThrowingIntegerrrr:rrc) r<ndarrayrmr)r r^rrr)rSrthrowing_floatr throwing_ints r8!test_scalar_exception_propagationz0TestRandomDist.test_scalar_exception_propagations BJJ #++M:i$ & bjj xx{''8 i!6!6 aKr:ctj|jtjddd}tjddgddgd d gg}t ||d y) Nrp= ף?rbrBkappargLZI@g'N"@gkr?gk=m@gډ?g^=\?rLrMrrrvonmisesr<rmrrPs r8 test_vonmiseszTestRandomDist.test_vonmisessb DIID6B((02EF02EF02EFHI "&'2>r:ctj|jtjddd}tt j |j y)Nrg g5_PG>@Br)rrrrrr<isfiniterrSrs r8test_vonmises_smallz"TestRandomDist.test_vonmises_smalls= DII OOre < A""$%r:ctj|jtjddd}tjgd}t ||dy)NrgcArjr)gA^>?g@R7?gx.rrMrrPs r8test_vonmises_largez"TestRandomDist.test_vonmises_largesE DIIBc:((45 "&'1=r:ctj|jtjdtj}t tj |y)Nr)rBr)rrrrr<rrrSrs r8test_vonmises_nanz TestRandomDist.test_vonmises_nans6 DII OOr 0 r:ctj|jtjddd}tjddgddgd d gg}t ||d y) Nrrrb)r&rrgZ@g- g@g8 m?gVP"?g`V?gx^&3?rrM)rrrwaldr<rmrrPs r8 test_waldzTestRandomDist.test_wald sb DII$d@((02EF02EF02EFHI "&'2>r:ctj|jtjdd}tjddgddgdd gg}t ||d y) Nrrbr[g@6?g]A?g(1ڥR?gU?g2_u?g^}-Q?rLrM)rrrweibullr<rmrrPs r8 test_weibullzTestRandomDist.test_weibulls` DII$V4((02EF02EF02EFHI "&'2>r:ctj|jttjddt j dt ttjdy)Nrrr[r)rH)rrrr rr<rr r_r`s r8test_weibull_0zTestRandomDist.test_weibull_0s? DIIV^^ab1288B<@j&..C8r:ctj|jtjdd}tjddgddgddgg}t ||y) Nrrbr[Brcrjr)rrrrr<rmr rPs r8 test_zipfzTestRandomDist.test_zipf!sU DIIt&1((RHFG%& 67+r:N)[rwrxryrrQrSr^rhrmrorrrxrzr~rrrrrrrrrrrrrrrrrrrrrrrr rrrrrrr!r$r)r+r-r/rr? parametrizer<rrr7r:rCrrGrLrQrTrWrYrardrhrkrnrprsrvryr{r}rrrrrrrrrrrrrrrzr:r8rBrBs?? E,2$,(&, @ E, , , , , 2&,9\9 /& 068$,6? ,?E& @; 6?A??F,G?<,4?=???,( [[W|r||B';R&LM >N > ,1%f,)?*? ?< L, E??>???D?? ???D L,?& > ??9 ,r:rBceZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!d Z"y!)" TestBroadcastcd|_y)N[rDr`s r8rzTestBroadcast.setup_method-s  r:cBtj|jyr3)rrrr`s r8set_seedzTestBroadcast.set_seed0s DIIr:cdg}dg}tj}tjgd}|j ||dz|}t ||d|j |||dz}t ||dy)Nrrcgl ?g_x ?g =*BN?rjrrM)rrr<rmrr)rSrrrr3r6s r8rzTestBroadcast.test_uniform3sxcs..((12 q$'!&'2> dQh'!&'2>r:c`dg}dg}dg}tj}tjgd}|j ||dz|}t ||dt t||dz||j |||dz}t ||dt t|||dzy)Nrrcr\)g-r@gYl@g-`w?rjrrM)rrVr<rmrrr r_)rSrr bad_scalerVr3r6s r8rWzTestBroadcast.test_normalCscD ((01 a'!&'2>j&#'9= UQY'!&'2>j&#y1}=r:cdg}dg}dg}dg}tj}tjgd}|j ||dz|}t ||dt t||dz|t t||dz||j |||dz}t ||dt t|||dzt t|||dzy) Nrcrr\rd)gnQVf?gVKB?g v`k?rjrrM)rrr<rmrrr r_)rSrHrIbad_abad_brr3r6s r8rzTestBroadcast.test_betaVs C C{{((12 a!eQ!&'2>j$ 15j$Au5 aQ!&'2>j$q1u5j$5195r:cdg}dg}tj}tjgd}|j ||dz}t ||dt t||dzyNrcr\)g.UgZ?giPrq?gE K?rjrrM)rrr<rmrrr r_)rSrrrr3r6s r8rzTestBroadcast.test_exponentiallscD (( ((12 UQY'!&'2>j+y1}=r:cdg}dg}tj}tjgd}|j ||dz}t ||dt t||dzyr)rrxr<rmrrr r_)rSr bad_shape std_gammar3r6s r8ryz!TestBroadcast.test_standard_gammayscD )) ((12 519%!&'2>j)Y];r:cdg}dg}dg}dg}tj}tjgd}|j ||dz|}t ||dt t||dz|t t||dz||j |||dz}t ||dt t|||dzt t|||dzy) Nrcrr\rd)g.UgZ?giPrq?gE K?rjrrM)rrr<rmrrr r_)rSrrrrrr3r6s r8rzTestBroadcast.test_gammasD D  ((01 uqy%(!&'2>j%Q>j%I> ueai(!&'2>j%EAI>j% A >r:cdg}dg}dg}dg}tj}tjgd}|j ||dz|}t ||dt t||dz|t t||dz||j |||dz}t ||dt t|||dzt t|||dzy) Nrcrr\rd)gbyʜ?go?gT7@rjrrM)rrr<rmrrr r_)rSrNrO bad_dfnum bad_dfdenrr3r6s r8rzTestBroadcast.test_fsD D HH((01 519e$!&'2>j!Y]E:j!UQY : 5%!)$!&'2>j!Y :j!UIM:r:c dg}dg}dg}dg}dg}dg}tj}tjgd}|j ||dz||} t | |d tj tj|||tjgdzsJtt||dz||tt||dz||tt||dz|||j |||dz|} t | |d tt|||dz|tt|||dz|tt|||dz||j ||||dz} t | |d tt||||dztt||||dztt||||dzy) Nrrjrkrr\rd)gr^G"@g/ *@gц!@rrM) rrPr<rmrrrrSrr r_) rSrNrOrJrrbad_noncnonc_fr3r6s r8rQzTestBroadcast.test_noncentral_fssC D 4$$((01  5$/!&'2>vvbhhveURVVHqLABCCCj&)a-Ej&%!)YEj&%!)UHE uqy$/!&'2>j&)UQYEj&%QEj&%HE udQh/!&'2>j&)UD1HEj&%D1HEj&%1 Er:c|jtjddg}tjdddd}t ||dy)Ngaz@gn4M;%?rrrrrM)rr<rmrrPr)rSr3r6s r8test_noncentral_f_small_dfz(TestBroadcast.test_noncentral_f_small_dfsB ((-/@AB$$S#qq9!&'2>r:cdg}dg}tj}tjgd}|j ||dz}t ||dt t||dzy)Nrcr\)g~}N??g$F?g'rS?rjrrM)rrr<rmrrr r_)rSrIbad_dfrr3r6s r8rzTestBroadcast.test_chisquarescS$$ ((01 26"!&'2>j)VaZ8r:cdg}dg}dg}dg}tj}tjgd}|j ||dz|}t ||dt t||dz|t t||dz||j |||dz}t ||dt t|||dzt t|||dzy) Nrcrr\rd)g w"@g2 WR@gRY@rjrrM)rrKr<rmrrr r_)rSrIrJrrnonc_chir3r6s r8rLz'TestBroadcast.test_noncentral_chisquaresSs4..((01 "q&$'!&'2>j(FQJ=j(BFH= "dQh'!&'2>j(FD1H=j(B1 =r:cdg}dg}tj}tjgd}|j ||dz}t ||dt t||dzt ttj|dzy)Nrcr\)gT @g~Fl@gƚtp?rjrrM)rrr<rmrrr r_)rSrIrtr3r6s r8rzTestBroadcast.test_standard_tsxS   ((01 26!&'2>j!VaZ0j&"3"3VaZ@r:c`dg}dg}dg}tj}tjgd}|j ||dz|}t ||dt t||dz||j |||dz}t ||dt t|||dzy)Nrrcr\)gW!@gOBg}?rjrrM)rrr<rmrrr r_)rSrBr bad_kapparr3r6s r8rzTestBroadcast.test_vonmises sSD ??((12 "q&%(!&'2>j(BFI> "eai(!&'2>j(B A >r:cdg}dg}tj}tjgd}|j ||dz}t ||dt t||dzt ttj|dzy)Nrcr\)g&8??geFX?gՋː?rjrrM)rr^r<rmrrr r_)rSrHrr^r3r6s r8razTestBroadcast.test_paretost C((01 A!&'2>j&%!)4j&--;r:cdg}dg}tj}tjgd}|j ||dz}t ||dt t||dzt ttj|dzyr)rrr<rmrrr r_)rSrHrrr3r6s r8rzTestBroadcast.test_weibull-st C..((12 Q!&'2>j'5195j&..%!)j%3j&,, :r:c`dg}dg}dg}tj}tjgd}|j ||dz|}t ||dt t||dz||j |||dz}t ||dt t|||dzy)Nrrcr\)g:BKc?g3k?g~q?rjrrM)rrr<rmrrr r_)rSrrrrr3r6s r8rzTestBroadcast.test_laplaceIscD ..((23 q%(!&'2>j'37I> eai(!&'2>j'3 A >r:c`dg}dg}dg}tj}tjgd}|j ||dz|}t ||dt t||dz||j |||dz}t ||dt t|||dzy)Nrrcr\)g'Zy?gdSO=?g3L1?rjrrM)rrr<rmrrr r_)rSrrrrr3r6s r8rzTestBroadcast.test_gumbel\scD ((12 a'!&'2>j&#'9= UQY'!&'2>j&#y1}=r:cdg}dg}dg}tj}tjgd}|j ||dz|}t ||dt t||dz||j |||dz}t ||dt t|||dzttjdd dy) Nrrcr\)g“y?gJR?g ~&?rjrrMr1r) rr#r<rmrrr r_r )rSrrrr#r3r6s r8r$zTestBroadcast.test_logisticoscD ??((23 #'5)!&'2>j(C!GY? #uqy)!&'2>j(CQ?V__S#.4r:cdg}dg}dg}tj}tjgd}|j ||dz|}t ||dt t||dz|t ttj|dz||j |||dz}t ||dt t|||dzt ttj||dzy)Nrrcr\)gH"@gܮ @gvv :@rjrrM)rr(r<rmrrr r_)rSr&r' bad_sigmar(r3r6s r8r)zTestBroadcast.test_lognormalssD $$ ((01 4!8U+!&'2>j)TAXyAj&"2"2D1HiH 4+!&'2>j)T9q=Aj&"2"2D)a-Hr:cdg}dg}tj}tjgd}|j ||dz}t ||dt t||dzy)Nrcr\)gݱlo?g/ӂ?gz~R?rjrrM)rrmr<rmrrr r_)rSrrrmr3r6s r8rnzTestBroadcast.test_rayleighsaD ??((01 %!)$!&'2>j(IM:r:cdg}dg}dg}dg}tj}tjgd}|j ||dz|}t ||dt t||dz|t t||dz|t ttj|dz|t ttj|dz||j |||dz}t ||dt t|||dzt t|||dzt t|d dt t|dd y) Nrrcrrd)g@m e?g`I߿?g|2?rjrrMr)rrr<rmrrr r_)rSr&rbad_meanrrr3r6s r8rzTestBroadcast.test_waldsu3D {{((01 dQh&!&'2>j$1 e<j$q)<j&++x!|UCj&++taxC dEAI&!&'2>j$%!)<j$i!m<j$Q/j$S1r:cdg}dg}dg}dg}dg}|dz\}}tj}tjgd} |j ||dz||} t | | dt t||dz||t t||dz||t t||dz|||j |||dz|} t | | dt t|||dz|t t|||dz|t t|||dz||j ||||dz} t | | dt t||||dzt t||||dzt t||||dzt t|dd d t t|dd d t t|dddy) Nrcrjrrk)g,P;bD@g%G@g,~S@rrMrrg4@g9@)rrr<rmrrr r_) rSrrr bad_left_one bad_mode_one bad_left_two bad_mode_tworr3r6s r8rzTestBroadcast.test_triangularssss s %*QY" l&& ((01 D1HdE2!&'2>j*lQ.>eLj*dQh eLj*lQ.>   D$(E2!&'2>j*lD1HeLj*dL14DeLj*lL1j*lD%!)Lj*dL%!)Lj*lLai ! j*c2s;j*c3<j*c3j)QUI> 1a!e$67+j)UAE:j)Q A >j)Q A >r:cDtjj}dg}dg}|dzg}tj}t j gd}|j ||dz}t||tt||dztt||dzy)Nrcr\r)rcrcrrj) rrP_poisson_lam_maxrr<rmrr r r_)rSmax_lamrc bad_lam_one bad_lam_tworr3r6s r8rdzTestBroadcast.test_poissons$$&77cd {m ..((9% q!67+j';?;j';?;r:cdg}dg}tj}tjgd}|j ||dz}t ||t t||dztjd5t t|tjt t|ddtjgdddy#1swYyxYw)Nrr)rrrcrjr3r4) rrr<rmrr r r_r6r)rSrHrrr3r6s r8rzTestBroadcast.test_zipf$s C{{((9% a!e67+j$ 2 [[ * < *dBFF 3 *dQ266N ; < < &6, > <?,;,!FF? 9>, A?& < = ;?&>&5(I* ;24&=P;.?. < < 7&9P .gen_randoms|||/CHr:)r/r(r,rSr2s r8rWzTestThread.test_normals 0 J84r:c0d}|j|dy)NcT|jtjd|d<y)NrrNr.)rr<rr0s r8r2z'TestThread.test_exp..gen_randoms"((rww{/C(DCHr:r8r3r4r5s r8test_expzTestThread.test_exps E J;7r:c0d}|j|dy)Nc:|jddgdzd|d<y)Nrr9rr/r.)rr0s r8r2z/TestThread.test_multinomial..gen_randoms#((fX\(FCHr:)r/rr3r4r5s r8r:zTestThread.test_multinomials G J:6r:N)rwrxryrr,rWr9r:rzr:r8rrus+,5 8 7r:rc$eZdZdZdZdZdZy)TestSingleEltArrayInputctjdg|_tjdg|_tjdg|_d|_y)Nrrjrkr)r<rmargOneargTwoargThreetgtShaper`s r8rz$TestSingleEltArrayInput.setup_methods<hhsm hhsm !   r:c dtjtjtjtjtj tj tjtjtjtjtjtjf }tjtjf}|D]U}||vr|tjdg}n||j}t!|j"|j$Wyr)rrrxrrr^rrjrmrrrrr<rmr?r rrB)rSfuncs probfuncsrr1s r8test_one_arg_funcsz*TestSingleEltArrayInput.test_one_arg_funcss##V%:%:!!6#4#4v!!6#3#3 5%%v'7'78  3Dy 288SE?+4;;' DMM 2 3r:ctjtjtjtjtj tj tjtjtjtjtjtjtjtjf}tjtjf}|D]}||vrtj dg}n |j"}||j$|}t'|j(|j*||j$d|}t'|j(|j*||j$|d}t'|j(|j*y)Nrr)rrrVrrrrKrrrr#r(rrrr<rmr@r?r rrB)rSrDrErr@r1s r8test_two_arg_funcsz*TestSingleEltArrayInput.test_two_arg_funcssfll666&..!!6;;&":": <__f&>&>?  3Dy 3%t{{F+C DMM 2t{{1~v.C DMM 2t{{F1I.C DMM 2 3r:c,tjtjtjg}|D]}||j|j |j }t|j|j||jd|j |j }t|j|j||j|j d|j }t|j|jyNr) rrPrrr?r@rAr rrB)rSrDrr1s r8test_three_arg_funcsz,TestSingleEltArrayInput.test_three_arg_funcss$$f&7&7&&( 3Dt{{DKK?C DMM 2t{{1~t{{DMMBC DMM 2t{{DKKNDMMBC DMM 2 3r:N)rwrxryrrFrHrKrzr:r8r=r=s 3&36 3r:r=ctjd|\}}}tt|}||ddi}t|jt jdk(y)Nrrrr/)rrrgetattrrrhr<)r9fnamerr(rr6s r8test_integer_dtyperOsN KK "E4A  1 F FLLBHHSM )*r:cLtjd|\}}}tt|}||ddi}tjdk7r|j }t j|jtjj}t||k(y)Nrrrr#) rrrrMr$r%r&r'r(r)r<rr*r)r9rNrr(rr,r-s r8test_integer_repeatrQs| KK "E4A T  C }} lln .."''* + 5 5 7C C6Mr:ctjt5tjdddgddddtjt5tjddgdddddtjt5tjddgddgddddy#1swYxYw#1swYTxYw#1swYyxYw)Nrcrgffffff?)rrcrr)rrr_rrrzr:r8test_broadcast_size_errorrSs z "4C:F34 z "2A&12 z "9Ac 899 442299s#B8CC8CC Cctjjtd}|j d|j \}}}|dj jdk(sJ|d}|j||jd}t|d|dt|dd |dd t|dd |dd t|d |d t|d |d y) Nrrcr)rFrrBrCrDrErFrG) r<rrPrr __reduce__ __class__rwrrr r )rsctorrstate_arIstate_bs r8&test_randomstate_ctor_old_style_picklerZs   wqz *Bq--/D$ 7   % % 22 2 lAKKkkk'G)7?+CDww'.0@0GHww'.0@0GH%w{';<!77#34r:cftjjd}|j}tjj |t tjj jjt|sJtjj}||usJyrJ) r<r default_rngrBr>rmtrand_rand_bit_generatorr;r=)r@def_bgbg second_bgs r8 test_hot_swaprcs{ YY " "1 %F   BII# bii&&,,;;T"X FF F ++-I ??r:ctd}tjj|tjj d}tjj dtjj d}t |t ||ddk(sJ|dd|ddk7sJ|dd|ddk7sJy) NrFrrcrBrrCinc)rr<rr>rrrprint)r@rarCrs r8test_seed_alt_bit_genrg$s qBII# II  u  -EIINN1 ##5#1I %L )  !W ,, , >' "i&8&A AA A >% Ig$6u$= == =r:c2tjj}td}tjj |t j td5tjj|dddy#1swYyxYw)Nrzstate must be for a PCG64r) r<rrrr>rrr_r)r@rCras r8test_state_error_alt_bit_genri2se II   !E qBII# z)D E# E"###s $ B  Bcptjjdtjjddd}t d}|j }tjj |tjjd}|D]}||||k(rJtjjdtjjddd}tj||k(rJ|j }|dd|ddk7sJ|dd|ddk(sJy) Ńr@rFrrCre) r<rrrrQrrCr>rr)r@rrarC state_directfieldpcg_valsrs r8test_swap_workedrp;sIINN5 99  Q ,D qB HHEII#99&&e&4L3U||E22223IINN5yy  GR0Hvvdh&'' 'I W g &%.*A AA A W e $ '(:5(A AA Ar:c$tjjtdtjj ddd}tjj td}|j ddd}t ||y)Nrkrrlr)r<rr>rrQrPr )r@singleton_valsrgnon_singleton_valss r8%test_swapped_singleton_against_directruMsfIIe -YY&&q'26N   uU| ,BAw3#^4r:)3r'rr$rurnumpyr<r numpy.randomrr numpy.testingrrrr r r r r rrr5rr9rr6fixturer9r@rJrLr|rrrrBrr?r@rr=rOrQrSrZrcrgrirprurzr:r8rzs  '   &+c!12"+   288BGG5 ,n,n,n,n,n,n,n,nO-o,n,n,n,n,n,n,nOhy1,2, --),?,?^ > >6.6.pTJTJna+a+Hh ,h ,VH <H #B$5r: