From 65b1fbeaa4466c31438bf38a3ec9a793bb3109ab Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Thu, 2 Apr 2009 18:54:05 +0200 Subject: [PATCH] images/oe-post-recursive-diff2.tex: Added first version of the graphic. --- images/oe-post-recursive-diff2.tex | 73 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 images/oe-post-recursive-diff2.tex diff --git a/images/oe-post-recursive-diff2.tex b/images/oe-post-recursive-diff2.tex new file mode 100644 index 0000000..2fc8700 --- /dev/null +++ b/images/oe-post-recursive-diff2.tex @@ -0,0 +1,73 @@ +\begin{tikzpicture}[scale=0.75,auto] + +%\draw[fill=red!10] (0,1) rectangle (3,2); +%\draw[fill=red!10] (.5,0) rectangle (1.5,1); + +%\draw[fill=blue!10] (0,3) rectangle (1,4); +%\draw[fill=blue!10] (1,1) rectangle (2,4); + +% Grid +%\path[draw,-] (0 ,2) -- (4 ,2); +%\path[draw,-] (0 ,1) -- (4.5,1); +%\path[draw,-] (.5,0) -- (4.5,0); + +% Space between nodes +\pgfmathsetmacro{\spacingx}{1.3} +% Amount even boxes are raised +\pgfmathsetmacro{\offsety}{0.8} + +% Space between `subpictures' +\pgfmathsetmacro{\spacingy}{.5} + +\pgfmathsetmacro{\subpicheight}{4 + \offsety} % Height of one sub-picture. + +\foreach \curzdiff in {0, 1, 2} +{ + \pgfmathsetmacro{\basey}{(\subpicheight + \spacingy) * (2 - \curzdiff)} + + \pgfmathsetmacro{\lastzeroindex}{\curzdiff} + \pgfmathsetmacro{\firstoneindex}{\curzdiff+1} + + % Lines + \foreach \x in {0, ..., 7} + \draw[edge] (\spacingx * \x, \basey) -- (\spacingx * \x, \basey + \subpicheight); + + \draw (8 * \spacingx, \basey + + \subpicheight) node[below] {Differenz: \curzdiff}; + + % Even zero nodes + \foreach \x in {0, ..., \lastzeroindex} + { + \draw[red box] (2 * \spacingx * \x - .5, \basey + 2 + \offsety) rectangle +(1,1); + \draw (2 * \spacingx * \x, \basey + 2.5 + \offsety) node {$0$}; + } + % Even one nodes + \foreach \x in {\firstoneindex, ..., 3} + { + \draw[blue box] (2 * \spacingx * \x - .5, \basey + 2 + \offsety) rectangle +(1,1); + \draw (2 * \spacingx * \x, \basey + 2.5 + \offsety) node {$1$}; + } + + % Odd zero nodes + \foreach \x in {0, ..., 0} + { + \draw[red box] (\spacingx + 2 * \spacingx * \x - .5, \basey + 2) rectangle +(1,1); + \draw (\spacingx + 2 * \spacingx * \x, \basey + 2.5) node {$0$}; + } + % Odd one nodes + \foreach \x in {1, ..., 3} + { + \draw[blue box] (\spacingx + 2 * \spacingx * \x - .5, \basey + 2) rectangle +(1,1); + \draw (\spacingx + 2 * \spacingx * \x, \basey + 2.5) node {$1$}; + } + + \foreach \x in {0, ..., 2} + \draw[comp] ( \spacingx + 2 * \spacingx * \x, \basey + 1) node[vertex] {} + -- (2 * \spacingx + 2 * \spacingx * \x, \basey + 1) node[vertex] {}; +} + +%\foreach \x in {0, ..., 3} +% \draw ( \spacingx * \x + .5, -.15) node {$u_\x$}; +%\foreach \x in {0, ..., 3} +% \draw (\spacingx + \spacingx * \x + .5, -.15) node {$v_\x$}; + +\end{tikzpicture} -- 2.11.0