Skip to content

Commit

Permalink
Use Info not Print in Decomposition
Browse files Browse the repository at this point in the history
Up to now, `DecompositionInt` and `Decomposition` used `Print`
for showing a message whenever a new prime had to be chosen because
the matrix in question was singular modulo the current prime.

Meanwhile I have several real-world examples where this happens,
which I want to use in package tests,
and I think it is better to omit these messages by default,
that is, to use `Info` instead of `Print`.
  • Loading branch information
ThomasBreuer committed Dec 20, 2019
1 parent 8399021 commit 056e4d8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/zlattice.gi
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,8 @@ InstallGlobalFunction( DecompositionInt, function( A, B, depth )

# matrix is singular modulo that `p', choose another one
p := NextPrimeInt( p );
Print( "#I DecompositionInt: choosing new prime : ", p, "\n" );
#T better Info
Info( InfoZLattice, 1,
"DecompositionInt: choosing new prime ", p );
Aqinv:= InverseMatMod( A, p );
od;

Expand Down
15 changes: 13 additions & 2 deletions tst/testinstall/zlattice.tst
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
#@local
#@local A
gap> START_TEST("zlattice.tst");

# 'Decomposition'
gap> A:= [ [ 82, 1 ], [ -1, 1 ] ];;
gap> SetInfoLevel( InfoZLattice, 0 );
gap> Decomposition( A, [ [ 82, 1 ] ], 1 );
[ [ 1, 0 ] ]
gap> SetInfoLevel( InfoZLattice, 1 );
gap> Decomposition( A, [ [ 82, 1 ] ], 1 );
#I DecompositionInt: choosing new prime 89
[ [ 1, 0 ] ]
gap> SetInfoLevel( InfoZLattice, 0 );

# trivial cases of `LLLReducedBasis'
gap> LLLReducedBasis( [ ] );
rec( B := [ ], basis := [ ], mue := [ ] )
gap> LLLReducedBasis( [ [ 0, 0 ], [ 0, 0 ] ], "linearcomb" );
rec( B := [ ], basis := [ ], mue := [ ],
relations := [ [ 1, 0 ], [ 0, 1 ] ], transformation := [ ] )
gap> STOP_TEST( "zlattice.tst", 1);
gap> STOP_TEST( "zlattice.tst" );

0 comments on commit 056e4d8

Please sign in to comment.