Skip to content

Commit

Permalink
Fix ShortestVector (#941)
Browse files Browse the repository at this point in the history
* Fix an edge case in ShortestVectors when an empty list could be left when "positive" is given as a parameter to ShortestVectors.
* Add a test.

Closes: #838 #839
  • Loading branch information
markuspf authored Nov 9, 2016
1 parent 1e4aa07 commit 3f7ca3d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/zlattice.gi
Original file line number Diff line number Diff line change
Expand Up @@ -1331,7 +1331,7 @@ InstallGlobalFunction( ShortestVectors, function( arg )
c.vectors[anz][i] := w;
od;
if checkpositiv and neg then
c.vectors[anz] := [];
Unbind(c.vectors[anz]);
anz := anz - 1;
else
c.norms[anz] := dam;
Expand Down
10 changes: 10 additions & 0 deletions tst/teststandard/bugfix.tst
Original file line number Diff line number Diff line change
Expand Up @@ -3155,6 +3155,16 @@ gap> g:=Group((1,2,4,3)(5,7,6,8)(9,11,10,13)(12,16,14,15)(17,19,18,20)
gap> Size(FrattiniSubgroup(g));
2

# 2016/11/08 (MP), #838, output of OrthognalEmbeddings is very long
gap> g := [ [ 6, 2, 2, 2, 2, 2, 0, 0, 0, 0 ], [ 2, 4, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 2, 0, 4, 0, 0, 0, 2, 0, 0, 0 ],
> [ 2, 0, 0, 4, 0, 0, 0, 2, 0, 0 ], [ 2, 0, 0, 0, 4, 0, 0, 0, 2, 0 ], [ 2, 0, 0, 0, 0, 4, 0, 0, 0, 2 ],
> [ 0, 0, 2, 0, 0, 0, 6, 0, 0, 0 ], [ 0, 0, 0, 2, 0, 0, 0, 6, 0, 0 ], [ 0, 0, 0, 0, 2, 0, 0, 0, 6, 0 ],
> [ 0, 0, 0, 0, 0, 2, 0, 0, 0, 6 ] ];;
gap> oe := OrthogonalEmbeddings(g, "positive");;
gap> Length(oe.vectors); Length(oe.solutions);
159
0

#############################################################################
gap> STOP_TEST( "bugfix.tst", 831990000);

Expand Down

0 comments on commit 3f7ca3d

Please sign in to comment.