From 094c7683c526c476fad0bf32f6a00ecc6555cc68 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Thu, 2 Apr 2009 22:58:13 +0200 Subject: [PATCH] images/.tex: Add the newly defined `red box' etc. styles. --- images/bitonic-merge-trichter.tex | 14 +++--- images/bitonic-merge.tex | 12 ++--- images/oe-post-recursive-diff2.tex | 89 ++++++++++++++------------------------ 3 files changed, 47 insertions(+), 68 deletions(-) diff --git a/images/bitonic-merge-trichter.tex b/images/bitonic-merge-trichter.tex index e0bc7c1..70e5c3f 100644 --- a/images/bitonic-merge-trichter.tex +++ b/images/bitonic-merge-trichter.tex @@ -9,10 +9,12 @@ \path[edge] (8,0) -- (8,9) node at ++(0,.5em) {$v_0$}; \draw[fill=white] (0.75,6) rectangle (4.25,8); -\path[draw,-,color=red,fill=red!10] (1,6.25) -- (4,7.75) -- (4,6.25) -- cycle; +%\path[draw,-,color=red,fill=red!10] (1,6.25) -- (4,7.75) -- (4,6.25) -- cycle; +\path[red box] (1,6.25) -- (4,7.75) -- (4,6.25) -- cycle; \draw[fill=white] (4.75,6) rectangle (8.25,8); -\path[draw,-,color=blue,fill=blue!10] (8,6.25) -- (8,7.75) -- (5,6.25) -- cycle; +%\path[draw,-,color=blue,fill=blue!10] (8,6.25) -- (8,7.75) -- (5,6.25) -- cycle; +\path[blue box] (8,6.25) -- (8,7.75) -- (5,6.25) -- cycle; \node[vertex] (v0) at (1,5) {}; \node[vertex] (v4) at (8,5) {}; @@ -31,11 +33,11 @@ \path[comp] (v3) -- (v7); \draw[fill=white] (0.75,1) rectangle (4.25,3); -\path[draw,-,color=red,fill=red!10] (1,1.25) -- (2.4,1.25) -- (2.4,1.95) -- cycle; -\path[draw,-,color=blue,fill=blue!10] (2.6,1.95) -- (4,1.25) -- (2.6,1.25) -- cycle; +\path[red box] (1,1.25) -- (2.4,1.25) -- (2.4,1.95) -- cycle; +\path[blue box] (2.6,1.95) -- (4,1.25) -- (2.6,1.25) -- cycle; \draw[fill=white] (4.75,1) rectangle (8.25,3); -\path[draw,-,color=red,fill=red!10] (5,2.75) -- (6.4,1.95) -- (6.4,1.25) -- (5,1.25) -- cycle; -\path[draw,-,color=blue,fill=blue!10] (6.6,1.95) -- (8,2.75) -- (8,1.25) -- (6.6,1.25) -- cycle; +\path[red box] (5,2.75) -- (6.4,1.95) -- (6.4,1.25) -- (5,1.25) -- cycle; +\path[blue box] (6.6,1.95) -- (8,2.75) -- (8,1.25) -- (6.6,1.25) -- cycle; \end{tikzpicture} diff --git a/images/bitonic-merge.tex b/images/bitonic-merge.tex index 2ce6e4c..d33dd3b 100644 --- a/images/bitonic-merge.tex +++ b/images/bitonic-merge.tex @@ -9,10 +9,10 @@ \path[edge] (8,0) -- (8,9) node at ++(0,.5em) {$v_3$}; \draw[fill=white] (0.75,6) rectangle (4.25,8); -\path[draw,-,color=red,fill=red!10] (1,6.25) -- (4,7.75) -- (4,6.25) -- cycle; +\path[red box] (1,6.25) -- (4,7.75) -- (4,6.25) -- cycle; \draw[fill=white] (4.75,6) rectangle (8.25,8); -\path[draw,-,color=blue,fill=blue!10] (8,6.25) -- (5,7.75) -- (5,6.25) -- cycle; +\path[blue box] (8,6.25) -- (5,7.75) -- (5,6.25) -- cycle; \node[vertex] (v0) at (1,5) {}; \node[vertex] (v4) at (5,5) {}; @@ -31,11 +31,11 @@ \path[comp] (v3) -- (v7); \draw[fill=white] (0.75,1) rectangle (4.25,3); -\path[draw,-,color=red,fill=red!10] (1,1.25) -- (2.4,1.25) -- (2.4,1.95) -- cycle; -\path[draw,-,color=blue,fill=blue!10] (2.6,1.95) -- (4,1.25) -- (2.6,1.25) -- cycle; +\path[red box] (1,1.25) -- (2.4,1.25) -- (2.4,1.95) -- cycle; +\path[blue box] (2.6,1.95) -- (4,1.25) -- (2.6,1.25) -- cycle; \draw[fill=white] (4.75,1) rectangle (8.25,3); -\path[draw,-,color=blue,fill=blue!10] (5,2.75) -- (6.4,1.95) -- (6.4,1.25) -- (5,1.25) -- cycle; -\path[draw,-,color=red,fill=red!10] (6.6,1.95) -- (8,2.75) -- (8,1.25) -- (6.6,1.25) -- cycle; +\path[blue box] (5,2.75) -- (6.4,1.95) -- (6.4,1.25) -- (5,1.25) -- cycle; +\path[red box] (6.6,1.95) -- (8,2.75) -- (8,1.25) -- (6.6,1.25) -- cycle; \end{tikzpicture} diff --git a/images/oe-post-recursive-diff2.tex b/images/oe-post-recursive-diff2.tex index 2fc8700..7bd73d6 100644 --- a/images/oe-post-recursive-diff2.tex +++ b/images/oe-post-recursive-diff2.tex @@ -1,73 +1,50 @@ -\begin{tikzpicture}[scale=0.75,auto] +\begin{tikzpicture}[scale=0.66,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); +\pgfmathsetmacro{\lastzeroindex}{2} % Space between nodes \pgfmathsetmacro{\spacingx}{1.3} % Amount even boxes are raised \pgfmathsetmacro{\offsety}{0.8} -% Space between `subpictures' -\pgfmathsetmacro{\spacingy}{.5} +\pgfmathsetmacro{\totalheight}{4 + \offsety} % Height of one sub-picture. -\pgfmathsetmacro{\subpicheight}{4 + \offsety} % Height of one sub-picture. +% Lines +\foreach \x in {0, ..., 7} + \draw[edge] (\spacingx * \x, 0) -- (\spacingx * \x, \totalheight); -\foreach \curzdiff in {0, 1, 2} +% Even zero nodes +\foreach \x in {0, ..., \lastzeroindex} { - \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}; + \draw[red box] (2 * \spacingx * \x - .5, 2 + \offsety) rectangle +(1,1); + \draw (2 * \spacingx * \x, 2.5 + \offsety) node {$0$}; +} - % 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$}; - } +% Even one nodes +\pgfmathsetmacro{\firstoneindex}{\lastzeroindex+1} +\foreach \x in {\firstoneindex, ..., 3} +{ + \draw[blue box] (2 * \spacingx * \x - .5, 2 + \offsety) rectangle +(1,1); + \draw (2 * \spacingx * \x, 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$}; - } +% Odd zero nodes +\foreach \x in {0, ..., 0} +{ + \draw[red box] (\spacingx + 2 * \spacingx * \x - .5, 2) rectangle +(1,1); + \draw (\spacingx + 2 * \spacingx * \x, 2.5) node {$0$}; +} - \foreach \x in {0, ..., 2} - \draw[comp] ( \spacingx + 2 * \spacingx * \x, \basey + 1) node[vertex] {} - -- (2 * \spacingx + 2 * \spacingx * \x, \basey + 1) node[vertex] {}; +% Odd one nodes +\foreach \x in {1, ..., 3} +{ + \draw[blue box] (\spacingx + 2 * \spacingx * \x - .5, 2) rectangle +(1,1); + \draw (\spacingx + 2 * \spacingx * \x, 2.5) node {$1$}; } -%\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$}; +% Comparators +\foreach \x in {0, ..., 2} + \draw[comp] ( \spacingx + 2 * \spacingx * \x, 1) node[vertex] {} + -- (2 * \spacingx + 2 * \spacingx * \x, 1) node[vertex] {}; \end{tikzpicture} -- 2.11.0