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

Functor to compute the derivation of an expression. More...

#include <derivation.hh>

Inheritance diagram for vcsn::rat::derivation_visitor< ExpSet >:
Collaboration diagram for vcsn::rat::derivation_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 = derivation_visitor
 
using context_t = context_t_of< expressionset_t >
 
using labelset_t = labelset_t_of< context_t >
 
using label_t = label_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 polynomialset_t = expression_polynomialset_t< expressionset_t >
 
using polynomial_t = typename polynomialset_t::value_t
 
using node_t = typename super_t::node_t
 

Public Member Functions

 derivation_visitor (const expressionset_t &rs)
 
polynomial_t operator() (const expression_t &v, label_t var)
 

Static Public Member Functions

static constexpr const charme ()
 

Private Types

using tuple_t = typename super_t::tuple_t
 

Private Member Functions

 VCSN_RAT_VISIT (zero,)
 
 VCSN_RAT_VISIT (one,)
 
 VCSN_RAT_VISIT (atom, e)
 
 VCSN_RAT_VISIT (add, e)
 
 VCSN_RAT_VISIT (mul, e)
 
expression_t prod_ (typename mul_t::iterator begin, typename mul_t::iterator end) const
 Build a product for these expressions. More...
 
 VCSN_RAT_VISIT (conjunction, e)
 
 VCSN_RAT_VISIT (shuffle, e)
 
 VCSN_RAT_VISIT (complement, 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_
 
weightset_t ws_ = *rs_.weightset()
 Shorthand to the weightset. More...
 
polynomialset_t ps_ = make_expression_polynomialset(rs_)
 
polynomial_t res_
 The result. More...
 
label_t variable_
 The derivation variable. More...
 

Detailed Description

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

Functor to compute the derivation of an expression.

Template Parameters
ExpSetthe expressionset type.

Definition at line 32 of file derivation.hh.

Member Typedef Documentation

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

Definition at line 40 of file derivation.hh.

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

Definition at line 43 of file derivation.hh.

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

Definition at line 36 of file derivation.hh.

template<typename ExpSet >
using vcsn::rat::derivation_visitor< ExpSet >::label_t = label_t_of<context_t>

Definition at line 42 of file derivation.hh.

template<typename ExpSet >
using vcsn::rat::derivation_visitor< ExpSet >::labelset_t = labelset_t_of<context_t>

Definition at line 41 of file derivation.hh.

template<typename ExpSet >
using vcsn::rat::derivation_visitor< ExpSet >::node_t = typename super_t::node_t

Definition at line 50 of file derivation.hh.

template<typename ExpSet >
using vcsn::rat::derivation_visitor< ExpSet >::polynomial_t = typename polynomialset_t::value_t

Definition at line 48 of file derivation.hh.

Definition at line 47 of file derivation.hh.

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

Definition at line 38 of file derivation.hh.

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

Definition at line 37 of file derivation.hh.

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

Definition at line 220 of file derivation.hh.

template<typename ExpSet >
using vcsn::rat::derivation_visitor< ExpSet >::weight_t = typename weightset_t::value_t

Definition at line 45 of file derivation.hh.

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

Definition at line 44 of file derivation.hh.

Constructor & Destructor Documentation

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

Definition at line 54 of file derivation.hh.

Member Function Documentation

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

Definition at line 52 of file derivation.hh.

template<typename ExpSet >
polynomial_t vcsn::rat::derivation_visitor< ExpSet >::operator() ( const expression_t v,
label_t  var 
)
inline

Definition at line 59 of file derivation.hh.

References vcsn::rat::derivation_visitor< ExpSet >::res_, vcsn::rat::derivation_visitor< ExpSet >::rs_, vcsn::rat::to_string(), and vcsn::rat::derivation_visitor< ExpSet >::variable_.

Here is the call graph for this function:

template<typename ExpSet >
expression_t vcsn::rat::derivation_visitor< ExpSet >::prod_ ( typename mul_t::iterator  begin,
typename mul_t::iterator  end 
) const
inlineprivate

Build a product for these expressions.

Pay attention to not building products with 0 or 1 expression.

FIXME: Code duplication with to_expansion.

Definition at line 140 of file derivation.hh.

References vcsn::rat::derivation_visitor< ExpSet >::rs_.

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

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

Definition at line 111 of file derivation.hh.

References vcsn::constant_term(), vcsn::rat::derivation_visitor< ExpSet >::prod_(), vcsn::rat::derivation_visitor< ExpSet >::ps_, vcsn::res, vcsn::rat::derivation_visitor< ExpSet >::res_, vcsn::rat::derivation_visitor< ExpSet >::rs_, vcsn::v, and vcsn::rat::derivation_visitor< ExpSet >::ws_.

Here is the call graph for this function:

template<typename ExpSet >
vcsn::rat::derivation_visitor< ExpSet >::VCSN_RAT_VISIT ( conjunction  ,
 
)
inlineprivate
template<typename ExpSet >
vcsn::rat::derivation_visitor< ExpSet >::VCSN_RAT_VISIT ( shuffle  ,
 
)
inlineprivate

Definition at line 167 of file derivation.hh.

References vcsn::label_of(), vcsn::rat::derivation_visitor< ExpSet >::ps_, vcsn::res, vcsn::rat::derivation_visitor< ExpSet >::res_, and vcsn::weight_of().

Here is the call graph for this function:

template<typename ExpSet >
vcsn::rat::derivation_visitor< ExpSet >::VCSN_RAT_VISIT ( complement  ,
 
)
inlineprivate
template<typename ExpSet >
vcsn::rat::derivation_visitor< ExpSet >::VCSN_RAT_VISIT ( star  ,
 
)
inlineprivate

Definition at line 196 of file derivation.hh.

References vcsn::constant_term(), vcsn::rat::derivation_visitor< ExpSet >::ps_, vcsn::rat::derivation_visitor< ExpSet >::res_, vcsn::rat::derivation_visitor< ExpSet >::rs_, and vcsn::rat::derivation_visitor< ExpSet >::ws_.

Here is the call graph for this function:

template<typename ExpSet >
vcsn::rat::derivation_visitor< ExpSet >::VCSN_RAT_VISIT ( lweight  ,
 
)
inlineprivate
template<typename ExpSet >
vcsn::rat::derivation_visitor< ExpSet >::VCSN_RAT_VISIT ( rweight  ,
 
)
inlineprivate
template<typename ExpSet >
void vcsn::rat::derivation_visitor< ExpSet >::visit ( const tuple_t v,
std::true_type   
)
inlineoverrideprivate

Definition at line 267 of file derivation.hh.

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

Member Data Documentation

template<typename ExpSet >
weightset_t vcsn::rat::derivation_visitor< ExpSet >::ws_ = *rs_.weightset()
private

Shorthand to the weightset.

Definition at line 275 of file derivation.hh.

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


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