are_isomorphic: return the mapping found, not just true or false

* src/bin/autfilt.cc: Here.
* src/tgbaalgos/are_isomorphic.cc, src/tgbaalgos/are_isomorphic.hh:
Here.
This commit is contained in:
Thibaud Michaud 2014-12-08 21:42:27 +01:00 committed by Alexandre Duret-Lutz
parent 97fdea9d71
commit 1b9354c9b5
3 changed files with 17 additions and 17 deletions

View file

@ -187,12 +187,12 @@ namespace
namespace spot
{
bool
std::vector<unsigned>
are_isomorphic(const const_tgba_digraph_ptr a1,
const const_tgba_digraph_ptr a2)
{
if (are_trivially_different(a1, a2))
return false;
return std::vector<unsigned>();
unsigned n = a1->num_states();
assert(n == a2->num_states());
class2states_t a1_classes = map_class_states(a1);
@ -202,14 +202,14 @@ namespace spot
// Get the first possible mapping between a1 and a2, or return false if
// the number of class or the size of the classes do not match.
if (!(mapping_from_classes(mapping, a1_classes, a2_classes)))
return false;
return std::vector<unsigned>();
while (!is_isomorphism(mapping, a1, a2))
{
if (!next_class_permutation(a2_classes))
return false;
return std::vector<unsigned>();
mapping_from_classes(mapping, a1_classes, a2_classes);
}
return true;
return mapping;
}
}