Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimal fix for Algebraic Extensions over finite fields of order > 256. #1569

Merged
merged 2 commits into from
Aug 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/algfld.gi
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ local fam,i,cof,red,rchar,impattr,deg;
fam!.deg:=deg;
i:=List([1..DegreeOfLaurentPolynomial(p)],i->fam!.zeroCoefficient);
i[2]:=fam!.oneCoefficient;
i:=ImmutableVector(rchar,i,true);
i:=ImmutableVector(Size(f),i,true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix looks correct to me.

Nitpick on the commits: The message "Add test for this bug." is not so helpful. I'd either squash the two commits into one, or amend the commit message, say to "Add test for bug in AlgebraicExtension"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also: If you add Fixes #1561 or Resolves #1561 to the commit message (say as its last line), then merging this PR will automatically close #1561.

fam!.primitiveElm:=MakeImmutable(ObjByExtRep(fam,i));
fam!.indeterminateName:=MakeImmutable("a");

Expand Down
14 changes: 14 additions & 0 deletions tst/testbugfix/2017-08-05-algfld.tst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#
# AlgebraicExtension used to fail for finite fields of size over 256
#
gap> algexttest := function(q, i1, i2)
> local f,x,pol;
> f := GF(q);
> x :=Indeterminate(f,"x");
> pol := x^2+Z(q)^i1*x+Z(q)^i2;
> AlgebraicExtension(f,pol);
> end;;
gap> algexttest(1009,108,864); # from bug report
gap> algexttest(1024,1023,5); # prime under 256, field size over
gap> algexttest(65537,1,1); # prime over 2^16
gap> algexttest(3^11,1,6); # prime under 2^16, field over