Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Views: 45897
Kernel: Python 3

automaton.rweight(weight, algo="auto")

The right scalar product of an automaton by a weight.

For consistency reasons with other operations, the algo parameter can be one of these:

  • "auto"

  • "general"

  • "standard"

However, due to how the scalar product works, this makes no difference.

Postconditions:

  • when applied to standard automata, the result is standard.

See also:

import vcsn a = vcsn.context('lal_char, q').expression('<2>a<3>bc', 'none').standard() a
Image in a Jupyter notebook
a.rweight(a.context().weight('5'))
Image in a Jupyter notebook

Instead of a.rweight(a.context().weight('5')), you may write a * 5.

a * 5
Image in a Jupyter notebook

To force the execution of the general algorithm you can do it this way.

a.rweight(a.context().weight('5'), 'general')
Image in a Jupyter notebook

However, apart from the multiplication by 0, there is no difference with the standard algorithm.