From 6ee05e0790fe0f830ca5b065ab190d8c39e70482 Mon Sep 17 00:00:00 2001
From: Andreas Kapp Lindquist <andkaplin05@gmail.com>
Date: Wed, 29 Oct 2025 17:07:53 +0100
Subject: report(array_maker): More

---
 report/report.tex | 30 +++++++++++++++++++++++++++---
 1 file changed, 27 insertions(+), 3 deletions(-)

(limited to 'report/report.tex')

diff --git a/report/report.tex b/report/report.tex
index 8989253..ea688ac 100644
--- a/report/report.tex
+++ b/report/report.tex
@@ -195,11 +195,35 @@ We implemented a global function \texttt{array\_maker}, that takes the
 array, and the number of elements. With this it then first calls a function
 \texttt{create\_file\_buffer}, that reads the contents of the file and puts it
 in memory. It then passes this address, and the length of the file onto the
-function \texttt{make\_pairwise\_data}
+function \texttt{make\_pairwise\_data}. This function removes
+\texttt{\textbackslash t} and \texttt{\textbackslash n}, and puts the integers
+side-by-side, with space for 64-bit integers. This format is nice, because it
+allows us to iterate over the number of coordinates, and select every $2n$ pair
+as the place in memory where the $n^\text{th}$ pair in the array points to.
+
+
+\begin{algorithm}[H]
+    \DontPrintSemicolon        % optional: removes ;
+    \SetKwInOut{Input}{Input}
+    \SetKwInOut{Output}{Output}
+
+    \Input{File descriptor $f$}
+    \Output{Pointer and size of array $A$}
+    \BlankLine
+
+    \texttt{// Pointer to file data in $p$ and length of that data in $n$.}\\
+    $p,n\leftarrow$ create\_file\_buffer($f$)\\
+    \texttt{// Pointer to pairwise data in $p$ and number of pairs in $n$}\\
+    $p,n\leftarrow$ make\_pairwise\_data($p,n$)\\
+    \texttt{// Allocate space for final array, and save pointer in $A$}\\
+    $A\leftarrow$ allocate($8n$)\\
+    \Return $p$ and $n$
+
+    \caption{Quicksort}
+\end{algorithm}
 
 \begin{figure}[H]
-    \snippet{19}{46}{../src/array_maker.s}
-    \caption{Code snippet from \texttt{array\_maker.s}}\label{fig:arraysnippet}
+    \caption{Psudocode of \texttt{array\_maker.s}}\label{fig:arraysnippet}
 \end{figure}
 
 Load file in memory
-- 
cgit v1.2.3-70-g09d2

