MTEngine
A random number generator engine for C++ based on the Mersenne Twister algorithm.
Loading...
Searching...
No Matches
C:/Users/harshn/Desktop/MTEngine/example.cpp
Go to the documentation of this file.
1
#include "
MTEngine.hpp
"
2
#include "PrintUtils/PrintUtils.hpp"
3
#include <vector>
4
#include <iostream>
5
9
int
main
()
10
{
16
MTEngine
engine;
17
22
std::cout << engine.
rand
() << std::endl;
23
29
std::cout << engine.
choice
(1, 2, 3) << std::endl;
30
34
std::vector<double> v = {1, 2, 3, 4, 5};
35
40
engine.
Shuffle
(v);
41
46
std::cout << v << std::endl;
47
48
54
std::cout<<engine.
Choice
(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)<<std::endl;
55
59
return
0;
60
}
MTEngine.hpp
MTEngine
A class that represents a random number generator engine.
Definition
MTEngine.hpp:22
MTEngine::Choice
T Choice(T Start, Args... args)
Definition
MTEngine.hpp:100
MTEngine::Shuffle
void Shuffle(std::vector< T > &X)
Definition
MTEngine.hpp:67
MTEngine::choice
double choice(double a, double b)
Definition
MTEngine.cpp:97
MTEngine::rand
double rand()
Definition
MTEngine.cpp:84
main
int main()
Definition
example.cpp:9
example.cpp
Generated on Thu Jun 6 2024 11:33:41 for MTEngine by
1.10.0