images/oe-post-recursive-diff2.tex: Added first version of the graphic.
[diplomarbeit.git] / images / oe-post-recursive-diff2.tex
1 \begin{tikzpicture}[scale=0.75,auto]
2
3 %\draw[fill=red!10] (0,1) rectangle (3,2);
4 %\draw[fill=red!10] (.5,0) rectangle (1.5,1);
5
6 %\draw[fill=blue!10] (0,3) rectangle (1,4);
7 %\draw[fill=blue!10] (1,1) rectangle (2,4);
8
9 % Grid
10 %\path[draw,-] (0 ,2) -- (4  ,2);
11 %\path[draw,-] (0 ,1) -- (4.5,1);
12 %\path[draw,-] (.5,0) -- (4.5,0);
13
14 % Space between nodes
15 \pgfmathsetmacro{\spacingx}{1.3}
16 % Amount even boxes are raised
17 \pgfmathsetmacro{\offsety}{0.8}
18
19 % Space between `subpictures'
20 \pgfmathsetmacro{\spacingy}{.5}
21
22 \pgfmathsetmacro{\subpicheight}{4 + \offsety} % Height of one sub-picture.
23
24 \foreach \curzdiff in {0, 1, 2}
25 {
26   \pgfmathsetmacro{\basey}{(\subpicheight + \spacingy) * (2 - \curzdiff)}
27
28   \pgfmathsetmacro{\lastzeroindex}{\curzdiff}
29   \pgfmathsetmacro{\firstoneindex}{\curzdiff+1}
30
31   % Lines
32   \foreach \x in {0, ..., 7}
33     \draw[edge] (\spacingx * \x, \basey) -- (\spacingx * \x, \basey + \subpicheight);
34
35   \draw (8 * \spacingx, \basey + + \subpicheight) node[below] {Differenz: \curzdiff};
36
37   % Even zero nodes
38   \foreach \x in {0, ..., \lastzeroindex}
39   {
40     \draw[red box]  (2 * \spacingx * \x - .5, \basey + 2 + \offsety) rectangle +(1,1);
41     \draw (2 * \spacingx * \x, \basey + 2.5 + \offsety) node {$0$};
42   }
43   % Even one nodes
44   \foreach \x in {\firstoneindex, ..., 3}
45   {
46     \draw[blue box] (2 * \spacingx * \x - .5, \basey + 2 + \offsety) rectangle +(1,1);
47     \draw (2 * \spacingx * \x, \basey + 2.5 + \offsety) node {$1$};
48   }
49
50   % Odd zero nodes
51   \foreach \x in {0, ..., 0}
52   {
53     \draw[red box]  (\spacingx + 2 * \spacingx * \x - .5, \basey + 2) rectangle +(1,1);
54     \draw (\spacingx + 2 * \spacingx * \x, \basey + 2.5) node {$0$};
55   }
56   % Odd one nodes
57   \foreach \x in {1, ..., 3}
58   {
59     \draw[blue box] (\spacingx + 2 * \spacingx * \x - .5, \basey + 2) rectangle +(1,1);
60     \draw (\spacingx + 2 * \spacingx * \x, \basey + 2.5) node {$1$};
61   }
62
63   \foreach \x in {0, ..., 2}
64     \draw[comp] (    \spacingx + 2 * \spacingx * \x, \basey + 1) node[vertex] {}
65              -- (2 * \spacingx + 2 * \spacingx * \x, \basey + 1) node[vertex] {};
66 }
67
68 %\foreach \x in {0, ..., 3}
69 %  \draw (            \spacingx * \x + .5, -.15) node {$u_\x$};
70 %\foreach \x in {0, ..., 3}
71 %  \draw (\spacingx  + \spacingx * \x + .5, -.15) node {$v_\x$};
72
73 \end{tikzpicture}