![]() |
Vcsn
2.1
Be Rational
|
Functor to compute the expansion of an expression. More...
#include <to-expansion.hh>
Classes | |
struct | visit_tuple |
struct | visit_tuple< false, Dummy > |
Public Types | |
using | expressionset_t = ExpSet |
using | super_t = typename expressionset_t::const_visitor |
using | self_t = to_expansion_visitor |
using | context_t = context_t_of< expressionset_t > |
using | labelset_t = labelset_t_of< context_t > |
using | expression_t = typename expressionset_t::value_t |
using | weightset_t = weightset_t_of< expressionset_t > |
using | weight_t = typename weightset_t::value_t |
using | expansionset_t = expansionset< expressionset_t > |
using | polynomialset_t = expression_polynomialset_t< expressionset_t > |
using | polynomial_t = typename polynomialset_t::value_t |
using | polys_t = typename expansionset_t::polys_t |
using | expansion_t = typename expansionset_t::value_t |
Public Member Functions | |
to_expansion_visitor (const expressionset_t &rs) | |
expansion_t | operator() (const expression_t &v) |
From an expression, build its expansion. More... | |
Static Public Member Functions | |
static constexpr const char * | me () |
Private Types | |
using | tuple_t = typename super_t::tuple_t |
Private Member Functions | |
expansion_t | to_expansion (const expression_t &e) |
Facilitate recursion. More... | |
std::ostream & | print_ (const expansion_t &v, std::ostream &o) const |
Print an expansion. More... | |
VCSN_RAT_VISIT (zero,) | |
VCSN_RAT_VISIT (one,) | |
VCSN_RAT_VISIT (atom, e) | |
VCSN_RAT_VISIT (sum, e) | |
VCSN_RAT_VISIT (prod, e) | |
expression_t | prod_ (typename prod_t::iterator begin, typename prod_t::iterator end) const |
Build a product for these expressions. More... | |
VCSN_RAT_VISIT (ldiv, e) | |
VCSN_RAT_VISIT (conjunction, e) | |
VCSN_RAT_VISIT (shuffle, e) | |
VCSN_RAT_VISIT (infiltration, e) | |
VCSN_RAT_VISIT (complement, e) | |
VCSN_RAT_VISIT (transposition, e) | |
VCSN_RAT_VISIT (star, e) | |
VCSN_RAT_VISIT (lweight, e) | |
VCSN_RAT_VISIT (rweight, e) | |
void | visit (const tuple_t &v, std::true_type) override |
Private Attributes | |
expressionset_t | rs_ |
Manipulate the expressions. More... | |
labelset_t | ls_ = *rs_.labelset() |
Manipulate the labels. More... | |
weightset_t | ws_ = *rs_.weightset() |
Manipulate the weights. More... | |
polynomialset_t | ps_ = make_expression_polynomialset(rs_) |
Manipulate the polynomials of expressions. More... | |
expansionset_t | es_ = {rs_} |
Manipulate the expansions. More... | |
bool | transposed_ = false |
Whether to work transposed. More... | |
expansion_t | res_ |
The result. More... | |
Functor to compute the expansion of an expression.
ExpSet | the expressionset type. |
Definition at line 40 of file to-expansion.hh.
using vcsn::rat::to_expansion_visitor< ExpSet >::context_t = context_t_of<expressionset_t> |
Definition at line 48 of file to-expansion.hh.
using vcsn::rat::to_expansion_visitor< ExpSet >::expansion_t = typename expansionset_t::value_t |
Definition at line 61 of file to-expansion.hh.
using vcsn::rat::to_expansion_visitor< ExpSet >::expansionset_t = expansionset<expressionset_t> |
Definition at line 53 of file to-expansion.hh.
using vcsn::rat::to_expansion_visitor< ExpSet >::expression_t = typename expressionset_t::value_t |
Definition at line 50 of file to-expansion.hh.
using vcsn::rat::to_expansion_visitor< ExpSet >::expressionset_t = ExpSet |
Definition at line 44 of file to-expansion.hh.
using vcsn::rat::to_expansion_visitor< ExpSet >::labelset_t = labelset_t_of<context_t> |
Definition at line 49 of file to-expansion.hh.
using vcsn::rat::to_expansion_visitor< ExpSet >::polynomial_t = typename polynomialset_t::value_t |
Definition at line 56 of file to-expansion.hh.
using vcsn::rat::to_expansion_visitor< ExpSet >::polynomialset_t = expression_polynomialset_t<expressionset_t> |
Definition at line 55 of file to-expansion.hh.
using vcsn::rat::to_expansion_visitor< ExpSet >::polys_t = typename expansionset_t::polys_t |
Definition at line 60 of file to-expansion.hh.
using vcsn::rat::to_expansion_visitor< ExpSet >::self_t = to_expansion_visitor |
Definition at line 46 of file to-expansion.hh.
using vcsn::rat::to_expansion_visitor< ExpSet >::super_t = typename expressionset_t::const_visitor |
Definition at line 45 of file to-expansion.hh.
|
private |
Definition at line 354 of file to-expansion.hh.
using vcsn::rat::to_expansion_visitor< ExpSet >::weight_t = typename weightset_t::value_t |
Definition at line 52 of file to-expansion.hh.
using vcsn::rat::to_expansion_visitor< ExpSet >::weightset_t = weightset_t_of<expressionset_t> |
Definition at line 51 of file to-expansion.hh.
|
inline |
Definition at line 63 of file to-expansion.hh.
|
inlinestatic |
Definition at line 58 of file to-expansion.hh.
|
inline |
From an expression, build its expansion.
Definition at line 68 of file to-expansion.hh.
References vcsn::rat::to_expansion_visitor< ExpSet >::es_, vcsn::rat::to_expansion_visitor< ExpSet >::res_, and vcsn::rat::expansionset< ExpSet >::zero().
|
inlineprivate |
Print an expansion.
Definition at line 122 of file to-expansion.hh.
References vcsn::rat::to_expansion_visitor< ExpSet >::es_, vcsn::rat::expansionset< ExpSet >::print(), and vcsn::rat::to_expansion_visitor< ExpSet >::transposed_.
Referenced by vcsn::rat::to_expansion_visitor< ExpSet >::VCSN_RAT_VISIT().
|
inlineprivate |
Build a product for these expressions.
Pay attention to not building products with 0 or 1 expression.
FIXME: Code duplication with derivation.
Definition at line 204 of file to-expansion.hh.
References vcsn::rat::to_expansion_visitor< ExpSet >::rs_.
Referenced by vcsn::rat::to_expansion_visitor< ExpSet >::VCSN_RAT_VISIT().
|
inlineprivate |
Facilitate recursion.
Saves and restore res_.
Definition at line 84 of file to-expansion.hh.
Referenced by vcsn::rat::to_expansion_visitor< ExpSet >::VCSN_RAT_VISIT().
|
inlineprivate |
Definition at line 131 of file to-expansion.hh.
References vcsn::rat::to_expansion_visitor< ExpSet >::es_, vcsn::rat::to_expansion_visitor< ExpSet >::res_, and vcsn::rat::expansionset< ExpSet >::zero().
|
inlineprivate |
Definition at line 136 of file to-expansion.hh.
References vcsn::rat::to_expansion_visitor< ExpSet >::es_, vcsn::rat::expansionset< ExpSet >::one(), and vcsn::rat::to_expansion_visitor< ExpSet >::res_.
|
inlineprivate |
Definition at line 141 of file to-expansion.hh.
References vcsn::rat::expansionset< ExpSet >::atom(), vcsn::rat::to_expansion_visitor< ExpSet >::es_, vcsn::rat::to_expansion_visitor< ExpSet >::ls_, vcsn::rat::to_expansion_visitor< ExpSet >::res_, and vcsn::rat::to_expansion_visitor< ExpSet >::transposed_.
|
inlineprivate |
Definition at line 148 of file to-expansion.hh.
References vcsn::rat::expansionset< ExpSet >::add_here(), vcsn::rat::to_expansion_visitor< ExpSet >::es_, vcsn::rat::to_expansion_visitor< ExpSet >::res_, vcsn::rat::to_expansion_visitor< ExpSet >::to_expansion(), vcsn::v, and vcsn::rat::expansionset< ExpSet >::zero().
|
inlineprivate |
Definition at line 155 of file to-expansion.hh.
References vcsn::rat::to_expansion_visitor< ExpSet >::es_, vcsn::rat::expansionset< ExpSet >::one(), vcsn::rat::to_expansion_visitor< ExpSet >::prod_(), vcsn::rat::to_expansion_visitor< ExpSet >::ps_, vcsn::rat::to_expansion_visitor< ExpSet >::res_, vcsn::rat::expansionset< ExpSet >::rmul_here(), vcsn::rat::to_expansion_visitor< ExpSet >::rs_, vcsn::rat::size(), vcsn::rat::to_expansion_visitor< ExpSet >::to_expansion(), vcsn::rat::to_expansion_visitor< ExpSet >::transposed_, and vcsn::rat::to_expansion_visitor< ExpSet >::ws_.
|
inlineprivate |
Definition at line 216 of file to-expansion.hh.
References vcsn::rat::expansionset< ExpSet >::add_here(), DEBUG_IF, vcsn::rat::to_expansion_visitor< ExpSet >::es_, vcsn::label_of(), vcsn::detail::label_one(), vcsn::rat::expansionset< ExpSet >::ldiv_here(), vcsn::rat::to_expansion_visitor< ExpSet >::ls_, vcsn::rat::expansionset< ExpSet >::normalize(), vcsn::rat::to_expansion_visitor< ExpSet >::print_(), vcsn::rat::to_expansion_visitor< ExpSet >::ps_, vcsn::rat::to_expansion_visitor< ExpSet >::res_, vcsn::rat::to_expansion_visitor< ExpSet >::rs_, vcsn::rat::to_expansion_visitor< ExpSet >::to_expansion(), vcsn::rat::to_expansion_visitor< ExpSet >::transposed_, vcsn::weight_of(), vcsn::rat::to_expansion_visitor< ExpSet >::ws_, vcsn::rat::expansionset< ExpSet >::zero(), and vcsn::zip_maps().
|
inlineprivate |
Definition at line 266 of file to-expansion.hh.
References vcsn::rat::expansionset< ExpSet >::conjunction(), vcsn::rat::to_expansion_visitor< ExpSet >::es_, vcsn::rat::to_expansion_visitor< ExpSet >::res_, and vcsn::rat::to_expansion_visitor< ExpSet >::to_expansion().
|
inlineprivate |
Definition at line 274 of file to-expansion.hh.
References vcsn::rat::to_expansion_visitor< ExpSet >::es_, vcsn::rat::to_expansion_visitor< ExpSet >::res_, vcsn::rat::to_expansion_visitor< ExpSet >::rs_, vcsn::rat::expansionset< ExpSet >::shuffle(), and vcsn::rat::to_expansion_visitor< ExpSet >::to_expansion().
|
inlineprivate |
Definition at line 289 of file to-expansion.hh.
References vcsn::rat::to_expansion_visitor< ExpSet >::es_, vcsn::rat::expansionset< ExpSet >::infiltration(), vcsn::rat::to_expansion_visitor< ExpSet >::res_, vcsn::rat::to_expansion_visitor< ExpSet >::rs_, and vcsn::rat::to_expansion_visitor< ExpSet >::to_expansion().
|
inlineprivate |
Definition at line 304 of file to-expansion.hh.
References vcsn::rat::expansionset< ExpSet >::complement(), vcsn::rat::to_expansion_visitor< ExpSet >::es_, vcsn::rat::to_expansion_visitor< ExpSet >::res_, and vcsn::rat::to_expansion_visitor< ExpSet >::to_expansion().
|
inlineprivate |
Definition at line 310 of file to-expansion.hh.
References vcsn::rat::to_expansion_visitor< ExpSet >::transposed_.
|
inlineprivate |
Definition at line 317 of file to-expansion.hh.
References vcsn::label_of(), vcsn::rat::to_expansion_visitor< ExpSet >::ps_, vcsn::rat::to_expansion_visitor< ExpSet >::res_, vcsn::rat::to_expansion_visitor< ExpSet >::rs_, vcsn::rat::to_expansion_visitor< ExpSet >::to_expansion(), vcsn::rat::to_expansion_visitor< ExpSet >::transposed_, vcsn::weight_of(), and vcsn::rat::to_expansion_visitor< ExpSet >::ws_.
|
inlineprivate |
Definition at line 334 of file to-expansion.hh.
References vcsn::rat::to_expansion_visitor< ExpSet >::es_, vcsn::rat::expansionset< ExpSet >::lmul_here(), vcsn::rat::to_expansion_visitor< ExpSet >::res_, vcsn::rat::expansionset< ExpSet >::rmul(), vcsn::rat::to_expansion_visitor< ExpSet >::to_expansion(), vcsn::rat::to_expansion_visitor< ExpSet >::transposed_, and vcsn::rat::to_expansion_visitor< ExpSet >::ws_.
|
inlineprivate |
Definition at line 344 of file to-expansion.hh.
References vcsn::rat::to_expansion_visitor< ExpSet >::es_, vcsn::rat::expansionset< ExpSet >::lmul_here(), vcsn::rat::to_expansion_visitor< ExpSet >::res_, vcsn::rat::expansionset< ExpSet >::rmul(), vcsn::rat::to_expansion_visitor< ExpSet >::to_expansion(), vcsn::rat::to_expansion_visitor< ExpSet >::transposed_, and vcsn::rat::to_expansion_visitor< ExpSet >::ws_.
|
inlineoverrideprivate |
Definition at line 387 of file to-expansion.hh.
References vcsn::rat::to_expansion_visitor< ExpSet >::res_, and vcsn::v.
|
private |
Manipulate the expansions.
Definition at line 401 of file to-expansion.hh.
Referenced by vcsn::rat::to_expansion_visitor< ExpSet >::operator()(), vcsn::rat::to_expansion_visitor< ExpSet >::print_(), vcsn::rat::to_expansion_visitor< ExpSet >::VCSN_RAT_VISIT(), and vcsn::rat::to_expansion_visitor< ExpSet >::visit_tuple< bool, Dummy >::work_().
|
private |
Manipulate the labels.
Definition at line 395 of file to-expansion.hh.
Referenced by vcsn::rat::to_expansion_visitor< ExpSet >::VCSN_RAT_VISIT().
|
private |
Manipulate the polynomials of expressions.
Definition at line 399 of file to-expansion.hh.
Referenced by vcsn::rat::to_expansion_visitor< ExpSet >::VCSN_RAT_VISIT().
|
private |
The result.
Definition at line 406 of file to-expansion.hh.
Referenced by vcsn::rat::to_expansion_visitor< ExpSet >::operator()(), vcsn::rat::to_expansion_visitor< ExpSet >::VCSN_RAT_VISIT(), and vcsn::rat::to_expansion_visitor< ExpSet >::visit().
|
private |
Manipulate the expressions.
Definition at line 393 of file to-expansion.hh.
Referenced by vcsn::rat::to_expansion_visitor< ExpSet >::prod_(), vcsn::rat::to_expansion_visitor< ExpSet >::VCSN_RAT_VISIT(), and vcsn::rat::to_expansion_visitor< ExpSet >::visit_tuple< bool, Dummy >::work_().
|
private |
Whether to work transposed.
Definition at line 404 of file to-expansion.hh.
Referenced by vcsn::rat::to_expansion_visitor< ExpSet >::print_(), and vcsn::rat::to_expansion_visitor< ExpSet >::VCSN_RAT_VISIT().
|
private |
Manipulate the weights.
Definition at line 397 of file to-expansion.hh.
Referenced by vcsn::rat::to_expansion_visitor< ExpSet >::VCSN_RAT_VISIT().