[ create a new paste ] login | about

Link: http://codepad.org/z3G53SfE    [ raw code | output | fork ]

C++, pasted on Mar 12:
1
2
3
4
5
6
7
8
9
10
11
#include <iostream>
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/triangle_distribution.hpp>

int main() {
	boost::mt19937 rng (0);
	boost::triangle_distribution<float> distribution (0.0, 0.2, 1.0);
	for (int i = 0; i < 20; ++i) {
		std::cout << distribution (rng) << std::endl;
	}
}


Output:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
-43423.8
-45132.1
-49570.9
-53858.8
-45508.1
-54293.4
-43268
-53953.9
-38152.2
-46286.7
-47108.2
-36340.8
-38774.5
-31972.8
-55353.4
-13958.4
-57541.3
-30606.8
-36296.3
-40511.3


Create a new paste based on this one


Comments: