Awali
Another Weighted Automata library
Data Structures | Public Types | Public Member Functions | Data Fields
awali::sttc::internal::transition_map< Aut, WeightSet, Deterministic, AllOut > Struct Template Reference

Cache the outgoing transitions of an automaton as efficient maps label -> vector<(weight, dst)>. More...

#include <transition_map.hh>

Data Structures

struct  transition
 

Public Types

using map_t = std::map< label_t_of< Aut >, transitions_t >
 
using maps_t = std::map< state_t, map_t >
 
using transitions_t = typename std::conditional< Deterministic, transition, std::vector< transition > >::type
 
using weight_t = typename weightset_t::value_t
 
using weightset_t = WeightSet
 

Public Member Functions

 transition_map (const Aut &aut)
 
 transition_map (const Aut &aut, const weightset_t &ws)
 
map_tbuild_map_ (typename maps_t::iterator lb, state_t s)
 Build and return the transition map for state s, store at res. 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...
 
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_toperator[] (state_t s)
 

Data Fields

const Aut & aut_
 The automaton whose transitions are cached. More...
 
maps_t maps_
 
const weightset_tws_
 The result weightset. More...
 

Detailed Description

template<typename Aut, typename WeightSet = weightset_t_of<Aut>, bool Deterministic = false, bool AllOut = false>
struct awali::sttc::internal::transition_map< Aut, WeightSet, Deterministic, AllOut >

Cache the outgoing transitions of an automaton as efficient maps label -> vector<(weight, dst)>.

Easy to zip.

Template Parameters
AutThe automaton type.
WeightSetThe set of weights into which the weights will be converted.
DeterministicWhether the automaton is guaranteed to be deterministic. If it is, transition_map[state][label] returns a single result, otherwise a vector.
AllOutWhether even the transitions to post() (via the special label) are to be included.

Data Structure Documentation

◆ awali::sttc::internal::transition_map::transition

struct awali::sttc::internal::transition_map::transition

template<typename Aut, typename WeightSet = weightset_t_of<Aut>, bool Deterministic = false, bool AllOut = false>
struct awali::sttc::internal::transition_map< Aut, WeightSet, Deterministic, AllOut >::transition

Data Fields
state_t dst
weight_t wgt The (converted) weight.

Member Typedef Documentation

◆ map_t

template<typename Aut , typename WeightSet = weightset_t_of<Aut>, bool Deterministic = false, bool AllOut = false>
using awali::sttc::internal::transition_map< Aut, WeightSet, Deterministic, AllOut >::map_t = std::map<label_t_of<Aut>, transitions_t>

◆ maps_t

template<typename Aut , typename WeightSet = weightset_t_of<Aut>, bool Deterministic = false, bool AllOut = false>
using awali::sttc::internal::transition_map< Aut, WeightSet, Deterministic, AllOut >::maps_t = std::map<state_t, map_t>

◆ transitions_t

template<typename Aut , typename WeightSet = weightset_t_of<Aut>, bool Deterministic = false, bool AllOut = false>
using awali::sttc::internal::transition_map< Aut, WeightSet, Deterministic, AllOut >::transitions_t = typename std::conditional<Deterministic, transition, std::vector<transition> >::type

◆ weight_t

template<typename Aut , typename WeightSet = weightset_t_of<Aut>, bool Deterministic = false, bool AllOut = false>
using awali::sttc::internal::transition_map< Aut, WeightSet, Deterministic, AllOut >::weight_t = typename weightset_t::value_t

◆ weightset_t

template<typename Aut , typename WeightSet = weightset_t_of<Aut>, bool Deterministic = false, bool AllOut = false>
using awali::sttc::internal::transition_map< Aut, WeightSet, Deterministic, AllOut >::weightset_t = WeightSet

Constructor & Destructor Documentation

◆ transition_map() [1/2]

template<typename Aut , typename WeightSet = weightset_t_of<Aut>, bool Deterministic = false, bool AllOut = false>
awali::sttc::internal::transition_map< Aut, WeightSet, Deterministic, AllOut >::transition_map ( const Aut &  aut,
const weightset_t ws 
)

◆ transition_map() [2/2]

template<typename Aut , typename WeightSet = weightset_t_of<Aut>, bool Deterministic = false, bool AllOut = false>
awali::sttc::internal::transition_map< Aut, WeightSet, Deterministic, AllOut >::transition_map ( const Aut &  aut)

Member Function Documentation

◆ build_map_()

template<typename Aut , typename WeightSet = weightset_t_of<Aut>, bool Deterministic = false, bool AllOut = false>
map_t& awali::sttc::internal::transition_map< Aut, WeightSet, Deterministic, AllOut >::build_map_ ( typename maps_t::iterator  lb,
state_t  s 
)

Build and return the transition map for state s, store at res.

Insert it in the cache.

◆ insert_() [1/2]

template<typename Aut , typename WeightSet = weightset_t_of<Aut>, bool Deterministic = false, bool AllOut = false>
template<bool Deterministic_>
void awali::sttc::internal::transition_map< Aut, WeightSet, Deterministic, AllOut >::insert_ ( map_t map,
label_t_of< Aut >  l,
transition  t,
typename std::enable_if< Deterministic_ >::type *  = nullptr 
)

Insert l -> t in map.

◆ insert_() [2/2]

template<typename Aut , typename WeightSet = weightset_t_of<Aut>, bool Deterministic = false, bool AllOut = false>
template<bool Deterministic_>
void awali::sttc::internal::transition_map< Aut, WeightSet, Deterministic, AllOut >::insert_ ( map_t map,
label_t_of< Aut >  l,
transition  t,
typename std::enable_if<!Deterministic_ >::type *  = nullptr 
)

Insert l -> t in map.

◆ operator[]()

template<typename Aut , typename WeightSet = weightset_t_of<Aut>, bool Deterministic = false, bool AllOut = false>
map_t& awali::sttc::internal::transition_map< Aut, WeightSet, Deterministic, AllOut >::operator[] ( state_t  s)

Field Documentation

◆ aut_

template<typename Aut , typename WeightSet = weightset_t_of<Aut>, bool Deterministic = false, bool AllOut = false>
const Aut& awali::sttc::internal::transition_map< Aut, WeightSet, Deterministic, AllOut >::aut_

The automaton whose transitions are cached.

◆ maps_

template<typename Aut , typename WeightSet = weightset_t_of<Aut>, bool Deterministic = false, bool AllOut = false>
maps_t awali::sttc::internal::transition_map< Aut, WeightSet, Deterministic, AllOut >::maps_

◆ ws_

template<typename Aut , typename WeightSet = weightset_t_of<Aut>, bool Deterministic = false, bool AllOut = false>
const weightset_t& awali::sttc::internal::transition_map< Aut, WeightSet, Deterministic, AllOut >::ws_

The result weightset.


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