Skip to content

Commit

Permalink
update to new API
Browse files Browse the repository at this point in the history
  • Loading branch information
malb committed Jun 6, 2017
1 parent 66f825c commit ef178b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 22 deletions.
7 changes: 2 additions & 5 deletions src/fpylll/fplll/fplll.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -768,14 +768,11 @@ cdef extern from "fplll/pruner.h" namespace "fplll":

cdef extern from "fplll/sieve/sieve_gauss.h" namespace "fplll":
cdef cppclass GaussSieve[ZT, FT]:
GaussSieve(ZZ_mat[ZT] &B, int alg, bool ver, int seed);
GaussSieve(ZZ_mat[ZT] &B, int algorithm, bool verbose, int seed);

bool run_2sieve()
bool run_3sieve()
bool run_4sieve()
bool sieve(Z_NR[ZT] target_norm)

void set_verbose(bool verbose)
void set_goal_norm2(Z_NR[ZT] norm)
bool verbose

int alg
Expand Down
21 changes: 4 additions & 17 deletions src/fpylll/fplll/sieve_gauss.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -56,25 +56,12 @@ cdef class GaussSieve:
"""


cdef Z_NR[mpz_t] target_norm_
assign_Z_NR_mpz(target_norm_, target_norm)
self._core.set_goal_norm2(target_norm_)

if self._core.alg == 2:
sig_on()
self._core.run_2sieve()
sig_off()
elif self._core.alg == 3:
sig_on()
self._core.run_2sieve()
sig_off()
elif self._core.alg == 4:
sig_on()
self._core.run_2sieve()
sig_off()
else:
raise RuntimeError("internal algorithm is %d"%self._core.alg)

sig_on()
self._core.sieve(target_norm_)
sig_off()

cdef NumVect[Z_NR[mpz_t]] r_ = self._core.return_first()
cdef list r = []
Expand Down

0 comments on commit ef178b1

Please sign in to comment.