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));
weightset_t_of< automaton_t > weightset_t
transition_t_of< automaton_t > transition_t
std::vector< transition_t > res_
For each state, its predecessor.
typename detail::label_t_of_impl< base_t< ValueSet >>::type label_t_of
std::vector< transition_t > operator()(state_t source, state_t dest)
boost::heap::fibonacci_heap< profile > heap_t
size_t states_size(const Aut &aut)
The largest state number, plus one.
std::vector< value_t > distance_t
weight_t_of< automaton_t > weight_t
dijkstra_impl(const Aut &aut, const ValueSet &vs, Mul mul)
size_t size(const ExpSet &rs, const typename ExpSet::value_t &r)
context_t_of< automaton_t > context_t
auto all_out(const Aut &aut, state_t_of< Aut > s)
Indexes of transitions leaving state s.
state_t_of< automaton_t > state_t
Dijkstra implementation of lightest automaton.
typename detail::weight_t_of_impl< base_t< ValueSet >>::type weight_t_of
typename valueset_t::value_t value_t
typename detail::state_t_of_impl< base_t< ValueSet >>::type state_t_of
typename detail::transition_t_of_impl< base_t< ValueSet >>::type transition_t_of
typename detail::weightset_t_of_impl< base_t< ValueSet >>::type weightset_t_of
auto make_dijkstra_impl(const Aut &aut, const ValueSet &vs, Mul mul)
bool operator<(const profile &rhs) const
typename detail::context_t_of_impl< base_t< ValueSet >>::type context_t_of
std::vector< transition_t_of< Aut > > lightest_path(const Aut &aut, state_t_of< Aut > source, state_t_of< Aut > dest, a_star_tag)
profile(state_t state, const self_t &d)
label_t_of< automaton_t > label_t