29 std::map<TypeId, string> g_type_id_to_name {
30 make_pair(TypeId::lcg64,
"lcg64"),
31 make_pair(TypeId::lcg64_shift,
"lcg64_shift"),
32 make_pair(TypeId::mrg2,
"mrg2"),
33 make_pair(TypeId::mrg3,
"mrg3"),
34 make_pair(TypeId::yarn2,
"yarn2"),
35 make_pair(TypeId::yarn3,
"yarn3")
38 std::map<string, TypeId> g_name_to_type_id {
39 make_pair(
"lcg64", TypeId::lcg64),
40 make_pair(
"lcg64_shift", TypeId::lcg64_shift),
41 make_pair(
"mrg2", TypeId::mrg2),
42 make_pair(
"mrg3", TypeId::mrg3),
43 make_pair(
"yarn2", TypeId::yarn2),
44 make_pair(
"yarn3", TypeId::yarn3)
50 namespace RandomEngineType {
54 return g_name_to_type_id.count(s) == 1;
59 return g_type_id_to_name.count(b) == 1;
65 if (g_type_id_to_name.count(b) == 1) {
66 ret = g_type_id_to_name[b];
74 if (g_name_to_type_id.count(s) == 1) {
75 ret = g_name_to_type_id[s];
string ToString(TypeId b)
Convert a type id to corresponding name.
TypeId FromString(string s)
Convert a string with name to type id.
Namespace for the core simulator.
bool IsExisting(TypeId b)
Check whether type with id b exists.
Namespace for Types of random engines.
TypeId
Enumerates type ids.
Interface of RandomEngineType.