Vcsn  2.2
Be Rational
vcsn::detail::pair_automaton_impl< Aut > Class Template Reference

The pair automaton is used by several algorithms for synchronizing words. More...

#include <pair.hh>

Inheritance diagram for vcsn::detail::pair_automaton_impl< Aut >:
Collaboration diagram for vcsn::detail::pair_automaton_impl< Aut >:

Public Types

using automaton_t = Aut
 
using self_t = pair_automaton_impl
 
using context_t = context_t_of< automaton_t >
 
template<typename Ctx = context_t>
using fresh_automaton_t = mutable_automaton< Ctx >
 When creating a copy of this automaton type. More...
 
using super_t = automaton_decorator< fresh_automaton_t<>>
 
using in_state_t = state_t_of< automaton_t >
 
using in_transition_t = transition_t_of< automaton_t >
 
using weightset_t = weightset_t_of< automaton_t >
 
using weight_t = typename weightset_t::value_t
 
using state_t = typename super_t::state_t
 
using singletons_t = std::vector< state_t >
 
using pair_states_t = std::unordered_map< state_name_t, state_t >
 
- Public Types inherited from vcsn::detail::automaton_decorator< mutable_automaton< context_t_of< Aut > > >
using automaton_t = Aut
 The type of automaton to wrap. More...
 
using context_t = context_t_of< Aut >
 
using element_type = typename automaton_t::element_type
 The automaton type, without shared_ptr. More...
 
using fresh_automaton_t = typename element_type::template fresh_automaton_t< Ctx >
 The (shared pointer) type to use it we have to create an automaton of the same (underlying) type. More...
 
using kind_t = typename context_t::kind_t
 
using labelset_t = typename context_t::labelset_t
 
using labelset_ptr = typename context_t::labelset_ptr
 
using label_t = typename labelset_t::value_t
 
using weightset_t = typename context_t::weightset_t
 
using weightset_ptr = typename context_t::weightset_ptr
 
using weight_t = typename weightset_t::value_t
 
using state_t = state_t_of< automaton_t >
 
using transition_t = transition_t_of< automaton_t >
 

Public Member Functions

 pair_automaton_impl (const automaton_t &aut, bool keep_initials=false)
 
std::ostream & print_set (std::ostream &o, format fmt={}) const
 
state_t get_q0 () const
 
bool is_singleton (state_t s) const
 
const singletons_tsingletons () const
 
const pair_states_tget_map_pair () const
 
const origins_torigins () const
 A map from result state to tuple of original states. More...
 
const state_name_tget_origin (state_t s) const
 
bool state_has_name (state_t s) const
 
std::ostream & print_state_name (state_t ss, std::ostream &o, format fmt={}, bool delimit=false) const
 
- Public Member Functions inherited from vcsn::detail::automaton_decorator< mutable_automaton< context_t_of< Aut > > >
 automaton_decorator (automaton_t aut)
 
 automaton_decorator (const automaton_decorator &aut)
 
 automaton_decorator (const context_t &ctx)
 
 automaton_decorator (automaton_decorator &&aut)
 
automaton_decoratoroperator= (automaton_decorator &&that)
 
automaton_t strip ()
 The automaton we decorate. More...
 
auto all_in (Args &&...args) const -> decltype(aut_-> all_in(std::forward< Args >(args)...))
 
auto all_out (Args &&...args) const -> decltype(aut_-> all_out(std::forward< Args >(args)...))
 
auto all_states (Args &&...args) const -> decltype(aut_-> all_states(std::forward< Args >(args)...))
 
auto all_transitions (Args &&...args) const -> decltype(aut_-> all_transitions(std::forward< Args >(args)...))
 
auto context (Args &&...args) const -> decltype(aut_-> context(std::forward< Args >(args)...))
 
auto dst_of (Args &&...args) const -> decltype(aut_-> dst_of(std::forward< Args >(args)...))
 
