Parallel Comparison
The purpose of the compression achieved by sketching is to allow all of the keys to be stored in one w-bit word. Let the node sketch of a node be the bit string
- 1
sketch(x1)1sketch(x2)...1sketch(xk)
We can assume that the sketch function uses exactly b ≤ r4 bits. Then each block uses 1 + b ≤ w4/5 bits, and since k ≤ w1/5, the total number of bits in the node sketch is at most w.
A brief notational aside: for a bit string s and nonnegative integer m, let sm denote the concatenation of s to itself m times. If t is also a bit string st denotes the concatenation of t to s.
The node sketch makes it possible to search the keys for any b-bit integer y. Let z = (0y)k, which can be computed in constant time (multiply y by the constant (0b1)k). Note that 1sketch(xi) - 0y is always positive, but preserves its leading 1 iff sketch(xi) ≥ y. We can thus compute the smallest index i such that sketch(xi) ≥ y as follows:
- Subtract z from the node sketch.
- Take the bitwise AND of the difference and the constant (10b)k. This clears all but the leading bit of each block.
- Find the most significant bit of the result.
- Compute i, using the fact that the leading bit of the i-th block has index i(b+1).
Read more about this topic: Fusion Tree
Famous quotes containing the words parallel and/or comparison:
“One writes of scars healed, a loose parallel to the pathology of the skin, but there is no such thing in the life of an individual. There are open wounds, shrunk sometimes to the size of a pin-prick but wounds still. The marks of suffering are more comparable to the loss of a finger, or the sight of an eye. We may not miss them, either, for one minute in a year, but if we should there is nothing to be done about it.”
—F. Scott Fitzgerald (18961940)
“What is man in nature? A nothing in comparison with the infinite, an all in comparison with the nothinga mean between nothing and everything.”
—Blaise Pascal (16231662)