@@ -839,7 +839,7 @@ def approximate_closest_vector(self, t, delta=None, algorithm='embedding', *args
839839 sage: L.closest_vector(t)
840840 (1326, 1349, 1339, 1345)
841841
842- sage: # checking that the other algorithms work
842+ sage: # Checking that the other algorithms work
843843 sage: L.approximate_closest_vector(t, algorithm='nearest_plane')
844844 (1326, 1349, 1339, 1345)
845845 sage: L.approximate_closest_vector(t, algorithm='rounding_off')
@@ -848,7 +848,7 @@ def approximate_closest_vector(self, t, delta=None, algorithm='embedding', *args
848848 if delta is None :
849849 delta = ZZ (99 )/ ZZ (100 )
850850
851- # bound checks on delta are performed in is_LLL_reduced
851+ # Bound checks on delta are performed in is_LLL_reduced
852852 if not self ._reduced_basis .is_LLL_reduced (delta = delta ):
853853 self .LLL (* args , delta = delta , ** kwargs )
854854
@@ -859,11 +859,10 @@ def approximate_closest_vector(self, t, delta=None, algorithm='embedding', *args
859859 L = matrix (QQ , B .nrows ()+ 1 , B .ncols ()+ 1 )
860860 L .set_block (0 , 0 , B )
861861 L .set_block (B .nrows (), 0 , matrix (t ))
862- weight = (B [- 1 ]* B [- 1 ]).isqrt ()+ 1 # norm of the largest vector
862+ weight = (B [- 1 ]* B [- 1 ]).isqrt ()+ 1 # Norm of the largest vector
863863 L [- 1 , - 1 ] = weight
864864
865- # the vector should be the last row but we iterate
866- # just in case
865+ # The vector should be the last row but we iterate just in case
867866 for v in reversed (L .LLL (delta = delta , * args , ** kwargs ).rows ()):
868867 if abs (v [- 1 ]) == weight :
869868 return t - v [:- 1 ]* v [- 1 ].sign ()
0 commit comments