Skip to content

Commit

Permalink
re-added the ViewObj method for generic fields
Browse files Browse the repository at this point in the history
This method had been lost in 2012 (see Commit v4.6.0)
when a `ViewString` method had replaced it.
Note that other `ViewObj` methods for the objects in question are
applicable that have a higher rank than the delegation to `ViewString`.
The same happens for many objects, but for the moment I want to fix
the behavior for fields.

(This could have been noticed in `tst/testbugfix/2012-08-14-t00271.tst`.)
  • Loading branch information
ThomasBreuer committed Oct 23, 2018
1 parent 0672c46 commit 55b1aec
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
18 changes: 17 additions & 1 deletion lib/field.gi
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,23 @@ InstallMethod( ClosureDivisionRing,

#############################################################################
##
#M ViewString( <F> ) . . . . . . . . . . . . . . . . . . . . . . view a field
#M ViewObj( <F> ) . . . . . . . . . . . . . . . . . . . . . . view a field
##
InstallMethod( ViewObj,
"for a field",
[ IsField ],
function( F )
if HasSize( F ) and IsInt( Size( F ) ) then
Print( "<field of size ", String(Size( F )), ">" );
else
Print( "<field in characteristic ", Characteristic( F ), ">" );
fi;
end );


#############################################################################
##
#M ViewString( <F> ) . . . . . . . . . . . . . . . . . . . . . view a field
##
InstallMethod( ViewString,
"for a field",
Expand Down
3 changes: 2 additions & 1 deletion tst/testbugfix/2012-08-14-t00271.tst
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# 2012/08/14 (AK)
gap> R:=PolynomialRing(GF(5),"mu");;
gap> mu:=Indeterminate(GF(5));;
gap> T:=AlgebraicExtension(GF(5),mu^5-mu+1);;
gap> T:=AlgebraicExtension(GF(5),mu^5-mu+1);
<field of size 3125>
gap> A:=PolynomialRing(T,"x");
<field of size 3125>[x]
2 changes: 1 addition & 1 deletion tst/testbugfix/2017-07-06-DoImmutableMatrix.tst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# handling of finite fields of size q <= 256 but not GF(q)
gap> f1 := AlgebraicExtension(GF(3), CyclotomicPolynomial(GF(3), 5));
<algebra-with-one of dimension 4 over GF(3)>
<field of size 81>
gap> a := RootOfDefiningPolynomial(f1);
a
gap> mat := [[a]];
Expand Down

0 comments on commit 55b1aec

Please sign in to comment.