auto get_final_weight (Args &&...args) const -> decltype(aut_-> get_ final _weight(std
 
auto get_initial_weight (Args &&...args) const -> decltype(aut_-> get_initial_weight(std::forward< Args >(args)...))
 
auto get_transition (Args &&...args) const -> decltype(aut_-> get_transition(std::forward< Args >(args)...))
 
auto has_state (Args &&...args) const -> decltype(aut_-> has_state(std::forward< Args >(args)...))
 
auto has_transition (Args &&...args) const -> decltype(aut_-> has_transition(std::forward< Args >(args)...))
 
auto is_final (Args &&...args) const -> decltype(aut_-> is_ final(std
 
auto is_initial (Args &&...args) const -> decltype(aut_-> is_initial(std::forward< Args >(args)...))
 
auto label_of (Args &&...args) const -> decltype(aut_-> label_of(std::forward< Args >(args)...))
 
auto labelset (Args &&...args) const -> decltype(aut_-> labelset(std::forward< Args >(args)...))
 
auto num_all_states (Args &&...args) const -> decltype(aut_-> num_all_states(std::forward< Args >(args)...))
 
auto num_finals (Args &&...args) const -> decltype(aut_-> num_ final s(std
 
auto num_initials (Args &&...args) const -> decltype(aut_-> num_initials(std::forward< Args >(args)...))
 
auto num_states (Args &&...args) const -> decltype(aut_-> num_states(std::forward< Args >(args)...))
 
auto num_transitions (Args &&...args) const -> decltype(aut_-> num_transitions(std::forward< Args >(args)...))
 
auto prepost_label (Args &&...args) const -> decltype(aut_-> prepost_label(std::forward< Args >(args)...))
 
auto print (Args &&...args) const -> decltype(aut_-> print(std::forward< Args >(args)...))
 
auto print_set (Args &&...args) const -> decltype(aut_-> print_set(std::forward< Args >(args)...))
 
auto print_state (Args &&...args) const -> decltype(aut_-> print_state(std::forward< Args >(args)...))
 
auto print_state_name (Args &&...args) const -> decltype(aut_-> print_state_name(std::forward< Args >(args)...))
 
auto src_of (Args &&...args) const -> decltype(aut_-> src_of(std::forward< Args >(args)...))
 
auto state_has_name (Args &&...args) const -> decltype(aut_-> state_has_name(std::forward< Args >(args)...))
 
auto is_lazy (Args &&...args) const -> decltype(aut_-> is_lazy(std::forward< Args >(args)...))
 
auto is_lazy_in (Args &&...args) const -> decltype(aut_-> is_lazy_in(std::forward< Args >(args)...))
 
auto states (Args &&...args) const -> decltype(aut_-> states(std::forward< Args >(args)...))
 
auto weight_of (Args &&...args) const -> decltype(aut_-> weight_of(std::forward< Args >(args)...))
 
auto weightset (Args &&...args) const -> decltype(aut_-> weightset(std::forward< Args >(args)...))
 
auto add_final (Args &&...args) -> decltype(aut_-> add_ final(std
 
auto add_initial (Args &&...args) -> decltype(aut_-> add_initial(std::forward< Args >(args)...))
 
auto add_transition (Args &&...args) -> decltype(aut_-> add_transition(std::forward< Args >(args)...))
 
auto add_transition_copy (Args &&...args) -> decltype(aut_-> add_transition_copy(std::forward< Args >(args)...))
 
auto add_weight (Args &&...args) -> decltype(aut_-> add_weight(std::forward< Args >(args)...))
 
auto del_state (Args &&...args) -> decltype(aut_-> del_state(std::forward< Args >(args)...))
 
auto del_transition (Args &&...args) -> decltype(aut_-> del_transition(std::forward< Args >(args)...))
 
auto lmul_weight (Args &&...args) -> decltype(aut_-> lmul_weight(std::forward< Args >(args)...))
 
auto new_state (Args &&...args) -> decltype(aut_-> new_state(std::forward< Args >(args)...))
 
auto new_transition (Args &&...args) -> decltype(aut_-> new_transition(std::forward< Args >(args)...))
 
auto new_transition_copy (Args &&...args) -> decltype(aut_-> new_transition_copy(std::forward< Args >(args)...))
 
auto rmul_weight (Args &&...args) -> decltype(aut_-> rmul_weight(std::forward< Args >(args)...))
 
auto set_final (Args &&...args) -> decltype(aut_-> set_ final(std
 
auto set_lazy (Args &&...args) -> decltype(aut_-> set_lazy(std::forward< Args >(args)...))
 
auto set_lazy_in (Args &&...args) -> decltype(aut_-> set_lazy_in(std::forward< Args >(args)...))
 
auto set_initial (Args &&...args) -> decltype(aut_-> set_initial(std::forward< Args >(args)...))
 
auto set_transition (Args &&...args) -> decltype(aut_-> set_transition(std::forward< Args >(args)...))
 
auto set_weight (Args &&...args) -> decltype(aut_-> set_weight(std::forward< Args >(args)...))
 
auto unset_final (Args &&...args) -> decltype(aut_-> unset_ final(std
 
auto unset_initial (Args &&...args) -> decltype(aut_-> unset_initial(std::forward< Args >(args)...))
 

Static Public Member Functions

static symbol sname ()
 
- Static Public Member Functions inherited from vcsn::detail::automaton_decorator< mutable_automaton< context_t_of< Aut > > >
static constexpr auto lazy_transition (Args &&...args) -> decltype(element_type::lazy_transition(std::forward< Args >(args)...))
 
static constexpr auto null_state (Args &&...args) -> decltype(element_type::null_state(std::forward< Args >(args)...))
 
static constexpr auto null_transition (Args &&...args) -> decltype(element_type::null_transition(std::forward< Args >(args)...))
 
static constexpr auto post (Args &&...args) -> decltype(element_type::post(std::forward< Args >(args)...))
 
static constexpr auto pre (Args &&...args) -> decltype(element_type::pre(std::forward< Args >(args)...))
 
static constexpr auto sname (Args &&...args) -> decltype(element_type::sname(std::forward< Args >(args)...))
 

Private Types

using state_name_t = std::pair< in_state_t, in_state_t >
 The semantics of the result states: unordered pair of input states. More...
 
using origins_t = std::map< state_t, state_name_t >
 State index -> pair of input automaton states. More...
 
using transition_map_t = transition_map< automaton_t, weightset_t, true >
 Fast maps label -> (weight, label). More...
 

Private Member Functions

state_t state_ (in_state_t s1, in_state_t s2)
 The state in the result automaton that corresponds to (s1, s2). More...
 

Private Attributes

automaton_t input_
 Input automaton. More...
 
transition_map_t transition_map_
 
pair_states_t pair_states_
 From state name to state index. More...
 
origins_t origins_
 From state index to state name. More...
 
singletons_t singletons_
 
state_t q0_ = this->null_state()
 
bool keep_initials_ = false
 

Additional Inherited Members

- Protected Attributes inherited from vcsn::detail::automaton_decorator< mutable_automaton< context_t_of< Aut > > >
automaton_t aut_
 The wrapped automaton, possibly const. More...
 

Detailed Description

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

The pair automaton is used by several algorithms for synchronizing words.

Definition at line 26 of file pair.hh.

Member Typedef Documentation

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

Definition at line 35 of file pair.hh.

template<Automaton Aut>
using vcsn::detail::pair_automaton_impl< Aut >::context_t = context_t_of<automaton_t>

Definition at line 37 of file pair.hh.

template<Automaton Aut>
template<typename Ctx = context_t>
using vcsn::detail::pair_automaton_impl< Aut >::fresh_automaton_t = mutable_automaton<Ctx>

When creating a copy of this automaton type.

Definition at line 50 of file pair.hh.

template<Automaton Aut>
using vcsn::detail::pair_automaton_impl< Aut >::in_state_t = state_t_of<automaton_t>

Definition at line 53 of file pair.hh.

Definition at line 54 of file pair.hh.

template<Automaton Aut>
using vcsn::detail::pair_automaton_impl< Aut >::origins_t = std::map<state_t, state_name_t>
private

State index -> pair of input automaton states.

Definition at line 64 of file pair.hh.

Definition at line 165 of file pair.hh.

template<Automaton Aut>
using vcsn::detail::pair_automaton_impl< Aut >::self_t = pair_automaton_impl

Definition at line 36 of file pair.hh.

template<Automaton Aut>
using vcsn::detail::pair_automaton_impl< Aut >::singletons_t = std::vector<state_t>

Definition at line 158 of file pair.hh.

template<Automaton Aut>
using vcsn::detail::pair_automaton_impl< Aut >::state_name_t = std::pair<in_state_t, in_state_t>
private

The semantics of the result states: unordered pair of input states.

Definition at line 62 of file pair.hh.

template<Automaton Aut>
using vcsn::detail::pair_automaton_impl< Aut >::state_t = typename super_t::state_t

Definition at line 57 of file pair.hh.

Definition at line 52 of file pair.hh.

template<Automaton Aut>
using vcsn::detail::pair_automaton_impl< Aut >::transition_map_t = transition_map<automaton_t, weightset_t, true>
private

Fast maps label -> (weight, label).

Definition at line 230 of file pair.hh.

template<Automaton Aut>
using vcsn::detail::pair_automaton_impl< Aut >::weight_t = typename weightset_t::value_t

Definition at line 56 of file pair.hh.

template<Automaton Aut>
using vcsn::detail::pair_automaton_impl< Aut >::weightset_t = weightset_t_of<automaton_t>

Definition at line 55 of file pair.hh.

Constructor & Destructor Documentation

Member Function Documentation

template<Automaton Aut>
const pair_states_t& vcsn::detail::pair_automaton_impl< Aut >::get_map_pair ( ) const
inline

Definition at line 166 of file pair.hh.

References vcsn::detail::pair_automaton_impl< Aut >::pair_states_.

template<Automaton Aut>
const state_name_t& vcsn::detail::pair_automaton_impl< Aut >::get_origin ( state_t  s) const
inline

Definition at line 177 of file pair.hh.

References vcsn::detail::pair_automaton_impl< Aut >::origins(), and vcsn::require().

Referenced by vcsn::detail::pair_automaton_impl< Aut >::is_singleton().

Here is the call graph for this function:

template<Automaton Aut>
state_t vcsn::detail::pair_automaton_impl< Aut >::get_q0 ( ) const
inline

Definition at line 140 of file pair.hh.

template<Automaton Aut>
bool vcsn::detail::pair_automaton_impl< Aut >::is_singleton ( state_t  s) const
inline

Definition at line 147 of file pair.hh.

References vcsn::detail::pair_automaton_impl< Aut >::get_origin(), vcsn::detail::pair_automaton_impl< Aut >::keep_initials_, and vcsn::detail::pair_automaton_impl< Aut >::q0_.

Here is the call graph for this function:

template<Automaton Aut>
const origins_t& vcsn::detail::pair_automaton_impl< Aut >::origins ( ) const
inline

A map from result state to tuple of original states.

Definition at line 172 of file pair.hh.

References vcsn::detail::pair_automaton_impl< Aut >::origins_.

Referenced by vcsn::detail::pair_automaton_impl< Aut >::get_origin(), and vcsn::detail::pair_automaton_impl< Aut >::state_has_name().

template<Automaton Aut>
std::ostream& vcsn::detail::pair_automaton_impl< Aut >::print_set ( std::ostream &  o,
format  fmt = {} 
) const
inline

Definition at line 133 of file pair.hh.

template<Automaton Aut>
std::ostream& vcsn::detail::pair_automaton_impl< Aut >::print_state_name ( state_t  ss,
std::ostream &  o,
format  fmt = {},
bool  delimit = false 
) const
inline

Definition at line 190 of file pair.hh.

template<Automaton Aut>
const singletons_t& vcsn::detail::pair_automaton_impl< Aut >::singletons ( ) const
inline

Definition at line 159 of file pair.hh.

References vcsn::detail::pair_automaton_impl< Aut >::singletons_.

template<Automaton Aut>
static symbol vcsn::detail::pair_automaton_impl< Aut >::sname ( )
inlinestatic

Definition at line 126 of file pair.hh.

References vcsn::sname().

Here is the call graph for this function:

template<Automaton Aut>
state_t vcsn::detail::pair_automaton_impl< Aut >::state_ ( in_state_t  s1,
in_state_t  s2 
)
inlineprivate

The state in the result automaton that corresponds to (s1, s2).

Allocate it if needed.

Definition at line 216 of file pair.hh.

References vcsn::detail::pair_automaton_impl< Aut >::keep_initials_, vcsn::make_unordered_pair(), vcsn::detail::pair_automaton_impl< Aut >::pair_states_, and vcsn::detail::pair_automaton_impl< Aut >::q0_.

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

Here is the call graph for this function:

template<Automaton Aut>
bool vcsn::detail::pair_automaton_impl< Aut >::state_has_name ( state_t  s) const
inline

Definition at line 184 of file pair.hh.

References vcsn::has(), and vcsn::detail::pair_automaton_impl< Aut >::origins().

Here is the call graph for this function:

Member Data Documentation

template<Automaton Aut>
automaton_t vcsn::detail::pair_automaton_impl< Aut >::input_
private

Input automaton.

Definition at line 228 of file pair.hh.

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

template<Automaton Aut>
origins_t vcsn::detail::pair_automaton_impl< Aut >::origins_
private

From state index to state name.

Definition at line 235 of file pair.hh.

Referenced by vcsn::detail::pair_automaton_impl< Aut >::origins(), and vcsn::detail::pair_automaton_impl< Aut >::pair_automaton_impl().

template<Automaton Aut>
transition_map_t vcsn::detail::pair_automaton_impl< Aut >::transition_map_
private

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