Vcsn
2.4
Be Rational
|
Copy an automaton. More...
#include <copy.hh>
Public Types | |
using | in_automaton_t = AutIn |
using | out_automaton_t = AutOut |
using | in_state_t = state_t_of< in_automaton_t > |
using | out_state_t = state_t_of< out_automaton_t > |
using | state_map_t = std::unordered_map< in_state_t, out_state_t > |
input state -> output state. More... | |
Public Member Functions | |
copier (const in_automaton_t &in, out_automaton_t &out, bool safe=true) | |
Prepare for an automaton full/partial duplication. More... | |
template<typename KeepState , typename KeepTrans > | |
void | operator() (KeepState keep_state, KeepTrans keep_trans) |
Copy some states, and some transitions. More... | |
template<typename Transitions > | |
auto | operator() (const Transitions &ts) -> decltype(ts[0]==in_->null_transition(), void()) |
Copy some transitions, and their corresponding states. More... | |
void | operator() (const transition_t_of< in_automaton_t > &t) |
Copy one transition, and its corresponding states. More... | |
void | operator() () |
Copy all the states, and all the transitions. More... | |
const state_map_t & | state_map () const |
A map from original state to result state. More... | |
state_map_t & | state_map () |
A map from original state to result state. More... | |
Private Member Functions | |
out_state_t | state (const in_state_t &s) |
The out state corresponding to the in-state s. More... | |
Private Attributes | |
in_automaton_t | in_ |
Input automaton. More... | |
out_automaton_t | out_ |
Output automaton. More... | |
bool | safe_ = true |
whether the input automaton is in normal form and never has two transitions with same (src, label, dst). More... | |
state_map_t | out_state_ |
input state -> output state. More... | |
Copy an automaton.
AutIn | The type of the automaton to copy. |
AutOut | The type of the resulting automaton. |
using vcsn::detail::copier< AutIn, AutOut >::in_automaton_t = AutIn |
using vcsn::detail::copier< AutIn, AutOut >::in_state_t = state_t_of<in_automaton_t> |
using vcsn::detail::copier< AutIn, AutOut >::out_automaton_t = AutOut |
using vcsn::detail::copier< AutIn, AutOut >::out_state_t = state_t_of<out_automaton_t> |
using vcsn::detail::copier< AutIn, AutOut >::state_map_t = std::unordered_map<in_state_t, out_state_t> |
|
inline |
|
inline |
Copy some states, and some transitions.
keep_state | a predicate to recognize states to keep |
keep_trans | a predicate to recognize transitions to keep |
Transitions are kept only if both criteria are satisfied: the transition is kept, and its source and destination too.
Definition at line 161 of file copy.hh.
References vcsn::detail::all_transitions().
|
inline |
Copy some transitions, and their corresponding states.
ts | the transitions to keep. |
Definition at line 191 of file copy.hh.
References vcsn::detail::copier< AutIn, AutOut >::operator()().
|
inline |
Copy one transition, and its corresponding states.
t | the transition to copy. |
Definition at line 201 of file copy.hh.
References vcsn::detail::copier< AutIn, AutOut >::state().
|
inline |
Copy all the states, and all the transitions.
Definition at line 212 of file copy.hh.
Referenced by vcsn::detail::copier< AutIn, AutOut >::operator()().
|
inlineprivate |
The out state corresponding to the in-state s.
If unknown, allocate it.
Definition at line 233 of file copy.hh.
References vcsn::res.
Referenced by vcsn::detail::copier< AutIn, AutOut >::operator()().
|
inline |
A map from original state to result state.
Definition at line 219 of file copy.hh.
References vcsn::detail::copier< AutIn, AutOut >::out_state_.
|
inline |
A map from original state to result state.
Definition at line 225 of file copy.hh.
References vcsn::detail::copier< AutIn, AutOut >::out_state_.
|
private |
|
private |
|
private |
input state -> output state.
Definition at line 134 of file copy.hh.
Referenced by vcsn::detail::copier< AutIn, AutOut >::state_map().
|
private |