Skip to content

Commit

Permalink
Bugfixes for the gcd_linear routine
Browse files Browse the repository at this point in the history
  • Loading branch information
benruijl committed Jun 15, 2015
1 parent c4277bd commit caea44a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sources/polygcd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1299,7 +1299,7 @@ const map<vector<int>,poly> polygcd::bracket(const poly &a, const vector<int>& f
mon.setmod(a.modp);
mon[0] = a[ai] + 1;
for (int i=0; i<a[ai]; i++)
if (i > 1 && i <= AN.poly_num_vars && varpattern[i - 1])
if (i > 0 && i <= AN.poly_num_vars && varpattern[i - 1])
mon[1+i] = 0;
else
mon[1+i] = a[ai+i];
Expand Down Expand Up @@ -1335,7 +1335,9 @@ const poly gcd_linear_helper (const poly &a, const poly &b) {

poly subgcd(BHEAD 1);
if (ba.size() == 2)
poly subgcd = polygcd::gcd_linear(ba.begin()->second, (ba.begin()++)->second);
subgcd = polygcd::gcd_linear(ba.begin()->second, (++ba.begin())->second);
else
subgcd = ba.begin()->second;

poly linfac = a / subgcd;
if (poly::divides(linfac,b))
Expand Down

0 comments on commit caea44a

Please sign in to comment.