Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
also coerce final output
Browse files Browse the repository at this point in the history
  • Loading branch information
cheuberg committed Oct 5, 2014
1 parent c8d91d0 commit 8e0b5cc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/sage/combinat/finite_state_machine_generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,8 @@ def Recursion(self, recursions, function, var, base,
....: print t.word_out[0].parent()
Integer Ring
Integer Ring
sage: T.states()[0].final_word_out[0].parent()
Integer Ring
In contrast, if ``output_rings`` is set to the empty list, the
results are not coerced::
Expand All @@ -816,6 +818,8 @@ def Recursion(self, recursions, function, var, base,
AttributeError: 'int' object has no attribute 'parent'
sage: T.transitions()[1].word_out[0].parent()
Symbolic Ring
sage: T.states()[0].final_word_out[0].parent()
Symbolic Ring
Finally, we use a somewhat questionable coercion::
Expand Down Expand Up @@ -1107,7 +1111,7 @@ def parse_equation(equation):
"in %s." % (left_side.operands()[0],
var))
if polynomial_left in base_ring and is_scalar(right_side):
initial_values[polynomial_left] = right_side
initial_values[polynomial_left] = coerce_output(right_side)
return

if polynomial_left.degree() != 1:
Expand Down

0 comments on commit 8e0b5cc

Please sign in to comment.