18 #ifndef VCSN_ALGORITHMS_IS_AMBIGUOUS_HXX
19 # define VCSN_ALGORITHMS_IS_AMBIGUOUS_HXX
24 # include <vaucanson/misc/usual_macros.hh>
34 template <
typename A,
typename AI>
36 do_is_ambiguous(
const AutomataBase<A>&,
37 const Element<A, AI>& aut)
39 typedef typename Element<A, AI>::hstate_t hstate_t;
42 std::map<hstate_t, std::pair<hstate_t, hstate_t> > m;
43 std::map<hstate_t, std::pair<hstate_t, hstate_t> > aut_p_m;
44 Element<A, AI> aut_p = product (aut, aut, m);
45 for (
typename std::map<hstate_t, std::pair<hstate_t, hstate_t> >::iterator i = m.begin();
47 aut_p_m.insert(std::make_pair(aut_p.get_state(
size_t(i->first)), i->second));
50 for_all_const_ (std::set<hstate_t>, i, s)
51 if (aut_p_m[*i].first != aut_p_m[*i].second)
56 template<typename A, typename AI>
60 BENCH_TASK_SCOPED(
"is_ambiguous");
61 return do_is_ambiguous(aut.structure(), aut);
66 #endif // ! VCSN_ALGORITHMS_IS_AMBIGUOUS_HXX