Vcsn  2.8
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 (name, v)
 
 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

◆ context_t

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.

◆ expression_t

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.

◆ expressionset_t

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

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

◆ self_t

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

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

◆ super_t

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.

◆ tuple_t

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

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

◆ weight_t

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.

◆ weightset_t

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

◆ constant_term_visitor()

Member Function Documentation

◆ constant_term()

◆ me()

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.

◆ operator()()

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:

◆ VCSN_RAT_UNSUPPORTED() [1/2]

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

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

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

◆ VCSN_RAT_UNSUPPORTED() [2/2]

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.

◆ VCSN_RAT_VISIT() [1/14]

template<typename ExpSet >
vcsn::rat::constant_term_visitor< ExpSet >::VCSN_RAT_VISIT ( zero  )
inlineprivate

◆ VCSN_RAT_VISIT() [2/14]

template<typename ExpSet >
vcsn::rat::constant_term_visitor< ExpSet >::VCSN_RAT_VISIT ( one  )
inlineprivate

◆ VCSN_RAT_VISIT() [3/14]

template<typename ExpSet >
vcsn::rat::constant_term_visitor< ExpSet >::VCSN_RAT_VISIT ( atom  )
inlineprivate

◆ VCSN_RAT_VISIT() [4/14]

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

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

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

Here is the call graph for this function:

◆ VCSN_RAT_VISIT() [5/14]

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

Definition at line 90 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:

◆ VCSN_RAT_VISIT() [6/14]

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

Definition at line 109 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:

◆ VCSN_RAT_VISIT() [7/14]

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

Definition at line 110 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:

◆ VCSN_RAT_VISIT() [8/14]

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

Definition at line 111 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:

◆ VCSN_RAT_VISIT() [9/14]

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

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

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

Here is the call graph for this function:

◆ VCSN_RAT_VISIT() [10/14]

template<typename ExpSet >
vcsn::rat::constant_term_visitor< ExpSet >::VCSN_RAT_VISIT ( transposition  ,
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:

◆ VCSN_RAT_VISIT() [11/14]

template<typename ExpSet >
vcsn::rat::constant_term_visitor< ExpSet >::VCSN_RAT_VISIT ( star  ,
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:

◆ VCSN_RAT_VISIT() [12/14]

template<typename ExpSet >
vcsn::rat::constant_term_visitor< ExpSet >::VCSN_RAT_VISIT ( lweight  ,
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:

◆ VCSN_RAT_VISIT() [13/14]

template<typename ExpSet >
vcsn::rat::constant_term_visitor< ExpSet >::VCSN_RAT_VISIT ( rweight  ,
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:

◆ VCSN_RAT_VISIT() [14/14]

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

Definition at line 144 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:

◆ visit()

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

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

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

◆ visit_product()

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 101 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

◆ res_

◆ rs_

◆ ws_


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