summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--report/k5.gv (renamed from k5.gv)0
-rw-r--r--report/k5_1.gv (renamed from k5_1.gv)0
-rw-r--r--report/k5_2.gv (renamed from k5_2.gv)0
-rw-r--r--report/k5_3.gv (renamed from k5_3.gv)0
-rw-r--r--report/k5_4.gv (renamed from k5_4.gv)0
-rw-r--r--report/k5_5.gv (renamed from k5_5.gv)0
-rw-r--r--report/k5_6.gv (renamed from k5_6.gv)0
-rw-r--r--report/k5_7.gv (renamed from k5_7.gv)0
-rw-r--r--report/report.tex (renamed from report.tex)13
9 files changed, 8 insertions, 5 deletions
diff --git a/k5.gv b/report/k5.gv
index 4bc4122..4bc4122 100644
--- a/k5.gv
+++ b/report/k5.gv
diff --git a/k5_1.gv b/report/k5_1.gv
index 9baa68c..9baa68c 100644
--- a/k5_1.gv
+++ b/report/k5_1.gv
diff --git a/k5_2.gv b/report/k5_2.gv
index 41f8c73..41f8c73 100644
--- a/k5_2.gv
+++ b/report/k5_2.gv
diff --git a/k5_3.gv b/report/k5_3.gv
index 38899c1..38899c1 100644
--- a/k5_3.gv
+++ b/report/k5_3.gv
diff --git a/k5_4.gv b/report/k5_4.gv
index 6c900a6..6c900a6 100644
--- a/k5_4.gv
+++ b/report/k5_4.gv
diff --git a/k5_5.gv b/report/k5_5.gv
index 99dd63c..99dd63c 100644
--- a/k5_5.gv
+++ b/report/k5_5.gv
diff --git a/k5_6.gv b/report/k5_6.gv
index 1a5dc6f..1a5dc6f 100644
--- a/k5_6.gv
+++ b/report/k5_6.gv
diff --git a/k5_7.gv b/report/k5_7.gv
index 3b88e7c..3b88e7c 100644
--- a/k5_7.gv
+++ b/report/k5_7.gv
diff --git a/report.tex b/report/report.tex
index a2d8409..2003af2 100644
--- a/report.tex
+++ b/report/report.tex
@@ -1,4 +1,4 @@
-\documentclass{article}
+\documentclass[11pt]{article}
\usepackage{graphicx}
\usepackage{listings}
\usepackage{xcolor}
@@ -56,6 +56,7 @@ A concrete example will illustrate how this works.
Consider the case of $n = 5$.
$B = \{0, 1, 2, 3, 4\}$.
Each ball has to be tested for collision with every other ball, so $C = \{(0, 1), (0, 2), (0, 3), (0, 4), (1, 2), (1, 3), (1, 4), (2, 3), (2, 4), (3, 4)\}$.
+
This is what $G$ will look like:
\includegraphics[width=0.25\textwidth]{"k5.png"}
@@ -77,9 +78,11 @@ Note that no edges within a cell share an endpoint---they can be computed concur
Pseudocode for partitioning the collisions:
\begin{lstlisting}
struct Collision { Ball b1, b2; }
+typedef [][]T Partition<T>
\end{lstlisting}
\begin{lstlisting}
-Partition<Collision> partitionCollisions([]Ball balls) {
+Partition<Collision>
+partitionCollisions([]Ball balls) {
G := complete graph on balls
P := empty partition
@@ -93,7 +96,8 @@ Partition<Collision> partitionCollisions([]Ball balls) {
}
\end{lstlisting}
\begin{lstlisting}
-[]Edge matching([]Edge E) {
+[]Edge
+matching([]Edge E) {
M := empty []Edge
for each Edge e in E {
@@ -113,8 +117,7 @@ Partition<Collision> partitionCollisions([]Ball balls) {
The part of the program that constructs the partition can be found in \texttt{partition.cpp}.
The program simply initializes the balls, and passes them to \texttt{partitionCollisions()} to construct the partition.
-Each frame it loops through the cells of the partition and uses \texttt{parallel\_for()} to call \texttt{collideBall()} with each pair of balls in the cell.
-This is performed by \texttt{animate()} in \texttt{balls.cpp}.
+Each frame, a call to \texttt{animate()} loops through the cells of the partition and uses \texttt{parallel\_for()} to call \texttt{collideBall()} with each pair of balls in the cell.
\texttt{parallel\_for()} was also used to parallelize some other trivial loops with no depences between iterations.