由买买提看人间百态

topics

全部话题 - 话题: ran2
1 (共1页)
s***e
发帖数: 911
1
来自主题: Science版 - Re: 请教一个问题

我把程序直接给你? 很短. 这个程序很好用. 其中有些注释句很多余,是以前我调程序
干的,没删掉. 是单精度实行.反正是random number, 没必要双精度. 主程序掉用强行
转一下就成.
FUNCTION ran2(idum)
c REAL FUNCTION ran2(idum)
INTEGER idum,IM1,IM2,IMM1,IA1,IA2,IQ1,IQ2,IR1,IR2,NTAB,NDIV
REAL ran2,AM,EPS,RNMX
* REAL*8 FUNCTION ran2(idum)
c REAL FUNCTION ran2(idum)
PARAMETER (IM1=2147483563,IM2=2147483399,AM=1./IM1,IMM1=IM1-1,
*IA1=40014,IA2=40692,IQ1=53668,IQ2=52774,IR1=12211,IR2=3791,
*NTAB=32,NDIV=1+IMM1/NTAB,EPS=1.2e-7,RNMX
h***s
发帖数: 2499
2
来自主题: Programming版 - 求助,哪个会更快一点
计算中需要大量的gaussian random number,采用的nr里的ran2(),因为周期长...
看见有人说ran2()计算费时间,所以第一次计算的时候把ran2()产生的数都存下来,下
次换了参数run的时候就读取保存的数据...
想问问,是再次调用ran2()快还是读外部文件快啊?
x********g
发帖数: 47
3
来自主题: Computation版 - 用mpiifort 编译 出错
请高手指教 。 makefile如下:
# application name
APP = parallel_femsim
# list of source files
SRC = ran2.f90 globals.f90 model.f90 scattering_factors.f90 fem1.f90
parallel_femsim.f90
# list of object files
OBJ = ran2.o globals.o model.o scattering_factors.o fem1.o parallel_femsim
.o
# define libraries needed by the linker
#LIBS = -lmkl
# compiler options for debugging
FC_DEBUG = mpif90 -g -debug -implicitnone
# compiler options for optmized running
#FC_OPT = ifort -O3 -xO -ipo -no-prec-div -static
#F
s**g
发帖数: 3271
4
来自主题: _PerfectMoms版 - bike question
last night, we are talking about this and I asked 2bao whether he wants to
use the nickname ran2 ran2, he refused
heng
c******n
发帖数: 4965
5
a search on wikipedia shows the difference
"chive" is really tiny green onions,
JIU3 CAI4 is completely different, its leaves are not tubular, like onions.
it's a native Chinese plant, so westerners translated it to
"chinese chives" or "garlic chives", such translations always cause problems
, they should simply adopt the pronounciation, like we did for
Zi1 Ran2
a*****e
发帖数: 16445
6
guo3 ran2 shi4 包子大户, zai4 pai2 10 huang2 bao1!
p**w
发帖数: 62
7
来自主题: Australia版 - 7001
haha, gang1 cai2 cai2 fa1 xian4 wo3 ju1 ran2 qiang3 dao4 le 7000,
hahaha
s**********n
发帖数: 2601
8
来自主题: Chicago版 - snowshine确实很贤惠!
of course, I 会做 everything.
yao4 bu4 ran2 zen3 me shuo1 wo3 bi3 SS xian2 hui4 ne~~
y*******g
发帖数: 3677
9
来自主题: Mississippi版 - 咱们来个成语接龙吧
wei1 ran2 da4 yi4
j**4
发帖数: 10425
10
来自主题: NewYork版 - gang1 cai2 zou3 zai4 lu4 shang4
tu1 ran2 fa1 xian4, wo3 dui4 liang3 jian4 shi4, bu4 gan3 mao4: one is money,
and the other is marriage certificate...
j**4
发帖数: 10425
11
来自主题: NewYork版 - tu1 ran2
hao3 xiang3 mai4 ying2...
V*****8
发帖数: 33122
12
来自主题: NewYork版 - tu1 ran2
多少钱啊
j**4
发帖数: 10425
13
来自主题: NewYork版 - tu1 ran2
maybe charge accordingly. if u r old and poor, maybe just a dollar... if u
r gao1 fu4 shuai4, then maybe $1,000,000
m*******y
发帖数: 14292
14
来自主题: NewYork版 - tu1 ran2
then you need to have your salon photo taken first. please contact Hao.
m*****5
发帖数: 23482
15
来自主题: NewYork版 - tu1 ran2
she said she wanted to sell silver
n***g
发帖数: 5027
16
来自主题: NewYork版 - tu1 ran2
开个价吧,
我就一普通穷人。
c********e
发帖数: 6158
17
来自主题: NewYork版 - tu1 ran2
a "g" difference
m*****5
发帖数: 23482
18
来自主题: NewYork版 - tu1 ran2

u know, beef comes from a place with no "g"
V*****8
发帖数: 33122
19
来自主题: NewYork版 - tu1 ran2
你这境界太高尚了,学习不来

u
j**4
发帖数: 10425
20
来自主题: NewYork版 - tu1 ran2
i am going for modeling.. there are plenty uglier prostitutes than me
j**4
发帖数: 10425
21
来自主题: NewYork版 - tu1 ran2
that's why i always attach a 'g' just in case...
m*******y
发帖数: 14292
22
来自主题: NewYork版 - tu1 ran2
smart girl. i can hook you up with my hudsband he orders models pretty
frequently for their company parties and stuff.
j**4
发帖数: 10425
23
来自主题: NewYork版 - tu1 ran2
sorry, i meant to say "i am NOT going for modeling..."
V***e
发帖数: 666
24
来自主题: NewYork版 - tu1 ran2
富贵不能淫。
j**4
发帖数: 10425
25
来自主题: NewYork版 - tu1 ran2 fa1 xian4
john bohner is kind of hot, and he cries a lot, even hotter
m*******y
发帖数: 14292
26
来自主题: NewYork版 - tu1 ran2 fa1 xian4
are you dominitrix?
j**4
发帖数: 10425
27
来自主题: NewYork版 - tu1 ran2 fa1 xian4
no, quite the opposite
H***e
发帖数: 471
28
来自主题: Canada版 - 谈谈对多伦多几点失望的地方
ZAI4 Canada ZHU4 GUO4 N DUO1 NIAN2, DAN4 SHI4 MEI2 YOU3 ZHU4 GUO4 Toronto DE
REN2 AN4 RAN2 PIAO1 GUO4.

506
g*********o
发帖数: 20357
29
来自主题: gardening版 - 恭喜少数民族MM
ran2
h*i
发帖数: 27
30
来自主题: Literature版 - Depth & Reality-Re: 所谓困难
It seems that almost everyone knows Marques's
"One Hundred Years of Solitude".
Somehow sadness literature expresses could be very deep.
Very often it conveys what we are really concerned for the
problems of human beings or the society, e.g. Kafka's work.
Reality has its cruel side, but also has its bright side.
From another point of view, we also need more lively
work to keep the balance. I recalled a paragraph in
Bai2 Xian1 Yong3's "Mu4 Ran2 Hui2 Shou3"(白先勇 "蓦然回首"),
as pasted below.
后来又在文学杂志上继续
d*****s
发帖数: 313
31
来自主题: JLU版 - Happylife's wedding
bu4 neng2 zai4 chui3 peng3 xia4 qu4 le. Bu4 ran2 wo3 gai1 shuo1 wo3
LD ye3 shuo1 ni3 pp le...:)
h***s
发帖数: 2499
32
来自主题: Programming版 - 求助,哪个会更快一点
产生一个ran2()number 和读取文件一个double,哪个快?
一次run是一个温度,重复是要模拟时间演化
第二次run用一样的rdn应该没问题
k****f
发帖数: 3794
33
来自主题: Programming版 - 求助,哪个会更快一点
如果就是1个,肯定是ran2快
如果是很多个,读取double应该会不错的
b***f
发帖数: 39
34
用其他的库会好些, 比如 Numerical Recipe 中的 ran2()
s***e
发帖数: 911
35
来自主题: Science版 - Re: 请教一个问题

Numerical recipe里面的ran2.f能干这个,很不错的程序;
s***e
发帖数: 911
36
来自主题: Science版 - 请教一个数学问题

首先计算机是无法产生不"伪"的随即数的. 这里的伪是指同样的初始值迭带
同样次数一定会得到同样的结果, 也就是一样的初始值值对应的迭代轨道相同.
但是这个"伪随即数"并不是指该随即数序列不够"随机". 实际上所有的随机数序列
都有一个特点, 都对初始值具有极端的敏感性. 实际两个不同的叠代轨道序列
统计上是无关的. 对给定的迭代序列进行统计分析, 也可以得到相当满意的统计
特征.
现在最常用的算法recipe上提供了子程序. 你需要的是一个uniform分布的随机
数, recipe里名字叫ran2. 你若需要fortran子程序,我可以寄给你.
j******o
发帖数: 127
37
来自主题: Statistics版 - sas大牛们这个要怎么实现呀
data c;
if _n_=1 then do;
set b (rename=(nu=nu1 ran=ran1) firstobs=1 obs=1);
set b (rename=(nu=nu2 ran=ran2) firstobs=2 obs=2);
end;
set a;
run;
1 (共1页)