18 #ifndef VCSN_ALGORITHMS_SUB_AUTOMATON_HXX
19 # define VCSN_ALGORITHMS_SUB_AUTOMATON_HXX
23 # include <vaucanson/automata/concept/automata_base.hh>
24 # include <vaucanson/misc/usual_macros.hh>
34 template<
typename A,
typename AI,
typename HStatesSet>
36 do_sub_automaton_here(
const AutomataBase<A>&,
38 const HStatesSet& selected,
41 BENCH_TASK_SCOPED(
"sub_automaton");
42 typedef Element<A, AI> automaton_t;
43 std::list<typename automaton_t::hstate_t> to_be_removed;
44 for (
typename automaton_t::state_iterator i = a.states().begin();
45 i != a.states().end(); ++i)
46 if (std::find(selected.begin(), selected.end(), *i) == selected.end())
47 to_be_removed.push_back(*i);
49 for_all_const_(std::list<typename automaton_t::hstate_t>, i, to_be_removed)
57 template<typename A, typename AI, typename HStatesSet>
62 std::set<typename Element<A, AI>::hstate_t> ret_s;
64 for_all_iterator(
typename HStatesSet::const_iterator, i, s)
65 ret_s.insert(ret.get_state(
size_t(*i)));
66 do_sub_automaton_here(ret.
structure(), ret, ret_s, check_states);
70 template<
typename A,
typename AI,
typename HStatesSet>
74 do_sub_automaton_here(a.
structure(), a, s, check_states);
79 #endif // ! VCSN_ALGORITHMS_SUB_AUTOMATON_HXX