Current File : //proc/self/root/proc/self/root/lib64/python2.7/site-packages/numpy/oldnumeric/random_array.pyc
�
E�`Qc@s�dddddddddd	d
ddd
dddddddddgZeZddljjZddlZddd�Z	d�Z
gd�Zgd�Zdgd�Z
dgd �Zd!�Zgd"�Zgd#�Zgd$�Zgd%�Zgd&�Zgd'�Zgd(�Zgd)�Zgd*�Zgd+�Zgd,�Zgd-�Zgd.�Zgd/�Zgd0�Zd1�Ze d2kr�e�ndS(3t
ArgumentErrortFtbetatbinomialt
chi_squaretexponentialtgammatget_seedt
mean_var_testtmultinomialtmultivariate_normaltnegative_binomialtnoncentral_Ftnoncentral_chi_squaretnormaltpermutationtpoissontrandinttrandomtrandom_integerstseedtstandard_normaltuniformi����NicCs<|dks|dkr%tj�ntj||f�dS(Ni(tmtR(txty((sC/usr/lib64/python2.7/site-packages/numpy/oldnumeric/random_array.pyRs
cCstd��dS(Ns�If you want to save the state of the random number generator.
Then you should use obj = numpy.random.get_state() followed by.
numpy.random.set_state(obj).(tNotImplementedError(((sC/usr/lib64/python2.7/site-packages/numpy/oldnumeric/random_array.pyRscCs"|gkrd}ntj|�S(s@random(n) or random([n, m, ...]) returns array of random numbersN(tNoneRt
random_sample(tshape((sC/usr/lib64/python2.7/site-packages/numpy/oldnumeric/random_array.pyRs	cCs(|gkrd}ntj|||�S(scuniform(minimum, maximum, shape=[]) returns array of given shape of random reals
    in given rangeN(RRR(tminimumtmaximumR((sC/usr/lib64/python2.7/site-packages/numpy/oldnumeric/random_array.pyR!s	cCs�t|t�std��n|dkr9|}d}nt|t�sWtd��n||t|�}t|tj�r�||jtj�S|t|�SdS(skrandint(min, max, shape=[]) = random integers >=min, < max
    If max not given, random integers >= 0, <mins'randint requires first argument integeris(randint requires second argument integerN(t
isinstancetintRRRtnptndarraytastype(RRRta((sC/usr/lib64/python2.7/site-packages/numpy/oldnumeric/random_array.pyR(s	icCst||d|�S(sRrandom_integers(max, min=1, shape=[]) = random integers in range min-max inclusivei(R(RRR((sC/usr/lib64/python2.7/site-packages/numpy/oldnumeric/random_array.pyR8scCs
tj|�S(s2permutation(n) = a permutation of indices range(n)(RR(tn((sC/usr/lib64/python2.7/site-packages/numpy/oldnumeric/random_array.pyR<scCs"|gkrd}ntj|�S(s�standard_normal(n) or standard_normal([n, m, ...]) returns array of
           random numbers normally distributed with mean 0 and standard
           deviation 1N(RRR(R((sC/usr/lib64/python2.7/site-packages/numpy/oldnumeric/random_array.pyR@s	cCs(|gkrd}ntj|||�S(s�normal(mean, std, n) or normal(mean, std, [n, m, ...]) returns
    array of random numbers randomly distributed with specified mean and
    standard deviationN(RRR(tmeantstdR((sC/usr/lib64/python2.7/site-packages/numpy/oldnumeric/random_array.pyRHs	cCs(|gkrd}ntj|||�S(sUmultivariate_normal(mean, cov) or multivariate_normal(mean, cov, [m, n, ...])
    returns an array containing multivariate normally distributed random numbers
    with specified mean and covariance.

    mean must be a 1 dimensional array. cov must be a square two dimensional
    array with the same number of rows and columns as mean has elements.

    The first form returns a single 1-D array containing a multivariate
    normal.

    The second form returns an array of shape (m, n, ..., cov.shape[0]).
    In this case, output[i,j,...,:] is a 1-D array containing a multivariate
    normal.N(RRR
(R'tcovR((sC/usr/lib64/python2.7/site-packages/numpy/oldnumeric/random_array.pyR
Ps	cCs%|gkrd}ntj||�S(s�exponential(mean, n) or exponential(mean, [n, m, ...]) returns array
      of random numbers exponentially distributed with specified meanN(RRR(R'R((sC/usr/lib64/python2.7/site-packages/numpy/oldnumeric/random_array.pyRbs	cCs(|gkrd}ntj|||�S(sWbeta(a, b) or beta(a, b, [n, m, ...]) returns array of beta distributed random numbers.N(RRR(R%tbR((sC/usr/lib64/python2.7/site-packages/numpy/oldnumeric/random_array.pyRis	cCs(|gkrd}ntj|||�S(sZgamma(a, r) or gamma(a, r, [n, m, ...]) returns array of gamma distributed random numbers.N(RRR(R%trR((sC/usr/lib64/python2.7/site-packages/numpy/oldnumeric/random_array.pyRos	cCs(|gkrd}ntj|||�S(s�F(dfn, dfd) or F(dfn, dfd, [n, m, ...]) returns array of F distributed random numbers with dfn degrees of freedom in the numerator and dfd degrees of freedom in the denominator.N(RRtf(tdfntdfdR((sC/usr/lib64/python2.7/site-packages/numpy/oldnumeric/random_array.pyRus	cCs+|gkrd}ntj||||�S(snoncentral_F(dfn, dfd, nonc) or noncentral_F(dfn, dfd, nonc, [n, m, ...]) returns array of noncentral F distributed random numbers with dfn degrees of freedom in the numerator and dfd degrees of freedom in the denominator, and noncentrality parameter nconc.N(RRtnoncentral_f(R-R.tnconcR((sC/usr/lib64/python2.7/site-packages/numpy/oldnumeric/random_array.pyR{s	cCs%|gkrd}ntj||�S(s�chi_square(df) or chi_square(df, [n, m, ...]) returns array of chi squared distributed random numbers with df degrees of freedom.N(RRt	chisquare(tdfR((sC/usr/lib64/python2.7/site-packages/numpy/oldnumeric/random_array.pyR�s	cCs(|gkrd}ntj|||�S(s�noncentral_chi_square(df, nconc) or chi_square(df, nconc, [n, m, ...]) returns array of noncentral chi squared distributed random numbers with df degrees of freedom and noncentrality parameter.N(RRtnoncentral_chisquare(R2R0R((sC/usr/lib64/python2.7/site-packages/numpy/oldnumeric/random_array.pyR
�s	cCs(|gkrd}ntj|||�S(sbinomial(trials, p) or binomial(trials, p, [n, m, ...]) returns array of binomially distributed random integers.

           trials is the number of trials in the binomial distribution.
           p is the probability of an event in each trial of the binomial distribution.N(RRR(ttrialstpR((sC/usr/lib64/python2.7/site-packages/numpy/oldnumeric/random_array.pyR�s	cCs(|gkrd}ntj|||�S(sInegative_binomial(trials, p) or negative_binomial(trials, p, [n, m, ...]) returns
           array of negative binomially distributed random integers.

           trials is the number of trials in the negative binomial distribution.
           p is the probability of an event in each trial of the negative binomial distribution.N(RRR(R4R5R((sC/usr/lib64/python2.7/site-packages/numpy/oldnumeric/random_array.pyR�s	cCs(|gkrd}ntj|||�S(s�multinomial(trials, probs) or multinomial(trials, probs, [n, m, ...]) returns
           array of multinomial distributed integer vectors.

           trials is the number of trials in each multinomial distribution.
           probs is a one dimensional array. There are len(prob)+1 events.
           prob[i] is the probability of the i-th event, 0<=i<len(prob).
           The probability of event len(prob) is 1.-np.sum(prob).

       The first form returns a single 1-D array containing one multinomially
           distributed vector.

           The second form returns an array of shape (m, n, ..., len(probs)).
           In this case, output[i,j,...,:] is a 1-D array containing a multinomially
           distributed integer 1-D array.N(RRR	(R4tprobsR((sC/usr/lib64/python2.7/site-packages/numpy/oldnumeric/random_array.pyR	�s	cCs%|gkrd}ntj||�S(s�poisson(mean) or poisson(mean, [n, m, ...]) returns array of poisson
           distributed random integers with specified mean.N(RRR(R'R((sC/usr/lib64/python2.7/site-packages/numpy/oldnumeric/random_array.pyR�s	c
Cs�t|�d}tj|dd�|}||}tj||dd�|d}dGt|�G|GHdG|GdG|GHdG|GdG|GH|gkr�tj|||dd�d|d	d
}	dG|GdG|	GHndS(Ng�?taxisis
Average of s(should be about s):s2Variance of those random numbers (should be about g��@g@g@s2Skewness of those random numbers (should be about (tlenR"tsum(
RttypeR'tvartskewR&tx_meantx_minus_meantx_vartx_skew((sC/usr/lib64/python2.7/site-packages/numpy/oldnumeric/random_array.pyR�s
!-cCsOtj�}tj|�tj�}|d|dj�rItd�ndGt�GHdGtjtd�dd�dGHtd	d
g�}t|j	�dks�|j	dd	ks�|j	dd
kr�td�ndB|_	d
Gtj|dd�dGHt
dddC�}t|j	�dksB|j	dd
ksB|j	dd	krNtd�ndD|_	tjj|�dks�tj
j|�dkr�td�ndGHtdd	ddg�GHdGtd	�GHdGtdd�GHdGHtd	ddg�GHd}td|d	d
g�}t|j	�dksB|j	dd	ksB|j	dd
krNtd�ndE|_	t|d|dfd|dd�tdd�}t|d|f||dd�ttjd	dg�tjddgdd gf��}d!G|GH|j	dFkr	td"�nttjd	dg�tjddgdd gg�d dg�}d#GH|GH|j	dGkrptd"�nttjd$dd%g�tjdddgdddgdddgg�d�}tj|dd�d}d&GH|GH||}d'GHtjtj|�|�d(GHtd)d*d�}t|d+d,d-�td.dd�}t|d/dHdJ�td0d�}t|d1d2d3dtjdd0��td)d*d�}t|d4d5d6�td7d�}t|d8ddd9�d:GHtd;dd;�GHd<GHtd;dd;g�GHd=GHt d;d>dd>gd?�}|GHd@Gtj|dd�dAGHdS(KNisFailed seed test.sFirst random number iss"Average of 10000 random numbers isi'R7ig��@i
i�israndom returned wrong shapes'Average of 100 by 100 random numbers isg�?g333333�?suniform returned wrong shapes%uniform returned out of desired rangesrandint(1, 10, shape=[50])Ri2spermutation(10)srandint(3,9)ii	srandom_integers(10, shape=[20])ig@g@s$standard_normal returned wrong shapes8normally distributed numbers with mean 2 and variance %fs5random numbers exponentially distributed with mean %fis
A multivariate normals(multivariate_normal returned wrong shapes-A 4x3x2 array containing multivariate normalsi����ids<Average of 10000 multivariate normals with mean [-100,0,100]s\Estimated covariance of 10000 multivariate normals with covariance [[3,2,1],[2,2,1],[1,1,1]]g���@g@g$@sbeta(5.,10.) random numbersgZd;�O�?gy�&1��?g{�G�z�?sgamma(.01,2.) random numbersg&@s5chi squared random numbers with 11 degrees of freedomiis1F random numbers with 5 and 10 degrees of freedomg�?g�������?gI@s#poisson random numbers with mean 50g�Q���?sG
Each element is the result of 16 binomial trials with probability 0.5:isP
Each element is the result of 16 negative binomial trials with probability 0.5:sX
Each row is the result of 16 multinomial trials with probabilities [0.1, 0.5, 0.1 0.3]:g�������?isMean = g @(i'(i�i
(i'(i'(i(iiii�i�i N(!Rt	get_statet	set_statetanyt
SystemExitRR"R9R8RRRtreduceRRRRRRRR
tarraytdott	transposeRRRtsqrtRRRRR	(tobjtobj2RRtsR=R>((sC/usr/lib64/python2.7/site-packages/numpy/oldnumeric/random_array.pyttest�s�
";	;	0;	%!9	BQ
't__main__(!t__all__t
ValueErrorRtnumpy.random.mtrandRtmtrandRtnumpyR"RRRRRRRRRR
RRRRRRR
RRR	RRRMt__name__(((sC/usr/lib64/python2.7/site-packages/numpy/oldnumeric/random_array.pyt<module>sB					
	B