File: test_random.py

package info (click to toggle)
fpylll 0.2.3%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 648 kB
  • ctags: 527
  • sloc: python: 818; makefile: 18
file content (19 lines) | stat: -rw-r--r-- 428 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# -*- coding: utf-8 -*-

from fpylll import IntegerMatrix, set_random_seed


def make_integer_matrix(m, n):
    A = IntegerMatrix(m, n)
    A.randomize("uniform", bits=m+n)
    return A


def test_randomize():
    set_random_seed(1337)
    A0 = make_integer_matrix(20, 20)
    set_random_seed(1337)
    A1 = make_integer_matrix(20, 20)
    for i in range(20):
        for j in range(20):
            assert A0[i, j] == A1[i, j]