Awali
Another Weighted Automata library
|
Linear combination of labels: map labels to weights. More...
#include <polynomialset.hh>
Public Types | |
using | context_t = Context |
using | label_t = typename labelset_t::value_t |
Polynomials over labels. More... | |
using | labelset_ptr = typename context_t::labelset_ptr |
using | labelset_t = labelset_t_of< context_t > |
using | monomial_t = typename value_t::value_type |
A pair <label, weight>. More... | |
using | polynomialset_t = polynomialset< context_t > |
using | self_type = polynomialset< Context > |
using | value_t = std::map< label_t, weight_t, internal::less< labelset_t > > |
using | weight_t = weight_t_of< context_t > |
using | weightset_ptr = typename context_t::weightset_ptr |
using | weightset_t = weightset_t_of< context_t > |
Public Member Functions | |
polynomialset ()=delete | |
polynomialset (const context_t &ctx) | |
polynomialset (const polynomialset &)=default | |
value_t | add (const value_t &l, const value_t &r) const |
The sum of polynomials l and r. More... | |
value_t & | add_here (value_t &v, const label_t &l, const weight_t k) const |
v += (l, k). More... | |
value_t & | add_here (value_t &v, const monomial_t &p) const |
v += m. More... | |
value_t & | add_here (value_t &v, const value_t &p) const |
v += p. More... | |
value_t | conjunction (const value_t &l, const value_t &r) const |
The conjunction of polynomials l and r. More... | |
const context_t & | context () const |
template<typename C > | |
value_t | conv (const polynomialset< C > &sps, const typename polynomialset< C >::value_t &v) const |
Convert from another polynomialset to type_t. More... | |
template<typename WS > | |
value_t | conv (const WS &ws, const typename WS::value_t &v) const |
FIXME: use enable_if to prevent this from being instantiated when WS is a polynomialset. More... | |
value_t | conv (std::istream &i, const char sep='+') const |
Construct from a string. More... | |
value_t & | del_weight (value_t &v, const label_t &w) const |
Remove the monomial of w in v. More... | |
std::string | format (const monomial_t &m) const |
Format a monomial. More... | |
std::string | format (const value_t &v, const std::string &sep=" + ", const std::string &fmt="text") const |
const weight_t | get_weight (const value_t &v, const label_t &w) const ATTRIBUTE_PURE |
bool | is_one (const value_t &v) const ATTRIBUTE_PURE |
bool | is_zero (const value_t &v) const |
const labelset_ptr & | labelset () const |
value_t & | ldiv_here (const weight_t &w, value_t &v) const |
Left exterior division. More... | |
value_t | lmul (const weight_t &w, const value_t &v) const |
Left exterior product. More... | |
value_t | lmul_letter (const label_t &lhs, const value_t &v) const |
Left product by a label. More... | |
const monomial_t & | monomial_one () const |
value_t | mul (const value_t &l, const value_t &r) const |
The product of polynomials l and r. More... | |
const value_t & | one () const |
std::ostream & | print (const monomial_t &m, std::ostream &out, const std::string &format="text") const |
Print a monomial. More... | |
std::ostream & | print (const value_t &v, std::ostream &out, const std::string &format="text", const std::string &sep=" + ") const |
Print a value (a polynomial). More... | |
std::ostream & | print_set (std::ostream &o, const std::string &format="text") const |
value_t & | rdiv_here (value_t &v, const weight_t &w) const |
Right exterior division. More... | |
value_t | rmul (const value_t &v, const weight_t &w) const |
Right exterior product. More... | |
value_t | rmul_letter (const value_t &v, const label_t &rhs) const |
Right product. More... | |
value_t & | set_weight (value_t &v, const label_t &w, const weight_t k) const |
Set the monomial of w in v to weight k. More... | |
value_t | star (const value_t &v) const |
The star of polynomial v. More... | |
value_t | transpose (const value_t &v) const |
std::string | vname (bool full=true) const |
The dynamic name. More... | |
const weightset_ptr & | weightset () const |
const value_t & | zero () const |
Static Public Member Functions | |
static value_t | conv (self_type, value_t v) |
Conversion from (this and) other weightsets. More... | |
static bool | equals (const value_t &l, const value_t &r) ATTRIBUTE_PURE |
static size_t | hash (const monomial_t &m) |
static size_t | hash (const value_t &v) |
static value_t | ldiv (const value_t &l, const value_t &r) |
static bool | less_than (const value_t &lhs, const value_t &rhs) |
static self_type | make (std::istream &is) |
Build from the description in is. More... | |
static ATTRIBUTE_PURE bool | monomial_less_than (const monomial_t &lhs, const monomial_t &rhs) |
static value_t | rdiv (const value_t &, const value_t &) |
static constexpr bool | show_one () |
static std::string | sname () |
The static name. More... | |
static constexpr star_status_t | star_status () |
Linear combination of labels: map labels to weights.
Context | the LabelSet and WeightSet types. |
using awali::sttc::polynomialset< Context >::context_t = Context |
using awali::sttc::polynomialset< Context >::label_t = typename labelset_t::value_t |
Polynomials over labels.
using awali::sttc::polynomialset< Context >::labelset_ptr = typename context_t::labelset_ptr |
using awali::sttc::polynomialset< Context >::labelset_t = labelset_t_of<context_t> |
using awali::sttc::polynomialset< Context >::monomial_t = typename value_t::value_type |
A pair <label, weight>.
using awali::sttc::polynomialset< Context >::polynomialset_t = polynomialset<context_t> |
using awali::sttc::polynomialset< Context >::self_type = polynomialset<Context> |
using awali::sttc::polynomialset< Context >::value_t = std::map<label_t, weight_t, internal::less<labelset_t> > |
using awali::sttc::polynomialset< Context >::weight_t = weight_t_of<context_t> |
using awali::sttc::polynomialset< Context >::weightset_ptr = typename context_t::weightset_ptr |
using awali::sttc::polynomialset< Context >::weightset_t = weightset_t_of<context_t> |
|
delete |
|
default |
awali::sttc::polynomialset< Context >::polynomialset | ( | const context_t & | ctx | ) |
value_t awali::sttc::polynomialset< Context >::add | ( | const value_t & | l, |
const value_t & | r | ||
) | const |
The sum of polynomials l and r.
value_t& awali::sttc::polynomialset< Context >::add_here | ( | value_t & | v, |
const label_t & | l, | ||
const weight_t | k | ||
) | const |
v += (l, k).
value_t& awali::sttc::polynomialset< Context >::add_here | ( | value_t & | v, |
const monomial_t & | p | ||
) | const |
v += m.
value_t& awali::sttc::polynomialset< Context >::add_here | ( | value_t & | v, |
const value_t & | p | ||
) | const |
v += p.
value_t awali::sttc::polynomialset< Context >::conjunction | ( | const value_t & | l, |
const value_t & | r | ||
) | const |
The conjunction of polynomials l and r.
Not valid for all the labelsets.
const context_t& awali::sttc::polynomialset< Context >::context | ( | ) | const |
value_t awali::sttc::polynomialset< Context >::conv | ( | const polynomialset< C > & | sps, |
const typename polynomialset< C >::value_t & | v | ||
) | const |
Convert from another polynomialset to type_t.
value_t awali::sttc::polynomialset< Context >::conv | ( | const WS & | ws, |
const typename WS::value_t & | v | ||
) | const |
FIXME: use enable_if to prevent this from being instantiated when WS is a polynomialset.
Then use this same technique for ratexps.
|
static |
Conversion from (this and) other weightsets.
value_t awali::sttc::polynomialset< Context >::conv | ( | std::istream & | i, |
const char | sep = '+' |
||
) | const |
Construct from a string.
Somewhat more general than a mere reversal of "format", in particular "a+a" is properly understood as "<2>a" in char_z.
i | the stream to parse |
sep | the separator between monomials. |
value_t& awali::sttc::polynomialset< Context >::del_weight | ( | value_t & | v, |
const label_t & | w | ||
) | const |
Remove the monomial of w in v.
|
static |
std::string awali::sttc::polynomialset< Context >::format | ( | const monomial_t & | m | ) | const |
Format a monomial.
std::string awali::sttc::polynomialset< Context >::format | ( | const value_t & | v, |
const std::string & | sep = " + " , |
||
const std::string & | fmt = "text" |
||
) | const |
const weight_t awali::sttc::polynomialset< Context >::get_weight | ( | const value_t & | v, |
const label_t & | w | ||
) | const |
|
static |
|
static |
bool awali::sttc::polynomialset< Context >::is_one | ( | const value_t & | v | ) | const |
bool awali::sttc::polynomialset< Context >::is_zero | ( | const value_t & | v | ) | const |
const labelset_ptr& awali::sttc::polynomialset< Context >::labelset | ( | ) | const |
|
static |
value_t& awali::sttc::polynomialset< Context >::ldiv_here | ( | const weight_t & | w, |
value_t & | v | ||
) | const |
Left exterior division.
|
static |
value_t awali::sttc::polynomialset< Context >::lmul | ( | const weight_t & | w, |
const value_t & | v | ||
) | const |
Left exterior product.
value_t awali::sttc::polynomialset< Context >::lmul_letter | ( | const label_t & | lhs, |
const value_t & | v | ||
) | const |
Left product by a label.
|
static |
Build from the description in is.
|
static |
const monomial_t& awali::sttc::polynomialset< Context >::monomial_one | ( | ) | const |
value_t awali::sttc::polynomialset< Context >::mul | ( | const value_t & | l, |
const value_t & | r | ||
) | const |
The product of polynomials l and r.
const value_t& awali::sttc::polynomialset< Context >::one | ( | ) | const |
std::ostream& awali::sttc::polynomialset< Context >::print | ( | const monomial_t & | m, |
std::ostream & | out, | ||
const std::string & | format = "text" |
||
) | const |
Print a monomial.
std::ostream& awali::sttc::polynomialset< Context >::print | ( | const value_t & | v, |
std::ostream & | out, | ||
const std::string & | format = "text" , |
||
const std::string & | sep = " + " |
||
) | const |
Print a value (a polynomial).
std::ostream& awali::sttc::polynomialset< Context >::print_set | ( | std::ostream & | o, |
const std::string & | format = "text" |
||
) | const |
|
static |
value_t& awali::sttc::polynomialset< Context >::rdiv_here | ( | value_t & | v, |
const weight_t & | w | ||
) | const |
Right exterior division.
value_t awali::sttc::polynomialset< Context >::rmul | ( | const value_t & | v, |
const weight_t & | w | ||
) | const |
Right exterior product.
value_t awali::sttc::polynomialset< Context >::rmul_letter | ( | const value_t & | v, |
const label_t & | rhs | ||
) | const |
Right product.
value_t& awali::sttc::polynomialset< Context >::set_weight | ( | value_t & | v, |
const label_t & | w, | ||
const weight_t | k | ||
) | const |
Set the monomial of w in v to weight k.
|
staticconstexpr |
|
static |
The static name.
value_t awali::sttc::polynomialset< Context >::star | ( | const value_t & | v | ) | const |
The star of polynomial v.
|
staticconstexpr |
value_t awali::sttc::polynomialset< Context >::transpose | ( | const value_t & | v | ) | const |
std::string awali::sttc::polynomialset< Context >::vname | ( | bool | full = true | ) | const |
The dynamic name.
const weightset_ptr& awali::sttc::polynomialset< Context >::weightset | ( | ) | const |
const value_t& awali::sttc::polynomialset< Context >::zero | ( | ) | const |