diff --git a/lib/ctblmoli.gi b/lib/ctblmoli.gi index 8790d68b1c..4794a7e25f 100644 --- a/lib/ctblmoli.gi +++ b/lib/ctblmoli.gi @@ -208,6 +208,7 @@ InstallGlobalFunction( MolienSeries, function( arg ) chi, # character of `tbl', optional third argument numers, # list of numerators of sum of polynomial quotients denoms, # list of denominators of sum of polynomial quotients + R, x, # indeterminate tblclasses, # class lengths of `tbl' orders, # representative orders of `tbl' @@ -279,7 +280,8 @@ InstallGlobalFunction( MolienSeries, function( arg ) # `pol' is an additive polynomial. numers:= []; denoms:= []; - x:= Indeterminate( Rationals ); + R:= UnivariatePolynomialRing(Rationals); + x:= R.1; pol:= Zero( x ); tblclasses:= SizesConjugacyClasses( tbl ); @@ -361,7 +363,7 @@ InstallGlobalFunction( MolienSeries, function( arg ) # Split the summand into two summands, with denominators # the special factor `f' resp. the remaining factors `F'. f:= ( x ^ special[1] - 1 ) ^ special[2]; - repr:= GcdRepresentation( F, f ); + repr:= GcdRepresentation( R, F, f ); # Reduce the numerators if possible. num:= numer * repr[1]; @@ -413,7 +415,7 @@ InstallGlobalFunction( MolienSeries, function( arg ) # $\prod_{j>i} f_j$ is stored in `F', and $f_i$ is in `f'. # at first position $r_i$, at second position $q_i$ - repr:= GcdRepresentation( F, f ); + repr:= GcdRepresentation( R, F, f ); # The numerator $p_i$. p:= q * repr[1]; diff --git a/tst/testinstall/ctblmoli.tst b/tst/testinstall/ctblmoli.tst index d84784bc9e..6711e64776 100644 --- a/tst/testinstall/ctblmoli.tst +++ b/tst/testinstall/ctblmoli.tst @@ -53,5 +53,15 @@ true gap> ser = ser2; true +# +# MolienSeries used to hang when given an non-character as input +# now an error is raised +# +gap> G:=Group((1,2,3,4,5,6,7),(5,6,7));; +gap> MolienSeries(NaturalCharacter(G)); +( 1-z^3+z^6-z^9+z^12-z^15+z^18 ) / ( (1-z^7)*(1-z^5)*(1-z^4)*(1-z^3)^2*(1-z^2)*(1-z) ) +gap> MolienSeries(-NaturalCharacter(G)); +Error, must be a subset of + # gap> STOP_TEST("ctblmoli.tst");