HashVal hash(Tuple t, ChoiceVec cv, int d)
{
HashVal h[nAttr(t)+1];
HashVal res = 0, oneBit;
int i, a, b;
for (i = 1; i <= nAttr(t); i++)
h[i] = hash1(t,i);
for (i = 0; i < d; i++) {
a = cv[i].attr;
b = cv[i].bit;
oneBit = bit(b, h[a]);
res = res | (oneBit << i);
}
return res;
}
|