config root man

Current Path : /compat/linux/proc/self/root/usr/local/lib/python2.5/test/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //compat/linux/proc/self/root/usr/local/lib/python2.5/test/sortperf.pyo

³ò
h”Rc@s£dZddkZddkZddkZddkZddkZddkZeiƒZd„Z	d„Z
d„Zd„Zd„Z
edjoe
ƒndS(	s_Sort performance test.

See main() for command line syntax.
See tabulate() for output format.

iÿÿÿÿNc	Cs|tiitd|ƒ}yt|dƒ}Wnßtj
oÓti}g}t|ƒD]}||ƒqW~}ypz3t|dƒ}ti	||ƒ|i
ƒd}Wd|o.yti|ƒWqÞti
j
oqÞXnXWqxtj
o}dG|GdG|GHqxXnlXti|ƒ}|i
ƒxNtdƒD]@}ti|ƒ}|| }||4|iƒ|i|ƒ~q4W|S(s+Return a list of n random floats in [0, 1).srr%06dtrbtwbNscan't writet:i
(tostpathtjointtdtopentIOErrortrandomtxrangetmarshaltdumptclosetNonetunlinkterrortloadtranget	randrangetreversetextend(	tntfntfptrt_[1]titresulttmsgttemp((s)/usr/local/lib/python2.5/test/sortperf.pyt
randfloatss<	*






cCstiiƒdS(N(tsyststdouttflush(((s)/usr/local/lib/python2.5/test/sortperf.pyR"8scCs9tiƒ}|iƒtiƒ}d||GtƒdS(Ns%6.2f(ttimetclocktsortR"(tLtt0tt1((s)/usr/local/lib/python2.5/test/sortperf.pytdoit;s

c

CsOtg}dD]}||dq~ƒ}ddt|ƒ}|d|GHxü|D]ô}d|>}t|ƒ}d||fGtƒt|ƒ|iƒt|ƒt|ƒxOtd	ƒD]A}ti|ƒ}	ti|ƒ}
||
||	||	<||
<q¹Wt|ƒ|d
jo5g}td
ƒD]}|tiƒq&~|d)nt|ƒx1t	|dƒD]}tiƒ|ti|ƒ<qeWt|ƒ|d
jo+|d
3||d
}t
d„|ƒ}nt|ƒ~t
tdg|ƒ}t|ƒ~|d}t|dddƒ}|it|ƒƒt
t
|ƒ}t|ƒHqSWdS(s:Tabulate sort speed for lists of various sizes.

    The sizes are 2**i for i in r (the argument, a list).

    The output displays i, 2**i, and the time to sort arrays of 2**i
    floating point numbers with the following properties:

    *sort: random data
    \sort: descending data
    /sort: ascending data
    3sort: ascending, then 3 random exchanges
    +sort: ascending, then 10 random at the end
    %sort: ascending, then randomly replace 1% of the elements w/ random values
    ~sort: many duplicates
    =sort: all equal
    !sort: worst case scenario

    s	*\/3+%~=!R%s%2s %7ss %6sRs2**iis%2d %7dii
iöÿÿÿidicSs|S(((tx((s)/usr/local/lib/python2.5/test/sortperf.pyt<lambda>ysgà¿iiÿÿÿÿN(Rs2**i(ttupletlenRR"R)RRR	RR
tmaptabsRtfloat(
RRtchtcasestfmtRRR&tdummyti1ti2t_[2]thalf((s)/usr/local/lib/python2.5/test/sortperf.pyttabulateBsR+






!

5






c
CsÌd}d}tido‘ttidƒ}}tidohttidƒ}tidoCd}x)tidD]}d|t|ƒ}qtWti|ƒq§q«nt||dƒ}t|ƒdS(sÂMain program when invoked as a script.

    One argument: tabulate a single row.
    Two arguments: tabulate a range (inclusive).
    Extra arguments are used to seed the random generator.

    iiiiiiÍ
N(R targvtintthashR	tseedRR9(tk1tk2R*taR((s)/usr/local/lib/python2.5/test/sortperf.pytmainŽs	t__main__(t__doc__R R#R	RttempfileRt
gettempdirRRR"R)R9RAt__name__(((s)/usr/local/lib/python2.5/test/sortperf.pys<module>s	'			L	


Man Man