Vcsn  2.0
Be Rational
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
vcsn::detail_weighted::minimizer< Aut > Class Template Reference

#include <minimize-weighted.hh>

Collaboration diagram for vcsn::detail_weighted::minimizer< Aut >:

Classes

class  label_less
 
class  label_to_weights_and_states_t
 
class  signature_equal_to
 
class  signature_hasher
 
class  signature_multimap
 
struct  state_output_for_label_t
 

Public Member Functions

 minimizer (const Aut &a)
 
void build_classes_ ()
 Build the initial classes, and split until fix point. More...
 
partition_automaton< automaton_toperator() ()
 The minimized automaton. More...
 

Private Types

using automaton_t = Aut
 
using labelset_t = labelset_t_of< automaton_t >
 
using weightset_t = weightset_t_of< automaton_t >
 
using label_t = label_t_of< automaton_t >
 
using weight_t = weight_t_of< automaton_t >
 
using state_t = state_t_of< automaton_t >
 
using class_t = unsigned
 
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 weight_and_state_t = std::pair< weight_t, state_t >
 
using state_output_t = std::vector< state_output_for_label_t >
 
using state_label_output_map_t = std::map< class_t, weight_t >
 The output of a given letter from a given state, keeping into account classes and weights, in a format suitable to comparison or hashing. More...
 

Private Member Functions

const state_label_output_map_t state_label_output_map (const std::vector< weight_and_state_t > &wss) const
 
void clear ()
 
class_t make_class (set_t &&set, class_t number=class_invalid)
 Make a new class with the given set of states. More...
 

Static Private Member Functions

static constexpr const charme ()
 

Private Attributes

const automaton_ta_
 Input automaton, supplied at construction time. More...
 
const labelset_tls_
 
const weightset_tws_
 
unsigned num_classes_ = 0
 
class_to_set_t class_to_set_
 
state_to_class_t state_to_class_
 
std::unordered_map< state_t,
state_output_t
state_to_state_output_
 

Static Private Attributes

static constexpr class_t class_invalid = -1
 An invalid class. More...
 

Friends

class label_less
 
class signature_hasher
 
class signature_equal_to
 
class signature_multimap
 

Detailed Description

template<typename Aut>
class vcsn::detail_weighted::minimizer< Aut >

Definition at line 21 of file minimize-weighted.hh.

Member Typedef Documentation

template<typename Aut>
using vcsn::detail_weighted::minimizer< Aut >::automaton_t = Aut
private

Definition at line 23 of file minimize-weighted.hh.

template<typename Aut>
using vcsn::detail_weighted::minimizer< Aut >::class_t = unsigned
private

Definition at line 37 of file minimize-weighted.hh.

template<typename Aut>
using vcsn::detail_weighted::minimizer< Aut >::class_to_set_t = std::vector<set_t>
private

Definition at line 40 of file minimize-weighted.hh.

template<typename Aut>
using vcsn::detail_weighted::minimizer< Aut >::label_t = label_t_of<automaton_t>
private

Definition at line 34 of file minimize-weighted.hh.

template<typename Aut>
using vcsn::detail_weighted::minimizer< Aut >::labelset_t = labelset_t_of<automaton_t>
private

Definition at line 28 of file minimize-weighted.hh.

template<typename Aut>
using vcsn::detail_weighted::minimizer< Aut >::set_t = std::vector<state_t>
private

Definition at line 38 of file minimize-weighted.hh.

template<typename Aut>
using vcsn::detail_weighted::minimizer< Aut >::state_label_output_map_t = std::map<class_t, weight_t>
private

The output of a given letter from a given state, keeping into account classes and weights, in a format suitable to comparison or hashing.

If a class is reachable with weight zero, it's guaranteed to be omitted from the table.

Definition at line 98 of file minimize-weighted.hh.

template<typename Aut>
using vcsn::detail_weighted::minimizer< Aut >::state_output_t = std::vector<state_output_for_label_t>
private

Definition at line 61 of file minimize-weighted.hh.

template<typename Aut>
using vcsn::detail_weighted::minimizer< Aut >::state_t = state_t_of<automaton_t>
private

Definition at line 36 of file minimize-weighted.hh.

template<typename Aut>
using vcsn::detail_weighted::minimizer< Aut >::state_to_class_t = std::unordered_map<state_t, class_t>
private

Definition at line 39 of file minimize-weighted.hh.

template<typename Aut>
using vcsn::detail_weighted::minimizer< Aut >::weight_and_state_t = std::pair<weight_t, state_t>
private

Definition at line 51 of file minimize-weighted.hh.

template<typename Aut>
using vcsn::detail_weighted::minimizer< Aut >::weight_t = weight_t_of<automaton_t>
private

Definition at line 35 of file minimize-weighted.hh.

template<typename Aut>
using vcsn::detail_weighted::minimizer< Aut >::weightset_t = weightset_t_of<automaton_t>
private

Definition at line 31 of file minimize-weighted.hh.

Constructor & Destructor Documentation

template<typename Aut>
vcsn::detail_weighted::minimizer< Aut >::minimizer ( const Aut &  a)
inline

Definition at line 291 of file minimize-weighted.hh.

References vcsn::is_trim(), vcsn::less_than(), vcsn::require(), and vcsn::sort().

Here is the call graph for this function:

Member Function Documentation

template<typename Aut>
void vcsn::detail_weighted::minimizer< Aut >::build_classes_ ( )
inline

Build the initial classes, and split until fix point.

Definition at line 331 of file minimize-weighted.hh.

template<typename Aut>
void vcsn::detail_weighted::minimizer< Aut >::clear ( )
inlineprivate

Definition at line 263 of file minimize-weighted.hh.

template<typename Aut>
class_t vcsn::detail_weighted::minimizer< Aut >::make_class ( set_t &&  set,
class_t  number = class_invalid 
)
inlineprivate

Make a new class with the given set of states.

Definition at line 271 of file minimize-weighted.hh.

template<typename Aut>
static constexpr const char* vcsn::detail_weighted::minimizer< Aut >::me ( )
inlinestaticprivate

Definition at line 42 of file minimize-weighted.hh.

template<typename Aut>
partition_automaton<automaton_t> vcsn::detail_weighted::minimizer< Aut >::operator() ( )
inline

The minimized automaton.

Definition at line 384 of file minimize-weighted.hh.

References vcsn::quotient().

Here is the call graph for this function:

template<typename Aut>
const state_label_output_map_t vcsn::detail_weighted::minimizer< Aut >::state_label_output_map ( const std::vector< weight_and_state_t > &  wss) const
inlineprivate

Friends And Related Function Documentation

template<typename Aut>
friend class label_less
friend

Definition at line 63 of file minimize-weighted.hh.

template<typename Aut>
friend class signature_equal_to
friend

Definition at line 155 of file minimize-weighted.hh.

template<typename Aut>
friend class signature_hasher
friend

Definition at line 121 of file minimize-weighted.hh.

template<typename Aut>
friend class signature_multimap
friend

Definition at line 244 of file minimize-weighted.hh.

Member Data Documentation

template<typename Aut>
const automaton_t& vcsn::detail_weighted::minimizer< Aut >::a_
private

Input automaton, supplied at construction time.

Definition at line 26 of file minimize-weighted.hh.

template<typename Aut>
constexpr class_t vcsn::detail_weighted::minimizer< Aut >::class_invalid = -1
staticprivate

An invalid class.

Definition at line 45 of file minimize-weighted.hh.

template<typename Aut>
class_to_set_t vcsn::detail_weighted::minimizer< Aut >::class_to_set_
private

Definition at line 48 of file minimize-weighted.hh.

template<typename Aut>
const labelset_t& vcsn::detail_weighted::minimizer< Aut >::ls_
private
template<typename Aut>
unsigned vcsn::detail_weighted::minimizer< Aut >::num_classes_ = 0
private

Definition at line 46 of file minimize-weighted.hh.

template<typename Aut>
state_to_class_t vcsn::detail_weighted::minimizer< Aut >::state_to_class_
private
template<typename Aut>
std::unordered_map<state_t, state_output_t> vcsn::detail_weighted::minimizer< Aut >::state_to_state_output_
private

Definition at line 92 of file minimize-weighted.hh.

template<typename Aut>
const weightset_t& vcsn::detail_weighted::minimizer< Aut >::ws_
private

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