]> mj.ucw.cz Git - saga.git/commitdiff
Unification of tenses.
authorMartin Mares <mj@ucw.cz>
Sun, 3 Feb 2008 20:13:30 +0000 (21:13 +0100)
committerMartin Mares <mj@ucw.cz>
Sun, 3 Feb 2008 20:13:30 +0000 (21:13 +0100)
ram.tex

diff --git a/ram.tex b/ram.tex
index fad390c8e3e5bebe7e915c0af04788b4dafb66a1..7dabe91c4a290fc2a0fbe31a909caedc19acd523 100644 (file)
--- a/ram.tex
+++ b/ram.tex
@@ -442,7 +442,7 @@ the result fits in $b$~bits:
 
 \alik{\<Sum>(x) = x \bmod \1^{b+1}. \cr}
 
-This works because when we work modulo~$\1^{b+1}$, the number $2^{b+1}=\1\0^{b+1}$
+This is correct because when we calculate modulo~$\1^{b+1}$, the number $2^{b+1}=\1\0^{b+1}$
 is congruent to~1 and thus $x = \sum_i 2^{(b+1)i}\cdot x_i \equiv \sum_i 1^i\cdot x_i \equiv \sum_i x_i$.
 As the result should fit in $b$~bits, the modulo makes no difference.
 
@@ -490,20 +490,20 @@ carries from propagating, so the fields do not interact with each other:
 It only remains to shift the separator bits to the right positions, negate them
 and mask out all other bits.
 
-\:$\<Rank>(x,\alpha)$ --- return the number of elements of~${\bf x}$ which are less than~$\alpha$,
+\:$\<Rank>(x,\alpha)$ --- returns the number of elements of~${\bf x}$ which are less than~$\alpha$,
 assuming that the result fits in~$b$ bits:
 
 \alik{
 \<Rank>(x,\alpha) = \<Sum>(\<Cmp>(x,\<Replicate>(\alpha))). \cr
 }
 
-\:$\<Insert>(x,\alpha)$ --- insert~$\alpha$ into a~sorted vector $\bf x$:
+\:$\<Insert>(x,\alpha)$ --- inserts~$\alpha$ into a~sorted vector $\bf x$:
 
-Calculate $k = \<Rank>(x,\alpha)$ first, then insert~$\alpha$ as the $k$-th
+We calculate $k = \<Rank>(x,\alpha)$ first, then insert~$\alpha$ as the $k$-th
 field of~$\bf x$ using masking operations and shifts.
 
-\:$\<Unpack>(\alpha)$ --- create a~vector whose elements are the bits of~$\(\alpha)_d$.
-In other words, insert blocks~$\0^b$ between the bits of~$\alpha$. Assuming that $b\ge d$,
+\:$\<Unpack>(\alpha)$ --- creates a~vector whose elements are the bits of~$\(\alpha)_d$.
+In other words, inserts blocks~$\0^b$ between the bits of~$\alpha$. Assuming that $b\ge d$,
 we can do it as follows:
 
 \algo
@@ -550,7 +550,7 @@ affected, so we can handle it separately.)
 \endlist
 
 \para
-We can use the above tricks to perform interesting operations on individual
+We can use the aforementioned tricks to perform interesting operations on individual
 numbers in constant time, too. Let us assume for a~while that we are
 operating on $b$-bit numbers and the word size is at least~$b^2$.
 This enables us to make use of intermediate vectors with $b$~elements
@@ -560,16 +560,16 @@ of $b$~bits each.
 
 \itemize\ibull
 
-\:$\<Weight>(\alpha)$ --- compute the Hamming weight of~$\alpha$, i.e., the number of ones in~$\(\alpha)$.
+\:$\<Weight>(\alpha)$ --- computes the Hamming weight of~$\alpha$, i.e., the number of ones in~$\(\alpha)$.
 
-Perform \<Unpack> and then \<Sum>.
+We perform \<Unpack> and then \<Sum>.
 
-\:$\<Permute>_\pi(\alpha)$ --- shuffle the bits of~$\alpha$ according
+\:$\<Permute>_\pi(\alpha)$ --- shuffles the bits of~$\alpha$ according
 to a~fixed permutation~$\pi$.
 
-Perform $\<Unpack>_\pi$ and \<Pack> back.
+We perform $\<Unpack>_\pi$ and \<Pack> back.
 
-\:$\<LSB>(\alpha)$ --- find the least significant bit of~$\alpha$,
+\:$\<LSB>(\alpha)$ --- finds the least significant bit of~$\alpha$,
 i.e., the smallest~$i$ such that $\alpha[i]=1$.
 
 By a~combination of subtraction with $\bxor$, we create a~number
@@ -583,7 +583,7 @@ which contains ones exactly at the position of $\<LSB>(\alpha)$ and below:
 
 Then we calculate the \<Weight> of the result and subtract~1.
 
-\:$\<MSB>(\alpha)$ --- find the most significant bit of~$\alpha$ (the position
+\:$\<MSB>(\alpha)$ --- finds the most significant bit of~$\alpha$ (the position
 of the highest bit set).
 
 Reverse the bits of the number~$\alpha$ first by calling \<Permute>, then apply \<LSB>