Skip to content

Commit 47a148f

Browse files
committed
色々と修正
1 parent fb03bcc commit 47a148f

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

PLM/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

PLM/PLM.py renamed to PythonLatticeModule/PythonLatticeModule.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,6 @@ def _ENUM_(mu: np.ndarray, B: np.ndarray, n: int, delta: float) -> np.ndarray:
384384
c = np.zeros(n); w = np.zeros(n, int)
385385
last_nonzero = 0; k = 0; R = delta * B[0]
386386
while True:
387-
if R < 1: return np.zeros(n, int)
388387
tmp = v[k] - c[k]; tmp *= tmp
389388
rho[k] = rho[k + 1] + tmp * B[k]
390389
if rho[k] <= R:
@@ -494,7 +493,6 @@ def _ENUM_(mu: np.ndarray, B: np.ndarray, n: int, a: np.ndarray, R: float) -> np
494493
rho[k] = rho[k + 1] + tmp * B[k]
495494
k = 0
496495
while True:
497-
if R < 1: return np.zeros(n, int)
498496
tmp = v[k] - c[k]; tmp *= tmp
499497
rho[k] = rho[k + 1] + tmp * B[k]
500498
if rho[k] <= R:
@@ -526,6 +524,14 @@ def _ENUM_(mu: np.ndarray, B: np.ndarray, n: int, a: np.ndarray, R: float) -> np
526524

527525

528526
def CVP(self, t: np.array) -> np.ndarray:
527+
"""Other name of ENUM_CVP.
528+
529+
Args:
530+
t (np.array): A target vector.
531+
532+
Returns:
533+
np.ndarray: The closest vector to target $t$ on the lattice.
534+
"""
529535
return self.ENUM_CVP(t)
530536

531537

PythonLatticeModule/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from PythonLatticeModule import PythonLatticeModule

0 commit comments

Comments
 (0)