KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /proc/21572/root/usr/lib64/python2.4/site-packages/Numeric/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/21572/root/usr/lib64/python2.4/site-packages/Numeric/MLab.pyo
mò
QµÝAc@s¬dZdkTdkZd„Zd„Zdddd„Zdddd„Zdd„Zd	„Z	d
„Z
dd„Zdd
„Zdd„Z
dd„Zdd„Zdd„Zdd„Zd„Zd„Zdd„Zdd„Zdd„Zdd„Zddd„Zddd„Zdddd„Zdd„ZdkZd„Zd„Zd „Zd!„Z d"„Z!d#„Z"d$„Z#d%„Z$d&„Z%d'„Z&d(„Z'dS()sùMatlab(tm) compatibility functions.

This will hopefully become a complete set of the basic functions available in
matlab.  The syntax is kept as close to the matlab syntax as possible.  One 
fundamental change is that the first index in matlab varies the fastest (as in 
FORTRAN).  That means that it will usually perform reductions over columns, 
whereas with this object the most natural reductions are over rows.  It's perfectly
possible to make this work the way it does in matlab if that's desired.
(t*NcGs
ti|ƒS(sœrand(d1,...,dn) returns a matrix of the given dimensions
    which is initialized to random numbers from a uniform distribution
    in the range [0,1).
    N(tRandomArraytrandomtargs(R((t2/usr/lib64/python2.4/site-packages/Numeric/MLab.pytrandscGsDti|ƒ}ti|ƒ}tdt|ƒƒtdt|ƒS(sxu = randn(d0,d1,...,dn) returns zero-mean, unit-variance Gaussian
    random numbers in an array of size (d0,d1,...,dn).iþÿÿÿiN(	RRRtx1tx2tsqrttlogtcostpi(RRR((RtrandnsicCsx|djo
|}nt|ƒtdƒjo|}|}nttit|ƒt|ƒƒ|ƒ}t|d|ƒS(s„eye(N, M=N, k=0, typecode=None) returns a N-by-M matrix where the 
    k-th diagonal is all ones, and everything else is zeros.
    tdttypecodeN(tMtNonetNttypeRtequaltsubtracttoutertarangetktmtasarray(RRRRR((Rteye$s


(cCsu|djo
|}nt|ƒtdƒjo|}|}nttit|ƒt|ƒƒ|ƒ}|i|ƒS(s•tri(N, M=N, k=0, typecode=None) returns a N-by-M matrix where all
    the diagonals starting from lower left corner up to the k-th are all ones.
    R
N(RRRRRt
greater_equalRRRRRtastype(RRRRR((Rttri0s


(cCs=t|ƒ}|i}t|ƒdjo‘|dt|ƒ}|djo%tt	||i
ƒƒ|fƒ}n4|djo&t|t	||i
ƒƒfƒ}nt|d|ƒ|Snt|ƒdjodti
t|d|dd|ƒ|ƒ}|djo||Sq9|djo|| Sq9|Sn
td‚dS(sdiag(v,k=0) returns the k-th diagonal if v is a matrix or
    returns a matrix with v as the k-th diagonal if v is a vector.
    iiRisInput must be 1- or 2-D.N(RtvtshapetstlentabsRtntconcatenatetzerosRRtaddtreducet
ValueError(RRR#R ((Rtdiag=s$	
%
&*

cCsLt|ƒ}t|iƒdjo
td‚n|dd…ddd…fS(s“fliplr(m) returns a 2-D matrix m with the rows preserved and
    columns flipped in the left/right direction.  Only works with 2-D
    arrays.
    isInput must be 2-D.Niÿÿÿÿ(RRR!RR((R((RtfliplrSs

cCs@t|ƒ}t|iƒdjo
td‚n|ddd…S(sŠflipud(m) returns a 2-D matrix with the columns preserved and
    rows flipped in the up/down direction.  Only works with 2-D arrays.
    isInput must be 2-D.Niÿÿÿÿ(RRR!RR((R((Rtflipud]s

icCsµt|ƒ}t|iƒdjo
td‚n|d}|djo|Snd|djott|ƒƒSnC|djott|ƒƒSn"|djott|ƒƒSndS(sorot90(m,k=1) returns the matrix found by rotating m by k*90 degrees
    in the counterclockwise direction.
    isInput must be 2-D.iiiiN(	RRR!RR(Rt	transposeR*R+(RR((Rtrot90hs





cCsb|iƒ}t|ddƒ}t|id|idd|d|iƒƒ|}|i	|ƒ|S(s¢tril(m,k=0) returns the elements on and below the k-th diagonal of
    m.  k=0 is the main diagonal, k > 0 is above and k < 0 is below the main
    diagonal.
    t	savespaceiiRRN(
Rt
spacesavertsvspRRRRRtoutR.(RRR0R1((Rttrilus3
cCsd|iƒ}t|ddƒ}dt|id|id|d|iƒƒ|}|i	|ƒ|S(s¢triu(m,k=0) returns the elements on and above the k-th diagonal of
    m.  k=0 is the main diagonal, k > 0 is above and k < 0 is below the main
    diagonal.
    R.iiN(
RR/R0RRRRRR1R.(RRR0R1((Rttriu€s5
cCst|ƒ}ti||ƒS(sAmax(m,axis=0) returns the maximum of m along dimension axis.
    N(RRtmaximumR'taxis(RR5((RtmaxŽscCst|ƒ}ti||ƒS(sAmin(m,axis=0) returns the minimum of m along dimension axis.
    N(RRtminimumR'R5(RR5((Rtmin”scCs&t|ƒ}t||ƒt||ƒS(sNptp(m,axis=0) returns the maximum - minimum along the the given dimension
    N(RRR6R5R8(RR5((RtptpœscCs-t|ƒ}ti||ƒt|i|ƒS(s…mean(m,axis=0) returns the mean of m along the given dimension.
       If m is of integer type, returns a floating point answer.
    N(RRR&R'R5tfloatR(RR5((Rtmean¢scCs"t|ƒ}ttt|ƒƒƒS(sImsort(m) returns a sort along the first dimension of m as in MATLAB.
    N(RRR,tsort(R((RtmsortªscCszt|ƒ}|idddjo|t|iddƒSn6t|ƒ}|idd}||d||dSdS(sDmedian(m) returns a median of m along the first dimension of m.
    iiif2.0N(R=RtsortedRtinttindex(RR>R@((Rtmedian°scCs£t|ƒ}t|i|ƒ}tt||ƒƒ}|djot	|iƒ|}n|i| d|i||_||}t
ti|||ƒ|dƒS(sÁstd(m,axis=0) returns the standard deviation along the given 
    dimension of m.  The result is unbiased with division by N-1.
    If m is of integer type returns a floating point answer.
    iif1.0N(i(
RRtxR:RR5R#R;tmxR!RR&R'(RR5R#RBRC((Rtstd»s

cCst|ƒ}ti||ƒS(sdcumsum(m,axis=0) returns the cumulative sum of the elements along the
    given dimension of m.
    N(RRR&t
accumulateR5(RR5((RtcumsumÉscCst|ƒ}ti||ƒS(s[prod(m,axis=0) returns the product of the elements along the given
    dimension of m.
    N(RRtmultiplyR'R5(RR5((RtprodÐscCst|ƒ}ti||ƒS(sacumprod(m) returns the cumulative product of the elments along the
    given dimension of m.
    N(RRRGRER5(RR5((Rtcumprod×siÿÿÿÿcCsÀt|ƒ}|djo
d}nt|d|ƒ}t|ƒ}t|iƒ}t
dƒg|}t
dƒg|}t
ddƒ||<t
ddƒ||<t
i|||||d|ƒS(sutrapz(y,x=None,axis=-1) integrates y along the given dimension of
    the data array using the trapezoidal rule.
    f1.0R5iiÿÿÿÿf2.0N(RtyRBRR
tdiffR5R!Rtndtslicetslice1tslice2R&R'(RJRBR5ROR
RNRL((RttrapzÞs

cCsït|ƒ}t|iƒ}|djo
d}n|djo
td‚n |djo|Sn‹|djo`tdƒg|}tdƒg|}tddƒ||<tddƒ||<||||Sntt|d|ƒ|dƒSdS(sÎdiff(x,n=1,axis=-1) calculates the n'th difference along the axis specified.
       Note that the result is one shorter in the axis'th dimension.
       Returns x if n == 0. Raises ValueError if n < 0.
    iis#MLab.diff, order argument negative.iÿÿÿÿN(
RRBR!RRLR#R(RMRRNROR5RK(RBR#R5RNRORL((RRKïs 





cCs*|djo
|}n|}|ot|ƒ}t|ƒ}n|iddjot|ƒ}n|iddjot|ƒ}n|id}|id|jo
td‚n|t|ddƒ}|t|ddƒ}|o|d}n|d}ttt|ƒt
|ƒƒ|ƒ}|S(sEstimate the covariance matrix.

    If m is a vector, return the variance.  For matrices where each row
    is an observation, and each column a variable, return the covariance
    matrix.  Note that in this case diag(cov(m)) is a vector of
    variances for each column.

    cov(m) is the same as cov(m, m)

    Normalization is by (N-1) where N is the number of observations
    (unbiased estimate).  If bias is 1 then normalization is by N.

    If rowvar is zero, then each row is a variable with
    observations in the columns.
    iis2x and y must have the same number of observations.R5f1.0N(RJRRtrowvarR,RRR(R;tbiastfacttsqueezetdott	conjugatetval(RRJRQRRRWRRS((Rtcovs*




%cCs5t||ƒ}t|ƒ}|tti||ƒƒS(s!The correlation coefficients
    N(	RXRBRJtcR)R
RRGR(RBRJRYR
((Rtcorrcoef-scCs@t|ƒ}t|iƒ}t|ttt|dƒ|ƒƒƒS(s>squeeze(a) returns a with any ones from the shape of a removediN(RtaRtbtreshapettupletcompresst	not_equal(R[R\((RRT7scCsZdk}td|ƒ}|dd}|i|td|||dƒƒ|i|ƒS(sœkaiser(M, beta) returns a Kaiser window of length M with shape parameter
    beta. It depends on the cephes module for the modified bessel function i0.
    Niif2.0(tcephesRRR#talphati0tbetaR(RRdR#RbRa((Rtkaiser>s
	cCsOtd|ƒ}ddtdt||dƒdtdt||dƒS(	s5blackman(M) returns the M-point Blackman window.
    if0.41999999999999998f0.5f2.0if0.080000000000000002f4.0N(RRR#R
R(RR#((RtblackmanGscCsLtd|ƒ}tt||ddƒd||ddd||dƒS(s5bartlett(M) returns the M-point Bartlett window.
    iif2.0N(RRR#twheret
less_equal(RR#((RtbartlettNscCs1td|ƒ}ddtdt||dƒS(s3hanning(M) returns the M-point Hanning window.
    if0.5f2.0iN(RRR#R
R(RR#((RthanningTscCs1td|ƒ}ddtdt||dƒS(s3hamming(M) returns the M-point Hamming window.
    if0.54000000000000004f0.46000000000000002f2.0iN(RRR#R
R(RR#((RthammingZscCs*tt|djd|ƒ}t|ƒ|S(s?sinc(x) returns sin(pi*x)/(pi*x) at all points of array x.
    if9.9999999999999995e-21N(RRgRBRJtsin(RBRJ((Rtsinc`scCs
ti|ƒS(sn[x,v] = eig(m) returns the eigenvalues of m in x and the corresponding
    eigenvectors in the rows of v.
    N(t
LinearAlgebrateigenvectorsR(R((RteigfscCs
ti|ƒS(sC[u,x,v] = svd(m) return the singular value decomposition of m.
    N(Rntsingular_value_decompositionR(R((RtsvdlscCsTt|ƒ}|iƒddgjo|i}|i}n
d}|}t||ƒS(s6phi = angle(z) return the angle of complex argument z.tDtFiN(RtzRtimagtzimagtrealtzrealtarctan2(RuRwRy((Rtanglers	
cCs÷t|ƒtititigjot|gƒ}n
t|ƒ}t|ƒ}t|i	ƒdjo
t
d‚nd}x ||djo|d}q|Wt||ƒ}t|ƒ}t
|dfdƒ}t|ƒ}x$||ddjo|d}qÝWt|| ƒ}t|ƒ}|djodtt|df|iƒƒdƒ}|d|d|ddd…f<t|ƒd||d*n|iƒdjot|idd	d
ƒp,|iƒdjo&t|idd	dƒo
|i}n|S(sò return the roots of the polynomial coefficients in p.

    The values in the rank-1 array p are coefficients of a polynomial.
    If the length of p is n+1 then the polynomial is
    p[0] * x**n + p[1] * x**(n-1) + ... + p[n-1]*x + p[n]
    isInput must be a rank-1 array.iRsiiÿÿÿÿNRttrtolf9.9999999999999995e-08f1e-14(RtpttypestIntTypet	FloatTypetComplexTypeRR!R#RR(tindRR%trootR)tonesRtARptallcloseRvRx(R}R…RƒR#R‚R((Rtroots~s6%

%#X
((t__doc__tNumericRRRRRRR)R*R+R-R2R3R6R8R9R;R=RARDRFRHRIRPRKRXRZRnRTReRfRiRjRkRmRpRrR{R‡(%RR2RPRjR3RKR{RFR‡R9ReRR8R)R=RnRRHRDRpR+R6RfRZRiR-RTRmRRRXRrRIRAR*RkR;((Rt?	sL			
	
	
		(													

Anon7 - 2021