Awali
Another Weighted Automata library
Public Types | Public Member Functions | Static Public Member Functions
awali::sttc::context< LabelSet, WeightSet > Class Template Reference

carries the algebraic settings of automata More...

#include <context.hh>

Public Types

enum  {
  is_lal = std::is_same<kind_t, labels_are_letters>::value , is_lan = std::is_same<kind_t, labels_are_nullable>::value , is_lao = std::is_same<kind_t, labels_are_one>::value , is_lar = std::is_same<kind_t, labels_are_ratexps>::value ,
  is_lat = std::is_same<kind_t, labels_are_tuples>::value , is_law = std::is_same<kind_t, labels_are_words>::value
}
 
using const_visitor = sttc::rat::const_visitor< label_t, weight_t >
 Type of RatExp visitor. More...
 
using kind_t = typename labelset_t::kind_t
 
using label_t = typename labelset_t::value_t
 Type of transition labels, and type of RatExp atoms. More...
 
using labelset_ptr = std::shared_ptr< const labelset_t >
 
using labelset_t = LabelSet
 
using node_t = rat::node< label_t, weight_t >
 Type of RatExp ratexps objects. More...
 
using ratexp_t = std::shared_ptr< const node_t >
 
using weight_t = typename weightset_t::value_t
 Type of weights. More...
 
using weightset_ptr = std::shared_ptr< const weightset_t >
 
using weightset_t = WeightSet
 

Public Member Functions

template<typename LabelSet2 = labelset_t>
 context ()
 Build a context whose labelset constructor takes no argument. More...
 
 context (const context &that)
 
 context (const labelset_ptr &ls, const weightset_ptr &ws)
 
 context (const labelset_t &ls, const weightset_t &ws={})
 Build a context. More...
 
template<typename LabelSet2 = labelset_t>
 context (const std::initializer_list< typename LabelSet2::letter_t > &gs, const weightset_t &ws={})
 Build a context. More...
 
const labelset_ptrlabelset () const
 
contextoperator= (const context &other)=default
 
std::ostream & print_set (std::ostream &o, const std::string &format="text") const
 
template<unsigned version = version::fsm_json>
json::node_tto_json () const
 
std::string vname (bool full=true) const
 
const weightset_ptrweightset () const
 

Static Public Member Functions

static constexpr bool has_one ()
 
static context make (std::istream &is)
 Build from the description in is. More...
 
static std::string sname ()
 The name of this context, built from its parameters. More...
 

Detailed Description

template<typename LabelSet, typename WeightSet>
class awali::sttc::context< LabelSet, WeightSet >

carries the algebraic settings of automata

Template Parameters
LabelSetthe type that manages labels
WeightSetthe type that manages weights

Member Typedef Documentation

◆ const_visitor

template<typename LabelSet , typename WeightSet >
using awali::sttc::context< LabelSet, WeightSet >::const_visitor = sttc::rat::const_visitor<label_t, weight_t>

Type of RatExp visitor.

◆ kind_t

template<typename LabelSet , typename WeightSet >
using awali::sttc::context< LabelSet, WeightSet >::kind_t = typename labelset_t::kind_t

◆ label_t

template<typename LabelSet , typename WeightSet >
using awali::sttc::context< LabelSet, WeightSet >::label_t = typename labelset_t::value_t

Type of transition labels, and type of RatExp atoms.

◆ labelset_ptr

template<typename LabelSet , typename WeightSet >
using awali::sttc::context< LabelSet, WeightSet >::labelset_ptr = std::shared_ptr<const labelset_t>

◆ labelset_t

template<typename LabelSet , typename WeightSet >
using awali::sttc::context< LabelSet, WeightSet >::labelset_t = LabelSet

◆ node_t

template<typename LabelSet , typename WeightSet >
using awali::sttc::context< LabelSet, WeightSet >::node_t = rat::node<label_t, weight_t>

Type of RatExp ratexps objects.

◆ ratexp_t

