3 #include <boost/heap/fibonacci_heap.hpp>
30 template <Automaton Aut,
typename ValueSet,
typename Mul>
43 using value_t =
typename valueset_t::value_t;
75 using heap_t = boost::heap::fibonacci_heap<profile>;
77 std::vector<transition_t>
81 auto handles = std::vector<typename heap_t::handle_type>(
size);
85 handles[source] = todo.emplace(source, *
this);
97 auto dst =
aut_->dst_of(t);
99 if (
res_[dst] ==
aut_->null_transition())
104 handles[dst] = todo.emplace(dst, *
this);
111 todo.update(handles[dst]);
115 return std::move(
res_);
121 std::vector<transition_t>
res_;
127 template <Automaton Aut,
typename ValueSet,
typename Mul>
135 template <Automaton Aut>
136 std::vector<transition_t_of<Aut>>
142 return aut->weightset()->mul(lhs, aut->weight_of(t));
145 return std::move(algo(source, dest));
label_t_of< automaton_t > label_t
typename detail::weight_t_of_impl< base_t< ValueSet >>::type weight_t_of
bool operator<(const profile &rhs) const
std::vector< transition_t > res_
For each state, its predecessor.
typename detail::transition_t_of_impl< base_t< ValueSet >>::type transition_t_of
size_t states_size(const Aut &aut)
The largest state number, plus one.
size_t size(const ExpSet &rs, const typename ExpSet::value_t &r)
typename detail::context_t_of_impl< base_t< ValueSet >>::type context_t_of
Dijkstra implementation of lightest automaton.
typename valueset_t::value_t value_t
transition_t_of< automaton_t > transition_t
typename detail::state_t_of_impl< base_t< ValueSet >>::type state_t_of
profile(state_t state, const self_t &d)
weightset_t_of< automaton_t > weightset_t
typename detail::label_t_of_impl< base_t< ValueSet >>::type label_t_of
std::vector< value_t > distance_t
context_t_of< automaton_t > context_t
state_t_of< automaton_t > state_t
boost::heap::fibonacci_heap< profile > heap_t
typename detail::weightset_t_of_impl< base_t< ValueSet >>::type weightset_t_of
weight_t_of< automaton_t > weight_t
dijkstra_impl(const Aut &aut, const ValueSet &vs, Mul mul)
auto all_out(const Aut &aut, state_t_of< Aut > s)
Indexes of transitions leaving state s.
std::vector< transition_t_of< Aut > > lightest_path(const Aut &aut, state_t_of< Aut > source, state_t_of< Aut > dest, a_star_tag)
auto make_dijkstra_impl(const Aut &aut, const ValueSet &vs, Mul mul)
std::vector< transition_t > operator()(state_t source, state_t dest)