source: trunk/documents/theses/dstn/figs-kdtree/permute-fig.tex @ 12340

Revision 12340, 4.1 KB checked in by dstn, 14 months ago (diff)

touch up apply-perm fig

Line 
1\input{kdfigs-tikz}
2\setpagesize{\permutefigwidth}{\permutefigheight}
3\begin{document}%
4\thispagestyle{empty}%
5\begin{center}%
6\newcommand{\myscale}{0.8}
7\newcommand{\myscalex}{0.7}
8\begin{tikzpicture}[>=latex, scale=\myscale] %, every node/.style={draw=red}]
9  \tikzstyle{vec}=[row sep=0, column sep={\myscale cm,between origins}, inner sep=0, outer sep=0,
10    anchor=north west, draw=black,
11    nodes={draw, black, line width=0, minimum size=\myscale cm, inner sep=0, outer sep=0, anchor=center}]
12
13  \tikzstyle{outline}=[row sep=0, column sep={\myscale cm,between origins}, inner sep=0, outer sep=0,
14    matrix anchor=west, fill=gray!40, draw=black,
15        %nodes={draw, black, opacity=0, minimum width=\myscale cm, minimum height=\myscalex cm, inner sep=0, outer sep=0, anchor=center}]
16        nodes={line width=0, minimum width=\myscale cm, minimum height=\myscalex cm, inner sep=0, outer sep=0, anchor=center}]
17  \tikzstyle{lab}=[anchor=east, inner sep=0]
18  %  \tikzstyle{lr}=[anchor=mid, inner sep=0pt, minimum height=\myscalex cm]
19  %  \tikzstyle{lr}=[anchor=center, inner sep=0pt, outer sep=0pt, minimum height=\myscale cm]
20  %  \draw [thin, gray] (-0.1,-10) grid (7, 10);
21
22
23  %  \node [lab, text width=2.7cm] at (-0.1,-1) {Data array:}; %{Input data array}; %: $N=6$, $D=2$.};
24  \node [lab] at (-0.1,-1) {Input data array:}; %{Input data array}; %: $N=6$, $D=2$.};
25  \node [matrix, vec] (dataA) at (0,0) {%
26    \node {6}; & \node {0}; & \node {7}; & \node{3}; & \node{2}; & \node{9}; \\
27    \node {4}; & \node {8}; & \node {0}; & \node{5}; & \node{5}; & \node{5}; \\
28  };
29
30  \begin{scope}[yshift=-2.6cm]
31    \node [lab] at (-0.1,0) {Root node:};
32
33    \node [matrix, outline] at (0,0) {
34          \node {\makebox[\myscale cm][l]{\ L=0,}};
35          & & & & &
36      \node {\makebox[\myscale cm][r]{R=5\ }}; \\
37    };
38
39    \begin{scope}[yshift=-0.6cm]
40
41      \node [lab] at (-0.1,-0.5) {Permutation array:};
42      \node [matrix, vec] (permA) at (0,0) {
43        \node (A0) {0}; & \node (A1) {1}; & \node (A2) {2}; &
44        \node (A3) {3}; & \node (A4) {4}; & \node (A5) {5}; \\
45      };
46
47      \begin{scope}[yshift=-3.5cm]
48
49        \node [lab] at (-0.2,1.25) {Split on first dimension:};
50
51        \node [lab] at (-0.2,-0.5) {New permutation array:};
52        \node [matrix, vec] (permB) at (-0.1,0) {
53          \node (B0) {4}; & \node (B1) {1}; & \node (B2) {3}; \\
54        };
55        \node [matrix, vec] (permB2) at (3.1,0) {
56          \node (B3) {2}; & \node (B4) {0}; & \node (B5) {5}; \\
57        };
58
59        \begin{scope}[yshift=-1.6cm]
60          \node [lab] at (-0.2,0) {Child nodes:};
61          \node [matrix, outline] at (-0.1,0) {%
62                   \node {\makebox[\myscale cm][l]{\ L=0,}};
63                        & &
64                        \node {\makebox[\myscale cm][r]{R=2\ }}; \\
65          };
66          \node [matrix, outline] at (3.1,0) {
67                   \node {\makebox[\myscale cm][l]{\ L=3,}};
68                        %& \node [lr] {\rule{0pt}{7pt}};
69                        & &
70                        \node {\makebox[\myscale cm][r]{R=5\ }}; \\
71          };
72
73          \begin{scope}[yshift=-0.6cm]
74
75            \node [lab] at (-0.2,-1) {New data array:};
76            \node [matrix, vec] (dataB) at (-0.1,0) {
77              \node (D0) {2}; & \node (D1) {0}; & \node (D2) {3}; \\
78              \node {5}; & \node {8}; & \node {5}; \\
79            };
80            \node [matrix, vec] (dataB2) at (3.1,0) {
81              \node (D3) {7}; & \node (D4) {6}; & \node (D5) {9}; \\
82              \node{0}; & \node{4}; & \node{5}; \\
83            };
84
85          \end{scope}
86        \end{scope}
87      \end{scope}
88    \end{scope}
89  \end{scope}
90
91  \draw [->, thick] (A0.south) to [out=300,in=120] (B4.north);
92  \draw [->, thick] (A4.south) to [out=240,in=60] (B0.north);
93  \draw [->, thick] (A2.south) -- (B3.north);
94  \draw [->, thick] (A3.south) -- (B2.north);
95  \draw [->, thick] (A1.south)+(-0.1,0) -- (B1.north);
96  \draw [->, thick] (A5.south)+(0.1,0) -- (B5.north);
97
98%  \draw [->, thick] (A0.south) to [out=300,in=120] (D4.north);
99%  \draw [->, thick] (A4.south) to [out=240,in=60]  (D0.north);
100%  \draw [->, thick] (A2.south) -- (D3.north);
101%  \draw [->, thick] (A3.south) -- (D2.north);
102%  \draw (current bounding box.south west) rectangle (current bounding box.north east);
103\end{tikzpicture}%
104\end{center}%
105\end{document}
Note: See TracBrowser for help on using the repository browser.