Optimizing closure and sl.

* src/tgbaalgos/closure.cc, src/tgbaalgos/closure.hh: Using vectors
instead of sets and unordered maps, adding an overload to handle rvalue
references.
* src/tgbaalgos/stutterize.cc, src/tgbaalgos/stutterize.hh: Adding
an overload to handle rvalue references.
* bench/stutter/stutter_invariance_formulas.cc,
bench/stutter/stutter_invariance_randomgraph.cc: Automata are modified
in-place by is_stutter_invariant so they have to be copied before being
processed.
* src/tgbaalgos/stutter_invariance.cc,
src/tgbaalgos/stutter_invariance.hh: Use the in-place version of
closure and sl.
This commit is contained in:
Thibaud Michaud 2014-10-29 10:47:52 +01:00 committed by Alexandre Duret-Lutz
parent 5817a3c11b
commit fcf6e25132
8 changed files with 130 additions and 131 deletions

View file

@ -75,18 +75,24 @@ main()
for (char algo = '1'; algo <= '8'; ++algo)
{
// set SPOT_STUTTER_CHECK environment variable
// Set SPOT_STUTTER_CHECK environment variable.
char algostr[2] = { 0 };
algostr[0] = algo;
setenv("SPOT_STUTTER_CHECK", algostr, true);
// Copy vec, because is_stutter_invariant modifies the
// automata.
std::vector<aut_pair_t> dup(vec);
spot::stopwatch sw;
sw.start();
bool res;
for (auto& a: vec)
res = spot::is_stutter_invariant(a.first, a.second, apdict);
res = spot::is_stutter_invariant(std::move(a.first),
std::move(a.second),
apdict);
const double time = sw.stop();
vec = dup;
std::cout << algo << ", " << props_n << ", " << states_n
<< ", " << res << ", " << time << std::endl;
}
@ -95,6 +101,5 @@ main()
}
}
return 0;
}