40 #include "EST_multistats.h"
42 #include "EST_types.h"
49 for (i = 0, p = lex.head(); p!=0; p = p->next(), ++i)
53 cerr <<
"Item " << name <<
" not found in word list\n";
64 for (p = list.
list.head(); p!=0; p = p->next())
66 m = nth(list.
key(p), lex);
67 n = nth(list.
val(p), lex);
68 if ((n != -1) && (m != -1))
69 a(m, n) = a(m, n) + 1;
89 for (i = 0; i < n; ++i)
92 for (j = 0; j < n; ++j)
93 row_total[i] += a(i, j);
96 for (j = 0; j < n; ++j)
99 for (i = 0; i < n; ++i)
100 col_total[j] += a(i, j);
103 for (i = 0; i < n; ++i)
105 float rt = row_total(i);
109 correct[i] = 100.0 * a(i, i) / rt;
112 for (p = lex.head(); p != 0; p = p->next())
116 cout << lex(p).before(3) <<
" ";
120 for (p = lex.head(), i = 0; i < n; ++i, p = p->next())
124 for (j = 0; j < n; ++j)
128 cout.setf(ios::right);
129 cout.setf(ios::fixed, ios::floatfield);
130 cout << ( (int) a(i, j) ) <<
" ";
133 cout << (int)row_total(i) <<
" ";
135 cout.setf(ios::right);
136 cout <<
"[" << ((int)a(i, i)) <<
"/" << ((
int)row_total(i)) << "]";
139 cout.setf(ios::right);
141 if (isnanf(correct(i)))
144 cout << correct(i) << endl;
147 for (j = 0; j < n; ++j)
150 cout << ((int)col_total(j)) <<
" ";
166 cout <<
"total " << ((int)t) <<
" correct " << s <<
" "