亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? randomnumbersin c_bygeorgemarsaglia_etc.htm

?? QPSK環(huán)境下的仿真性能分析
?? HTM
?? 第 1 頁 / 共 5 頁
字號(hào):
<HTML><HEAD><TITLE>Random Numbers in C</TITLE><META NAME = "DESCRIPTION"      CONTENT = "A whole set of tested 'one liner' randomnumber generators in C.A Ciphers By Ritter page."><META NAME = "KEYWORDS"      CONTENT = "random,number,generator,pseuodorandom,software,C"></HEAD><BODY><H1 ALIGN=CENTER>Random Numbers in C</H1><BR><H2 ALIGN = CENTER>A<A HREF = "http://www.ciphersbyritter.com/"><I>Ciphers By Ritter</I></A> Page</H2><BR><P>Random number generators (<I>pseudo-</I>random, of course) in C;mostly fast one-liners for "inline" use (to eliminate call / returnoverhead).  If you just want to <I>use</I> these RNG's, it might bea good idea to start at the last message.<P><HR><H3>Contents</H3><UL><LI><A HREF = "#369B5E30.65A55FD1@stat.fsu.edu">1999-01-12 George Marsaglia:</A>    "This posting ends with  17  lines of    C code that provide eight different    in-line random number generators, six for    random 32-bit integers and two for uniform    reals in (0,1) and (-1,1)."<LI><A HREF = "#369B66AB.6CDED9F8@ix.netcom.com">1999-01-12 Charles Bond:</A>    "Do you know if any theoretical work has been done since    Knuth's book to justify SWB?"<LI><A HREF = "#369B9AE9.52C98810@stat.fsu.edu">1999-01-12 George Marsaglia:</A>    "It hasn't been very many years      since I invented the subtract-with-borrow method,      and developed theory for establishing the periods."<LI><A HREF = "#369BE439.92E0E011@ix.netcom.com">1999-01-12 Charles Bond:</A>    "I did not mean to imply that Knuth's subtractive    generator was *the same* as your subtract with borrow, only that    it was *similar* (high speed, no multiplications)."<LI><A HREF = "#369BE0A2.CA197F7B@math.ucla.edu">1999-01-12 Mike Oliver:</A>    "Could you give us a pointer to information about    why these RNGs [lagged Fibonacci generators using xor]    are unsatisfactory and what sort of test they tend to fail?"<LI><A HREF = "#tun23mnctq.fsf@labejb.lsid.hp.com">1999-01-13 Eric Backus:</A>    "I have a small problem with the definition of LFIB4 and SWB.  In an    attempt to make these a single line of C code, they both use "++c" in    the same expression as they use "c".  A C compiler is free to    rearrange the order in which it calculates the intermediate terms of    these expressions, so the expressions can produce different results    depending on the compiler."<LI><A HREF = "#369F6FCA.74C7C041@stat.fsu.edu">1999-01-15 George Marsaglia:</A>    "The generators MWC, KISS, LFIB4 and SWB seem to pass all tests.    By themselves, CONG and SHR3 do not, but using    CONG+SHR3 provides one of the fastest combinations that satisfy    the DIEHARD battery of tests."<LI><A HREF = "#790f49x60.fsf@poole.statgen.ncsu.edu">1999-01-15 Dmitri Zaykin:</A>    "Shouldn't these be...."<LI><A HREF = "#99Jan15.151547edt.785@neuron.ai.toronto.edu">1999-01-01 Radford Neal:</A>    "This doesn't work either."<LI><A HREF = "#QfQn2.10695$bf6.2024@news1.giganews.com">1999-01-15 Jeff Stout:</A>    "The preprocessor is just doing    a stupid text substituation, its the C compiler that is ambigous about    the interpretation."<LI><A HREF = "#99Jan15.233424edt.6005@cortex.ai.toronto.edu">1999-01-01 Radford Neal:</A>    "...although one can indeed create lots of junk using the    C pre-processor, one cannot, in general, use it to create in-line    procedures."<LI><A HREF = "#7ogny6htm.fsf@poole.statgen.ncsu.edu">1999-01-16 Dmitri Zaykin:</A>    "It is probably true that the posted random number generators are    better implemented as regular functions."<LI><A HREF = "#7pv8f55tf.fsf@poole.statgen.ncsu.edu">1999-01-16 Dmitri Zaykin:</A>    "These should work...."<LI><A HREF = "#36A21A2C.AD5145D1@concentric.net">1999-01-17 Ramin Sina:</A>    "Could someone please post a short example code on how to use these in    practice."<LI><A HREF = "#77vrbs$pmj$1@sun500.nas.nasa.gov">1999-01-18 Ed Hook:</A>    "No -- 'SHR3' and 'LFIB4' are OK, but your version of 'SWB'    still invokes the dreaded undefined behavior."<LI><A HREF = "#78207l$1l8$1@due.unit.no">1999-01-19 Orjan Johansen:</A>    "Surely in an expression of the form y=..., the evaluation of ... is    guaranteed to happen before the assignment."<LI><A HREF = "#36a4cb5e.39101741@news.snafu.de">1999-01-19 Horst Kraemer:</A>    "Sorry. No sequence point is needed between reading an writing to an    lvalue."<LI><A HREF = "#77t9ot$15ha@b.stat.purdue.edu">1999-01-17 Herman Rubin:</A>    "I think it should be clarified, and probably written out in some    more detail.  But the procedure call overhead would be comparable    to the computing cost...."<LI><A HREF = "#36a23371.10418803@newshost.uwo.ca">1999-01-17 Duncan Murdoch:</A>    "I don't know if that's true or not, but I don't think it is really    something to worry about."<LI><A HREF = "#77veih$11ts@b.stat.purdue.edu">1999-01-18 Herman Rubin:</A>    "It certainly is.  The cost of one procedure call could far exceed    the cost of a uniform, or even many nonuniform, random variables."<LI><A HREF = "#99Jan18.133644edt.6004@cortex.ai.toronto.edu">1999-01-01 Radford Neal:</A>    "Even on a CISC    machine like a VAX, I doubt the C procedure call overhead would be    more that twice the time for the actual work, and on modern RISC    machines the ratio will tend to be less."<LI><A HREF = "#78284m$m0e@b.stat.purdue.edu">1999-01-19 Herman Rubin:</A>    "The code discussed was not in making a call for an array, but    for a single step in the generation procedure."<LI><A HREF = "#36a5f74f.11285673@newshost.uwo.ca">1999-01-19 Duncan Murdoch:</A>    "I'm not sure what you have in mind."<LI><A HREF = "#782bon$qjg@b.stat.purdue.edu">1999-01-19 Herman Rubin:</A>    "Can we afford range checking?"    "Basic random tools should be as a bit stream, not as floating    numbers, for many reasons."<LI><A HREF = "#36a63ccd.18681450@newshost.uwo.ca">1999-01-20 Duncan Murdoch:</A>    "...all languages that I know (including C) provide ways of    forcing the order of evaluation:  just put the things that need to be    done first in an earlier statement."<LI><A HREF = "#cUwZzZKf1ety-pn2-vB2YCWNn5fgR@mfs-pci-bqh-vty163.as.wcom.net">1999-01-17 David W. Noon:</A>    "I don't mind translating all this stuff into assembler, but anybody    not using an Intel 80486 or better running a 32-bit version of OS/2    will not be able to use my code."<LI><A HREF = "#5tFXN12Xwb3.7WA43126hM3916@statgen.ncsu.edu">1999-01-18 Dmitri Zaykin:</A>    "Another option is to re-write macros as C++ member functions."<LI><A HREF = "#cUwZzZKf1ety-pn2-NxnsgFONxOGO@localhost">1999-01-18 David W. Noon:</A>    "The problem with C++ is that VMT calling mechanisms are almost    invariably slower than the calling mechanisms used by C, PL/I,    FORTRAN, Pascal, etc."<LI><A HREF = "#7sod842aa.fsf@poole.statgen.ncsu.edu">1999-01-18 Dmitri Zaykin:</A>    "Well, in this particular case all that does not apply, since there are    no virtual functions in the code."<LI><A HREF = "#36a3fc77.12606540@newshost.uwo.ca">1999-01-19 Duncan Murdoch:</A>    "...but just as with any other aspect of the program, speed isn't as    important as correctness."<LI><A HREF = "#7sod5s6d4.fsf@poole.statgen.ncsu.edu">1999-01-20 Dmitri Zaykin:</A>    "To check if C-macros for these random number generators do indeed    always produce faster, and maybe 'less bloated' code than inlined C++    member functions, I did a little experiment...."<LI><A HREF = "#124123g26m11754.1356cjx442854@statgen.ncsu.edu">1999-01-21 Dmitri Zaykin:</A><LI><A HREF = "#slrn7aeqsa.bkc.davis@aluche.mit.edu">1999-01-21 John E. Davis:</A>    "Using your code (t.cc and t.c), my conclusion is the opposite...."<LI><A HREF = "#7btjsuxvo.fsf@poole.statgen.ncsu.edu">1999-01-21 Dmitri Zaykin:</A>    "I used egcs-1.1.1 compiler. It is is an improvement over gcc-2.8.1."<LI><A HREF = "#780843$ikj$1@relay1.dsccc.com">1999-01-18 Mike McCarty:</A><LI><A HREF = "#780jh1$11ii@odds.stat.purdue.edu">1999-01-18 Herman Rubin:</A>    "Decent random number code cannot be portable."<LI><A HREF = "#cUwZzZKf1ety-pn2-deRYWonQPOXL@localhost">1999-01-19 David W. Noon:</A>    "I meant portable across software platforms, not hardware."<LI><A HREF = "#783bio$12vk@odds.stat.purdue.edu">1999-01-19 Herman Rubin:</A>    "It is by no means clear that HLL generated code will do this, as the    machine instructions involved are different."    "What was meant was the distance to the next one in a stream of    random bits.  In other words, generate a geometric (.5) random    variable using only the number of bits required by information."<LI><A HREF = "#cUwZzZKf1ety-pn2-FJ7g8dchLbd1@localhost">1999-01-19 David W. Noon:</A>    "C++ just isn't ideally suited to the task under current    implementations of the language."<LI><A HREF = "#7841pn$1ha$1@uni00nw.unity.ncsu.edu">1999-01-20 Dmitri Zaykin:</A>    "Templates can be an alternative to C-macros in terms of    genericity, not inlining."<LI><A HREF = "#780824$ie4$1@relay1.dsccc.com">1999-01-18 Mike McCarty:</A>    "There are no 'idiot-proof languages'."<LI><A HREF = "#780ip6$11h8@odds.stat.purdue.edu">1999-01-18 Herman Rubin:</A>    "A language has a built in inefficiency in every situation in which    the optimal use of machine instructions cannot be addressed in that    language."<LI><A HREF = "#787tt7$gr$1@relay1.dsccc.com">1999-01-21 Mike McCarty:</A>    "The checking I had in mind costs *nothing* during the execution of the    program."<LI><A HREF = "#7k8ym6d4q.fsf@poole.statgen.ncsu.edu">1999-01-16 Dmitri Zaykin:</A>    "I see one more problem with the code."<LI><A HREF = "#781p6l$lrv$1@nnrp1.dejanews.com">1999-01-19 qscgz@my-dejanews.com:</A>    "DIEHARD-tests fail on...."<LI><A HREF = "#36A5FC62.17C9CC33@stat.fsu.edu">1999-01-20 George Marsaglia:</A>    "My offer of RNG's for C was an invitation to dance;    I did not expect the Tarantella."    "Numerous responses have led to improvements; the result    is the listing below...."</UL><PRE><HR><A NAME = "369B5E30.65A55FD1@stat.fsu.edu"></A>Subject: Random numbers in C: Some suggestions.Date: Tue, 12 Jan 1999 09:37:37 -0500From: George Marsaglia &LT;geo@stat.fsu.edu>Message-ID: &LT;369B5E30.65A55FD1@stat.fsu.edu>Newsgroups: sci.stat.math,sci.math,sci.math.num-analysis,sci.crypt,sci.physicsLines: 243This posting ends with  17  lines ofC code that provide eight differentin-line random number generators, six forrandom 32-bit integers and two for uniformreals in (0,1) and (-1,1).Comments are interspersed with thatcode. Various combinations of the six in-lineinteger generators may put in C expressions toprovide a wide variety of very fast, long period,well-tested RNG's. I invite comments, feedback,verifications and timings.First, there is narrative giving backgroundfor this posting; you may want to skip it.Narrative:Having had experience in producing andtesting for randomness in computers,I am frequently asked to suggest goodrandom number generators (RNG's), testRNG's, or comment on existing RNG's.  Manyrecent queries have been in two areas:(1) requests for implementations in C and(2) comments on generators with immense periods,particularly the Mersenne Twister.This posting is mainly for category (1),for which I suggest a set of C implementationsof RNG's I have developed.  C implementationsof my DIEHARD battery of tests will bediscussed elsewhere, and Narasimhan's GUIversion is expected to be released soon.For (2), I merely repeat what I have saidin response to various queries: the MersenneTwister looks good, but it seems to be essentiallya lagged Fibonacci RNG using the exclusive-or(xor) operation, and experience has shown thatlagged Fibonacci generators using xor provideunsatisfactory 'randomness' unless the lags arevery long, and even for those with very long lags,(and even for those using + or - rather than xor),many people (I among them) are inclined to becautious about sequences based on such a simpleoperation as: each new integer is the xor, (or sum,or difference), of two earlier ones.  To be sure,the resulting integers can be "twisted", but not,I think, as simply or as safely as combining, sayby addition, with members of a sequence from a(shorter period) generator that has itself passedextensive tests of randomness.I also reply that it does not take an immenseprogram (as, for example, in posted listingsof Twister) to produce a more satisfactory RNGwith an immense period, and give this example,on which I will expand below: Inclusion of#define SWB ( t[c+237]=(x=t[c+15])-(y=t[++c]+(x&LT;y)) )together with suitably initialized seeds instatic unsigned long x,y,t[256]; unsigned char c;will allow you to put the string SWB in any Cexpression and it will provide, in about 100 nanosecs,a 32-bit random integer with period  2^7578. (Hereand below, ^ means exponent, except in C expressions,where it means xor (exclusive-or).Now for the (2) part, in which I suggest a numberof C implementations and invite comment and feedback.Most of these were previously developed and testedvia Fortran versions.  I list eight RNG's, each ofthem by means of C's powerful #define device. Thisprovides  fast, compact implementation, allowsinsertion of the required random variable directlyinto an expression, and, finally, provides a goodselection of RNG's for use individually or incombination.  The latter makes it possible tofurther confirm what empirical results suggest:combining two or more RNG's provides better,(or no worse) randomness, and for encryption enthusiasts:combination generators are harder to "crack".For those wishing to try these eight RNG's:At the top of your C program, include thesedefinitions and the static variables that follow.Everything past this line is either C code or comment.--------------------------------------------------#define UL unsigned long#define znew  ((z=36969*(z&65535)+(z>>16))&LT;&LT;16)#define wnew  ((w=18000*(w&65535)+(w>>16))&65535)#define MWC   (znew+wnew)#define SHR3  (jsr=(jsr=(jsr=jsr^(jsr&LT;&LT;17))^(jsr>>13))^(jsr&LT;&LT;5))#define CONG  (jcong=69069*jcong+1234567)#define KISS  ((MWC^CONG)+SHR3)#define LFIB4 (t[c]=t[c]+t[c+58]+t[c+119]+t[++c+178])#define SWB   (t[c+237]=(x=t[c+15])-(y=t[++c]+(x&LT;y)))#define UNI   (KISS*2.328306e-10)#define VNI   ((long) KISS)*4.656613e-10/*  Global static variables: */ static UL z=362436069, w=521288629, jsr=123456789, jcong=380116160; static UL t[256]; static UL x=0,y=0; static unsigned char c=0;/* Random seeds must be used to reset z,w,jsr,jcong andthe table t[256]  Here is an example procedure, using KISS: */ void settable(UL i1,UL i2,UL i3,UL i4) { int i; z=i1;w=i2,jsr=i3; jcong=i4; for(i=0;i&LT;256;i++)  t[i]=KISS;        }/*  End of C code;  Only comments follow. Stick the above   17 lines in your simulation programs, initialize the table,   and have a variety of promising RNG's at your disposal.  *//* You may want use more complicated names for the   above simple 1-letter variable names: z,w,x,y,t,c,   to avoid clashing with favorites in your code.    *//* Any one of KISS, MWC, LFIB4, SWB, SHR3, or CONG   can be used in an expression to provide a random   32-bit integer, and UNI in an expression will   provide a random uniform in (01), or VNI in (-1,1).   For example, for int i, float v; i=(MWC>>24); will   provide a random byte, while v=4.+3.*UNI; will   provide a uniform v in the interval 4. to 7.

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩视频免费观看高清完整版 | 日韩精品久久理论片| 色婷婷久久久亚洲一区二区三区| 中文字幕一区二区三区不卡在线| av激情综合网| 亚洲线精品一区二区三区| 欧美精品 国产精品| 久久精品国产秦先生| 26uuu亚洲综合色| 成人晚上爱看视频| 亚洲综合成人在线视频| 日韩一区二区三区视频在线观看 | 精彩视频一区二区三区| 亚洲国产精品成人综合色在线婷婷| 菠萝蜜视频在线观看一区| 亚洲一区二区三区四区中文字幕| 欧美精品丝袜中出| 国产一区二区三区观看| 自拍视频在线观看一区二区| 欧美日韩亚洲国产综合| 国产乱淫av一区二区三区| 最好看的中文字幕久久| 日韩视频中午一区| www.亚洲国产| 久久精品国产久精国产| 日韩一区欧美小说| 日韩三级伦理片妻子的秘密按摩| eeuss鲁一区二区三区| 亚洲高清一区二区三区| 国产亚洲女人久久久久毛片| 欧美视频在线播放| 国产.欧美.日韩| 日韩中文字幕av电影| 《视频一区视频二区| 日韩一区二区电影| 色婷婷亚洲一区二区三区| 国产一区二区成人久久免费影院| 一区二区三区.www| 日本一区二区三区四区| 日韩一区二区在线观看视频| 色噜噜狠狠成人网p站| 国产精品正在播放| 五月天丁香久久| 中文字幕人成不卡一区| 国产精品美日韩| 在线观看日韩电影| 国产激情91久久精品导航| 日韩专区在线视频| 国产91在线|亚洲| 亚洲网友自拍偷拍| 亚洲女性喷水在线观看一区| 日韩一级完整毛片| 欧美午夜精品免费| 日韩免费一区二区三区在线播放| 精品久久久久久久一区二区蜜臀| 久久久99精品免费观看| 国产精品久久影院| 亚洲一区二区视频| 精品一区二区三区免费| 成人午夜短视频| 欧美色综合网站| 久久在线观看免费| 亚洲欧美综合另类在线卡通| 午夜私人影院久久久久| 久久se精品一区二区| 99久久国产综合精品色伊| 欧美日本韩国一区| 久久精品亚洲乱码伦伦中文| 亚洲私人影院在线观看| 日本不卡一二三| www.视频一区| 欧美一区二区三区日韩| 国产精品视频麻豆| 图片区日韩欧美亚洲| 岛国精品在线观看| 欧美精品久久天天躁| 国产日韩欧美精品综合| 亚洲午夜精品一区二区三区他趣| 精品制服美女久久| 色综合婷婷久久| 欧美一二三区在线| 中文字幕一区二区三中文字幕 | 五月天网站亚洲| 国产不卡在线播放| 欧美精三区欧美精三区| 国产欧美日韩亚州综合| 天堂精品中文字幕在线| 成人激情免费网站| 欧美电影免费观看高清完整版在线 | 国产一区二区三区蝌蚪| 欧美色综合网站| 中文字幕精品—区二区四季| 日本欧美韩国一区三区| 色香蕉成人二区免费| 国产日韩欧美激情| 另类综合日韩欧美亚洲| 在线视频综合导航| 中文字幕欧美日韩一区| 看片的网站亚洲| 欧美三级视频在线播放| 国产精品女主播在线观看| 精品无码三级在线观看视频 | 日韩欧美成人午夜| 亚洲一区二区免费视频| aaa欧美日韩| 久久久久久久av麻豆果冻| 日韩国产欧美在线观看| 色成年激情久久综合| 国产精品私人自拍| 国产一区二区在线免费观看| 欧美军同video69gay| 亚洲综合色成人| 91在线观看高清| 久久精品综合网| 激情综合色丁香一区二区| 欧美一区三区四区| 亚洲va在线va天堂| 欧美三级欧美一级| 亚洲一区二区欧美| 欧美性视频一区二区三区| 亚洲日本韩国一区| 91浏览器入口在线观看| 中文字幕一区三区| 大尺度一区二区| 亚洲国产精品ⅴa在线观看| 国产福利精品一区| 国产午夜亚洲精品羞羞网站| 国产一区二区在线电影| 精品国产免费人成电影在线观看四季| 亚洲一区二区三区视频在线| 欧洲一区在线观看| 亚洲一区二区精品视频| 欧美日韩一区精品| 婷婷亚洲久悠悠色悠在线播放| 欧美日韩一区二区在线视频| 亚洲国产精品自拍| 欧美日本一区二区| 日本亚洲免费观看| 欧美白人最猛性xxxxx69交| 麻豆成人在线观看| 久久天天做天天爱综合色| 国产成人精品www牛牛影视| 国产欧美日韩激情| 99re8在线精品视频免费播放| 中文字幕一区二区三区不卡 | 日韩在线播放一区二区| 欧美电影免费观看完整版| 国产精品一区二区黑丝| 日本一区二区视频在线| 色哟哟一区二区在线观看| 五月综合激情网| 日韩午夜激情av| 国产成人午夜精品影院观看视频 | 国产成人综合亚洲网站| 国产精品久久久一本精品| 在线观看视频91| 老司机午夜精品| 国产精品人妖ts系列视频| 色哟哟国产精品| 免费成人在线视频观看| 久久精品一区二区三区不卡 | 午夜成人在线视频| 欧美成人激情免费网| 丁香六月久久综合狠狠色| 一区二区三区四区乱视频| 3atv在线一区二区三区| 国产乱码精品一区二区三区忘忧草 | 18涩涩午夜精品.www| 欧美日韩不卡在线| 黄页网站大全一区二区| 亚洲欧美一区二区三区极速播放 | 中文字幕中文字幕一区| 欧美主播一区二区三区| 国产在线麻豆精品观看| 亚洲精品视频在线| 欧美电影免费观看高清完整版在| 成人做爰69片免费看网站| 婷婷中文字幕综合| 国产精品私人影院| 欧美一区二区网站| 97se亚洲国产综合在线| 久久99精品久久久久久动态图| 国产精品视频线看| 欧美一级二级在线观看| fc2成人免费人成在线观看播放 | 亚洲综合一区在线| 久久精品日韩一区二区三区| 在线中文字幕一区二区| 国产乱子伦一区二区三区国色天香| 亚洲天堂中文字幕| 久久你懂得1024| 欧美日韩精品欧美日韩精品| 在线亚洲人成电影网站色www| 黄网站免费久久| 日韩不卡一二三区| 亚洲欧美日韩人成在线播放| 久久久久久久久久久久久女国产乱| 欧美日韩一区二区三区高清| 成人激情小说网站| 国内外成人在线|