Vcsn  2.8
Be Rational
vcsn::rat::split_visitor< ExpSet > Class Template Reference

Break a rational expression into a polynomial. More...

#include <split.hh>

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

Public Types

using expressionset_t = ExpSet
 
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 super_t = typename expressionset_t::const_visitor
 
template<type_t Type>
using variadic_t = typename super_t::template variadic_t< Type >
 
using tuple_t = typename super_t::tuple_t
 

Public Member Functions

 split_visitor (const expressionset_t &rs)
 
polynomial_t operator() (const expression_t &v)
 Break an expression into a polynomial. More...
 
polynomial_t split (const expression_t &v)
 Easy recursion. More...
 
 VCSN_RAT_VISIT (zero,)
 
 VCSN_RAT_VISIT (add, e)
 
polynomial_t multiply (const expression_t &l, const expression_t &r)
 The split-multiplation of l with r. More...
 
polynomial_t multiply (const polynomial_t &l, const expression_t &r)
 The split-multiplation of l with r. More...
 
 VCSN_RAT_VISIT (mul, e)
 Handle an n-ary multiplication. More...
 
 VCSN_RAT_VISIT (atom, e)
 
 VCSN_RAT_VISIT (complement, e)
 
 VCSN_RAT_VISIT (compose, e)
 
 VCSN_RAT_VISIT (conjunction, e)
 
 VCSN_RAT_VISIT (infiltrate, e)
 
 VCSN_RAT_VISIT (ldivide, e)
 
 VCSN_RAT_VISIT (name, e)
 
 VCSN_RAT_VISIT (one, e)
 
 VCSN_RAT_VISIT (shuffle, e)
 
 VCSN_RAT_VISIT (star, e)
 
 VCSN_RAT_VISIT (transposition, e)
 
void visit (const tuple_t &, std::true_type) override
 
 VCSN_RAT_VISIT (lweight, e)
 
 VCSN_RAT_VISIT (rweight, e)
 

Static Public Member Functions

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

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

Detailed Description

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

Break a rational expression into a polynomial.

This is based on the following paper:

/// @article{angrand.2010.jalc,
///   author =       {Pierre-Yves Angrand and Sylvain Lombardy and Jacques
///                   Sakarovitch},
///   journal =      {Journal of Automata, Languages and Combinatorics},
///   number =       {1/2},
///   pages =        {27--51},
///   title =        {On the Number of Broken Derived Terms of a Rational
///                   Expression},
///   volume =       15,
///   year =         2010,
///   abstract =     {Bounds are given on the number of broken derived
///                   terms (a variant of Antimirov's ``partial
///                   derivatives'') of a rational expression $E$. It is
///                   shown that this number is less than or equal to
///                   $2l(E) + 1$ in the general case, where $l(E)$ is the
///                   literal length of the expression $E$, and that the
///                   classical bound $l(E) + 1$ which holds for partial
///                   derivatives also holds for broken derived terms if E
///                   is in star normal form.\\In a second part of the
///                   paper, the influence of the bracketing of an
///                   expression on the number of its derived terms is
///                   also discussed.}
/// }
///

Definition at line 75 of file split.hh.

Member Typedef Documentation

◆ context_t

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

Definition at line 80 of file split.hh.

◆ expression_t

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

Definition at line 83 of file split.hh.

◆ expressionset_t

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

Definition at line 79 of file split.hh.

◆ label_t

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

Definition at line 82 of file split.hh.

◆ labelset_t

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

Definition at line 81 of file split.hh.

◆ polynomial_t

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

Definition at line 88 of file split.hh.

◆ polynomialset_t

Definition at line 87 of file split.hh.

◆ super_t

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

Definition at line 90 of file split.hh.

◆ tuple_t

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

Definition at line 196 of file split.hh.

◆ variadic_t

template<typename ExpSet >
template<type_t Type>
using vcsn::rat::split_visitor< ExpSet >::variadic_t = typename super_t::template variadic_t<Type>

Definition at line 93 of file split.hh.

◆ weight_t

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

Definition at line 85 of file split.hh.

◆ weightset_t

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

Definition at line 84 of file split.hh.

Constructor & Destructor Documentation

◆ split_visitor()

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

Definition at line 98 of file split.hh.

Member Function Documentation

◆ me()

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

Name of this algorithm, for error messages.

Definition at line 96 of file split.hh.

◆ multiply() [1/2]

template<typename ExpSet >
polynomial_t vcsn::rat::split_visitor< ExpSet >::multiply ( const expression_t l,
const expression_t r 
)
inline

The split-multiplation of l with r.

Returns split(l) x split(r).

Definition at line 134 of file split.hh.

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

Here is the call graph for this function:

◆ multiply() [2/2]

template<typename ExpSet >
polynomial_t vcsn::rat::split_visitor< ExpSet >::multiply ( const polynomial_t l,
const expression_t r 
)
inline

The split-multiplation of l with r.

Returns l x split(r).

FIXME: This is inefficient, we split the lhs way too often.

Definition at line 156 of file split.hh.

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

Here is the call graph for this function:

◆ operator()()

template<typename ExpSet >
polynomial_t vcsn::rat::split_visitor< ExpSet >::operator() ( const expression_t v)
inline

Break an expression into a polynomial.

Definition at line 103 of file split.hh.

References vcsn::split().

Here is the call graph for this function:

◆ split()

template<typename ExpSet >
polynomial_t vcsn::rat::split_visitor< ExpSet >::split ( const expression_t v)
inline

Easy recursion.

Definition at line 109 of file split.hh.

◆ VCSN_RAT_VISIT() [1/16]

template<typename ExpSet >
vcsn::rat::split_visitor< ExpSet >::VCSN_RAT_VISIT ( zero  )
inline

Definition at line 115 of file split.hh.

◆ VCSN_RAT_VISIT() [2/16]

template<typename ExpSet >
vcsn::rat::split_visitor< ExpSet >::VCSN_RAT_VISIT ( add  ,
 
)
inline

Definition at line 120 of file split.hh.

References vcsn::res, and vcsn::v.

◆ VCSN_RAT_VISIT() [3/16]

template<typename ExpSet >
vcsn::rat::split_visitor< ExpSet >::VCSN_RAT_VISIT ( mul  ,
 
)
inline

Handle an n-ary multiplication.

Definition at line 168 of file split.hh.

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

Here is the call graph for this function:

◆ VCSN_RAT_VISIT() [4/16]

template<typename ExpSet >
vcsn::rat::split_visitor< ExpSet >::VCSN_RAT_VISIT ( atom  ,
 
)
inline

Definition at line 183 of file split.hh.

◆ VCSN_RAT_VISIT() [5/16]

template<typename ExpSet >
vcsn::rat::split_visitor< ExpSet >::VCSN_RAT_VISIT ( complement  ,
 
)
inline

Definition at line 184 of file split.hh.

◆ VCSN_RAT_VISIT() [6/16]

template<typename ExpSet >
vcsn::rat::split_visitor< ExpSet >::VCSN_RAT_VISIT ( compose  ,
 
)
inline

Definition at line 185 of file split.hh.

◆ VCSN_RAT_VISIT() [7/16]

template<typename ExpSet >
vcsn::rat::split_visitor< ExpSet >::VCSN_RAT_VISIT ( conjunction  ,
 
)
inline

Definition at line 186 of file split.hh.

◆ VCSN_RAT_VISIT() [8/16]

template<typename ExpSet >
vcsn::rat::split_visitor< ExpSet >::VCSN_RAT_VISIT ( infiltrate  ,
 
)
inline

Definition at line 187 of file split.hh.

◆ VCSN_RAT_VISIT() [9/16]

template<typename ExpSet >
vcsn::rat::split_visitor< ExpSet >::VCSN_RAT_VISIT ( ldivide  ,
 
)
inline

Definition at line 188 of file split.hh.

◆ VCSN_RAT_VISIT() [10/16]

template<typename ExpSet >
vcsn::rat::split_visitor< ExpSet >::VCSN_RAT_VISIT ( name  ,
 
)
inline

Definition at line 189 of file split.hh.

◆ VCSN_RAT_VISIT() [11/16]

template<typename ExpSet >
vcsn::rat::split_visitor< ExpSet >::VCSN_RAT_VISIT ( one  ,
 
)
inline

Definition at line 190 of file split.hh.

◆ VCSN_RAT_VISIT() [12/16]

template<typename ExpSet >
vcsn::rat::split_visitor< ExpSet >::VCSN_RAT_VISIT ( shuffle  ,
 
)
inline

Definition at line 191 of file split.hh.

◆ VCSN_RAT_VISIT() [13/16]

template<typename ExpSet >
vcsn::rat::split_visitor< ExpSet >::VCSN_RAT_VISIT ( star  ,
 
)
inline

Definition at line 192 of file split.hh.

◆ VCSN_RAT_VISIT() [14/16]

template<typename ExpSet >
vcsn::rat::split_visitor< ExpSet >::VCSN_RAT_VISIT ( transposition  ,
 
)
inline

Definition at line 193 of file split.hh.

◆ VCSN_RAT_VISIT() [15/16]

template<typename ExpSet >
vcsn::rat::split_visitor< ExpSet >::VCSN_RAT_VISIT ( lweight  ,
 
)
inline

Definition at line 202 of file split.hh.

◆ VCSN_RAT_VISIT() [16/16]

template<typename ExpSet >
vcsn::rat::split_visitor< ExpSet >::VCSN_RAT_VISIT ( rweight  ,
 
)
inline

Definition at line 208 of file split.hh.

◆ visit()

template<typename ExpSet >
void vcsn::rat::split_visitor< ExpSet >::visit ( const tuple_t ,
std::true_type   
)
inlineoverride

Definition at line 197 of file split.hh.

Member Data Documentation

◆ ps_

template<typename ExpSet >
polynomialset_t vcsn::rat::split_visitor< ExpSet >::ps_ = make_expression_polynomialset(rs_)
private

Definition at line 218 of file split.hh.

◆ res_

template<typename ExpSet >
polynomial_t vcsn::rat::split_visitor< ExpSet >::res_
private

The result.

Definition at line 220 of file split.hh.

◆ rs_

template<typename ExpSet >
expressionset_t vcsn::rat::split_visitor< ExpSet >::rs_
private

Definition at line 215 of file split.hh.

◆ ws_

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

Shorthand to the weightset.

Definition at line 217 of file split.hh.


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