Vcsn  2.4
Be Rational
vcsn::rat::constant_term_visitor< ExpSet > Class Template Reference

A functor to compute the constant term of an expression. More...

#include <constant-term.hh>

Inheritance diagram for vcsn::rat::constant_term_visitor< ExpSet >:
Collaboration diagram for vcsn::rat::constant_term_visitor< ExpSet >:

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 = constant_term_visitor
 
using context_t = context_t_of< expressionset_t >
 
using expression_t = typename expressionset_t::value_t
 
using weight_t = weight_t_of< expressionset_t >
 
using weightset_t = weightset_t_of< expressionset_t >
 

Public Member Functions

 constant_term_visitor (const expressionset_t &rs)
 
weight_t operator() (const expression_t &v)
 

Static Public Member Functions

static constexpr const charme ()
 Name of this algorithm, for error messages. More...
 

Private Types

using tuple_t = typename super_t::tuple_t
 

Private Member Functions

weight_t constant_term (const expression_t &v)
 Easy recursion. More...
 
 VCSN_RAT_VISIT (zero,)
 
 VCSN_RAT_VISIT (one,)
 
 VCSN_RAT_VISIT (atom,)
 
 VCSN_RAT_VISIT (add, v)
 
template<typename Node >
void visit_product (const Node &v)
 Visit a variadic node whose constant-term is the product of the constant-terms of its children. More...
 
 VCSN_RAT_VISIT (conjunction, v)
 
 VCSN_RAT_VISIT (infiltrate, v)
 
 VCSN_RAT_VISIT (mul, v)
 
 VCSN_RAT_VISIT (shuffle, v)
 
 VCSN_RAT_UNSUPPORTED (ldivide)
 y`, yet both operands have a null constant-term. More...
 
 VCSN_RAT_UNSUPPORTED (compose)
 Cannot compute the constant-term easily here: c(<x>\\e|x @ <y>x|\\e) = xy, yet both operands have a null constant-term. More...
 
 VCSN_RAT_VISIT (transposition, v)
 
 VCSN_RAT_VISIT (star, v)
 
 VCSN_RAT_VISIT (lweight, v)
 
 VCSN_RAT_VISIT (rweight, v)
 
 VCSN_RAT_VISIT (complement, v)
 
void visit (const tuple_t &v, std::true_type) override
 

Private Attributes

expressionset_t rs_
 
weightset_t ws_
 
weight_t res_
 

Detailed Description

template<typename ExpSet>
class vcsn::rat::constant_term_visitor< ExpSet >

A functor to compute the constant term of an expression.

Template Parameters
ExpSetthe expressionset type.

Definition at line 28 of file constant-term.hh.

Member Typedef Documentation

template<typename ExpSet >
using vcsn::rat::constant_term_visitor< ExpSet >::context_t = context_t_of<expressionset_t>

Definition at line 36 of file constant-term.hh.

template<typename ExpSet >
using vcsn::rat::constant_term_visitor< ExpSet >::expression_t = typename expressionset_t::value_t

Definition at line 37 of file constant-term.hh.

template<typename ExpSet >
using vcsn::rat::constant_term_visitor< ExpSet >::expressionset_t = ExpSet

Definition at line 32 of file constant-term.hh.

template<typename ExpSet >
using vcsn::rat::constant_term_visitor< ExpSet >::self_t = constant_term_visitor

Definition at line 34 of file constant-term.hh.

template<typename ExpSet >
using vcsn::rat::constant_term_visitor< ExpSet >::super_t = typename expressionset_t::const_visitor

Definition at line 33 of file constant-term.hh.

template<typename ExpSet >
using vcsn::rat::constant_term_visitor< ExpSet >::tuple_t = typename super_t::tuple_t
private

Definition at line 151 of file constant-term.hh.

template<typename ExpSet >
using vcsn::rat::constant_term_visitor< ExpSet >::weight_t = weight_t_of<expressionset_t>

Definition at line 38 of file constant-term.hh.

template<typename ExpSet >
using vcsn::rat::constant_term_visitor< ExpSet >::weightset_t = weightset_t_of<expressionset_t>

Definition at line 39 of file constant-term.hh.

Constructor & Destructor Documentation

template<typename ExpSet >
vcsn::rat::constant_term_visitor< ExpSet >::constant_term_visitor ( const expressionset_t rs)
inline

Definition at line 44 of file constant-term.hh.

Member Function Documentation

template<typename ExpSet >
static constexpr const char* vcsn::rat::constant_term_visitor< ExpSet >::me ( )
inlinestatic

Name of this algorithm, for error messages.

Definition at line 42 of file constant-term.hh.

template<typename ExpSet >
weight_t vcsn::rat::constant_term_visitor< ExpSet >::operator() ( const expression_t v)
inline

Definition at line 49 of file constant-term.hh.

References vcsn::rat::constant_term_visitor< ExpSet >::constant_term(), vcsn::rat::constant_term_visitor< ExpSet >::rs_, and vcsn::rat::to_string().

Here is the call graph for this function:

template<typename ExpSet >
vcsn::rat::constant_term_visitor< ExpSet >::VCSN_RAT_UNSUPPORTED ( ldivide  )
private

y`, yet both operands have a null constant-term.

template<typename ExpSet >
vcsn::rat::constant_term_visitor< ExpSet >::VCSN_RAT_UNSUPPORTED ( compose  )
private

Cannot compute the constant-term easily here: c(<x>\\e|x @ <y>x|\\e) = xy, yet both operands have a null constant-term.

