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

Commit

Permalink
divide-by-two potential error. Improved an error message
Browse files Browse the repository at this point in the history
  • Loading branch information
johanrosenkilde committed Jul 30, 2016
1 parent e1cce49 commit b683f55
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/sage/rings/polynomial/skew_polynomial_ring.py
Original file line number Diff line number Diff line change
Expand Up @@ -717,13 +717,14 @@ def minimal_vanishing_polynomial(self, eval_pts, check=True):
else:
return x - (sigma(eval_pts[0]) / eval_pts[0])
else:
A = eval_pts[:len(eval_pts)/2]
B = eval_pts[(len(eval_pts)/2):]
t = len(eval_pts)//2
A = eval_pts[:t]
B = eval_pts[t:]
M_A = self.minimal_vanishing_polynomial(A)
M_A_B = self.multi_point_evaluation(M_A, B)
if check:
if 0 in M_A_B:
raise ValueError("evaluation points are not linearly independent")
raise ValueError("evaluation points must be linearly independent over the fixed field of the twist map")
M_M_A_B = self.minimal_vanishing_polynomial(M_A_B)
return M_M_A_B * M_A

Expand Down Expand Up @@ -758,8 +759,9 @@ def multi_point_evaluation(self, p, eval_pts):
if len(eval_pts) == 1:
return [ p(eval_pts[0]) ]
else:
A = eval_pts[:len(eval_pts)/2]
B = eval_pts[(len(eval_pts)/2):]
t = len(eval_pts)//2
A = eval_pts[:t]
B = eval_pts[t:]
M_A = self.minimal_vanishing_polynomial(A)
M_B = self.minimal_vanishing_polynomial(B)
Q_A, R_A = p.right_quo_rem(M_A)
Expand Down

0 comments on commit b683f55

Please sign in to comment.