template<typename LabelSet , typename WeightSet >
using awali::sttc::context< LabelSet, WeightSet >::ratexp_t = std::shared_ptr<const node_t>

◆ weight_t

template<typename LabelSet , typename WeightSet >
using awali::sttc::context< LabelSet, WeightSet >::weight_t = typename weightset_t::value_t

Type of weights.

◆ weightset_ptr

template<typename LabelSet , typename WeightSet >
using awali::sttc::context< LabelSet, WeightSet >::weightset_ptr = std::shared_ptr<const weightset_t>

◆ weightset_t

template<typename LabelSet , typename WeightSet >
using awali::sttc::context< LabelSet, WeightSet >::weightset_t = WeightSet

Member Enumeration Documentation

◆ anonymous enum

template<typename LabelSet , typename WeightSet >
anonymous enum
Enumerator
is_lal 
is_lan 
is_lao 
is_lar 
is_lat 
is_law 

Constructor & Destructor Documentation

◆ context() [1/5]

template<typename LabelSet , typename WeightSet >
awali::sttc::context< LabelSet, WeightSet >::context ( const context< LabelSet, WeightSet > &  that)

◆ context() [2/5]

template<typename LabelSet , typename WeightSet >
awali::sttc::context< LabelSet, WeightSet >::context ( const labelset_ptr ls,
const weightset_ptr ws 
)
Parameters
lsthe labelset
wsthe weightset

◆ context() [3/5]

template<typename LabelSet , typename WeightSet >
awali::sttc::context< LabelSet, WeightSet >::context ( const labelset_t ls,
const weightset_t ws = {} 
)

Build a context.

Parameters
lsthe labelset
wsthe weightset

◆ context() [4/5]

template<typename LabelSet , typename WeightSet >
template<typename LabelSet2 = labelset_t>
awali::sttc::context< LabelSet, WeightSet >::context ( const std::initializer_list< typename LabelSet2::letter_t > &  gs,
const weightset_t ws = {} 
)

Build a context.

Parameters
gsthe generators
wsthe weightset

◆ context() [5/5]

template<typename LabelSet , typename WeightSet >
template<typename LabelSet2 = labelset_t>
awali::sttc::context< LabelSet, WeightSet >::context ( )

Build a context whose labelset constructor takes no argument.

Member Function Documentation

◆ has_one()

template<typename LabelSet , typename WeightSet >
static constexpr bool awali::sttc::context< LabelSet, WeightSet >::has_one ( )
staticconstexpr

◆ labelset()

template<typename LabelSet , typename WeightSet >
const labelset_ptr& awali::sttc::context< LabelSet, WeightSet >::labelset ( ) const

◆ make()

template<typename LabelSet , typename WeightSet >
static context awali::sttc::context< LabelSet, WeightSet >::make ( std::istream &  is)
static

Build from the description in is.

◆ operator=()

template<typename LabelSet , typename WeightSet >
context& awali::sttc::context< LabelSet, WeightSet >::operator= ( const context< LabelSet, WeightSet > &  other)
default

◆ print_set()

template<typename LabelSet , typename WeightSet >
std::ostream& awali::sttc::context< LabelSet, WeightSet >::print_set ( std::ostream &  o,
const std::string &  format = "text" 
) const

◆ sname()

template<typename LabelSet , typename WeightSet >
static std::string awali::sttc::context< LabelSet, WeightSet >::sname ( )
static

The name of this context, built from its parameters.

E.g., "lal_char_b", "law_char_zmin".

◆ to_json()

template<typename LabelSet , typename WeightSet >
template<unsigned version = version::fsm_json>
json::node_t* awali::sttc::context< LabelSet, WeightSet >::to_json ( ) const

◆ vname()

template<typename LabelSet , typename WeightSet >
std::string awali::sttc::context< LabelSet, WeightSet >::vname ( bool  full = true) const

◆ weightset()

template<typename LabelSet , typename WeightSet >
const weightset_ptr& awali::sttc::context< LabelSet, WeightSet >::weightset ( ) const

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