![]() |
Vcsn
2.0
Be Rational
|
Cache the outgoing transitions of an automaton as efficient maps label -> vector<(weight, dst)>. More...
#include <transition-map.hh>
Classes | |
| struct | transition_ |
| Outgoing signature: weight, destination. More... | |
| struct | transition_< true, Dummy > |
| Outgoing signature: weight, destination, transition identifier. More... | |
Public Types | |
| using | state_t = state_t_of< Aut > |
| using | transition_t = transition_t_of< Aut > |
| using | weightset_t = WeightSet |
| using | weight_t = typename weightset_t::value_t |
| using | transition = transition_< KeepTransitions > |
| Outgoing signature: weight, destination, and possibly transition identifier. More... | |
| using | transitions_t = typename std::conditional< Deterministic, transition, std::vector< transition >>::type |
| using | map_t = std::map< label_t_of< Aut >, transitions_t > |
Public Member Functions | |
| transition_map (const Aut &aut, const weightset_t &ws) | |
| transition_map (const Aut &aut) | |
| map_t & | operator[] (state_t s) |
| Outgoing transitions of state s, sorted by label. More... | |
Private Types | |
| using | maps_t = std::map< state_t, map_t > |
Private Member Functions | |
| template<bool Deterministic_> | |
| void | insert_ (map_t &map, label_t_of< Aut > l, transition t, typename std::enable_if< Deterministic_ >::type *=nullptr) |
| Insert l -> t in map. More... | |
| template<bool Deterministic_> | |
| void | insert_ (map_t &map, label_t_of< Aut > l, transition t, typename std::enable_if<!Deterministic_ >::type *=nullptr) |
| Insert l -> t in map. More... | |
| map_t & | build_map_ (typename maps_t::iterator lb, state_t s) |
| Build and return the transition map for state s, store at res. More... | |
Private Attributes | |
| maps_t | maps_ |
| The cache. More... | |
| const Aut & | aut_ |
| The automaton whose transitions are cached. More... | |
| const weightset_t & | ws_ |
| The result weightset. More... | |
Cache the outgoing transitions of an automaton as efficient maps label -> vector<(weight, dst)>.
Easy to zip.
| Aut | The automaton type. |
| WeightSet | The set of weights into which the weights will be converted. |
| Deterministic | Whether the automaton is guaranteed to be deterministic. If it is, transition_map[state][label] returns a single result, otherwise a vector. |
| AllOut | Whether even the transitions to post() (via the special label) are to be included. |
| KeepTransitions | If enabled, add a "transition" field to the cache that allows to recover the transition id. |
Definition at line 33 of file transition-map.hh.
| using vcsn::detail::transition_map< Aut, WeightSet, Deterministic, AllOut, KeepTransitions >::map_t = std::map<label_t_of<Aut>, transitions_t> |
Definition at line 73 of file transition-map.hh.
|
private |
Definition at line 95 of file transition-map.hh.
| using vcsn::detail::transition_map< Aut, WeightSet, Deterministic, AllOut, KeepTransitions >::state_t = state_t_of<Aut> |
Definition at line 36 of file transition-map.hh.
| using vcsn::detail::transition_map< Aut, WeightSet, Deterministic, AllOut, KeepTransitions >::transition = transition_<KeepTransitions> |
Outgoing signature: weight, destination, and possibly transition identifier.
Definition at line 67 of file transition-map.hh.
| using vcsn::detail::transition_map< Aut, WeightSet, Deterministic, AllOut, KeepTransitions >::transition_t = transition_t_of<Aut> |
Definition at line 37 of file transition-map.hh.
| using vcsn::detail::transition_map< Aut, WeightSet, Deterministic, AllOut, KeepTransitions >::transitions_t = typename std::conditional<Deterministic, transition, std::vector<transition>>::type |
Definition at line 72 of file transition-map.hh.
| using vcsn::detail::transition_map< Aut, WeightSet, Deterministic, AllOut, KeepTransitions >::weight_t = typename weightset_t::value_t |
Definition at line 39 of file transition-map.hh.
| using vcsn::detail::transition_map< Aut, WeightSet, Deterministic, AllOut, KeepTransitions >::weightset_t = WeightSet |
Definition at line 38 of file transition-map.hh.
|
inline |
Definition at line 75 of file transition-map.hh.
|
inline |
Definition at line 80 of file transition-map.hh.
|
inlineprivate |
Build and return the transition map for state s, store at res.
Insert it in the cache.
Definition at line 120 of file transition-map.hh.
Referenced by vcsn::detail::transition_map< automaton_t, weightset_t_of< automaton_t >, true >::operator[]().
|
inlineprivate |
Insert l -> t in map.
Definition at line 100 of file transition-map.hh.
|
inlineprivate |
Insert l -> t in map.
Definition at line 110 of file transition-map.hh.
|
inline |
Outgoing transitions of state s, sorted by label.
Definition at line 85 of file transition-map.hh.
|
private |
The automaton whose transitions are cached.
Definition at line 137 of file transition-map.hh.
Referenced by vcsn::detail::transition_map< automaton_t, weightset_t_of< automaton_t >, true >::build_map_().
|
private |
The cache.
Definition at line 135 of file transition-map.hh.
Referenced by vcsn::detail::transition_map< automaton_t, weightset_t_of< automaton_t >, true >::build_map_(), and vcsn::detail::transition_map< automaton_t, weightset_t_of< automaton_t >, true >::operator[]().
|
private |
The result weightset.
Definition at line 139 of file transition-map.hh.
Referenced by vcsn::detail::transition_map< automaton_t, weightset_t_of< automaton_t >, true >::build_map_().