# automaton.lweight(weight, algo="auto")¶

The left scalar product of an automaton by a weight.

The algo parameter must be one of these:

• "auto": default parameter, same as "standard".
• "general": puts the weight on the initial transitions.
• "standard": does not put the weight on the initial transitions.

Postconditions:

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

In [1]:
import vcsn
a = vcsn.context('lal_char, q').expression('<2>a<3>b<4>', 'none').standard()
a

Out[1]:
In [2]:
a.lweight(a.context().weight('5'))

Out[2]:

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

In [3]:
5 * a

Out[3]:

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

In [4]:
a.lweight(a.context().weight('5'), 'general')

Out[4]: