Vcsn  2.1
Be Rational
vcsn::detail_weighted::minimizer< Aut > Class Template Reference

#include <minimize-weighted.hh>

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

Classes

struct  classset
 Dealing with class numbers. More...
 
struct  signature_equal_to
 
struct  signature_hasher
 

Public Member Functions

 minimizer (const Aut &a)
 
class_to_set_tclasses ()
 The minimized automaton. More...
 
void build_classes_ ()
 Build the initial classes, and split until fix point. 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 class_polynomialset_t = polynomialset< context< classset, weightset_t >>
 The output of a given letter from a given state, keeping into account classes and weights. More...
 
using class_polynomial_t = typename class_polynomialset_t::value_t
 
using signature_t = std::map< label_t, class_polynomial_t >
 A signature: for each label, the outgoing class polynomial. More...
 
using signature_multimap = std::unordered_map< signature_t, set_t, signature_hasher, signature_equal_to >
 Cluster states per signature. More...
 

Private Member Functions

signature_t signature (state_t s) const
 The signature of state s. More...
 
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

automaton_t a_
 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_
 
class_polynomialset_t cps_ {{classset{}, ws_}}
 Class polynomialset. More...
 

Static Private Attributes

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

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_polynomial_t = typename class_polynomialset_t::value_t
private

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

The output of a given letter from a given state, keeping into account classes and weights.

Definition at line 76 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.

Cluster states per signature.

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

template<typename Aut >
using vcsn::detail_weighted::minimizer< Aut >::signature_t = std::map<label_t, class_polynomial_t>
private

A signature: for each label, the outgoing class polynomial.

Definition at line 84 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_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 171 of file minimize-weighted.hh.

References vcsn::is_trim(), vcsn::detail_weighted::minimizer< Aut >::me(), and vcsn::require().

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 187 of file minimize-weighted.hh.

References vcsn::detail_weighted::minimizer< Aut >::class_invalid, vcsn::detail_weighted::minimizer< Aut >::classes(), vcsn::detail_weighted::minimizer< Aut >::make_class(), and vcsn::detail_weighted::minimizer< Aut >::signature().

Referenced by vcsn::detail_weighted::minimizer< Aut >::classes().

Here is the call graph for this function:

template<typename Aut >
class_to_set_t& vcsn::detail_weighted::minimizer< Aut >::classes ( )
inline

The minimized automaton.

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

References vcsn::detail_weighted::minimizer< Aut >::build_classes_(), and vcsn::detail_weighted::minimizer< Aut >::class_to_set_.

Referenced by vcsn::detail_weighted::minimizer< Aut >::build_classes_().

Here is the call graph for this function:

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

Definition at line 138 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.

Parameters
setthe states belonging to this class
numberthe class number to use. If class_invalid, allocate one.

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

References vcsn::set.

Referenced by vcsn::detail_weighted::minimizer< Aut >::build_classes_().

template<typename Aut >
static constexpr const char* vcsn::detail_weighted::minimizer< Aut >::me ( )
inlinestaticprivate
template<typename Aut >
signature_t vcsn::detail_weighted::minimizer< Aut >::signature ( state_t  s) const
inlineprivate

The signature of state s.

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

References vcsn::detail_weighted::minimizer< Aut >::cps_.

Referenced by vcsn::detail_weighted::minimizer< Aut >::build_classes_().

Member Data Documentation

template<typename Aut >
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.

Referenced by vcsn::detail_weighted::minimizer< Aut >::build_classes_().

template<typename Aut >
class_to_set_t vcsn::detail_weighted::minimizer< Aut >::class_to_set_
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

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

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

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


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