📄 dist_uniformtest.cpp
字号:
/*Send a stream number as the first command line argument when runningthis code. Suppose the binary of this program is named "main". Thentype "./main 2 >> rand_2.txt". Then run Octave and type "loadrand_2.txt". Finally, type "hist(M)" to see a relatively flathistogram of the values produced by this program. Slightly differenthistograms are produced by different streams, but this is to beexpected.*/#include <iostream>#include <cstdlib>#include "../include/mcsLibre.h"int main(int argc, char *argv[]){ mcsLibre mytest; int samples = 100000; int i; double V; cout << "# Created by Octave 2.1.33, Wed Feb 06 19:40:34 2002 PST <waldo@localhost.localdomain>" << endl; cout << "# name: M" << endl; cout << "# type: matrix" << endl; cout << "# rows: " << samples << endl; cout << "# columns: 1" << endl; for (i=0; i<samples; i++) { V = mytest.uniform(3, 8, atoi(argv[1])); cout << V << endl; } return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -