Skip to content

Commit

Permalink
Fix bug in PartialPerm if length of img and dom differ
Browse files Browse the repository at this point in the history
Resolve issue gap-system#2301.
  • Loading branch information
James Mitchell authored and ChrisJefferson committed Jun 14, 2018
1 parent a42872a commit 28fce77
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/pperm.gi
Original file line number Diff line number Diff line change
Expand Up @@ -545,12 +545,13 @@ function(arg)
fi;
elif Length(arg)=2 then
if IsSSortedList(arg[1]) and ForAll(arg[1], IsPosInt) and
IsDuplicateFreeList(arg[2]) and ForAll(arg[2], IsPosInt) then
IsDuplicateFreeList(arg[2]) and ForAll(arg[2], IsPosInt) and
Length(arg[1]) = Length(arg[2]) then
return SparsePartialPermNC(arg[1], arg[2]);
else
ErrorNoReturn("usage: the 1st argument must be a set of positive integers ",
"and the 2nd argument must be a duplicate-free list of positive ",
"integers");
"integers of equal length to the first");
fi;
fi;

Expand Down
6 changes: 6 additions & 0 deletions tst/testinstall/pperm.tst
Original file line number Diff line number Diff line change
Expand Up @@ -2440,6 +2440,12 @@ gap> MultiplicativeZeroOp(x);
gap> MultiplicativeZero(x);
<empty partial perm>
# Test PartialPerm (for sparse incorrect arg)
gap> PartialPerm([1,2,8],[3,4,1,2]);
Error, usage: the 1st argument must be a set of positive integers and the 2nd \
argument must be a duplicate-free list of positive integers of equal length to\
the first
#
gap> SetUserPreference("PartialPermDisplayLimit", display);;
gap> SetUserPreference("NotationForPartialPerm", notationpp);;
Expand Down

0 comments on commit 28fce77

Please sign in to comment.