Skip to content

Commit

Permalink
New Union implementation. Output format change to one existing test, …
Browse files Browse the repository at this point in the history
…new test.

Improve test file to get 100% coverage of new code. Fix some bugs. Document change.

Add a sweep phase to deal with the matching stride case faster.
  • Loading branch information
stevelinton committed Jan 13, 2016
1 parent 7f00bbb commit 5deeb11
Show file tree
Hide file tree
Showing 5 changed files with 421 additions and 211 deletions.
24 changes: 24 additions & 0 deletions dev/Updates/union
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Format 'yyyy/mm/dd'
!! Date
2016/01/11
!! Changed by
SL
! Reported by
Nick Loughlin
!! Type of Change
Fix: wrong result

!! Description
Under some circumstances the union of a combination of lists of small integers
and ranges could be computed incorrectly. This change fixes this and also
avoids expanding ranges unnecessarily in some cases.

! Test Code
# included in union.tst

! Prefetch

!! Changeset

!! End
5 changes: 4 additions & 1 deletion lib/coll.gd
Original file line number Diff line number Diff line change
Expand Up @@ -3092,7 +3092,10 @@ DeclareOperation( "Intersection2",
## [ 1, 2, 3, 4 ]
## gap> Union( [ ] );
## [ ]
## ]]></Example>
## ]]></Example><P/>
## When computing the Union of lists or sets of small integers and ranges,
## every attempt is made to return the result as a range and to avoid expanding
## ranges provided as input.
## </Description>
## </ManSection>
## <#/GAPDoc>
Expand Down
Loading

0 comments on commit 5deeb11

Please sign in to comment.