Awali
Another Weighted Automata library
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes
awali::sttc::zz< N > Class Template Reference

The cyclic semiring with characteristic N. More...

#include <zz.hh>

Public Types

using finite_t = bool
 
using self_type = zz< N >
 
using value_t = int
 

Public Member Functions

 zz ()
 
std::ostream & print_set (std::ostream &o, const std::string &format="text") const
 
template<unsigned version = version::fsm_json>
value_t value_from_json (json::node_t *p) const
 
template<unsigned version = version::fsm_json>
json::node_tvalue_to_json (value_t v) const
 
std::string vname (bool=true) const
 

Static Public Member Functions

static value_t add (const value_t l, const value_t r)
 
static value_t conv (self_type, value_t v)
 
static value_t conv (std::istream &stream)
 
static bool equals (const value_t l, const value_t r)
 
static size_t hash (value_t v)
 
static constexpr bool is_commutative_semiring ()
 
static bool is_one (const value_t v)
 
constexpr static bool is_special (value_t)
 
static bool is_zero (const value_t v)
 
static value_t ldiv (const value_t l, const value_t r)
 
static bool less_than (value_t lhs, value_t rhs)
 Whether lhs < rhs. More...
 
static zz< N > make (std::istream &is)
 Build from the description in is. More...
 
static value_t mul (const value_t l, const value_t r)
 
static value_t one ()
 
static value_t parse (const std::string &s, size_t &p)
 
static std::ostream & print (const value_t v, std::ostream &o, const std::string &format="text")
 
static value_t rdiv (const value_t l, const value_t r)
 
static constexpr bool show_one ()
 
static std::string sname ()
 
static value_t star (const value_t v)
 
static constexpr star_status_t star_status ()
 
static value_t sub (const value_t l, const value_t r)
 
template<unsigned version = version::fsm_json>
static json::node_tto_json ()
 
static value_t transpose (const value_t v)
 
static value_t zero ()
 

Static Public Attributes

static const finite_t finite =true
 

Detailed Description

template<unsigned int N>
class awali::sttc::zz< N >

The cyclic semiring with characteristic N.

The type of values are int.

Template Parameters
Nan integer larger than 1: the characteristic of the semiring.

Member Typedef Documentation

◆ finite_t

template<unsigned int N>
using awali::sttc::zz< N >::finite_t = bool

◆ self_type

template<unsigned int N>
using awali::sttc::zz< N >::self_type = zz<N>

◆ value_t

template<unsigned int N>
using awali::sttc::zz< N >::value_t = int

Constructor & Destructor Documentation

◆ zz()

template<unsigned int N>
awali::sttc::zz< N >::zz ( )

Member Function Documentation

◆ add()

template<unsigned int N>
static value_t awali::sttc::zz< N >::add ( const value_t  l,
const value_t  r 
)
static

◆ conv() [1/2]

template<unsigned int N>
static value_t awali::sttc::zz< N >::conv ( self_type  ,
value_t  v 
)
static

◆ conv() [2/2]

template<unsigned int N>
static value_t awali::sttc::zz< N >::conv ( std::istream &  stream)
static

◆ equals()

template<unsigned int N>
static bool awali::sttc::zz< N >::equals ( const value_t  l,
const value_t  r 
)
static

◆ hash()

template<unsigned int N>
static size_t awali::sttc::zz< N >::hash ( value_t  v)
static

◆ is_commutative_semiring()

template<unsigned int N>
static constexpr bool awali::sttc::zz< N >::is_commutative_semiring ( )
staticconstexpr

◆ is_one()

template<unsigned int N>
static bool awali::sttc::zz< N >::is_one ( const value_t  v)
static

◆ is_special()

template<unsigned int N>
constexpr static bool awali::sttc::zz< N >::is_special ( value_t  )
staticconstexpr

◆ is_zero()

template<unsigned int N>
static bool awali::sttc::zz< N >::is_zero ( const value_t  v)
static

◆ ldiv()

template<unsigned int N>
static value_t awali::sttc::zz< N >::ldiv ( const value_t  l,
const value_t  r 
)
static

◆ less_than()

template<unsigned int N>
static bool awali::sttc::zz< N >::less_than ( value_t  lhs,
value_t  rhs 
)
static

Whether lhs < rhs.

◆ make()

template<unsigned int N>
static zz<N> awali::sttc::zz< N >::make ( std::istream &  is)
static

Build from the description in is.

◆ mul()

template<unsigned int N>
static value_t awali::sttc::zz< N >::mul ( const value_t  l,
const value_t  r 
)
static

◆ one()

template<unsigned int N>
static value_t awali::sttc::zz< N >::one ( )
static

◆ parse()

template<unsigned int N>
static value_t awali::sttc::zz< N >::parse ( const std::string &  s,
size_t &  p 
)
static

◆ print()

template<unsigned int N>
static std::ostream& awali::sttc::zz< N >::print ( const value_t  v,
std::ostream &  o,
const std::string &  format = "text" 
)
static

◆ print_set()

template<unsigned int N>
std::ostream& awali::sttc::zz< N >::print_set ( std::ostream &  o,
const std::string &  format = "text" 
) const

◆ rdiv()

template<unsigned int N>
static value_t awali::sttc::zz< N >::rdiv ( const value_t  l,
const value_t  r 
)
static

◆ show_one()

template<unsigned int N>
static constexpr bool awali::sttc::zz< N >::show_one ( )
staticconstexpr

◆ sname()

template<unsigned int N>
static std::string awali::sttc::zz< N >::sname ( )
static

◆ star()

template<unsigned int N>
static value_t awali::sttc::zz< N >::star ( const value_t  v)
static

◆ star_status()

template<unsigned int N>
static constexpr star_status_t awali::sttc::zz< N >::star_status ( )
staticconstexpr

◆ sub()

template<unsigned int N>
static value_t awali::sttc::zz< N >::sub ( const value_t  l,
const value_t  r 
)
static

◆ to_json()

template<unsigned int N>
template<unsigned version = version::fsm_json>
static json::node_t* awali::sttc::zz< N >::to_json ( )
static

◆ transpose()

template<unsigned int N>
static value_t awali::sttc::zz< N >::transpose ( const value_t  v)
static

◆ value_from_json()

template<unsigned int N>
template<unsigned version = version::fsm_json>
value_t awali::sttc::zz< N >::value_from_json ( json::node_t p) const

◆ value_to_json()

template<unsigned int N>
template<unsigned version = version::fsm_json>
json::node_t* awali::sttc::zz< N >::value_to_json ( value_t  v) const

◆ vname()

template<unsigned int N>
std::string awali::sttc::zz< N >::vname ( bool  = true) const

◆ zero()

template<unsigned int N>
static value_t awali::sttc::zz< N >::zero ( )
static

Field Documentation

◆ finite

template<unsigned int N>
const finite_t awali::sttc::zz< N >::finite =true
static

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