Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Added a test for the precision of calibration
Browse files Browse the repository at this point in the history
  • Loading branch information
johanrosenkilde committed Jul 6, 2017
1 parent 08a9e50 commit c6ddf43
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/sage/coding/information_set_decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,24 @@ def calibrate(self):
{'search_size': 1}
sage: A.time_estimate() #random
0.0008162108571427874
A long test which verifies that the calibration is not too far from
reality. The constructed code has minimum distance 10::
sage: from sage.coding.information_set_decoder import LeeBrickellISDAlgorithm
sage: C = codes.QuadraticResidueCode(37, GF(3))
sage: Chan = channels.StaticErrorRateChannel(C.ambient_space(), 4)
sage: A = LeeBrickellISDAlgorithm(C, (0,4))
sage: A.calibrate()
sage: def time_100():
....: import time
....: zero = C.ambient_space().zero()
....: before = time.clock()
....: for i in range(100): A.decode(Chan(zero)); None
....: return time.clock() - before
sage: elapsed = time_100() # long time
sage: elapsed/100 > A.time_estimate()/5 and elapsed/100 < A.time_estimate() * 5 # long time
True
"""
from sage.all import sample, mean, random_vector, random_matrix, randint
import time
Expand Down

0 comments on commit c6ddf43

Please sign in to comment.