Skip to content

Commit

Permalink
Pruner interface
Browse files Browse the repository at this point in the history
  • Loading branch information
malb committed Jul 8, 2017
1 parent c0db87a commit 0dc6d25
Show file tree
Hide file tree
Showing 8 changed files with 571 additions and 16 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ before_script:

script:
- LD_LIBRARY_PATH="$VIRTUAL_ENV/lib" py.test
- LD_LIBRARY_PATH="$VIRTUAL_ENV/lib" python -m doctest src/fpylll/*.pyx src/fpylll/fplll/*.pyx
- LD_LIBRARY_PATH="$VIRTUAL_ENV/lib" python -m doctest src/fpylll/algorithms/*.py
- LD_LIBRARY_PATH="$VIRTUAL_ENV/lib" python -m doctest src/fpylll/fplll/*.pyx
- LD_LIBRARY_PATH="$VIRTUAL_ENV/lib" python -m doctest src/fpylll/*.pyx
- LD_LIBRARY_PATH="$VIRTUAL_ENV/lib" python setup.py sdist

notifications:
Expand Down
2 changes: 1 addition & 1 deletion src/fpylll/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from .fplll.bkz_param import load_strategies_json
from .fplll.svpcvp import SVP
from .fplll.svpcvp import CVP
from .fplll.pruner import prune
from .fplll.pruner import prune, Pruner
from .fplll.sieve_gauss import GaussSieve
from .util import ReductionError
from .util import set_random_seed, set_precision, get_precision
Expand Down
2 changes: 1 addition & 1 deletion src/fpylll/algorithms/bkz.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from fpylll import Enumeration
from fpylll import EnumerationError
from fpylll.util import adjust_radius_to_gh_bound
from .bkz_stats import BKZTreeTracer, dummy_tracer
from fpylll.algorithms.bkz_stats import BKZTreeTracer, dummy_tracer


class BKZReduction:
Expand Down
4 changes: 2 additions & 2 deletions src/fpylll/algorithms/bkz_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def pretty_dict(d, keyword_width=None, round_bound=9999):
:param round_bound: values beyond this bound are shown as `2^x`
>>> pretty_dict({'d': 2, 'f': 0.1, 'large': 4097})
u'{"large": 2^12.0, "d": 2, "f": 0.100000}'
u'{"large": 4097, "d": 2, "f": 0.100000}'
"""
s = []
Expand Down Expand Up @@ -413,7 +413,7 @@ def report(self, indentation=0, depth=None):
>>> print(root.report())
{"root": {}}
{"(u'child', 1)": {"a": 100.000}}
{"(u'child', 3)": {"a": 2^12.0}}
{"(u'child', 3)": {"a": 4097}}
{"(u'child', 2)": {}}
>>> print(root.report(indentation=2, depth=1))
Expand Down
2 changes: 1 addition & 1 deletion src/fpylll/algorithms/simple_dbkz.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-

from __future__ import absolute_import
from .simple_bkz import BKZReduction
from fpylll.algorithms.simple_bkz import BKZReduction
from fpylll import Enumeration
import math
from functools import reduce
Expand Down
8 changes: 8 additions & 0 deletions src/fpylll/fplll/pruner.pxd
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# -*- coding: utf-8 -*-

from integer_matrix cimport IntegerMatrix
from decl cimport pruner_core_t, fplll_nr_type_t

cdef class Pruner:
cdef fplll_nr_type_t _type
cdef pruner_core_t _core

0 comments on commit 0dc6d25

Please sign in to comment.