/usr/lib/python2.7/dist-packages/brial/heuristics.py is in python-brial 1.2.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | from .PyPolyBoRi import Polynomial, gauss_on_polys
from .nf import symmGB_F2_python
from .interpolate import variety_lex_leading_terms, nf_lex_points
def dense_system(I):
I = (Polynomial(p) for p in I)
I = (p for p in I if not p.is_zero())
for p in I:
d = p.deg()
if p.deg() == 1:
continue
else:
try:
if len(p) > 2 ** d + 5:
return True
except OverflowError:
return True
return False
def gauss_on_linear(I):
I = (Polynomial(p) for p in I)
linear = []
non_linear = []
for p in I:
if p.is_zero():
continue
if p.deg() <= 1:
linear.append(p)
else:
non_linear.append(p)
if len(linear) == 0:
return non_linear
linear = list(gauss_on_polys(linear))
return linear + non_linear
|