Vcsn  2.3
Be Rational
vcsn::detail::quotienter< Aut > Class Template Reference

Apply a quotient onto an automaton: fuse equivalent states. More...

#include <quotient.hh>

Collaboration diagram for vcsn::detail::quotienter< Aut >:

Public Types

using automaton_t = Aut
 
using quotient_t = partition_automaton_t< automaton_t >
 
template<typename Ctx = context_t_of<Aut>>
using fresh_automaton_t = fresh_automaton_t_of< automaton_t, Ctx >
 
using origins_t = origins_t_of< quotient_t >
 
using class_t = unsigned
 
using state_t = state_t_of< automaton_t >
 
using set_t = std::vector< state_t >
 
using state_to_class_t = std::unordered_map< state_t, class_t >
 
using class_to_set_t = std::vector< set_t >
 
using class_to_state_t = std::vector< state_t >
 

Public Member Functions

 quotienter (class_to_set_t &class_to_set)
 
void sort_classes_ ()
 Sort the classes. More...
 
quotient_t operator() (const automaton_t &aut)
 Build the resulting automaton. More...
 

Private Attributes

class_to_set_tclass_to_set_
 
unsigned num_classes_
 

Detailed Description

template<Automaton Aut>
class vcsn::detail::quotienter< Aut >

Apply a quotient onto an automaton: fuse equivalent states.

Template Parameters
Autthe type of the input automaton

Definition at line 21 of file quotient.hh.

Member Typedef Documentation

template<Automaton Aut>
using vcsn::detail::quotienter< Aut >::automaton_t = Aut

Definition at line 24 of file quotient.hh.

template<Automaton Aut>
using vcsn::detail::quotienter< Aut >::class_t = unsigned

Definition at line 32 of file quotient.hh.

template<Automaton Aut>
using vcsn::detail::quotienter< Aut >::class_to_set_t = std::vector<set_t>

Definition at line 36 of file quotient.hh.

template<Automaton Aut>
using vcsn::detail::quotienter< Aut >::class_to_state_t = std::vector<state_t>

Definition at line 37 of file quotient.hh.

template<Automaton Aut>
template<typename Ctx = context_t_of<Aut>>
using vcsn::detail::quotienter< Aut >::fresh_automaton_t = fresh_automaton_t_of<automaton_t, Ctx>

Definition at line 28 of file quotient.hh.

template<Automaton Aut>
using vcsn::detail::quotienter< Aut >::origins_t = origins_t_of<quotient_t>

Definition at line 30 of file quotient.hh.

template<Automaton Aut>
using vcsn::detail::quotienter< Aut >::quotient_t = partition_automaton_t<automaton_t>

Definition at line 25 of file quotient.hh.

template<Automaton Aut>
using vcsn::detail::quotienter< Aut >::set_t = std::vector<state_t>

Definition at line 34 of file quotient.hh.

template<Automaton Aut>
using vcsn::detail::quotienter< Aut >::state_t = state_t_of<automaton_t>

Definition at line 33 of file quotient.hh.

template<Automaton Aut>
using vcsn::detail::quotienter< Aut >::state_to_class_t = std::unordered_map<state_t, class_t>

Definition at line 35 of file quotient.hh.

Constructor & Destructor Documentation

template<Automaton Aut>
vcsn::detail::quotienter< Aut >::quotienter ( class_to_set_t class_to_set)
inline
Parameters
class_to_setThe equivalence classes. Might be modified to put the states with the smallest ID first in their class.

Definition at line 42 of file quotient.hh.

References vcsn::detail::quotienter< Aut >::sort_classes_().

Here is the call graph for this function:

Member Function Documentation

template<Automaton Aut>
quotient_t vcsn::detail::quotienter< Aut >::operator() ( const automaton_t aut)
inline

Build the resulting automaton.

Parameters
autthe input automaton to quotient

Definition at line 74 of file quotient.hh.

References vcsn::detail::all_out(), vcsn::detail::quotienter< Aut >::class_to_set_, vcsn::make_fresh_automaton(), vcsn::make_partition_automaton(), vcsn::detail::quotienter< Aut >::num_classes_, vcsn::res, and vcsn::set.

Here is the call graph for this function:

template<Automaton Aut>
void vcsn::detail::quotienter< Aut >::sort_classes_ ( )
inline

Sort the classes.

This step, which is "useless" in that the result would be correct anyway, just ensures that the classes are numbered after their states: classes are sorted by the smallest of their state ids.

Definition at line 55 of file quotient.hh.

References vcsn::detail::quotienter< Aut >::class_to_set_, vcsn::detail::quotienter< Aut >::num_classes_, and vcsn::sort().

Referenced by vcsn::detail::quotienter< Aut >::quotienter().

Here is the call graph for this function:

Member Data Documentation

template<Automaton Aut>
class_to_set_t& vcsn::detail::quotienter< Aut >::class_to_set_
private
template<Automaton Aut>
unsigned vcsn::detail::quotienter< Aut >::num_classes_
private

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