Objets/Documentation
regimes26.py
Quand le meilleur décodeur change de formule · regimes26.py
Télécharger ↓"""Optimal within-cell decoder after both first contacts. Rational Bernstein certificates."""
from fractions import Fraction as F
from faces25 import constraints,load,table
SEGMENTS=[[(F(1,5),F(3,5),'first'),(F(3,5),F(3,4),'last')],
[(F(3,19),F(9,19),'first'),(F(9,19),F(1,2),'middle'),(F(1,2),F(5,8),'last')]]
def formula(profile,section,h):
if section=='first':
if profile==0:x=[24-40*h,12+40*h,15+20*h];den=96
else:x=[312-152*h,36+152*h,45+76*h];den=288
return x,den,[4*h+3,5-4*h,4],12,[3,4,10]
if section=='middle':
return [78-58*h,18+10*h,9+17*h],24*(3-h),[4*h+3,4-8*h,5],4*(3-h),[1,4,10]
if profile==0:x=[0,4*h,3*h];den=4*(1+h)
else:x=[20*(1+h),28*h,21*h];den=24*(1+h)