Vcsn  2.3
Be Rational
vcsn::detail::state_eliminator< Aut, Profiler > Struct Template Reference

Eliminate states in an automaton. More...

#include <to-expression.hh>

Collaboration diagram for vcsn::detail::state_eliminator< Aut, Profiler >:

Public Types

using profiler_t = Profiler
 
using profile_t = typename profiler_t::state_profile
 
using automaton_t = std::remove_cv_t< Aut >
 
using state_t = state_t_of< automaton_t >
 

Public Member Functions

 state_eliminator (automaton_t &aut, profiler_t &profiler)
 Prepare for state-elimination. More...
 
void operator() (state_t s)
 Eliminate state s. More...
 
void operator() ()
 Eliminate all the states, in the order specified by next_state. More...
 

Private Types

using heap_t = boost::heap::fibonacci_heap< profile_t >
 Max-heap to decide the order of state-elimination. More...
 

Private Member Functions

void update_heap_ ()
 
void show_heap_ () const
 Show the heap, for debugging. More...
 
template<typename Kind = typename context_t_of<automaton_t>::kind_t>
auto eliminate_state_ (state_t s) -> std::enable_if_t< std::is_same< Kind, labels_are_one >::value, void >
 Eliminate state s in the case of labels are one. More...
 
template<typename Kind >
auto eliminate_state_impl_ (state_t s) -> std::enable_if_t< std::is_same< Kind, labels_are_expressions >::value, void >
 Eliminate state s in the case of labels are expressions. More...
 

Private Attributes

automaton_t aut_
 The automaton we work on. More...
 
profiler_tprofiler_
 The profiler we work with. Corresponding to a specific heuristic. More...
 
heap_t todo_
 
std::vector< typename heap_t::handle_type > handles_
 Map: state -> heap-handle. More...
 
std::unordered_set< state_tneighbors_
 

Detailed Description

template<Automaton Aut, typename Profiler>
struct vcsn::detail::state_eliminator< Aut, Profiler >

Eliminate states in an automaton.

Precondition
The labelset is oneset or expressionset.

Definition at line 227 of file to-expression.hh.

Member Typedef Documentation

template<Automaton Aut, typename Profiler>
using vcsn::detail::state_eliminator< Aut, Profiler >::automaton_t = std::remove_cv_t<Aut>

Definition at line 231 of file to-expression.hh.

template<Automaton Aut, typename Profiler>
using vcsn::detail::state_eliminator< Aut, Profiler >::heap_t = boost::heap::fibonacci_heap<profile_t>
private

Max-heap to decide the order of state-elimination.

Definition at line 416 of file to-expression.hh.

template<Automaton Aut, typename Profiler>
using vcsn::detail::state_eliminator< Aut, Profiler >::profile_t = typename profiler_t::state_profile

Definition at line 230 of file to-expression.hh.

template<Automaton Aut, typename Profiler>
using vcsn::detail::state_eliminator< Aut, Profiler >::profiler_t = Profiler

Definition at line 229 of file to-expression.hh.

template<Automaton Aut, typename Profiler>
using vcsn::detail::state_eliminator< Aut, Profiler >::state_t = state_t_of<automaton_t>

Definition at line 232 of file to-expression.hh.

Constructor & Destructor Documentation

template<Automaton Aut, typename Profiler>
vcsn::detail::state_eliminator< Aut, Profiler >::state_eliminator ( automaton_t aut,
profiler_t profiler 
)
inline

Member Function Documentation

template<Automaton Aut, typename Profiler>
template<typename Kind = typename context_t_of<automaton_t>::kind_t>
auto vcsn::detail::state_eliminator< Aut, Profiler >::eliminate_state_ ( state_t  s) -> std::enable_if_t<std::is_same<Kind, labels_are_one>::value, void>
inlineprivate
template<Automaton Aut, typename Profiler>
template<typename Kind >
auto vcsn::detail::state_eliminator< Aut, Profiler >::eliminate_state_impl_ ( state_t  s) -> std::enable_if_t<std::is_same<Kind, labels_are_expressions>::value, void>
inlineprivate

Eliminate state s in the case of labels are expressions.

Definition at line 370 of file to-expression.hh.

References vcsn::detail::all_in(), vcsn::detail::all_out(), vcsn::detail::state_eliminator< Aut, Profiler >::aut_, vcsn::detail::in(), vcsn::detail::make_vector(), vcsn::detail::state_eliminator< Aut, Profiler >::neighbors_, vcsn::detail::out(), vcsn::detail::outin(), vcsn::detail::state_eliminator< Aut, Profiler >::profiler_, vcsn::detail::rs, and vcsn::detail::state_eliminator< Aut, Profiler >::update_heap_().

Here is the call graph for this function:

template<Automaton Aut, typename Profiler>
void vcsn::detail::state_eliminator< Aut, Profiler >::operator() ( state_t  s)
inline

Eliminate state s.

Definition at line 248 of file to-expression.hh.

References vcsn::detail::state_eliminator< Aut, Profiler >::aut_, vcsn::detail::state_eliminator< Aut, Profiler >::eliminate_state_(), vcsn::require(), and vcsn::detail::state_eliminator< Aut, Profiler >::todo_.

Here is the call graph for this function:

template<Automaton Aut, typename Profiler>
void vcsn::detail::state_eliminator< Aut, Profiler >::operator() ( )
inline

Eliminate all the states, in the order specified by next_state.

Definition at line 263 of file to-expression.hh.

References vcsn::detail::state_eliminator< Aut, Profiler >::eliminate_state_(), and vcsn::detail::state_eliminator< Aut, Profiler >::todo_.

Here is the call graph for this function:

template<Automaton Aut, typename Profiler>
void vcsn::detail::state_eliminator< Aut, Profiler >::show_heap_ ( ) const
inlineprivate

Member Data Documentation

template<Automaton Aut, typename Profiler>
std::vector<typename heap_t::handle_type> vcsn::detail::state_eliminator< Aut, Profiler >::handles_
private

The documentation for this struct was generated from the following file: