Skip to content

Commit

Permalink
fix benchmark tool and test it
Browse files Browse the repository at this point in the history
  • Loading branch information
malb committed Jul 31, 2017
1 parent 858be34 commit 7fba772
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ before_script:

script:
- LD_LIBRARY_PATH="$VIRTUAL_ENV/lib" py.test
- LD_LIBRARY_PATH="$VIRTUAL_ENV/lib" python -m doctest src/fpylll/tools/*.py
- 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
Expand Down
3 changes: 0 additions & 3 deletions src/fpylll/tools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
# flake8: noqa
from __future__ import absolute_import
from .benchmark import bench_enumeration
7 changes: 5 additions & 2 deletions src/fpylll/tools/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from fpylll.fplll.integer_matrix import IntegerMatrix
from fpylll.fplll.lll import LLLReduction
from fpylll.fplll.enumeration import Enumeration
from fpylll.fplll.pruner import prune
from fpylll import Pruning
from time import time


Expand All @@ -14,6 +14,9 @@ def bench_enumeration(n):
:param n: dimension
:returns: nodes, wall time
>>> import fpylll.tools.benchmark
>>> _ = fpylll.tools.benchmark.bench_enumeration(30)
"""

A = IntegerMatrix.random(n, "qary", bits=5*n, k=1)
Expand All @@ -22,7 +25,7 @@ def bench_enumeration(n):
L(0, 0, n)

radius = M.get_r(0, 0) * .999
pruning = prune(radius, 2**30, 0.9, M.r())
pruning = Pruning.run(radius, 2.0**30, M.r(), 0.9)

enum = Enumeration(M)
t = time()
Expand Down

0 comments on commit 7fba772

Please sign in to comment.