@@ -81,11 +81,12 @@ void instrumentert::instrument_with_strategy(instrumentation_strategyt strategy)
81
81
}
82
82
83
83
void inline instrumentert::instrument_all_inserter (
84
- const std::set<event_grapht::critical_cyclet> &set_of_cycles )
84
+ const std::set<event_grapht::critical_cyclet> &subset_of_cycles )
85
85
{
86
- for (std::set<event_grapht::critical_cyclet>::const_iterator
87
- it=(set_of_cycles).begin ();
88
- it!=(set_of_cycles).end (); ++it)
86
+ for (std::set<event_grapht::critical_cyclet>::const_iterator it =
87
+ subset_of_cycles.begin ();
88
+ it != subset_of_cycles.end ();
89
+ ++it)
89
90
{
90
91
for (std::set<event_grapht::critical_cyclet::delayt>::const_iterator
91
92
p_it=it->unsafe_pairs .begin ();
@@ -109,15 +110,16 @@ void inline instrumentert::instrument_all_inserter(
109
110
}
110
111
111
112
void inline instrumentert::instrument_one_event_per_cycle_inserter (
112
- const std::set<event_grapht::critical_cyclet> &set_of_cycles )
113
+ const std::set<event_grapht::critical_cyclet> &subset_of_cycles )
113
114
{
114
115
/* to keep track of the delayed pair, and to avoid the instrumentation
115
116
of two pairs in a same cycle */
116
117
std::set<event_grapht::critical_cyclet::delayt> delayed;
117
118
118
- for (std::set<event_grapht::critical_cyclet>::iterator
119
- it=set_of_cycles.begin ();
120
- it!=set_of_cycles.end (); ++it)
119
+ for (std::set<event_grapht::critical_cyclet>::iterator it =
120
+ subset_of_cycles.begin ();
121
+ it != subset_of_cycles.end ();
122
+ ++it)
121
123
{
122
124
/* cycle with already a delayed pair? */
123
125
bool next=false ;
@@ -189,7 +191,7 @@ unsigned inline instrumentert::cost(
189
191
}
190
192
191
193
void inline instrumentert::instrument_minimum_interference_inserter (
192
- const std::set<event_grapht::critical_cyclet> &set_of_cycles )
194
+ const std::set<event_grapht::critical_cyclet> &subset_of_cycles )
193
195
{
194
196
/* Idea:
195
197
We solve this by a linear programming approach,
@@ -216,10 +218,10 @@ void inline instrumentert::instrument_minimum_interference_inserter(
216
218
#ifdef HAVE_GLPK
217
219
/* first, identify all the unsafe pairs */
218
220
std::set<event_grapht::critical_cyclet::delayt> edges;
219
- for (std::set<event_grapht::critical_cyclet>::iterator
220
- C_j=set_of_cycles .begin ();
221
- C_j!=set_of_cycles .end ();
222
- ++C_j)
221
+ for (std::set<event_grapht::critical_cyclet>::iterator C_j =
222
+ subset_of_cycles .begin ();
223
+ C_j != subset_of_cycles .end ();
224
+ ++C_j)
223
225
for (std::set<event_grapht::critical_cyclet::delayt>::const_iterator e_i=
224
226
C_j->unsafe_pairs .begin ();
225
227
e_i!=C_j->unsafe_pairs .end ();
@@ -236,8 +238,8 @@ void inline instrumentert::instrument_minimum_interference_inserter(
236
238
glp_set_prob_name (lp, " instrumentation optimisation" );
237
239
glp_set_obj_dir (lp, GLP_MIN);
238
240
239
- message.debug () << " edges: " <<edges. size ()<< " cycles: " <<set_of_cycles .size ()
240
- << messaget::eom;
241
+ message.debug () << " edges: " << edges .size ()
242
+ << " cycles: " << subset_of_cycles. size () << messaget::eom;
241
243
242
244
/* sets the variables and coefficients */
243
245
glp_add_cols (lp, edges.size ());
@@ -256,20 +258,20 @@ void inline instrumentert::instrument_minimum_interference_inserter(
256
258
}
257
259
258
260
/* sets the constraints (soundness): one per cycle */
259
- glp_add_rows (lp, set_of_cycles .size ());
261
+ glp_add_rows (lp, subset_of_cycles .size ());
260
262
i=0 ;
261
- for (std::set<event_grapht::critical_cyclet>::iterator
262
- C_j=set_of_cycles .begin ();
263
- C_j!=set_of_cycles .end ();
264
- ++C_j)
263
+ for (std::set<event_grapht::critical_cyclet>::iterator C_j =
264
+ subset_of_cycles .begin ();
265
+ C_j != subset_of_cycles .end ();
266
+ ++C_j)
265
267
{
266
268
++i;
267
269
std::string name=" C_" +std::to_string (i);
268
270
glp_set_row_name (lp, i, name.c_str ());
269
271
glp_set_row_bnds (lp, i, GLP_LO, 1.0 , 0.0 ); /* >= 1*/
270
272
}
271
273
272
- const std::size_t mat_size=set_of_cycles .size ()* edges.size ();
274
+ const std::size_t mat_size = subset_of_cycles .size () * edges.size ();
273
275
message.debug () << " size of the system: " << mat_size
274
276
<< messaget::eom;
275
277
std::vector<int > imat (mat_size+1 );
@@ -287,10 +289,10 @@ void inline instrumentert::instrument_minimum_interference_inserter(
287
289
++e_i)
288
290
{
289
291
row=1 ;
290
- for (std::set<event_grapht::critical_cyclet>::iterator
291
- C_j=set_of_cycles .begin ();
292
- C_j!=set_of_cycles .end ();
293
- ++C_j)
292
+ for (std::set<event_grapht::critical_cyclet>::iterator C_j =
293
+ subset_of_cycles .begin ();
294
+ C_j != subset_of_cycles .end ();
295
+ ++C_j)
294
296
{
295
297
imat[i]=row;
296
298
jmat[i]=col;
@@ -344,7 +346,7 @@ void inline instrumentert::instrument_minimum_interference_inserter(
344
346
345
347
glp_delete_prob (lp);
346
348
#else
347
- (void )set_of_cycles ; // unused parameter
349
+ (void )subset_of_cycles ; // unused parameter
348
350
throw " sorry, minimum interference option requires glpk; "
349
351
" please recompile goto-instrument with glpk" ;
350
352
#endif
0 commit comments