Objets/Documentation
raccord27.py
Tout un segment de décodeurs optimaux · raccord27.py
Télécharger ↓"""Face of optimal faithful decoders at the half-transfer junction."""
import json
from fractions import Fraction as F
from faces25 import vertices,load,table,constraints
def study():
laws=table(load('commun23')['controls'][1]['target'])
j=next(i for i in (0,1) if laws[2][i])
laws[2][j]-=F(1,2);laws[2][2]+=F(1,2)
vs=sorted(vertices(laws,F(7,24)))
assert len(vs)==2
costs=[]
for a in range(11):
u,v=[(x*a+y*(10-a))/10 for x,y in zip(*vs)]
cost=max(x*u+y*v-rhs for (x,y),rhs in constraints(laws));assert cost==F(7,24)
costs.append([F(a,10),u,v,cost])