graph: let transitions() iterate only on valid transitions

This fixes #6.

* src/graph/graph.hh: Rename the old transitions() as
transition_vector(), and implement a new transitions() that iterates
only on non-dead transitions.
* src/tgba/tgbagraph.hh, src/tgba/tgbagraph.cc, src/graph/ngraph.hh:
Adjust wrappers.
* src/hoaparse/hoaparse.yy, src/tgbaalgos/complete.cc,
src/tgbaalgos/dtbasat.cc, src/tgbaalgos/dtgbasat.cc,
src/tgbaalgos/randomize.cc, src/tgbaalgos/safety.cc: Adjust calls.
This commit is contained in:
Alexandre Duret-Lutz 2014-12-08 12:04:09 +01:00
parent 8014833ae3
commit fbbf584bbb
10 changed files with 147 additions and 17 deletions

View file

@ -42,9 +42,9 @@ namespace spot
}
if (randomize_transitions)
{
auto begin = g.transitions().begin() + 1;
auto end = g.transitions().end();
std::random_shuffle(begin, end, spot::mrand);
g.remove_dead_transitions_();
auto& v = g.transition_vector();
std::random_shuffle(v.begin() + 1, v.end(), spot::mrand);
}
typedef tgba_digraph::graph_t::trans_storage_t tr_t;