Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/fplll/fpylll
Browse files Browse the repository at this point in the history
  • Loading branch information
lducas committed Jul 14, 2017
2 parents 781dc68 + ecb9945 commit 282d926
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions src/fpylll/fplll/enumeration.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,21 @@ class EnumerationError(Exception):
pass

class EvaluatorStrategy:
"""Strategies to update the enumeration radius and deal with multiple solutions.
Possible values are:
EvaluatorStrategy.
BEST_N_SOLUTIONS
Starting with the nr_solutions-th solution, every time a new solution is found
the enumeration bound is updated to the length of the longest solution. If
more than nr_solutions were found, the longest is dropped.
OPPORTUNISTIC_N_SOLUTIONS
Every time a solution is found, update the enumeration distance to the length
of the solution. If more than nr_solutions were found, the longest is dropped.
FIRST_N_SOLUTIONS
The enumeration bound is not updated. As soon as nr_solutions are found,
enumeration stops.
"""
BEST_N_SOLUTIONS = EVALSTRATEGY_BEST_N_SOLUTIONS
OPPORTUNISTIC_N_SOLUTIONS = EVALSTRATEGY_OPPORTUNISTIC_N_SOLUTIONS
FIRST_N_SOLUTIONS = EVALSTRATEGY_FIRST_N_SOLUTIONS
Expand All @@ -46,7 +61,9 @@ cdef class Enumeration:
def __init__(self, MatGSO M, nr_solutions=1, strategy=EvaluatorStrategy.BEST_N_SOLUTIONS):
"""Create new enumeration object
:param MatGSO M: GSO matrix
:param MatGSO M: GSO matrix
:param nr_solutions: Number of solutions to be returned by enumeration
:param strategy: EvaluatorStrategy to use when finding new solutions
"""

cdef MatGSO_c[Z_NR[mpz_t], FP_NR[d_t]] *m_mpz_d
Expand Down Expand Up @@ -217,7 +234,7 @@ cdef class Enumeration:
:param pruning: pruning parameters
:param dual: run enumeration in the primal or dual lattice.
:param subtree_reset:
:returns: list of pairs containing the solutions and their lengths
:returns: list of pairs containing the solutions' coefficient vectors and their lengths
"""
cdef int block_size = last-first
Expand Down

0 comments on commit 282d926

Please sign in to comment.