-
Notifications
You must be signed in to change notification settings - Fork 175
Closed
Labels
kind: bugIssues describing general bugs, and PRs fixing themIssues describing general bugs, and PRs fixing themtopic: packagesissues or PRs related to package handling, or specific to a package (for packages w/o issue tracker)issues or PRs related to package handling, or specific to a package (for packages w/o issue tracker)
Description
@cdwensley reported the following: With no packages loaded, one gets this:
gap> R := GroupRing( GF(2), Group( (1,2,3) ) );;
gap> z := Zero(R);
<zero> of ...
But if the RCWA package by @Stefan-Kohl is loaded, one gets this instead:
gap> R := GroupRing( GF(2), Group( (1,2,3) ) );;
gap> z := Zero(R);
0
The problem is caused by this method in RCWA, file lib/rcwamap.gi:3165:
InstallMethod( ViewObj,
"for elements of group rings of rcwa groups (RCWA)",
ReturnTrue, [ IsElementOfFreeMagmaRing ], 100,
function ( elm )
...The description string suggests this is "for elements of group rings of rcwa groups (RCWA)", but the type selector applies to arbitrary group rings, thus causing the breakage.
Actually, the function tries to restrict itself, via this check:
l := CoefficientsAndMagmaElements(elm);
grpelms := l{[1,3..Length(l)-1]};
coeffs := l{[2,4..Length(l)]};
if not ForAll(grpelms,IsRcwaMapping) then TryNextMethod(); fi;But this fails for the zero element, because for that l is empty.
One fix therefore would be to simply change RCWA to also print <zero> of ..., like the library.
Alternatively, one could always perform the check on the one element, like so:
if not IsRcwaMapping(CoefficientsAndMagmaElements(One(elm))[1]) then
TryNextMethod();
fi;Metadata
Metadata
Assignees
Labels
kind: bugIssues describing general bugs, and PRs fixing themIssues describing general bugs, and PRs fixing themtopic: packagesissues or PRs related to package handling, or specific to a package (for packages w/o issue tracker)issues or PRs related to package handling, or specific to a package (for packages w/o issue tracker)