☰
\(\newcommand \ensuremath [1]{#1}\) \(\newcommand {\toprule }[1][]{\hline }\) \(\let \midrule \toprule \) \(\let \bottomrule \toprule \) \(\def\textemdash{\unicode{x2014}}\) \(\renewcommand {\vec }{\boldsymbol }\) \(\newcommand {\Edge }{\ensuremath {\,\textemdash \,}}\) \(\newcommand \Const [1]{\text {\textsf {#1}}}\) \(\DeclareMathOperator {\lerp }{lerp}\) \(\DeclareMathOperator {\bitlen }{bitlen}\) \(\DeclareMathOperator {\sign }{sign}\) \(\newcommand {\I }{\mathrm {i}}\) \(\newcommand \AND {\mathbin {\&}}\) \(\newcommand \OR {\mathbin {|}}\) \(\newcommand \XOR {\mathbin {{}^{\wedge }}}\) \(\newcommand \shl {\ll }\) \(\newcommand \shr {\ggg }\) \(\newcommand \asr {\gg }\) \(\newcommand \NOT {\ensuremath {\mathord {\sim }}}\) \(\newcommand {\isep }{\mathrel {{.}\,{.}}}\) \(\newcommand {\Id }[1]{\mathit {#1}}\) \(\newcommand {\const }[1]{\mathsf {#1}}\) \(\newcommand {\algorithmname }[1]{\text {\textsc {#1}}}\) \(\newcommand {\bits }[1]{\text {#1}}\) \(\newcommand {\hexa }[1]{\mathtt {0x#1}}\) \(\newcommand {\num }[1]{#1}\) \(\newcommand {\qed }{\quad \square }\) \(\newcommand {\idiv }[2]{\lfloor #1/#2\rfloor }\) \(\newcommand \attribdot {\ensuremath {\mkern 1.5mu.\mkern 1.5mu}}\) \(\newcommand \attribxr [2]{#1\attribdot \text {#2}}\) \(\newcommand \attribir [2]{\Id {#1}\attribdot \text {#2}}\) \(\newcommand \attribii [2]{\Id {#1}\attribdot \Id {#2}}\) \(\newcommand \textsc [1]{#1}\) \(\newcommand {\intertext }[1]{\text {#1}\notag \\}\)

Appendix A Index to Notations

This appendix summarizes some of the notation we use throughout the book. The following letters and typographic conventions are used to indicate variables or quantities of a particular type:

.
\(n,m\) integer
\(x,y\) real number
\(z,w\) complex number
\(S,T\) set
\(\vec {x},\vec {y}\) vector
\(\vec {A},\vec {B}\) matrix

Mathematical Notations

.
Notation

Meaning

\(\emptyset \)

the empty set \(\{\}\)

\(\bar S\)

set complement

\(S\cap T\)

set intersection

\(S\cup T\)

set union

\(S - T\)

set difference

\(n\isep m\)

sequence of integers \(n,n+1,\ldots ,m\)

\(\lfloor x\rfloor \)

floor of \(x\): the nearest integer \(\le x\)

\(\lceil x\rceil \)

ceiling of \(x\): the nearest integer \(\ge x\)

\(\lfloor n/m\rfloor \)

floor division

\(n\bmod m\)

remainder of integer division: \(n - \lfloor n/m\rfloor m\)

\((a_{n-1}a_{n-2}\ldots a_0)_B\)

base-\(B\) integer with digits \(a_k\)

\(n!\)

factorial function, \(n!=n(n-1)\cdots 1\)

\(F_n\)

Fibonacci numbers

\(n \shl m\)

bit shift to the left

\(n \shr m\)

bit shift to the right

\(n \asr m\)

arithmetic right shift

\(\NOT n\)

bitwise complement

\(n \AND m\)

bitwise AND

\(n \OR m\)

bitwise OR

\(n \XOR m\)

bitwise XOR

\(|x|\)

absolute value of \(x\)

\(\sign (x)\)

sign of \(x\), one of \(-1,0,+1\)

\(\I \)

the imaginary unit \(\I ^2=-1\)

\(\pi \)

the constant pi \(\approx 3.14159\)

\(\phi \)

the golden ratio \((1+\sqrt {5})/2\)

\(O(f(x))\)

big-Oh notation

\(|\vec {x}|\)

the length of the vector \(\vec {x}\)

\(\det \vec {A}\)

determinant of the matrix \(\vec {A}\)

\(\lerp (\vec {x},\vec {y}, t)\)

linear interpolation of \(\vec {x}\) and \(\vec {y}\)

Algorithms

.
Notation

Meaning

\(\text {\textrm {\textsc {Baz}}}(a,b)=\)

define a function Baz with arguments \(a\) and \(b\)

record Foo(bar, buz)

define a record with fields bar and buz

var x

define a variable x

let x

define a read-only variable x

Foo(bar=1, buz=2)

create a record with fields bar and buz

\(\attribii {data}{field}\)

access field of data structure or record

\(\attribir {data}{method}()\)

invoke method on a data structure

if, else, else if

conditional execution

for \(i=1\) to \(10\)

loop over integers from 1 to 10 inclusive

for \(i=10\) downto \(1\)

loop over integers from 10 to 1 inclusive

for \(x\) in \(S\)

loop over all elements of \(S\)

while, repeat

general loops

exit

exit innermost loop

output value

output value and continue algorithm

return value

return value and stop algorithm