template<typename ExpSet >
vcsn::rat::constant_term_visitor< ExpSet >::VCSN_RAT_VISIT ( zero  )
inlineprivate
template<typename ExpSet >
vcsn::rat::constant_term_visitor< ExpSet >::VCSN_RAT_VISIT ( one  )
inlineprivate
template<typename ExpSet >
vcsn::rat::constant_term_visitor< ExpSet >::VCSN_RAT_VISIT ( atom  )
inlineprivate
template<typename ExpSet >
vcsn::rat::constant_term_visitor< ExpSet >::VCSN_RAT_VISIT ( add  ,
v   
)
inlineprivate

Definition at line 85 of file constant-term.hh.

References vcsn::rat::constant_term_visitor< ExpSet >::constant_term(), vcsn::res, vcsn::rat::constant_term_visitor< ExpSet >::res_, vcsn::v, and vcsn::rat::constant_term_visitor< ExpSet >::ws_.

Here is the call graph for this function:

template<typename ExpSet >
vcsn::rat::constant_term_visitor< ExpSet >::VCSN_RAT_VISIT ( conjunction  ,
v   
)
inlineprivate

Definition at line 104 of file constant-term.hh.

References vcsn::v, and vcsn::rat::constant_term_visitor< ExpSet >::visit_product().

Here is the call graph for this function:

template<typename ExpSet >
vcsn::rat::constant_term_visitor< ExpSet >::VCSN_RAT_VISIT ( infiltrate  ,
v   
)
inlineprivate

Definition at line 105 of file constant-term.hh.

References vcsn::v, and vcsn::rat::constant_term_visitor< ExpSet >::visit_product().

Here is the call graph for this function:

template<typename ExpSet >
vcsn::rat::constant_term_visitor< ExpSet >::VCSN_RAT_VISIT ( mul  ,
v   
)
inlineprivate

Definition at line 106 of file constant-term.hh.

References vcsn::v, and vcsn::rat::constant_term_visitor< ExpSet >::visit_product().

Here is the call graph for this function:

template<typename ExpSet >
vcsn::rat::constant_term_visitor< ExpSet >::VCSN_RAT_VISIT ( shuffle  ,
v   
)
inlineprivate

Definition at line 107 of file constant-term.hh.

References vcsn::v, and vcsn::rat::constant_term_visitor< ExpSet >::visit_product().

Here is the call graph for this function:

template<typename ExpSet >
vcsn::rat::constant_term_visitor< ExpSet >::VCSN_RAT_VISIT ( transposition  ,
v   
)
inlineprivate

Definition at line 119 of file constant-term.hh.

References vcsn::rat::constant_term_visitor< ExpSet >::constant_term(), vcsn::rat::constant_term_visitor< ExpSet >::res_, vcsn::v, and vcsn::rat::constant_term_visitor< ExpSet >::ws_.

Here is the call graph for this function:

template<typename ExpSet >
vcsn::rat::constant_term_visitor< ExpSet >::VCSN_RAT_VISIT ( star  ,
v   
)
inlineprivate

Definition at line 124 of file constant-term.hh.

References vcsn::rat::constant_term_visitor< ExpSet >::constant_term(), vcsn::rat::constant_term_visitor< ExpSet >::res_, vcsn::v, and vcsn::rat::constant_term_visitor< ExpSet >::ws_.

Here is the call graph for this function:

template<typename ExpSet >
vcsn::rat::constant_term_visitor< ExpSet >::VCSN_RAT_VISIT ( lweight  ,
v   
)
inlineprivate

Definition at line 129 of file constant-term.hh.

References vcsn::rat::constant_term_visitor< ExpSet >::constant_term(), vcsn::rat::constant_term_visitor< ExpSet >::res_, vcsn::v, and vcsn::rat::constant_term_visitor< ExpSet >::ws_.

Here is the call graph for this function:

template<typename ExpSet >
vcsn::rat::constant_term_visitor< ExpSet >::VCSN_RAT_VISIT ( rweight  ,
v   
)
inlineprivate

Definition at line 134 of file constant-term.hh.

References vcsn::rat::constant_term_visitor< ExpSet >::constant_term(), vcsn::rat::constant_term_visitor< ExpSet >::res_, vcsn::v, and vcsn::rat::constant_term_visitor< ExpSet >::ws_.

Here is the call graph for this function:

template<typename ExpSet >
vcsn::rat::constant_term_visitor< ExpSet >::VCSN_RAT_VISIT ( complement  ,
v   
)
inlineprivate

Definition at line 139 of file constant-term.hh.

References vcsn::rat::constant_term_visitor< ExpSet >::constant_term(), vcsn::rat::constant_term_visitor< ExpSet >::res_, vcsn::v, and vcsn::rat::constant_term_visitor< ExpSet >::ws_.

Here is the call graph for this function:

template<typename ExpSet >
void vcsn::rat::constant_term_visitor< ExpSet >::visit ( const tuple_t v,
std::true_type   
)
inlineoverrideprivate

Definition at line 189 of file constant-term.hh.

References vcsn::rat::constant_term_visitor< ExpSet >::res_, and vcsn::v.

template<typename ExpSet >
template<typename Node >
void vcsn::rat::constant_term_visitor< ExpSet >::visit_product ( const Node &  v)
inlineprivate

Visit a variadic node whose constant-term is the product of the constant-terms of its children.

Definition at line 96 of file constant-term.hh.

References vcsn::rat::constant_term_visitor< ExpSet >::constant_term(), vcsn::res, vcsn::rat::constant_term_visitor< ExpSet >::res_, and vcsn::rat::constant_term_visitor< ExpSet >::ws_.

Referenced by vcsn::rat::constant_term_visitor< ExpSet >::VCSN_RAT_VISIT().

Here is the call graph for this function:

Member Data Documentation


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