Gentoo Archives: gentoo-commits

From: "Panagiotis Christopoulos (pchrist)" <pchrist@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-benchmarks/acovea/files: acovea-5.1.1-libevocosm.patch
Date: Sun, 01 Jun 2008 16:58:21
Message-Id: E1K2qsp-0005sU-Dl@stork.gentoo.org
1 pchrist 08/06/01 16:58:15
2
3 Added: acovea-5.1.1-libevocosm.patch
4 Log:
5 Apply patch which fixes dev-libs/libevocosm issue. Patch created by John Brooks <aspecialj@×××××.com>, bug 219998
6 (Portage version: 2.1.5.2)
7
8 Revision Changes Path
9 1.1 app-benchmarks/acovea/files/acovea-5.1.1-libevocosm.patch
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-benchmarks/acovea/files/acovea-5.1.1-libevocosm.patch?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-benchmarks/acovea/files/acovea-5.1.1-libevocosm.patch?rev=1.1&content-type=text/plain
13
14 Index: acovea-5.1.1-libevocosm.patch
15 ===================================================================
16 --- - 2008-05-30 21:03:16.545065718 -0600
17 +++ libacovea-5.1.1/libacovea/acovea.cpp 2008-05-30 20:55:48.000000000 -0600
18 @@ -86,7 +86,7 @@
19 // randomize settings of this option
20 void option::randomize()
21 {
22 - m_enabled = (g_random.get_rand_real2() < 0.5);
23 + m_enabled = (g_random.get_real() < 0.5);
24 }
25
26 // mutate this option
27 @@ -246,7 +246,7 @@
28 m_step = 1;
29
30 // possibly adjust value to randomize populations
31 - size_t choice = g_random.get_rand_index(3);
32 + size_t choice = g_random.get_index(3);
33
34 switch (choice)
35 {
36 @@ -304,12 +304,12 @@
37 void tuning_option::mutate()
38 {
39 // select our mutation
40 - if (g_random.get_rand_real2() < 0.5)
41 + if (g_random.get_real() < 0.5)
42 option::mutate();
43 else
44 {
45 // mutate value of this option, up or down randomly
46 - if (g_random.get_rand_real2() < 0.5)
47 + if (g_random.get_real() < 0.5)
48 m_value -= m_step;
49 else
50 m_value += m_step;
51 @@ -335,7 +335,7 @@
52 enum_option::enum_option(const vector<string> & a_choices, bool a_enabled)
53 : option(a_enabled),
54 m_choices(a_choices),
55 - m_setting(g_random.get_rand_index(a_choices.size()))
56 + m_setting(g_random.get_index(a_choices.size()))
57 {
58 // nada
59 }
60 @@ -344,7 +344,7 @@
61 enum_option::enum_option(const char ** a_choices, size_t a_num_choices, bool a_enabled)
62 : option(a_enabled),
63 m_choices(),
64 - m_setting(g_random.get_rand_index(a_num_choices))
65 + m_setting(g_random.get_index(a_num_choices))
66 {
67 for (int n = 0; n < a_num_choices; ++n)
68 m_choices.push_back(string(a_choices[n]));
69 @@ -369,7 +369,7 @@
70 token = strtok(NULL,"|");
71 }
72
73 - m_setting = g_random.get_rand_index(m_choices.size());
74 + m_setting = g_random.get_index(m_choices.size());
75
76 free(choices);
77 }
78 @@ -407,17 +407,17 @@
79 void enum_option::randomize()
80 {
81 // randomize enabled
82 - m_enabled = (g_random.get_rand_real2() < 0.5);
83 + m_enabled = (g_random.get_real() < 0.5);
84
85 // randomize setting
86 - m_setting = g_random.get_rand_index(m_choices.size());
87 + m_setting = g_random.get_index(m_choices.size());
88 }
89
90 // mutate this option
91 void enum_option::mutate()
92 {
93 // select our mutation
94 - if (g_random.get_rand() & 1)
95 + if (g_random.get_real() < 0.5)
96 option::mutate();
97 else
98 {
99 @@ -435,7 +435,7 @@
100
101 // find a different setting
102 while (new_setting == m_setting)
103 - new_setting = g_random.get_rand_index(m_choices.size());
104 + new_setting = g_random.get_index(m_choices.size());
105
106 m_setting = new_setting;
107 }
108 @@ -915,7 +915,7 @@
109 // randomly pick an option from one of the parents
110 for (int n = 0; n < a_parent1.size(); ++n)
111 {
112 - if (g_random.get_rand() & 1)
113 + if (g_random.get_real() < 0.5)
114 child.push_back(a_parent1[n]->clone());
115 else
116 child.push_back(a_parent2[n]->clone());
117 @@ -931,7 +931,7 @@
118 {
119 for (int n = 0; n < a_options.size(); ++n)
120 {
121 - if (g_random.get_rand_real2() < a_mutation_chance)
122 + if (g_random.get_real() < a_mutation_chance)
123 a_options[n]->mutate();
124 }
125 }
126 @@ -1096,7 +1096,7 @@
127 acovea_organism * child;
128
129 // do we crossover?
130 - if (g_random.get_rand_real2() <= m_crossover_rate)
131 + if (g_random.get_real() <= m_crossover_rate)
132 {
133 // select a second parent
134 size_t second_index = first_index;
135
136
137
138 --
139 gentoo-commits@l.g.o mailing list