Skip to content

Commit 605c02a

Browse files
committed
fix comment formatting
1 parent 5845212 commit 605c02a

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/sage/matrix/matrix_integer_dense.pyx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3346,15 +3346,15 @@ cdef class Matrix_integer_dense(Matrix_dense):
33463346
A = IntegerMatrix.from_matrix(self)
33473347
return LLL.is_reduced(A, delta=delta, eta=eta)
33483348
elif algorithm == 'sage':
3349-
# this is pretty slow
3349+
# This is pretty slow
33503350
import sage.modules.misc
33513351
G, mu = sage.modules.misc.gram_schmidt(self.rows())
3352-
#For any $i>j$, we have $|mu_{i, j}| <= \eta$
3352+
# For any $i>j$, we have $|mu_{i, j}| <= \eta$
33533353
for e in mu.list():
33543354
if e.abs() > eta:
33553355
return False
33563356

3357-
#For any $i<d$, we have $\delta |b_i^*|^2 <= |b_{i+1}^* + mu_{i+1, i} b_i^* |^2$
3357+
# For any $i<d$, we have $\delta |b_i^*|^2 <= |b_{i+1}^* + mu_{i+1, i} b_i^* |^2$
33583358
norms = [G[i].norm()**2 for i in range(len(G))]
33593359
for i in range(1,self.nrows()):
33603360
if norms[i] < (delta - mu[i,i-1]**2) * norms[i-1]:

src/sage/modules/free_module_integer.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)