* format VT 6.5 * seite Tabelle 4 * L1 Nota 8.4 - prima figura \m \includegraphics[scale=4]{0804-1.ps} * L2 Nota 8.4 - seconda figura \m \includegraphics[scale=4]{0804-2.ps} * L3 Nota 8.4 - terza figura \m \includegraphics[scale=4]{0804-3.ps} * R1 Esempio 8.13 {\scriptsize\begin{verbatim} [0.00,0.04) 27 [0.04,0.09) 27 [0.09,0.13) 66 [0.13,0.17) 27 [0.17,0.22) 27 [0.22,0.26) 66 [0.26,0.30) 27 [0.30,0.35) 27 [0.35,0.39) 66 [0.39,0.43) 27 [0.43,0.48) 27 [0.48,0.52) 66 [0.52,0.57) 54 [0.57,0.61) 0 [0.61,0.65) 66 [0.65,0.70) 27 [0.70,0.74) 27 [0.74,0.78) 66 [0.78,0.83) 27 [0.83,0.87) 27 [0.87,0.91) 66 [0.91,0.96) 27 [0.96,1.00) 93 \end{verbatim}} * R2 Nota 8.14 {\scriptsize\begin{verbatim} class immbase: def __call__ (A,j,k,car=0,esa=0): fjk=A.f(j,k) if not (car or esa): return fjk h=int(fjk*255) if esa: return h return chr(h) def __init__ (A,colonne=None,righe=None,f=None): A.colonne=colonne; A.righe=righe; A.f=f def isto (A,n=None): # n=None corrisponde al caso discreto. if n: def g (j,k): x=A(j,k) if x<1: return int(n*x) return n-1 else: n=256 def g (j,k): return A(j,k,esa=1) conto={} for h in xrange(n): conto[h]=0 for j in xrange(A.righe): for k in xrange(A.colonne): conto[g(j,k)]+=1 return conto def leggibyte (A,nome): testo=aus.leggifile(nome).lstrip() u=re.compile('\s+'); lv=u.split(testo,2); stringavalori=lv[2] m=A.colonne=int(lv[0]); n=A.righe=int(lv[1]) A.f=lambda j,k: ord(stringavalori[m*k+j])/255.0 def leggipgm (A,nome): testo='# '+aus.leggifile(nome).strip(); testo=aus.eliminacommenti(testo) valori=map(int,testo.split()); m=A.colonne=valori[0]; n=A.righe=valori[1] A.f=lambda j,k: valori[3+m*k+j]/255.0 def scrivipgm (A,nome): preambolo='P2\n# %s\n%d %d\n255\n' %(nome,A.colonne,A.righe); a=[] for k in xrange(A.righe): for j in xrange(A.colonne): a.append('%d' %(A(j,k,esa=1))) aus.scrivifile(nome,preambolo+' '.join(a)) def scrivibyte (A,nome): preambolo='%d %d\n' %(A.colonne,A.righe); a=[] for k in xrange(A.righe): for j in xrange(A.colonne): a.append(A(j,k,car=1)) aus.scrivifile(nome,preambolo+''.join(a)) \end{verbatim}}