Commit 7845b11d authored by Glen Mével's avatar Glen Mével
Browse files

ICFP21 paper: 3-column layout for code of pipeline (modify code slightly)

parent 7e15ce54
\begin{figure}
\begin{codeblock}[]
%\begin{codeblock}[]
% \Let* \pipeline {g,f,\refXArray} {%
% \LetIn \nbelems {\Length \refXArray} \\
% \LetIn \refYQueue {\make\;\Unit} \\
% \Fork* {%
% \For* \idx 0 {\nbelems-1} {%
% \LetIn x {\ArrayReadNA \refXArray \idx} \\
% \LetIn y {f\;x} \\
% \enqueue\;\refYQueue\;{y}
% }
% } ; \\
% \LetIn \refZArray {\ArrayAllocNA \nbelems \Unit} \\
% \For* \idx 0 {\nbelems-1} {%
% \LetIn y {\dequeue\;\refYQueue} \\
% \LetIn z {g\;y} \\
% \ArrayWriteNA \refZArray \offset {z}
% } ; \\
% \refZArray
% }
%\end{codeblock}
\[\begin{array}{@{}p{1.1\linewidth}@{}}%
\(\begin{codeblock}[]
\Let* \pipeline {g,f,\refXArray} {%
\LetIn \nbelems {\Length \refXArray} \\
\LetIn \refYQueue {\make\;\Unit} \\
\Fork* {%
\For* \idx 0 {\nbelems-1} {%
\LetIn x {\ArrayReadNA \refXArray \idx} \\
\LetIn y {f\;x} \\
\enqueue\;\refYQueue\;{y}
}
} \\
\Fork {(\pname{pipef}\;\nbelems\;\refXArray\;\refYQueue\;f)} ; \\
\LetIn \refZArray {\ArrayAllocNA \nbelems \Unit} \\
\pname{pipef}\;\nbelems\;\refYQueue\;\refZArray\;g ; \\
\refZArray
}
\end{codeblock}\)
%\hfill
\(\begin{codeblock}[]
\Let* {\pname{pipef}} {\nbelems,\refXArray,\refYQueue,f} {%
\For* \idx 0 {\nbelems-1} {%
\LetIn x {\ArrayReadNA \refXArray \idx} \\
\LetIn y {f\;x} \\
\enqueue\;\refYQueue\;{y}
}
}
\end{codeblock}\)
%\hfill
\(\begin{codeblock}[]
\Let* {\pname{pipeg}} {\nbelems,\refYQueue,\refZArray,g} {%
\For* \idx 0 {\nbelems-1} {%
\LetIn y {\dequeue\;\refYQueue} \\
\LetIn z {g\;y} \\
\ArrayWriteNA \refZArray \offset {z}
} ; \\
\refZArray
}
}
\end{codeblock}
\end{codeblock}\)
\end{array}\]%
\Description{\mocaml implementation of a pipeline.}
\caption{Implementation of a pipeline}
\label{fig:pipeline:impl}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment