Skip to content

Commit f63180f

Browse files
committed
[bit.permute] Create notation for the popcount of the first n bits.
This avoids having to put a complex expression into sub- and superscripts in the definitions of "expand" and "compress". We itemize the definitions for improved legibility.
1 parent b082209 commit f63180f

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

source/utilities.tex

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16733,10 +16733,17 @@
1673316733

1673416734
\pnum
1673516735
In the following descriptions,
16736-
let $N$ denote the value of \tcode{numeric_limits<T>::digits}, and
16736+
\begin{itemize}
16737+
\item
16738+
let $N$ denote the value of \tcode{numeric_limits<T>::digits},
16739+
\item
1673716740
let $\alpha_n$ denote the value of the $n^\text{th}$ least significant bit
1673816741
in the base-2 representation of an integer $\alpha$,
16739-
so that $\alpha$ equals $\sum_{n=0}^{N-1} \alpha_n 2^n$.
16742+
so that $\alpha$ equals $\sum_{n=0}^{N-1} \alpha_n 2^n$, and
16743+
\item
16744+
let $\sigma(\alpha, n) = \sum_{k=0}^{n-1} \alpha_k$
16745+
be the count of one-bits among the lowest $n$ bits of $\alpha$.
16746+
\end{itemize}
1674016747

1674116748
\indexlibraryglobal{bit_reverse}%
1674216749
\begin{itemdecl}
@@ -16823,7 +16830,7 @@
1682316830
$m$ is \tcode{m}.
1682416831
\begin{formula}{bit.permute.compress}
1682516832
\mathsf{compress}(x, m) =
16826-
\sum_{n=0}^{N-1} m_n x_n \, 2^{\left(\sum_{k=0}^{n-1} m_k\right)}
16833+
\sum_{n=0}^{N-1} m_n x_n \, 2^{\sigma(m, n)}
1682716834
\end{formula}
1682816835

1682916836
\pnum
@@ -16857,7 +16864,7 @@
1685716864
$m$ is \tcode{m}.
1685816865
\begin{formula}{bit.permute.expand}
1685916866
\mathsf{expand}(x, m) =
16860-
\sum_{n=0}^{N-1} m_n \, x_{\left(\sum_{k=0}^{n-1} m_k\right)} \, 2^n
16867+
\sum_{n=0}^{N-1} m_n \, x_{\sigma(m, n)} \, 2^n
1686116868
\end{formula}
1686216869

1686316870
\pnum

0 commit comments

Comments
 (0)