tgbagraph: add a merge_transitions() method.
* src/graph/graph.hh: Add some framework to erase transitions, and defrag the resulting transitions_ vector on demand. Also remove the nb_states() and nb_transitions() because num_states() and num_transitions() already exist. * src/graphtest/graph.cc, src/graphtest/ngraph.cc: Adjust to use num_states(). * src/tgba/tgbagraph.hh (merge_transitions): New method. * src/misc/hash.hh: Add a pair_hash class, needed by merge_transitions(). * src/graphtest/tgbagraph.cc, src/graphtest/tgbagraph.test: Add states for transitions removal and merge_transitions().
This commit is contained in:
parent
9909699c63
commit
424de90385
7 changed files with 286 additions and 10 deletions
|
|
@ -75,6 +75,18 @@ namespace spot
|
|||
return s;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
struct pair_hash
|
||||
{
|
||||
template<typename T, typename U>
|
||||
std::size_t operator()(const std::pair<T, U> &p) const
|
||||
{
|
||||
return wang32_hash(static_cast<size_t>(p.first) ^
|
||||
static_cast<size_t>(p.second));
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // SPOT_MISC_HASH_HH
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue