Vcsn  2.8
Be Rational
vcsn::detail::polynomialset_impl< Context, Kind > Class Template Reference

Linear combination of labels: map labels to weights. More...

#include <fwd.hh>

Collaboration diagram for vcsn::detail::polynomialset_impl< Context, Kind >:

Classes

struct  norm_
 In the general case, normalize by the first (non null) weight. More...
 
struct  norm_< polynomialset< Ctx, Knd >, Dummy >
 Compute the left GCD of weights which are polynomials. More...
 
struct  norm_< z, Dummy >
 For Z, take the GCD, with the sign of the first value. More...
 

Public Types

using self_t = polynomialset< Context, Kind >
 
using context_t = Context
 
using labelset_t = labelset_t_of< context_t >
 
using weightset_t = weightset_t_of< context_t >
 
using labelset_ptr = typename context_t::labelset_ptr
 
using weightset_ptr = typename context_t::weightset_ptr
 
using label_t = typename labelset_t::value_t
 Polynomials over labels. More...
 
using weight_t = weight_t_of< context_t >
 
using value_t = wet_of< context_t, Kind >
 
using monomial_t = typename value_t::value_type
 A pair <label, weight>. More...
 
template<typename Ctx >
using rweight_t = decltype(std::declval< labelset_t_of< Ctx > >() .rweight(std::declval< label_t_of< Ctx > >(), std::declval< weight_t_of< Ctx > >()))
 Detect whether the labelset features rweight. More...
 
template<typename Ctx >
using has_rweight_fn = detect< Ctx, rweight_t >
 Whether LabelSet features rweight. More...
 
template<typename Ctx >
using compose_t = decltype(std::declval< labelset_t_of< Ctx > >() .compose(std::declval< label_t_of< Ctx > >(), std::declval< label_t_of< Ctx > >()))
 Detect whether the labelset features a binary compose. More...
 
template<typename Ctx >
using has_compose_fn = detect< Ctx, compose_t >
 Whether LabelSet features compose. More...
 

Public Member Functions

 polynomialset_impl ()=delete
 
 polynomialset_impl (const polynomialset_impl &)=default
 
 polynomialset_impl (polynomialset_impl &&)=default
 
 polynomialset_impl (const context_t &ctx)
 
const self_tself () const
 Ourself, but after the application of weightset_mixin. More...
 
const context_tcontext () const
 
const labelset_ptrlabelset () const
 
const weightset_ptrweightset () const
 
value_t value (const label_t &l, const weight_t w) const
 Create a polynomial with a single value. More...
 
value_tdel_weight (value_t &v, const label_t &l) const
 Remove the monomial of l in v. More...
 
value_tnew_weight (value_t &v, const label_t &l, const weight_t w) const
 Set the monomial of l in v to weight w. More...
 
value_tset_weight (value_t &v, const label_t &l, const weight_t w) const
 Set the monomial of l in v to weight w. More...
 
const weight_t get_weight (const value_t &v, const label_t &l) const ATTRIBUTE_PURE
 
void clear (value_t &v)
 Set to zero. More...
 
value_tadd_here (value_t &v, const label_t &l, const weight_t k) const
 v += <k>l. More...
 
value_tadd_here (value_t &v, const monomial_t &m) const
 v += m. More...
 
template<wet_kind_t WetType, typename WS >
auto add_here_impl_ (value_t &l, const value_t &r) const -> std::enable_if_t< WetType !=wet_kind_t::bitset, value_t &>
 v += p, default case. More...
 
template<wet_kind_t WetType, typename WS >
auto add_here_impl_ (value_t &l, const value_t &r) const -> std::enable_if_t<(WetType==wet_kind_t::bitset &&std::is_same< WS, b >::value), value_t &>
 v += p, B and bitsets. More...
 
template<wet_kind_t WetType, typename WS >
auto add_here_impl_ (value_t &l, const value_t &r) const -> std::enable_if_t<(WetType==wet_kind_t::bitset &&std::is_same< WS, f2 >::value), value_t &>
 v += p, F2 and bitsets. More...
 
value_tadd_here (value_t &l, const value_t &r) const
 
value_t add (value_t res, const value_t &r) const
 The sum of polynomials l and r. More...
 
value_tsub_here (value_t &v, const monomial_t &m) const
 v -= m. More...
 
value_t sub (const value_t &l, const value_t &r) const
 The subtraction of polynomials l and r. More...
 
monomial_t mul (const monomial_t &l, const monomial_t &r) const
 The product of monomials l and r. More...
 
template<wet_kind_t WetType>
auto mul_impl_ (const value_t &l, const value_t &r) const -> std::enable_if_t< WetType !=wet_kind_t::bitset, value_t >
 The product of polynomials l and r. More...
 
template<wet_kind_t WetType>
auto mul_impl_ (const value_t &l, const value_t &r) const -> std::enable_if_t< WetType==wet_kind_t::bitset, value_t >
 The product of polynomials l and r. More...
 
auto mul (const value_t &l, const value_t &r) const -> value_t
 The product of polynomials l and r. More...
 
auto mul (const value_t &p, const label_t &l, const weight_t w) const -> value_t
 The product of polynomials l and r. More...
 
template<typename Ctx >
std::enable_if_t< Ctx::is_lar, value_tconjunction_impl_ (const value_t &l, const value_t &r) const
 The conjunction of polynomials l and r. More...
 
template<typename Ctx >
std::enable_if_t<!Ctx::is_lar, value_tconjunction_impl_ (const value_t &l, const value_t &r) const
 The conjunction of polynomials l and r. More...
 
value_t conjunction (const value_t &l, const value_t &r) const
 
value_t infiltrate (const value_t &l, const value_t &r) const
 The infiltration of polynomials l and r. More...
 
template<wet_kind_t WetType = value_t::kind>
auto scalar_product (const value_t &l, const value_t &r) const -> std::enable_if_t< WetType !=wet_kind_t::bitset, weight_t >
 The sum of the weights of the common labels. More...
 
template<wet_kind_t WetType = value_t::kind, typename WS = weightset_t>
auto scalar_product (const value_t &l, const value_t &r) const -> std::enable_if_t<(WetType==wet_kind_t::bitset &&std::is_same< WS, b >::value), weight_t >
 The sum of the weights of the common labels. More...
 
template<wet_kind_t WetType = value_t::kind, typename WS = weightset_t>
auto scalar_product (const value_t &l, const value_t &r) const -> std::enable_if_t<(WetType==wet_kind_t::bitset &&std::is_same< WS, f2 >::value), weight_t >
 The sum of the weights of the common labels. More...
 
value_t abs (const value_t &v) const
 Map all weights to their absolute value. More...
 
value_t star (const value_t &v) const
 The star of polynomial v. More...
 
value_t lweight (const weight_t w, const value_t &v) const
 Left exterior product. More...
 
value_t lmul_label (const label_t &lhs, const value_t &v) const
 Left product by a label. More...
 
value_t mul (const monomial_t &lhs, const value_t &v) const
 Left product by a monomial. More...
 
auto rweight (const value_t &v, const weight_t w) const -> value_t
 Right exterior product. More...
 
value_t rmul_label (const value_t &v, const label_t &rhs) const
 Right product. More...
 
value_t mul (const value_t &l, const monomial_t &rhs) const
 Right product by a monomial. More...
 
value_t rdivide (const value_t &l, const value_t &r) const
 
monomial_t ldivide (const monomial_t &l, const monomial_t &r) const
 Left division between two mononials: l \ r. More...
 
value_t ldivide (const monomial_t &l, const value_t &r) const
 Left division by a monomial: l \ r. More...
 
template<typename Ctx = context_t>
std::enable_if_t< Ctx::is_lar, value_t & > add_ldivide_here (value_t &res, const value_t &l, const value_t &r) const
 The left-division of polynomials l and r: res += l \ r. More...
 
template<typename Ctx = context_t>
std::enable_if_t<!Ctx::is_lar, value_t & > add_ldivide_here (value_t &res, const value_t &l, const value_t &r) const
 The left-division of polynomials l and r: res += l \ r. More...
 
value_t ldivide (const value_t &l, const value_t &r) const
 Left division of two polynomials: l \ r. More...
 
value_tldivide_here (const weight_t w, value_t &v) const
 Left exterior division. More...
 
value_trdivide_here (value_t &v, const weight_t w) const
 Right exterior division. More...
 
value_t lgcd (const value_t &lhs, const value_t &rhs) const
 LGCD between two polynomials. More...
 
auto norm (const value_t &v) const -> weight_t
 The norm: the weight with which we should divide a polynomial to normalize it. More...
 
weight_t normalize_here (value_t &v) const
 Normalize v in place: compute the LGCD of the weights, ldivide the monomials with that factor, and return the factor. More...
 
value_t normalize (value_t res) const
 Normalized v. More...
 
template<typename... Polys>
auto tuple (Polys &&... vs) const -> value_t
 Build a tuple of polynomials: (e.E+f.F)|(g.G+h.H) => eg. More...
 
template<size_t Tape>
auto project () const
 The polynomialset for tape Tape. More...
 
template<size_t Tape>
auto project (const value_t &v) const
 Extract a single tape. More...
 
template<typename Ctx1 , typename Ctx2 >
auto compose (const polynomialset< Ctx1 > &ps1, const typename polynomialset< Ctx1 >::value_t &p1, const polynomialset< Ctx2 > &ps2, const typename polynomialset< Ctx2 >::value_t &p2) const -> std::enable_if_t< are_composable< Ctx1, Ctx2 >
 The composition of polynomials l and r when the context is a composable tupleset. More...
 
template<typename Ctx = context_t>
auto compose (const value_t &l, const value_t &r) const -> std::enable_if_t< has_compose_fn< Ctx >
 The composition of polynomials l and r when the context features compose. More...
 
label_t to_label (const value_t &v) const
 Convert into a label. More...
 
monomial_t determinize (value_t v) const
 "Determinize" this polynomial: turn into a monomial. More...
 
value_t complement (const value_t &v) const
 Complement this polynomial. More...
 
const value_tzero () const
 
bool is_zero (const value_t &v) const
 
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...
 
template<typename C , wet_kind_t K>
value_t conv (const polynomialset< C, K > &sps, const typename polynomialset< C, K >::value_t &v) const
 Convert from another polynomialset to type_t. More...
 
value_t transpose (const value_t &v) const
 Transpose the labels and the weights. More...
 
std::ostream & print_set (std::ostream &o, format fmt={}) const
 
boost::optional< label_tconv_label (std::istream &i, bool weighted, const char sep='+') const
 Read a label, if there is one. More...
 
weight_t conv_weight (std::istream &i) const
 Read a weight, if there is one, bracketed. More...
 
boost::optional< monomial_tconv_monomial (std::istream &i, const char sep='+') const
 Read a monomial from a stream. More...
 
value_t conv (std::istream &i, const char sep='+') const
 Read a polynomial from a stream. More...
 
std::ostream & print (const monomial_t &m, std::ostream &out=std::cout, format fmt={}) const
 Print a monomial. More...
 
std::ostream & print (const value_t &v, std::ostream &out=std::cout, format fmt={}, const std::string &sep=" + ") const
 Print a value (a polynomial). More...
 

Static Public Member Functions

static symbol sname ()
 The static name. More...
 
static constexpr bool is_commutative ()
 
static constexpr bool has_lightening_weights ()
 
static ATTRIBUTE_PURE bool monomial_equal (const monomial_t &lhs, const monomial_t &rhs)
 
template<wet_kind_t WetType>
static ATTRIBUTE_PURE auto equal_impl_ (const value_t &l, const value_t &r) -> std::enable_if_t< WetType !=wet_kind_t::bitset, bool >
 
template<wet_kind_t WetType>
static ATTRIBUTE_PURE auto equal_impl_ (const value_t &l, const value_t &r) -> std::enable_if_t< WetType==wet_kind_t::bitset, bool >
 
static ATTRIBUTE_PURE bool equal (const value_t &l, const value_t &r)
 Whether l == r. More...
 
static const value_tone ()
 The unit polynomial. More...
 
static const monomial_tmonomial_one ()
 The unit monomial. More...
 
static bool is_one (const value_t &v) ATTRIBUTE_PURE
 Whether is the unit polynomial. More...
 
static constexpr bool show_one ()
 
static constexpr star_status_t star_status ()
 
static value_t conv (self_t, const value_t &v)
 Conversion from (this and) other weightsets. More...
 
static ATTRIBUTE_PURE int monomial_compare (const monomial_t &lhs, const monomial_t &rhs)
 
template<wet_kind_t WetType>
static ATTRIBUTE_PURE auto compare_impl_ (const value_t &l, const value_t &r) -> std::enable_if_t< WetType !=wet_kind_t::bitset, int >
 
template<wet_kind_t WetType>
static ATTRIBUTE_PURE auto compare_impl_ (const value_t &l, const value_t &r) -> std::enable_if_t< WetType==wet_kind_t::bitset, int >
 
static ATTRIBUTE_PURE int compare (const value_t &l, const value_t &r)
 
static ATTRIBUTE_PURE bool monomial_less (const monomial_t &lhs, const monomial_t &rhs)
 
template<wet_kind_t WetType>
static ATTRIBUTE_PURE auto less_impl_ (const value_t &l, const value_t &r) -> std::enable_if_t< WetType !=wet_kind_t::bitset, bool >
 
template<wet_kind_t WetType>
static ATTRIBUTE_PURE auto less_impl_ (const value_t &l, const value_t &r) -> std::enable_if_t< WetType==wet_kind_t::bitset, bool >
 
static ATTRIBUTE_PURE bool less (const value_t &l, const value_t &r)
 
static ATTRIBUTE_PURE size_t hash (const monomial_t &m, size_t res=0)
 
template<wet_kind_t WetType>
static ATTRIBUTE_PURE auto hash_impl_ (const value_t &p) -> std::enable_if_t< WetType !=wet_kind_t::bitset, size_t >
 
template<wet_kind_t WetType>
static ATTRIBUTE_PURE auto hash_impl_ (const value_t &p) -> std::enable_if_t< WetType==wet_kind_t::bitset, size_t >
 
static ATTRIBUTE_PURE size_t hash (const value_t &v)
 
static self_t make (std::istream &is)
 Build from the description in is. More...
 

Public Attributes

 value_t
 
const auto & ls1 = *ps1.labelset()
 
const auto & ls2 = *ps2.labelset()
 
constexpr auto out = number_of_tapes<Ctx2>::value - 1
 
constexpr auto in = 0
 
const auto & midls = ls1.template set<out>()
 
auto res = value_t{}
 
for(const auto &m1:p1) for(const auto &m2 return res
 
for(const auto &lm:l) for(const auto &rm return res
 

Private Member Functions

std::ostream & print_weight_ (const weight_t w, std::ostream &out, format fmt) const
 Print a weight. More...
 
std::ostream & print_without_classes_ (const value_t &v, std::ostream &out, format fmt, const std::string &sep) const
 Print a polynomial value without classes. More...
 
std::ostream & print_with_classes_ (const value_t &v, std::ostream &out, format fmt, const std::string &sep) const
 Print a polynomial value with classes. More...
 
template<typename Ctx = context_t>
std::enable_if_t<!labelset_t_of< Ctx >::is_letterized(), std::ostream & > print_ (const value_t &v, std::ostream &out, format fmt={}, const std::string &sep=" + ") const
 Print a non-null value for a non letterized labelset. More...
 
template<typename Ctx = context_t>
std::enable_if_t< labelset_t_of< Ctx >::is_letterized(), std::ostream & > print_ (const value_t &v, std::ostream &out, format fmt={}, const std::string &sep=" + ") const
 Print a non-null value for a letterized labelset (e.g., letterset or nullableset. More...
 

Private Attributes

context_t ctx_
 

Static Private Attributes

static constexpr char langle = '<'
 Left marker for weight in concrete syntax. More...
 
static constexpr char rangle = '>'
 Right marker for weight in concrete syntax. More...
 

Detailed Description

template<typename Context, wet_kind_t Kind>
class vcsn::detail::polynomialset_impl< Context, Kind >

Linear combination of labels: map labels to weights.

Template Parameters
Contextthe LabelSet and WeightSet types.

Definition at line 41 of file fwd.hh.

Member Typedef Documentation

◆ compose_t

template<typename Context , wet_kind_t Kind>
template<typename Ctx >
using vcsn::detail::polynomialset_impl< Context, Kind >::compose_t = decltype(std::declval<labelset_t_of<Ctx> >() .compose(std::declval<label_t_of<Ctx> >(), std::declval<label_t_of<Ctx> >()))

Detect whether the labelset features a binary compose.

Definition at line 859 of file polynomialset.hh.

◆ context_t

template<typename Context , wet_kind_t Kind>
using vcsn::detail::polynomialset_impl< Context, Kind >::context_t = Context

Definition at line 83 of file polynomialset.hh.

◆ has_compose_fn

template<typename Context , wet_kind_t Kind>
template<typename Ctx >
using vcsn::detail::polynomialset_impl< Context, Kind >::has_compose_fn = detect<Ctx, compose_t>

Whether LabelSet features compose.

This is actually meant to detect the case of expressionset.

Definition at line 864 of file polynomialset.hh.

◆ has_rweight_fn

template<typename Context , wet_kind_t Kind>
template<typename Ctx >
using vcsn::detail::polynomialset_impl< Context, Kind >::has_rweight_fn = detect<Ctx, rweight_t>

Whether LabelSet features rweight.

Definition at line 543 of file polynomialset.hh.

◆ label_t

template<typename Context , wet_kind_t Kind>
using vcsn::detail::polynomialset_impl< Context, Kind >::label_t = typename labelset_t::value_t

Polynomials over labels.

Definition at line 90 of file polynomialset.hh.

◆ labelset_ptr

template<typename Context , wet_kind_t Kind>
using vcsn::detail::polynomialset_impl< Context, Kind >::labelset_ptr = typename context_t::labelset_ptr

Definition at line 87 of file polynomialset.hh.

◆ labelset_t

template<typename Context , wet_kind_t Kind>
using vcsn::detail::polynomialset_impl< Context, Kind >::labelset_t = labelset_t_of<context_t>

Definition at line 84 of file polynomialset.hh.

◆ monomial_t

template<typename Context , wet_kind_t Kind>
using vcsn::detail::polynomialset_impl< Context, Kind >::monomial_t = typename value_t::value_type

A pair <label, weight>.

Definition at line 95 of file polynomialset.hh.

◆ rweight_t

template<typename Context , wet_kind_t Kind>
template<typename Ctx >
using vcsn::detail::polynomialset_impl< Context, Kind >::rweight_t = decltype(std::declval<labelset_t_of<Ctx> >() .rweight(std::declval<label_t_of<Ctx> >(), std::declval<weight_t_of<Ctx> >()))

Detect whether the labelset features rweight.

Definition at line 539 of file polynomialset.hh.

◆ self_t

template<typename Context , wet_kind_t Kind>
using vcsn::detail::polynomialset_impl< Context, Kind >::self_t = polynomialset<Context, Kind>

Definition at line 82 of file polynomialset.hh.

◆ value_t

template<typename Context , wet_kind_t Kind>
using vcsn::detail::polynomialset_impl< Context, Kind >::value_t = wet_of<context_t, Kind>

Definition at line 93 of file polynomialset.hh.

◆ weight_t

template<typename Context , wet_kind_t Kind>
using vcsn::detail::polynomialset_impl< Context, Kind >::weight_t = weight_t_of<context_t>

Definition at line 91 of file polynomialset.hh.

◆ weightset_ptr

template<typename Context , wet_kind_t Kind>
using vcsn::detail::polynomialset_impl< Context, Kind >::weightset_ptr = typename context_t::weightset_ptr

Definition at line 88 of file polynomialset.hh.

◆ weightset_t

template<typename Context , wet_kind_t Kind>
using vcsn::detail::polynomialset_impl< Context, Kind >::weightset_t = weightset_t_of<context_t>

Definition at line 85 of file polynomialset.hh.

Constructor & Destructor Documentation

◆ polynomialset_impl() [1/4]

template<typename Context , wet_kind_t Kind>
vcsn::detail::polynomialset_impl< Context, Kind >::polynomialset_impl ( )
delete

◆ polynomialset_impl() [2/4]

template<typename Context , wet_kind_t Kind>
vcsn::detail::polynomialset_impl< Context, Kind >::polynomialset_impl ( const polynomialset_impl< Context, Kind > &  )
default

◆ polynomialset_impl() [3/4]

template<typename Context , wet_kind_t Kind>
vcsn::detail::polynomialset_impl< Context, Kind >::polynomialset_impl ( polynomialset_impl< Context, Kind > &&  )
default

◆ polynomialset_impl() [4/4]

template<typename Context , wet_kind_t Kind>
vcsn::detail::polynomialset_impl< Context, Kind >::polynomialset_impl ( const context_t ctx)
inline

Definition at line 100 of file polynomialset.hh.

Member Function Documentation

◆ abs()

template<typename Context , wet_kind_t Kind>
value_t vcsn::detail::polynomialset_impl< Context, Kind >::abs ( const value_t v) const
inline

Map all weights to their absolute value.

Definition at line 471 of file polynomialset.hh.

References vcsn::add_here(), vcsn::label_of(), vcsn::res, and vcsn::weight_of().

Here is the call graph for this function:

◆ add()

template<typename Context , wet_kind_t Kind>
value_t vcsn::detail::polynomialset_impl< Context, Kind >::add ( value_t  res,
const value_t r 
) const
inline

The sum of polynomials l and r.

Definition at line 266 of file polynomialset.hh.

References vcsn::add_here(), and vcsn::res.

Here is the call graph for this function:

◆ add_here() [1/3]

template<typename Context , wet_kind_t Kind>
value_t& vcsn::detail::polynomialset_impl< Context, Kind >::add_here ( value_t v,
const label_t l,
const weight_t  k 
) const
inline

v += <k>l.

Definition at line 195 of file polynomialset.hh.

References vcsn::detail::label_is_zero(), vcsn::detail::v, and vcsn::weight_of().

Here is the call graph for this function:

◆ add_here() [2/3]

template<typename Context , wet_kind_t Kind>
value_t& vcsn::detail::polynomialset_impl< Context, Kind >::add_here ( value_t v,
const monomial_t m 
) const
inline

v += m.

Definition at line 218 of file polynomialset.hh.

References vcsn::add_here(), vcsn::label_of(), and vcsn::weight_of().

Here is the call graph for this function:

◆ add_here() [3/3]

template<typename Context , wet_kind_t Kind>
value_t& vcsn::detail::polynomialset_impl< Context, Kind >::add_here ( value_t l,
const value_t r 
) const
inline

Definition at line 260 of file polynomialset.hh.

◆ add_here_impl_() [1/3]

template<typename Context , wet_kind_t Kind>
template<wet_kind_t WetType, typename WS >
auto vcsn::detail::polynomialset_impl< Context, Kind >::add_here_impl_ ( value_t l,
const value_t r 
) const -> std::enable_if_t<WetType != wet_kind_t::bitset, value_t&>
inline

v += p, default case.

Definition at line 226 of file polynomialset.hh.

References vcsn::add_here().

Here is the call graph for this function:

◆ add_here_impl_() [2/3]

template<typename Context , wet_kind_t Kind>
template<wet_kind_t WetType, typename WS >
auto vcsn::detail::polynomialset_impl< Context, Kind >::add_here_impl_ ( value_t l,
const value_t r 
) const -> std::enable_if_t<(WetType == wet_kind_t::bitset && std::is_same<WS, b>::value), value_t&>
inline

v += p, B and bitsets.

Definition at line 238 of file polynomialset.hh.

◆ add_here_impl_() [3/3]

template<typename Context , wet_kind_t Kind>
template<wet_kind_t WetType, typename WS >
auto vcsn::detail::polynomialset_impl< Context, Kind >::add_here_impl_ ( value_t l,
const value_t r 
) const -> std::enable_if_t<(WetType == wet_kind_t::bitset && std::is_same<WS, f2>::value), value_t&>
inline

v += p, F2 and bitsets.

Definition at line 250 of file polynomialset.hh.

◆ add_ldivide_here() [1/2]

template<typename Context , wet_kind_t Kind>
template<typename Ctx = context_t>
std::enable_if_t<Ctx::is_lar, value_t&> vcsn::detail::polynomialset_impl< Context, Kind >::add_ldivide_here ( value_t res,
const value_t l,
const value_t r 
) const
inline

The left-division of polynomials l and r: res += l \ r.

Valid only for expressionsets.

Definition at line 628 of file polynomialset.hh.

References vcsn::add_here(), vcsn::label_of(), vcsn::res, and vcsn::weight_of().

Here is the call graph for this function:

◆ add_ldivide_here() [2/2]

template<typename Context , wet_kind_t Kind>
template<typename Ctx = context_t>
std::enable_if_t<!Ctx::is_lar, value_t&> vcsn::detail::polynomialset_impl< Context, Kind >::add_ldivide_here ( value_t res,
const value_t l,
const value_t r 
) const
inline

The left-division of polynomials l and r: res += l \ r.

Valid only for every other labelsets.

Definition at line 649 of file polynomialset.hh.

References vcsn::add_here(), vcsn::factor(), vcsn::detail::front(), vcsn::res, and vcsn::to_string().

Here is the call graph for this function:

◆ clear()

template<typename Context , wet_kind_t Kind>
void vcsn::detail::polynomialset_impl< Context, Kind >::clear ( value_t v)
inline

Set to zero.

Definition at line 183 of file polynomialset.hh.

◆ compare()

template<typename Context , wet_kind_t Kind>
static ATTRIBUTE_PURE int vcsn::detail::polynomialset_impl< Context, Kind >::compare ( const value_t l,
const value_t r 
)
inlinestatic

Definition at line 1103 of file polynomialset.hh.

◆ compare_impl_() [1/2]

template<typename Context , wet_kind_t Kind>
template<wet_kind_t WetType>
static ATTRIBUTE_PURE auto vcsn::detail::polynomialset_impl< Context, Kind >::compare_impl_ ( const value_t l,
const value_t r 
) -> std::enable_if_t<WetType != wet_kind_t::bitset, int>
inlinestatic

Definition at line 1084 of file polynomialset.hh.

References vcsn::detail::lexicographical_cmp().

Here is the call graph for this function:

◆ compare_impl_() [2/2]

template<typename Context , wet_kind_t Kind>
template<wet_kind_t WetType>
static ATTRIBUTE_PURE auto vcsn::detail::polynomialset_impl< Context, Kind >::compare_impl_ ( const value_t l,
const value_t r 
) -> std::enable_if_t<WetType == wet_kind_t::bitset, int>
inlinestatic

Definition at line 1094 of file polynomialset.hh.

◆ complement()

template<typename Context , wet_kind_t Kind>
value_t vcsn::detail::polynomialset_impl< Context, Kind >::complement ( const value_t v) const
inline

Complement this polynomial.

Requires a rather powerful labelset, typically expressionset.

Definition at line 943 of file polynomialset.hh.

References vcsn::normalize().

Here is the call graph for this function:

◆ compose() [1/2]

template<typename Context , wet_kind_t Kind>
template<typename Ctx1 , typename Ctx2 >
auto vcsn::detail::polynomialset_impl< Context, Kind >::compose ( const polynomialset< Ctx1 > &  ps1,
const typename polynomialset< Ctx1 >::value_t p1,
const polynomialset< Ctx2 > &  ps2,
const typename polynomialset< Ctx2 >::value_t p2 
) const -> std::enable_if_t<are_composable<Ctx1, Ctx2>
inline

The composition of polynomials l and r when the context is a composable tupleset.

Definition at line 871 of file polynomialset.hh.

◆ compose() [2/2]

template<typename Context , wet_kind_t Kind>
template<typename Ctx = context_t>
auto vcsn::detail::polynomialset_impl< Context, Kind >::compose ( const value_t l,
const value_t r 
) const -> std::enable_if_t<has_compose_fn<Ctx>
inline

The composition of polynomials l and r when the context features compose.

Definition at line 902 of file polynomialset.hh.

References vcsn::res.

◆ conjunction()

template<typename Context , wet_kind_t Kind>
value_t vcsn::detail::polynomialset_impl< Context, Kind >::conjunction ( const value_t l,
const value_t r 
) const
inline

Definition at line 411 of file polynomialset.hh.

◆ conjunction_impl_() [1/2]

template<typename Context , wet_kind_t Kind>
template<typename Ctx >
std::enable_if_t<Ctx::is_lar, value_t> vcsn::detail::polynomialset_impl< Context, Kind >::conjunction_impl_ ( const value_t l,
const value_t r 
) const
inline

The conjunction of polynomials l and r.

Valid only for expressionsets.

Definition at line 384 of file polynomialset.hh.

References vcsn::add_here(), vcsn::detail::conjunction(), vcsn::label_of(), vcsn::res, and vcsn::weight_of().

Here is the call graph for this function:

◆ conjunction_impl_() [2/2]

template<typename Context , wet_kind_t Kind>
template<typename Ctx >
std::enable_if_t<!Ctx::is_lar, value_t> vcsn::detail::polynomialset_impl< Context, Kind >::conjunction_impl_ ( const value_t l,
const value_t r 
) const
inline

The conjunction of polynomials l and r.

Valid only for every other labelsets.

Definition at line 399 of file polynomialset.hh.

References vcsn::add_here(), vcsn::label_of(), vcsn::res, and vcsn::weight_of().

Here is the call graph for this function:

◆ context()

template<typename Context , wet_kind_t Kind>
const context_t& vcsn::detail::polynomialset_impl< Context, Kind >::context ( ) const
inline

Definition at line 123 of file polynomialset.hh.

◆ conv() [1/4]

template<typename Context , wet_kind_t Kind>
static value_t vcsn::detail::polynomialset_impl< Context, Kind >::conv ( self_t  ,
const value_t v 
)
inlinestatic

Conversion from (this and) other weightsets.

Definition at line 1035 of file polynomialset.hh.

References vcsn::detail::v.

◆ conv() [2/4]

template<typename Context , wet_kind_t Kind>
template<typename WS >
value_t vcsn::detail::polynomialset_impl< Context, Kind >::conv ( const WS &  ws,
const typename WS::value_t &  v 
) const
inline

FIXME: use enable_if to prevent this from being instantiated when WS is a polynomialset.

Then use this same technique for expressions.

Definition at line 1045 of file polynomialset.hh.

◆ conv() [3/4]

template<typename Context , wet_kind_t Kind>
template<typename C , wet_kind_t K>
value_t vcsn::detail::polynomialset_impl< Context, Kind >::conv ( const polynomialset< C, K > &  sps,
const typename polynomialset< C, K >::value_t v 
) const
inline

Convert from another polynomialset to type_t.

Definition at line 1053 of file polynomialset.hh.

References vcsn::add_here(), vcsn::label_of(), vcsn::res, and vcsn::weight_of().

Here is the call graph for this function:

◆ conv() [4/4]

template<typename Context , wet_kind_t Kind>
value_t vcsn::detail::polynomialset_impl< Context, Kind >::conv ( std::istream &  i,
const char  sep = '+' 
) const
inline

Read a polynomial from a stream.

More general than a mere inverse of print, in particular a+a is properly understood as <2>a in lal, z.

Parameters
ithe stream to parse.
septhe separator between monomials.

Definition at line 1372 of file polynomialset.hh.

References vcsn::add_here(), vcsn::require(), vcsn::res, and SKIP_SPACES.

Here is the call graph for this function:

◆ conv_label()

template<typename Context , wet_kind_t Kind>
boost::optional<label_t> vcsn::detail::polynomialset_impl< Context, Kind >::conv_label ( std::istream &  i,
bool  weighted,
const char  sep = '+' 
) const
inline

Read a label, if there is one.

Does not handle \\z, nor letter classes.

Returns
none if there is no label.

Definition at line 1257 of file polynomialset.hh.

◆ conv_monomial()

template<typename Context , wet_kind_t Kind>
boost::optional<monomial_t> vcsn::detail::polynomialset_impl< Context, Kind >::conv_monomial ( std::istream &  i,
const char  sep = '+' 
) const
inline

Read a monomial from a stream.

Parameters
ithe stream to parse
septhe separator between monomials.
Returns
boost::none on EOF

Definition at line 1341 of file polynomialset.hh.

References vcsn::require(), and SKIP_SPACES.

Here is the call graph for this function:

◆ conv_weight()

template<typename Context , wet_kind_t Kind>
weight_t vcsn::detail::polynomialset_impl< Context, Kind >::conv_weight ( std::istream &  i) const
inline

Read a weight, if there is one, bracketed.

Definition at line 1318 of file polynomialset.hh.

References vcsn::bracketed(), and vcsn::conv().

Here is the call graph for this function:

◆ del_weight()

template<typename Context , wet_kind_t Kind>
value_t& vcsn::detail::polynomialset_impl< Context, Kind >::del_weight ( value_t v,
const label_t l 
) const
inline

Remove the monomial of l in v.

Definition at line 141 of file polynomialset.hh.

References vcsn::detail::v.

◆ determinize()

template<typename Context , wet_kind_t Kind>
monomial_t vcsn::detail::polynomialset_impl< Context, Kind >::determinize ( value_t  v) const
inline

"Determinize" this polynomial: turn into a monomial.

Requires a rather powerful labelset, typically expressionset.

Definition at line 934 of file polynomialset.hh.

◆ equal()

template<typename Context , wet_kind_t Kind>
static ATTRIBUTE_PURE bool vcsn::detail::polynomialset_impl< Context, Kind >::equal ( const value_t l,
const value_t r 
)
inlinestatic

Whether l == r.

Definition at line 984 of file polynomialset.hh.

◆ equal_impl_() [1/2]

template<typename Context , wet_kind_t Kind>
template<wet_kind_t WetType>
static ATTRIBUTE_PURE auto vcsn::detail::polynomialset_impl< Context, Kind >::equal_impl_ ( const value_t l,
const value_t r 
) -> std::enable_if_t<WetType != wet_kind_t::bitset, bool>
inlinestatic

Definition at line 964 of file polynomialset.hh.

◆ equal_impl_() [2/2]

template<typename Context , wet_kind_t Kind>
template<wet_kind_t WetType>
static ATTRIBUTE_PURE auto vcsn::detail::polynomialset_impl< Context, Kind >::equal_impl_ ( const value_t l,
const value_t r 
) -> std::enable_if_t<WetType == wet_kind_t::bitset, bool>
inlinestatic

Definition at line 974 of file polynomialset.hh.

◆ get_weight()

template<typename Context , wet_kind_t Kind>
const weight_t vcsn::detail::polynomialset_impl< Context, Kind >::get_weight ( const value_t v,
const label_t l 
) const
inline

Definition at line 168 of file polynomialset.hh.

References vcsn::detail::v, and vcsn::weight_of().

Here is the call graph for this function:

◆ has_lightening_weights()

template<typename Context , wet_kind_t Kind>
static constexpr bool vcsn::detail::polynomialset_impl< Context, Kind >::has_lightening_weights ( )
inlinestatic

Definition at line 128 of file polynomialset.hh.

◆ hash() [1/2]

template<typename Context , wet_kind_t Kind>
static ATTRIBUTE_PURE size_t vcsn::detail::polynomialset_impl< Context, Kind >::hash ( const monomial_t m,
size_t  res = 0 
)
inlinestatic

Definition at line 1176 of file polynomialset.hh.

References vcsn::hash_combine(), vcsn::label_of(), vcsn::res, and vcsn::weight_of().

Here is the call graph for this function:

◆ hash() [2/2]

template<typename Context , wet_kind_t Kind>
static ATTRIBUTE_PURE size_t vcsn::detail::polynomialset_impl< Context, Kind >::hash ( const value_t v)
inlinestatic

Definition at line 1207 of file polynomialset.hh.

References vcsn::detail::v.

◆ hash_impl_() [1/2]

template<typename Context , wet_kind_t Kind>
template<wet_kind_t WetType>
static ATTRIBUTE_PURE auto vcsn::detail::polynomialset_impl< Context, Kind >::hash_impl_ ( const value_t p) -> std::enable_if_t<WetType != wet_kind_t::bitset, size_t>
inlinestatic

Definition at line 1186 of file polynomialset.hh.

References vcsn::res.

◆ hash_impl_() [2/2]

template<typename Context , wet_kind_t Kind>
template<wet_kind_t WetType>
static ATTRIBUTE_PURE auto vcsn::detail::polynomialset_impl< Context, Kind >::hash_impl_ ( const value_t p) -> std::enable_if_t<WetType == wet_kind_t::bitset, size_t>
inlinestatic

Definition at line 1199 of file polynomialset.hh.

References vcsn::detail::hash_value().

Here is the call graph for this function:

◆ infiltrate()

template<typename Context , wet_kind_t Kind>
value_t vcsn::detail::polynomialset_impl< Context, Kind >::infiltrate ( const value_t l,
const value_t r 
) const
inline

The infiltration of polynomials l and r.

Not valid for all the labelsets.

Definition at line 419 of file polynomialset.hh.

References vcsn::add_here(), vcsn::label_of(), vcsn::res, and vcsn::weight_of().

Here is the call graph for this function:

◆ is_commutative()

template<typename Context , wet_kind_t Kind>
static constexpr bool vcsn::detail::polynomialset_impl< Context, Kind >::is_commutative ( )
inlinestatic

Definition at line 127 of file polynomialset.hh.

◆ is_one()

template<typename Context , wet_kind_t Kind>
static bool vcsn::detail::polynomialset_impl< Context, Kind >::is_one ( const value_t v)
inlinestatic

Whether is the unit polynomial.

Definition at line 1004 of file polynomialset.hh.

References vcsn::detail::v.

◆ is_zero()

template<typename Context , wet_kind_t Kind>
bool vcsn::detail::polynomialset_impl< Context, Kind >::is_zero ( const value_t v) const
inline

Definition at line 1022 of file polynomialset.hh.

◆ labelset()

template<typename Context , wet_kind_t Kind>
const labelset_ptr& vcsn::detail::polynomialset_impl< Context, Kind >::labelset ( ) const
inline

Definition at line 124 of file polynomialset.hh.

◆ ldivide() [1/3]

template<typename Context , wet_kind_t Kind>
monomial_t vcsn::detail::polynomialset_impl< Context, Kind >::ldivide ( const monomial_t l,
const monomial_t r 
) const
inline

Left division between two mononials: l \ r.

Definition at line 608 of file polynomialset.hh.

References vcsn::label_of(), and vcsn::weight_of().

Here is the call graph for this function:

◆ ldivide() [2/3]

template<typename Context , wet_kind_t Kind>
value_t vcsn::detail::polynomialset_impl< Context, Kind >::ldivide ( const monomial_t l,
const value_t r 
) const
inline

Left division by a monomial: l \ r.

Definition at line 616 of file polynomialset.hh.

References vcsn::add_here(), and vcsn::res.

Here is the call graph for this function:

◆ ldivide() [3/3]

template<typename Context , wet_kind_t Kind>
value_t vcsn::detail::polynomialset_impl< Context, Kind >::ldivide ( const value_t l,
const value_t r 
) const
inline

Left division of two polynomials: l \ r.

Definition at line 672 of file polynomialset.hh.

References vcsn::res.

◆ ldivide_here()

template<typename Context , wet_kind_t Kind>
value_t& vcsn::detail::polynomialset_impl< Context, Kind >::ldivide_here ( const weight_t  w,
value_t v 
) const
inline

Left exterior division.

Definition at line 681 of file polynomialset.hh.

References vcsn::detail::v, vcsn::weight_of(), and vcsn::weight_set().

Here is the call graph for this function:

◆ less()

template<typename Context , wet_kind_t Kind>
static ATTRIBUTE_PURE bool vcsn::detail::polynomialset_impl< Context, Kind >::less ( const value_t l,
const value_t r 
)
inlinestatic

Definition at line 1146 of file polynomialset.hh.

◆ less_impl_() [1/2]

template<typename Context , wet_kind_t Kind>
template<wet_kind_t WetType>
static ATTRIBUTE_PURE auto vcsn::detail::polynomialset_impl< Context, Kind >::less_impl_ ( const value_t l,
const value_t r 
) -> std::enable_if_t<WetType != wet_kind_t::bitset, bool>
inlinestatic

Definition at line 1127 of file polynomialset.hh.

◆ less_impl_() [2/2]

template<typename Context , wet_kind_t Kind>
template<wet_kind_t WetType>
static ATTRIBUTE_PURE auto vcsn::detail::polynomialset_impl< Context, Kind >::less_impl_ ( const value_t l,
const value_t r 
) -> std::enable_if_t<WetType == wet_kind_t::bitset, bool>
inlinestatic

Definition at line 1137 of file polynomialset.hh.

◆ lgcd()

template<typename Context , wet_kind_t Kind>
value_t vcsn::detail::polynomialset_impl< Context, Kind >::lgcd ( const value_t lhs,
const value_t rhs 
) const
inline

LGCD between two polynomials.

Based only on weights. For instance <2>a+<4>b, <3>a+<6>b => <1>a+<2>b. And ab, a => 1. We could try to have ab, a => a in the future.

Definition at line 705 of file polynomialset.hh.

References vcsn::lgcd(), and vcsn::res.

Here is the call graph for this function:

◆ lmul_label()

template<typename Context , wet_kind_t Kind>
value_t vcsn::detail::polynomialset_impl< Context, Kind >::lmul_label ( const label_t lhs,
const value_t v 
) const
inline

Left product by a label.

Definition at line 512 of file polynomialset.hh.

References vcsn::add_here(), vcsn::label_of(), vcsn::res, and vcsn::weight_of().

Here is the call graph for this function:

◆ lweight()

template<typename Context , wet_kind_t Kind>
value_t vcsn::detail::polynomialset_impl< Context, Kind >::lweight ( const weight_t  w,
const value_t v 
) const
inline

Left exterior product.

Definition at line 499 of file polynomialset.hh.

References vcsn::add_here(), vcsn::label_of(), vcsn::res, vcsn::detail::v, and vcsn::weight_of().

Here is the call graph for this function:

◆ make()

template<typename Context , wet_kind_t Kind>
static self_t vcsn::detail::polynomialset_impl< Context, Kind >::make ( std::istream &  is)
inlinestatic

Build from the description in is.

Definition at line 1214 of file polynomialset.hh.

References vcsn::detail::ctx, and vcsn::eat().

Here is the call graph for this function:

◆ monomial_compare()

template<typename Context , wet_kind_t Kind>
static ATTRIBUTE_PURE int vcsn::detail::polynomialset_impl< Context, Kind >::monomial_compare ( const monomial_t lhs,
const monomial_t rhs 
)
inlinestatic

Definition at line 1073 of file polynomialset.hh.

References vcsn::compare(), vcsn::label_of(), vcsn::res, and vcsn::weight_of().

Here is the call graph for this function:

◆ monomial_equal()

template<typename Context , wet_kind_t Kind>
static ATTRIBUTE_PURE bool vcsn::detail::polynomialset_impl< Context, Kind >::monomial_equal ( const monomial_t lhs,
const monomial_t rhs 
)
inlinestatic

Definition at line 954 of file polynomialset.hh.

References vcsn::label_of(), and vcsn::weight_of().

Here is the call graph for this function:

◆ monomial_less()

template<typename Context , wet_kind_t Kind>
static ATTRIBUTE_PURE bool vcsn::detail::polynomialset_impl< Context, Kind >::monomial_less ( const monomial_t lhs,
const monomial_t rhs 
)
inlinestatic

Definition at line 1114 of file polynomialset.hh.

References vcsn::label_of(), and vcsn::weight_of().

Here is the call graph for this function:

◆ monomial_one()

template<typename Context , wet_kind_t Kind>
static const monomial_t& vcsn::detail::polynomialset_impl< Context, Kind >::monomial_one ( )
inlinestatic

The unit monomial.

Definition at line 997 of file polynomialset.hh.

References vcsn::res.

◆ mul() [1/5]

template<typename Context , wet_kind_t Kind>
monomial_t vcsn::detail::polynomialset_impl< Context, Kind >::mul ( const monomial_t l,
const monomial_t r 
) const
inline

The product of monomials l and r.

Definition at line 320 of file polynomialset.hh.

References vcsn::label_of(), and vcsn::weight_of().

Here is the call graph for this function:

◆ mul() [2/5]

template<typename Context , wet_kind_t Kind>
auto vcsn::detail::polynomialset_impl< Context, Kind >::mul ( const value_t l,
const value_t r 
) const -> value_t
inline

The product of polynomials l and r.

Definition at line 356 of file polynomialset.hh.

◆ mul() [3/5]

template<typename Context , wet_kind_t Kind>
auto vcsn::detail::polynomialset_impl< Context, Kind >::mul ( const value_t p,
const label_t l,
const weight_t  w 
) const -> value_t
inline

The product of polynomials l and r.

Definition at line 364 of file polynomialset.hh.

References vcsn::add_here(), vcsn::label_of(), vcsn::res, and vcsn::weight_of().

Here is the call graph for this function:

◆ mul() [4/5]

template<typename Context , wet_kind_t Kind>
value_t vcsn::detail::polynomialset_impl< Context, Kind >::mul ( const monomial_t lhs,
const value_t v 
) const
inline

Left product by a monomial.

Definition at line 524 of file polynomialset.hh.

References vcsn::add_here(), vcsn::label_of(), vcsn::res, and vcsn::weight_of().

Here is the call graph for this function:

◆ mul() [5/5]

template<typename Context , wet_kind_t Kind>
value_t vcsn::detail::polynomialset_impl< Context, Kind >::mul ( const value_t l,
const monomial_t rhs 
) const
inline

Right product by a monomial.

Definition at line 589 of file polynomialset.hh.

References vcsn::add_here(), vcsn::label_of(), vcsn::res, and vcsn::weight_of().

Here is the call graph for this function:

◆ mul_impl_() [1/2]

template<typename Context , wet_kind_t Kind>
template<wet_kind_t WetType>
auto vcsn::detail::polynomialset_impl< Context, Kind >::mul_impl_ ( const value_t l,
const value_t r 
) const -> std::enable_if_t<WetType != wet_kind_t::bitset, value_t>
inline

The product of polynomials l and r.

General case.

Definition at line 330 of file polynomialset.hh.

References vcsn::add_here(), vcsn::label_of(), vcsn::res, and vcsn::weight_of().

Here is the call graph for this function:

◆ mul_impl_() [2/2]

template<typename Context , wet_kind_t Kind>
template<wet_kind_t WetType>
auto vcsn::detail::polynomialset_impl< Context, Kind >::mul_impl_ ( const value_t l,
const value_t r 
) const -> std::enable_if_t<WetType == wet_kind_t::bitset, value_t>
inline

The product of polynomials l and r.

Case of bitsets.

Definition at line 347 of file polynomialset.hh.

◆ new_weight()

template<typename Context , wet_kind_t Kind>
value_t& vcsn::detail::polynomialset_impl< Context, Kind >::new_weight ( value_t v,
const label_t l,
const weight_t  w 
) const
inline

Set the monomial of l in v to weight w.

Precondition
w is not null

Definition at line 150 of file polynomialset.hh.

References vcsn::detail::v.

◆ norm()

template<typename Context , wet_kind_t Kind>
auto vcsn::detail::polynomialset_impl< Context, Kind >::norm ( const value_t v) const -> weight_t
inline

The norm: the weight with which we should divide a polynomial to normalize it.

Definition at line 774 of file polynomialset.hh.

References vcsn::detail::v.

◆ normalize()

template<typename Context , wet_kind_t Kind>
value_t vcsn::detail::polynomialset_impl< Context, Kind >::normalize ( value_t  res) const
inline

Normalized v.

Definition at line 800 of file polynomialset.hh.

References vcsn::res.

◆ normalize_here()

template<typename Context , wet_kind_t Kind>
weight_t vcsn::detail::polynomialset_impl< Context, Kind >::normalize_here ( value_t v) const
inline

Normalize v in place: compute the LGCD of the weights, ldivide the monomials with that factor, and return the factor.

Definition at line 790 of file polynomialset.hh.

References vcsn::res.

◆ one()

template<typename Context , wet_kind_t Kind>
static const value_t& vcsn::detail::polynomialset_impl< Context, Kind >::one ( )
inlinestatic

The unit polynomial.

Definition at line 990 of file polynomialset.hh.

References vcsn::res.

◆ print() [1/2]

template<typename Context , wet_kind_t Kind>
std::ostream& vcsn::detail::polynomialset_impl< Context, Kind >::print ( const monomial_t m,
std::ostream &  out = std::cout,
format  fmt = {} 
) const
inline

Print a monomial.

Definition at line 1415 of file polynomialset.hh.

References vcsn::label_of(), vcsn::format::latex, vcsn::detail::out(), and vcsn::weight_of().

Here is the call graph for this function:

◆ print() [2/2]

template<typename Context , wet_kind_t Kind>
std::ostream& vcsn::detail::polynomialset_impl< Context, Kind >::print ( const value_t v,
std::ostream &  out = std::cout,
format  fmt = {},
const std::string &  sep = " + " 
) const
inline

Print a value (a polynomial).

Parameters
vthe polynomial
outthe output stream
fmtthe format: "text" or "latex"
septhe separator between monomials

Definition at line 1435 of file polynomialset.hh.

References vcsn::format::latex, vcsn::detail::out(), vcsn::detail::print_(), and vcsn::format::utf8.

Here is the call graph for this function:

◆ print_() [1/2]

template<typename Context , wet_kind_t Kind>
template<typename Ctx = context_t>
std::enable_if_t<!labelset_t_of<Ctx>::is_letterized(), std::ostream&> vcsn::detail::polynomialset_impl< Context, Kind >::print_ ( const value_t v,
std::ostream &  out,
format  fmt = {},
const std::string &  sep = " + " 
) const
inlineprivate

Print a non-null value for a non letterized labelset.

Definition at line 1561 of file polynomialset.hh.

References vcsn::detail::is_letterized().

Here is the call graph for this function:

◆ print_() [2/2]

template<typename Context , wet_kind_t Kind>
template<typename Ctx = context_t>
std::enable_if_t<labelset_t_of<Ctx>::is_letterized(), std::ostream&> vcsn::detail::polynomialset_impl< Context, Kind >::print_ ( const value_t v,
std::ostream &  out,
format  fmt = {},
const std::string &  sep = " + " 
) const
inlineprivate

Print a non-null value for a letterized labelset (e.g., letterset or nullableset.

Definition at line 1573 of file polynomialset.hh.

◆ print_set()

template<typename Context , wet_kind_t Kind>
std::ostream& vcsn::detail::polynomialset_impl< Context, Kind >::print_set ( std::ostream &  o,
format  fmt = {} 
) const
inline

Definition at line 1224 of file polynomialset.hh.

References vcsn::format::latex, vcsn::context< LabelSet, WeightSet >::print_set(), and vcsn::format::sname.

Here is the call graph for this function:

◆ print_weight_()

template<typename Context , wet_kind_t Kind>
std::ostream& vcsn::detail::polynomialset_impl< Context, Kind >::print_weight_ ( const weight_t  w,
std::ostream &  out,
format  fmt 
) const
inlineprivate

Print a weight.

Definition at line 1459 of file polynomialset.hh.

References vcsn::format::latex, vcsn::detail::out(), and vcsn::format::utf8.

Here is the call graph for this function:

◆ print_with_classes_()

template<typename Context , wet_kind_t Kind>
std::ostream& vcsn::detail::polynomialset_impl< Context, Kind >::print_with_classes_ ( const value_t v,
std::ostream &  out,
format  fmt,
const std::string &  sep 
) const
inlineprivate

Print a polynomial value with classes.

Definition at line 1495 of file polynomialset.hh.

References vcsn::format::for_labels(), vcsn::detail::front(), vcsn::detail::is_letterized(), vcsn::label_of(), vcsn::map, vcsn::detail::out(), vcsn::detail::print(), vcsn::detail::print_label_class(), and vcsn::weight_of().

Here is the call graph for this function:

◆ print_without_classes_()

template<typename Context , wet_kind_t Kind>
std::ostream& vcsn::detail::polynomialset_impl< Context, Kind >::print_without_classes_ ( const value_t v,
std::ostream &  out,
format  fmt,
const std::string &  sep 
) const
inlineprivate

Print a polynomial value without classes.

Definition at line 1478 of file polynomialset.hh.

References vcsn::detail::out(), and vcsn::detail::print().

Here is the call graph for this function:

◆ project() [1/2]

template<typename Context , wet_kind_t Kind>
template<size_t Tape>
auto vcsn::detail::polynomialset_impl< Context, Kind >::project ( ) const
inline

The polynomialset for tape Tape.

Definition at line 832 of file polynomialset.hh.

References vcsn::detail::make_polynomialset().

Here is the call graph for this function:

◆ project() [2/2]

template<typename Context , wet_kind_t Kind>
template<size_t Tape>
auto vcsn::detail::polynomialset_impl< Context, Kind >::project ( const value_t v) const
inline

Extract a single tape.

Definition at line 839 of file polynomialset.hh.

References vcsn::label_of(), vcsn::res, and vcsn::weight_of().

Here is the call graph for this function:

◆ rdivide()

template<typename Context , wet_kind_t Kind>
value_t vcsn::detail::polynomialset_impl< Context, Kind >::rdivide ( const value_t l,
const value_t r 
) const
inline

Definition at line 600 of file polynomialset.hh.

References vcsn::to_string().

Here is the call graph for this function:

◆ rdivide_here()

template<typename Context , wet_kind_t Kind>
value_t& vcsn::detail::polynomialset_impl< Context, Kind >::rdivide_here ( value_t v,
const weight_t  w 
) const
inline

Right exterior division.

Definition at line 691 of file polynomialset.hh.

References vcsn::rdivide(), vcsn::detail::v, vcsn::weight_of(), and vcsn::weight_set().

Here is the call graph for this function:

◆ rmul_label()

template<typename Context , wet_kind_t Kind>
value_t vcsn::detail::polynomialset_impl< Context, Kind >::rmul_label ( const value_t v,
const label_t rhs 
) const
inline

Right product.

Definition at line 577 of file polynomialset.hh.

References vcsn::add_here(), vcsn::label_of(), vcsn::res, and vcsn::weight_of().

Here is the call graph for this function:

◆ rweight()

template<typename Context , wet_kind_t Kind>
auto vcsn::detail::polynomialset_impl< Context, Kind >::rweight ( const value_t v,
const weight_t  w 
) const -> value_t
inline

Right exterior product.

Definition at line 547 of file polynomialset.hh.

References vcsn::add_here(), vcsn::label_of(), vcsn::res, vcsn::detail::v, and vcsn::weight_of().

Here is the call graph for this function:

◆ scalar_product() [1/3]

template<typename Context , wet_kind_t Kind>
template<wet_kind_t WetType = value_t::kind>
auto vcsn::detail::polynomialset_impl< Context, Kind >::scalar_product ( const value_t l,
const value_t r 
) const -> std::enable_if_t<WetType != wet_kind_t::bitset, weight_t>
inline

The sum of the weights of the common labels.

Default case.

Definition at line 434 of file polynomialset.hh.

References vcsn::res, and vcsn::weight_of().

Here is the call graph for this function:

◆ scalar_product() [2/3]

template<typename Context , wet_kind_t Kind>
template<wet_kind_t WetType = value_t::kind, typename WS = weightset_t>
auto vcsn::detail::polynomialset_impl< Context, Kind >::scalar_product ( const value_t l,
const value_t r 
) const -> std::enable_if_t<(WetType == wet_kind_t::bitset && std::is_same<WS, b>::value), weight_t>
inline

The sum of the weights of the common labels.

B and bitsets.

Definition at line 450 of file polynomialset.hh.

◆ scalar_product() [3/3]

template<typename Context , wet_kind_t Kind>
template<wet_kind_t WetType = value_t::kind, typename WS = weightset_t>
auto vcsn::detail::polynomialset_impl< Context, Kind >::scalar_product ( const value_t l,
const value_t r 
) const -> std::enable_if_t<(WetType == wet_kind_t::bitset && std::is_same<WS, f2>::value), weight_t>
inline

The sum of the weights of the common labels.

F2 and bitsets.

Definition at line 462 of file polynomialset.hh.

◆ self()

template<typename Context , wet_kind_t Kind>
const self_t& vcsn::detail::polynomialset_impl< Context, Kind >::self ( ) const
inline

Ourself, but after the application of weightset_mixin.

FIXME: this is ugly. It is due to the fact that instead of the CRTP, we used a mixin approach to add features to expressionset as opposed to expressionset_impl. Except that here, we have an expression_impl, and we need the expression. So after all, maybe the CRTP is a better approach.

Cannot be a reference member, as we do support assignments, in which case the copied self would point to the original this.

Definition at line 114 of file polynomialset.hh.

◆ set_weight()

template<typename Context , wet_kind_t Kind>
value_t& vcsn::detail::polynomialset_impl< Context, Kind >::set_weight ( value_t v,
const label_t l,
const weight_t  w 
) const
inline

Set the monomial of l in v to weight w.

Definition at line 159 of file polynomialset.hh.

◆ show_one()

template<typename Context , wet_kind_t Kind>
static constexpr bool vcsn::detail::polynomialset_impl< Context, Kind >::show_one ( )
inlinestatic

Definition at line 1027 of file polynomialset.hh.

◆ sname()

template<typename Context , wet_kind_t Kind>
static symbol vcsn::detail::polynomialset_impl< Context, Kind >::sname ( )
inlinestatic

The static name.

Definition at line 117 of file polynomialset.hh.

References vcsn::res, and vcsn::sname().

Here is the call graph for this function:

◆ star()

template<typename Context , wet_kind_t Kind>
value_t vcsn::detail::polynomialset_impl< Context, Kind >::star ( const value_t v) const
inline

The star of polynomial v.

Definition at line 481 of file polynomialset.hh.

References vcsn::raise_not_starrable().

Here is the call graph for this function:

◆ star_status()

template<typename Context , wet_kind_t Kind>
static constexpr star_status_t vcsn::detail::polynomialset_impl< Context, Kind >::star_status ( )
inlinestatic

Definition at line 1028 of file polynomialset.hh.

◆ sub()

template<typename Context , wet_kind_t Kind>
value_t vcsn::detail::polynomialset_impl< Context, Kind >::sub ( const value_t l,
const value_t r 
) const
inline

The subtraction of polynomials l and r.

Definition at line 305 of file polynomialset.hh.

References vcsn::res.

◆ sub_here()

template<typename Context , wet_kind_t Kind>
value_t& vcsn::detail::polynomialset_impl< Context, Kind >::sub_here ( value_t v,
const monomial_t m 
) const
inline

v -= m.

Definition at line 279 of file polynomialset.hh.

References vcsn::detail::label_is_zero(), vcsn::label_of(), vcsn::to_string(), vcsn::detail::v, vcsn::weight_of(), and vcsn::weight_set().

Here is the call graph for this function:

◆ to_label()

template<typename Context , wet_kind_t Kind>
label_t vcsn::detail::polynomialset_impl< Context, Kind >::to_label ( const value_t v) const
inline

Convert into a label.

Requires a rather powerful labelset, typically expressionset. Typical usage is therefore to "project" a polynomial of expressions into an expression (say for complement for instance).

Definition at line 922 of file polynomialset.hh.

References vcsn::label_of(), vcsn::res, and vcsn::weight_of().

Here is the call graph for this function:

◆ transpose()

template<typename Context , wet_kind_t Kind>
value_t vcsn::detail::polynomialset_impl< Context, Kind >::transpose ( const value_t v) const
inline

Transpose the labels and the weights.

In the case of a polynomial of expressions, use transposition instead of transpose, i.e., add tranposition operators instead of creating deep transposed copies of the expressions.

Definition at line 1158 of file polynomialset.hh.

References vcsn::label_of(), vcsn::res, vcsn::transpose(), and vcsn::weight_of().

Here is the call graph for this function:

◆ tuple()

template<typename Context , wet_kind_t Kind>
template<typename... Polys>
auto vcsn::detail::polynomialset_impl< Context, Kind >::tuple ( Polys &&...  vs) const -> value_t
inline

Build a tuple of polynomials: (e.E+f.F)|(g.G+h.H) => eg.

(E|G) + eh.(E|H) + fg.(F|G) + fh.(F|H).

Definition at line 816 of file polynomialset.hh.

References vcsn::add_here(), vcsn::detail::cross(), vcsn::res, and vcsn::detail::tuple().

Here is the call graph for this function:

◆ value()

template<typename Context , wet_kind_t Kind>
value_t vcsn::detail::polynomialset_impl< Context, Kind >::value ( const label_t l,
const weight_t  w 
) const
inline

Create a polynomial with a single value.

Definition at line 134 of file polynomialset.hh.

◆ weightset()

template<typename Context , wet_kind_t Kind>
const weightset_ptr& vcsn::detail::polynomialset_impl< Context, Kind >::weightset ( ) const
inline

Definition at line 125 of file polynomialset.hh.

◆ zero()

template<typename Context , wet_kind_t Kind>
const value_t& vcsn::detail::polynomialset_impl< Context, Kind >::zero ( ) const
inline

Definition at line 1015 of file polynomialset.hh.

References vcsn::res.

Member Data Documentation

◆ ctx_

template<typename Context , wet_kind_t Kind>
context_t vcsn::detail::polynomialset_impl< Context, Kind >::ctx_
private

Definition at line 1586 of file polynomialset.hh.

◆ in

template<typename Context , wet_kind_t Kind>
constexpr auto vcsn::detail::polynomialset_impl< Context, Kind >::in = 0

Definition at line 883 of file polynomialset.hh.

◆ langle

template<typename Context , wet_kind_t Kind>
constexpr char vcsn::detail::polynomialset_impl< Context, Kind >::langle = '<'
staticprivate

Left marker for weight in concrete syntax.

Definition at line 1589 of file polynomialset.hh.

◆ ls1

template<typename Context , wet_kind_t Kind>
const auto& vcsn::detail::polynomialset_impl< Context, Kind >::ls1 = *ps1.labelset()

Definition at line 878 of file polynomialset.hh.

◆ ls2

template<typename Context , wet_kind_t Kind>
const auto& vcsn::detail::polynomialset_impl< Context, Kind >::ls2 = *ps2.labelset()

Definition at line 879 of file polynomialset.hh.

◆ midls

template<typename Context , wet_kind_t Kind>
const auto& vcsn::detail::polynomialset_impl< Context, Kind >::midls = ls1.template set<out>()

Definition at line 885 of file polynomialset.hh.

◆ out

template<typename Context , wet_kind_t Kind>
constexpr auto vcsn::detail::polynomialset_impl< Context, Kind >::out = number_of_tapes<Ctx2>::value - 1

Definition at line 881 of file polynomialset.hh.

◆ rangle

template<typename Context , wet_kind_t Kind>
constexpr char vcsn::detail::polynomialset_impl< Context, Kind >::rangle = '>'
staticprivate

Right marker for weight in concrete syntax.

Definition at line 1591 of file polynomialset.hh.

◆ res [1/3]

template<typename Context , wet_kind_t Kind>
auto vcsn::detail::polynomialset_impl< Context, Kind >::res = value_t{}

Definition at line 886 of file polynomialset.hh.

◆ res [2/3]

template<typename Context , wet_kind_t Kind>
for (const auto& m1: p1) for ( const auto & m2 return vcsn::detail::polynomialset_impl< Context, Kind >::res

Definition at line 887 of file polynomialset.hh.

◆ res [3/3]

template<typename Context , wet_kind_t Kind>
for (const auto& lm: l) for ( const auto & rm return vcsn::detail::polynomialset_impl< Context, Kind >::res

Definition at line 906 of file polynomialset.hh.

◆ value_t

template<typename Context , wet_kind_t Kind>
vcsn::detail::polynomialset_impl< Context, Kind >::value_t
Initial value:
{
const auto& ls = *labelset()

Definition at line 876 of file polynomialset.hh.


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